wip(929): stage 4 — migrate agents/pool/* + lifecycle.rs read sides off yaml_legacy
Read-side migrations: - agents/pool/auto_assign/backlog.rs: depends_on check now reads from WorkItem.depends_on() instead of parse_front_matter. - agents/pool/auto_assign/story_checks.rs: read_story_front_matter_agent drops its YAML fallback — post-891 the CRDT entry is reliable, and removing the fallback makes the contract honest. The now-unused read_story_contents helper goes too. - agents/pool/start/validation.rs: same shape — YAML fallback removed, CRDT register is the only source for agent pinning. - agents/pool/start/spawn.rs: epic-context injection wraps the parse_front_matter call in `yaml_residue(...)` since `meta.epic` has no CRDT analog (sub-story 933). - agents/lifecycle.rs: item_type_from_id (numeric-only ID path) wraps its parse_front_matter in `yaml_residue(...)` for the same reason (933). The write-side `fields_to_clear_transform` calls in lifecycle.rs are left for stage 8, when FS-shadow writes are deleted wholesale. Test fix: - start_agent_returns_error_when_front_matter_agent_busy now seeds the CRDT entry (write_item with agent="coder-opus") instead of relying on parse_front_matter reading the YAML on disk. Filed earlier: - 932 (review_hold register) — note: this turns out to be a real class-1 bug: write_review_hold_to_store still writes YAML but has_review_hold reads Stage::Frozen, so the write goes into a void. 932 is the correct fix. All 2861 tests pass; fmt + clippy clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,16 +24,12 @@ impl AgentPool {
|
||||
/// logged so the user can see the promotion was triggered by an archived dep, not
|
||||
/// a clean completion.
|
||||
pub(super) fn promote_ready_backlog_stories(&self, project_root: &Path) {
|
||||
use crate::db::yaml_legacy::parse_front_matter;
|
||||
|
||||
let items = scan_stage_items(project_root, "1_backlog");
|
||||
for story_id in &items {
|
||||
// Only promote stories that explicitly declare dependencies.
|
||||
let contents = crate::db::read_content(story_id);
|
||||
let has_deps = contents
|
||||
.and_then(|c| parse_front_matter(&c).ok())
|
||||
.and_then(|m| m.depends_on)
|
||||
.map(|d| !d.is_empty())
|
||||
// Only promote stories that explicitly declare dependencies
|
||||
// (story 929: read from the CRDT register, not YAML).
|
||||
let has_deps = crate::crdt_state::read_item(story_id)
|
||||
.map(|w| !w.depends_on().is_empty())
|
||||
.unwrap_or(false);
|
||||
if !has_deps {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user