Reference ct reaper recent edit guard


name: CT dev-slot reaper: recent-edit guard added (90 min) on top of dirty-worktree guard description: Reaper now has 3 guards: never reap if worktree dirty (server-only downgrade), never reap if source edited in last 90 min, browser-tab idle check for the rest. type: reference


The CreatorTrack dev-slot reaper (scripts/forge_ct_reaper*) now has two independent "leave it alone" guards plus the original browser-idle check, shipped in commits c87d796 and 57083ce on forge main (2026-07-08):

  1. Dirty-worktree guard (c87d796): teardown.sh checks git status --porcelain; if dirty (or git state unreadable), auto-downgrades to --server-only (stops the RAM-hungry next dev, keeps worktree + clone DB). --force-dirty opts into full removal anyway.
  2. Recent-edit guard (57083ce): a slot is protected if a git-tracked or untracked source file was touched in the last CT_REAPER_ACTIVE_MINUTES (default 90), read via git ls-files --cached --others --exclude-standard so .next//node_modules/ build churn doesn't count. This exists because a slot worked through a chat session (no browser preview tab open) still looked "idle" to the old browser-connection signal.

A slot is now fully reaped only when ALL of: no browser tab connected, no source edits within CT_REAPER_ACTIVE_MINUTES (90), and worktree is clean. Otherwise it's left alone, or at most has its idle server stopped while files+DB survive. Other tunables: CT_REAPER_IDLE_MINUTES (45), CT_REAPER_MAX_SLOTS (4).

Why: the reaper had twice destroyed in-progress work (uncommitted files, then a full slot) because its only "in use" signal was an open browser tab to the dev server; chat-driven work has no such tab.

How to apply: the older workaround advice "commit each task before the next so the reaper can't eat it" ([[ct-dev-slot-commit-often]]) is now a secondary safety net, not the primary protection — the reaper itself should no longer destroy uncommitted or recently-edited work. Still commit often for durability (push to remote), but don't assume a chat-only working session is at risk of losing files to the reaper.

[auto-memory session 60edb075-6de4-453e-81bb-a0c9ec2a9418, confidence 0.85, mode direct]