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
+10 -20
View File
@@ -1,6 +1,6 @@
use crate::agents::move_story_to_merge;
use crate::http::context::AppContext;
use crate::io::story_metadata::write_merge_failure;
use crate::io::story_metadata::write_merge_failure_in_content;
use crate::slog;
use crate::slog_warn;
use serde_json::{json, Value};
@@ -134,26 +134,16 @@ pub(super) fn tool_report_merge_failure(args: &Value, ctx: &AppContext) -> Resul
reason: reason.to_string(),
});
// Persist the failure reason to the story file's front matter so it
// Persist the failure reason to the content store + CRDT so it
// survives server restarts and is visible in the web UI.
if let Ok(project_root) = ctx.state.get_project_root() {
let story_file = project_root
.join(".huskies")
.join("work")
.join("4_merge")
.join(format!("{story_id}.md"));
if story_file.exists() {
if let Err(e) = write_merge_failure(&story_file, reason) {
slog_warn!(
"[mergemaster] Failed to persist merge_failure to story file for '{story_id}': {e}"
);
}
} else {
slog_warn!(
"[mergemaster] Story file not found in 4_merge/ for '{story_id}'; \
merge_failure not persisted to front matter"
);
}
if let Some(contents) = crate::db::read_content(story_id) {
let updated = write_merge_failure_in_content(&contents, reason);
crate::db::write_item_with_content(story_id, "4_merge", &updated);
} else {
slog_warn!(
"[mergemaster] No content in store for '{story_id}'; \
merge_failure not persisted"
);
}
Ok(format!(
+4 -6
View File
@@ -46,12 +46,10 @@ pub(super) async fn tool_approve_qa(args: &Value, ctx: &AppContext) -> Result<St
let project_root = ctx.agents.get_project_root(&ctx.state)?;
// Clear review_hold before moving
let qa_path = project_root
.join(".huskies/work/3_qa")
.join(format!("{story_id}.md"));
if qa_path.exists() {
let _ = crate::io::story_metadata::clear_front_matter_field(&qa_path, "review_hold");
// Clear review_hold in content store + CRDT before moving.
if let Some(contents) = crate::db::read_content(story_id) {
let updated = crate::io::story_metadata::clear_front_matter_field_in_content(&contents, "review_hold");
crate::db::write_item_with_content(story_id, "3_qa", &updated);
}
// Move story from work/3_qa/ to work/4_merge/