wip(929): stage 1 — migrate chat/commands/* off yaml_legacy

Each chat command that previously read parse_front_matter for story
metadata (name, agent, depends_on, blocked, retry_count, merge_failure,
qa_mode) now reads from the typed CRDT API:

- WorkItem (via crdt_state::read_item) for pipeline-item registers.
- MergeJobView (via crdt_state::read_merge_job) for the merge failure
  detail text, which has its own LWW-map CRDT entry.

Files migrated: depends.rs, freeze.rs, move_story.rs, overview.rs,
status/render.rs, triage.rs, unblock.rs, unreleased.rs.

unblock.rs: also removes the legacy front-matter cleanup branch that
fired when the typed Blocked→Coding transition failed. Post-929 there
is no YAML on disk to clean; the fallback now just resets retry_count
in the CRDT.

triage.rs: drops the YAML-only `review_hold` and `coverage_baseline`
fields from the dump. These have no CRDT register and were never
load-bearing on the triage output; if needed later, add a CRDT register
and surface it back.

Tests:
- The three status/render merge-failure rendering tests now seed a
  MergeJob CRDT entry via write_merge_job instead of writing YAML.
- The unblock test that asserted YAML cleanup on disk is now an assertion
  on the CRDT registers (blocked=false, retry_count=0). Also re-seeded
  in `2_blocked` stage so the typed Blocked → Coding transition actually
  fires (not the fallback path).

All 2855 tests pass; fmt clean; clippy clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Timmy
2026-05-12 18:41:43 +01:00
co-authored by Claude Opus 4.7
parent b940b95ec3
commit a49a1cf7cb
9 changed files with 88 additions and 180 deletions
+5 -6
View File
@@ -7,7 +7,6 @@
//! Passing no dependency numbers clears the field entirely.
use super::CommandContext;
use crate::db::yaml_legacy::parse_front_matter;
/// Handle the `depends` command.
///
@@ -51,7 +50,7 @@ pub(super) fn handle_depends(ctx: &CommandContext) -> Option<String> {
}
// Find the story by numeric prefix: CRDT → content store → filesystem.
let (story_id, _stage_dir, _path, content) =
let (story_id, _stage_dir, _path, _content) =
match crate::chat::lookup::find_story_by_number(ctx.effective_root(), num_str) {
Some(found) => found,
None => {
@@ -61,10 +60,10 @@ pub(super) fn handle_depends(ctx: &CommandContext) -> Option<String> {
}
};
let story_name = content
.as_deref()
.and_then(|c| parse_front_matter(c).ok())
.and_then(|m| m.name)
// Story name comes from the CRDT register, not the on-disk YAML
// (story 929 — CRDT is the sole source of story metadata).
let story_name = crate::crdt_state::read_item(&story_id)
.and_then(|w| w.name().map(str::to_string))
.unwrap_or_else(|| story_id.clone());
// Write depends_on to the typed CRDT register — single source of truth.