Reference ct reaper teardown dirty guard fixed
name: CT dev-slot reaper: dirty-worktree data-loss bug fixed description: teardown.sh now auto-downgrades to server-only for dirty worktrees; reaper drives it explicitly type: reference
Root cause of the Task 10 file-wipe incident: the CT dev-slot reaper called teardown.sh, which removed server + worktree + clone DB for ANY idle slot regardless of uncommitted work. Fixed in commit c87d796 (forge repo, 2026-07-08).
Fix: teardown.sh now has an authoritative data-loss guard usable by any caller: if git status --porcelain is non-empty (or git state is unreadable, treated as dirty), it auto-downgrades to server-only (stops the next dev process to free RAM, but preserves worktree + DB). New flags: --server-only, --force-dirty (explicit opt-in to nuke a dirty tree anyway). The reaper now calls worktree_dirty(), drives teardown explicitly, and sends a warning-level notify when it preserves (vs a routine clean reap) so Justin knows a slot was parked, not deleted.
Why: the RAM problem was always the next dev process, not the on-disk worktree/DB files, so full teardown was solving the wrong problem and destroying uncommitted work as a side effect.
How to apply: this is now the source of truth for [[ct-dev-slot-commit-often]] — the reaper is no longer a data-loss risk for dirty slots, but committing often is still recommended since abandoned dirty slots keep their files on disk indefinitely (parked, not synced) until merged or --force-dirty'd.
[auto-memory session 60edb075-6de4-453e-81bb-a0c9ec2a9418, confidence 0.85, mode direct]