huskies: merge 539_bug_crdt_event_bridge_still_writes_filesystem_shadow_files_after_530_eliminated_filesystem_state

This commit is contained in:
dave
2026-04-11 17:04:36 +00:00
parent 6998275331
commit 599fbdc71d
9 changed files with 153 additions and 190 deletions
@@ -139,27 +139,15 @@ impl AgentPool {
);
let empty_diff_reason = "Feature branch has no code changes — the coder agent \
did not produce any commits.";
// Write merge_failure and blocked to content store.
if let Some(contents) = crate::db::read_content(story_id) {
let updated = crate::io::story_metadata::write_merge_failure_in_content(
&contents,
empty_diff_reason,
);
let blocked = crate::io::story_metadata::write_blocked_in_content(&updated);
crate::db::write_content(story_id, &blocked);
crate::db::write_item_with_content(story_id, stage_dir, &blocked);
} else {
// Fallback: filesystem.
let story_path = project_root
.join(".huskies/work")
.join(stage_dir)
.join(format!("{story_id}.md"));
let _ = crate::io::story_metadata::write_merge_failure(
&story_path,
empty_diff_reason,
);
let _ = crate::io::story_metadata::write_blocked(&story_path);
}
// Write merge_failure and blocked to content store + CRDT.
let contents = crate::db::read_content(story_id)
.unwrap_or_else(|| "---\nname: unknown\n---\n".to_string());
let updated = crate::io::story_metadata::write_merge_failure_in_content(
&contents,
empty_diff_reason,
);
let blocked = crate::io::story_metadata::write_blocked_in_content(&updated);
crate::db::write_item_with_content(story_id, stage_dir, &blocked);
let _ = self.watcher_tx.send(crate::io::watcher::WatcherEvent::StoryBlocked {
story_id: story_id.to_string(),
reason: empty_diff_reason.to_string(),