huskies: merge 1007

This commit is contained in:
dave
2026-05-14 08:36:46 +00:00
parent 13ab97a615
commit 761b6934f1
7 changed files with 215 additions and 7 deletions
+3 -1
View File
@@ -106,7 +106,9 @@ mod tests {
assert!(names.contains(&"show_epic"));
assert!(names.contains(&"freeze_story"));
assert!(names.contains(&"unfreeze_story"));
assert_eq!(tools.len(), 74);
assert!(names.contains(&"find_orphaned_items"));
assert!(names.contains(&"recover_half_written_items"));
assert_eq!(tools.len(), 76);
}
#[test]
@@ -341,5 +341,27 @@ pub(super) fn system_tools() -> Vec<Value> {
"properties": {}
}
}),
json!({
"name": "find_orphaned_items",
"description": "Find half-written (orphaned) pipeline items: story IDs that exist in the content store but have no live CRDT entry. These are invisible to all normal read paths (list_refactors, get_pipeline_status, etc.) and result from the bug 1001 split-brain race. Returns a list of orphaned IDs with their names and tombstone status. Use recover_half_written_items to fix them.",
"inputSchema": {
"type": "object",
"properties": {}
}
}),
json!({
"name": "recover_half_written_items",
"description": "Recover half-written (orphaned) pipeline items by lifting each onto a fresh non-tombstoned ID. For each orphan, allocates a new ID, copies the content, re-applies item_type and depends_on from front matter, verifies the new entry is live in the CRDT, then removes the orphaned row. Pass 'only' to restrict recovery to specific orphan IDs (safe for live systems); omit to recover all. Returns old_id → new_id mappings for every successful recovery.",
"inputSchema": {
"type": "object",
"properties": {
"only": {
"type": "array",
"items": { "type": "string" },
"description": "Optional: restrict recovery to these specific orphan IDs (e.g. ['1000', '999']). Omit to recover all orphans."
}
}
}
}),
]
}