Repository navigation
Description
Problem
When a builder runs porch done <id> to mark its protocol complete (BUGFIX, AIR, PIR — any protocol that ends with a porch done rather than awaiting an external signal), the builder is deregistered from afx's project/issue registry as part of completion. Subsequent afx cleanup attempts then fail because cleanup is registry-keyed — both afx cleanup -p <id> and afx cleanup -i <issue> return:
[error] Builder not found for project: <id>
[error] Bugfix builder not found for issue #<issue>
The Tower-level PTY session for the builder is not killed by porch done (Tower's terminal registry is independent of the project/issue registry). It remains visible in afx status as an (active) terminal indefinitely. There is no registry-independent terminal-kill command in afx.
Observed
Sequence on a real BUGFIX builder run that completed cleanly:
- Builder ran
porch done <id>(BUGFIX protocol-complete on merged PR). - Builder sent the "ready for cleanup" notification.
afx cleanup -p <id>→Builder not found for project: <id>(builder already deregistered).- Manually
git worktree remove --force+git branch -D builder/<...>succeeded (those don't go through afx's registry). afx cleanup -i <issue> -f→Bugfix builder not found for issue #<issue>(same; cleanup still can't find a registry entry).afx statuscontinued to show the builder's terminal as(active)with no work, no worktree, no branch, no porch state — a dead PTY in Tower with a stale registry entry.
The only afx mechanism that can clear an orphaned Tower terminal is afx tower stop && afx tower start — which kills every other live builder terminal in the session. Unacceptable collateral in any multi-builder workflow.
Impact
- Every self-completing builder accumulates a permanent orphan terminal.
afx statusbecomes increasingly noisy with dead entries from past completed work, with no way to distinguish dead from live except by external knowledge. - No clean recovery exists. Killing the underlying PTY process directly bypasses Tower and risks Tower-state inconsistency. Restarting Tower wipes all live work. The user is left with permanent cosmetic noise that compounds across sessions.
- Cleanup ordering is fundamentally lossy. A builder that self-completes via
porch doneis structurally uncleanable via afx the moment the registry entry is dropped — there is no window in whichafx cleanupcan both find the builder and kill its terminal.
Related
- Loose family: porch: verify-wedge — a reworked artifact can't re-enter verify after its approval gate has fired (rollback can't target current phase) #776 (porch verify-wedge) — both are afx/porch lifecycle gaps where a state transition leaves an unreachable artifact.
Activity
amrmelsayed commentedon May 21, 2026
Sibling: #801 (porch approve state-push silently fails after auto-delete on PR merge — builder worktree never sees gate-approved state-sync). Same lifecycle family as this issue — both leave the builder in a stale / unreachable state after a normal completion path.
amrmelsayed commentedon May 21, 2026
Sibling: #802 (state-bookkeeping commits accumulate as orphan artifacts on builder branches when not auto-deleted on PR merge). Same afx/porch-lifecycle family — branch persists with dead bookkeeping commits after work is done.