RFC 0008: Status updates now sync to markdown files, not just DB RFC 0009: Add Audit as first-class document type, rename blue_audit to blue_health_check to avoid naming collision Also includes: - Update RFC 0005 with Ollama auto-detection and bundled Goose support - Mark RFCs 0001-0006 as Implemented - Add spikes documenting investigations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
RFC 0008: Status Update File Sync
| Status | Implemented |
| Date | 2026-01-24 |
| Source Spike | rfc-status-update-not-persisting |
Summary
Status update handlers only update the database but not the markdown files, causing a sync mismatch between what users see in files and what's in the database.
Problem
When status is updated via MCP tools:
blue_rfc_update_status→ Updates DB only ❌blue_rfc_complete→ Updates DB only ❌blue_spike_complete→ Updates both DB and file ✅
This causes confusion when users check markdown files expecting to see updated status.
Proposal
Add a helper function to update markdown file status, then call it from all status-changing handlers.
Implementation
- Create
update_markdown_status(file_path, old_status, new_status)helper inblue-core - Update
handle_rfc_update_statusinserver.rsto call helper after DB update - Update
handle_rfc_completeinrfc.rsto call helper after DB update - Consider adding to ADR handlers if they have status changes
Helper Function
pub fn update_markdown_status(
file_path: &Path,
new_status: &str
) -> Result<(), std::io::Error> {
let content = fs::read_to_string(file_path)?;
// Match common status formats
let patterns = [
(r"\| \*\*Status\*\* \| [^|]+ \|", format!("| **Status** | {} |", new_status)),
(r"\*\*Status:\*\* \w+", format!("**Status:** {}", new_status)),
];
let mut updated = content;
for (pattern, replacement) in patterns {
updated = regex::Regex::new(pattern)
.unwrap()
.replace(&updated, replacement.as_str())
.to_string();
}
fs::write(file_path, updated)
}
Test Plan
blue_rfc_update_statusupdates both DB and markdown fileblue_rfc_completeupdates both DB and markdown file- Status patterns are correctly replaced (table format, inline format)
- No changes to files without status fields
Implementation Plan
- Add
update_markdown_statushelper to blue-core (documents.rs:391) - Update
handle_rfc_update_statusin server.rs - Update
handle_completein rfc.rs - Add unit tests for status replacement
- Refactor
blue_spike_completeto use shared helper
"Right then. Let's get to it."
— Blue