Every document filename now mirrors its lifecycle state with a status suffix (e.g., .draft.md, .wip.md, .accepted.md). No more bare .md for tracked document types. Also renamed all from_str methods to parse to avoid FromStr trait confusion, introduced StagingDeploymentParams struct, and fixed all 19 clippy warnings across the codebase. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.8 KiB
1.8 KiB
Spike: Docs Path Resolution Bug
| Status | Completed |
| Date | 2026-01-24 |
| Outcome | Answered |
Question
Why does blue_rfc_create write to .blue/repos/blue/docs/rfcs/ instead of .blue/docs/rfcs/?
Root Cause
The bug was caused by coexistence of OLD and NEW directory structures:
- OLD:
.blue/repos/blue/docs/,.blue/data/blue/blue.db - NEW:
.blue/docs/,.blue/blue.db
When detect_blue() runs:
- It sees
.blue/repos/or.blue/data/exist - Calls
migrate_to_new_structure() - Migration is a NO-OP because new paths already exist
- Returns
BlueHome::new(root)which sets correct paths
However, the MCP server caches ProjectState in self.state. If the server was started when old structure was the only structure, the cached state has old paths. The state only resets when cwd changes.
Evidence
- RFC created at
.blue/repos/blue/docs/rfcs/(wrong) - Spike created at
.blue/docs/spikes/(correct) detect_blue()now returns correct paths- Old DB (
.blue/data/blue/blue.db) was modified at 16:28 - New DB (
.blue/blue.db) was modified at 16:01
The RFC was stored in the old database because the MCP server had cached the old state.
Fix Applied
Removed old structure directories:
rm -rf .blue/repos .blue/data
This prevents the migration code path from triggering and ensures only new paths are used.
Recommendations
- Migration should DELETE old directories after migration completes, not leave them as orphans
- Or:
detect_blue()should always use new paths and ignore old structure once new structure exists - Consider adding a version marker file (
.blue/version) to distinguish structure versions
"The old paths were ghosts. We exorcised them."
— Blue