wip(929): stage 5 — drop FS-based dep checks and qa-mode parser from io/story_metadata

Migrate the last three callers of the FS-scanning dependency helpers to the
CRDT-direct equivalents and delete the dead helpers:

- agents/pool/auto_assign/story_checks.rs: has_unmet_dependencies and
  check_archived_dependencies now wrap check_unmet_deps_crdt /
  check_archived_deps_crdt directly. Tests rewritten to seed the CRDT.
- http/mcp/story_tools/story/update.rs: bug-503 archived-dep warning now
  reads from CRDT instead of scanning 6_archived.
- agents/pool/pipeline/advance/helpers.rs: resolve_qa_mode_from_store is
  CRDT-only (the FS fallback for content-store-empty stories is gone).
- io/story_metadata/parser.rs: resolve_qa_mode_from_content removed.
- io/story_metadata/deps.rs: check_unmet_deps and dep_is_done deleted,
  along with the unused check_unmet_deps_from_list helper.
- io/story_metadata/mod.rs: re-exports trimmed accordingly.

check_archived_deps_from_list survives because story-creation still calls
it before the CRDT entry exists (used from story_tools/story/create.rs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Timmy
2026-05-12 19:14:54 +01:00
parent f775f4cfb9
commit 6e704a33b7
10 changed files with 128 additions and 238 deletions
@@ -52,29 +52,18 @@ pub(crate) fn spawn_pipeline_advance(
/// Resolve QA mode for a story.
///
/// Checks the typed `qa_mode` CRDT register first. If the register holds a
/// recognised value, returns it immediately without touching the content store.
/// Otherwise reads the story content and falls back to YAML front-matter
/// parsing via [`crate::io::story_metadata::resolve_qa_mode_from_content`].
/// Story 929: reads the typed `qa_mode` register; the legacy YAML fallback
/// is gone (the CRDT register is the only source).
pub(super) fn resolve_qa_mode_from_store(
_project_root: &Path,
story_id: &str,
default: crate::io::story_metadata::QaMode,
) -> crate::io::story_metadata::QaMode {
// CRDT register is the authoritative source; check it before the content store.
if let Some(view) = crate::crdt_state::read_item(story_id)
&& let Some(s) = view.qa_mode()
&& let Some(mode) = crate::io::story_metadata::QaMode::from_str(s)
{
return mode;
}
// Fall back to YAML front matter for backward compatibility.
if let Some(contents) = crate::db::read_content(story_id) {
return crate::io::story_metadata::resolve_qa_mode_from_content(
story_id, &contents, default,
);
}
default
crate::crdt_state::read_item(story_id)
.and_then(|view| view.qa_mode().map(str::to_string))
.as_deref()
.and_then(crate::io::story_metadata::QaMode::from_str)
.unwrap_or(default)
}
/// Write review_hold to the content store.