fix(bin): require positive landing proof before teardown - #1
Merged
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
jokim1
added a commit
that referenced
this pull request
Aug 15, 2026
Codex adversarial blockers on PR #1: - B1: classify recorded PR/MR by forge (gh for GitHub, glab for GitLab); restore landed GitLab MR cleanup via content-in-default after MERGED. - B2: CLOSED is not landing evidence; require content in default (or refuse). - B3: MERGED requires current HEAD in PR head (or unpushed patch match / content-in-default) even when the branch is fully pushed. - W1: strict one-line STATE\\tHEAD parse; MERGED needs a valid SHA; unknown and multi-line responses refuse. - W2: remote reachability alone is not landing for ship tasks without content or merged-PR proof (covers no-pr= unique pushed work). - W4: refusal text names provider and distinguishes lookup vs malformed vs unknown. Regression tests: GitLab merged/open, CLOSED unique, MERGED head mismatch, no-pr unique pushed, malformed multi-line response.
Empty-unpushed remote reachability is not landing. Require live default tip proof (ancestry, no-pr tree equality, or MERGED containment/tree) against a default tip whose remote OID still matches after fetch. Always refuse OPEN. Unconfirmed never accepts tree equality. Missing worktree refuses. Recheck dirty+land+full PR classify after quiescence before destructive return.
jokim1
force-pushed
the
fm/fm-teardown-landed-false-positive-adopt
branch
from
August 16, 2026 06:42
bdd6425 to
0e9bd25
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Risk Assessment
✅ Low: The updated implementation now revalidates Playbot worktrees after endpoint quiescence and immediately before deletion, while preserving the prior force, scout, and secondmate carveouts.
Testing
Inspected the target change and intent, added an end-to-end Playbot cleanup regression, passed the focused adapter and complete cleanup-command suites, manually captured the operator-facing late-write refusal and persisted state, and verified only the intentional test change remains; no lint or static analysis was run per instruction.
Evidence: End-to-end late-write refusal transcript
$ bin/fm-teardown.sh task-x1 exit_code=1 REFUSED: worktree ... has uncommitted changes. error: playbot teardown refused ... preserving every durable record Lifecycle calls: stop, archive - no delete Preserved: late-worker-write.txt, task metadata, route, and outboxEvidence: Playbot adapter regression transcript
Evidence: Full cleanup regression transcript
Pipeline
Updates from git push no-mistakes
⏭️ **intent** - skipped
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
bin/fm-teardown.sh:2732- Safety validation runs only before the pipeline is aborted and worktree processes are reaped. The callback passed toteardown_treehouse_returnruns only after stale-lock cleanup, not before normal returns or retries, and Orca/Playbot removal has no post-quiescence check. A terminating process can therefore leave new changes, or landing state can change, after approval but before destructive removal. Re-run the full dirty/landing/PR validation after quiescence and immediately before every destructive return/removal attempt.bin/fm-teardown.sh:976- The post-fetch default-name check silently accepts an empty secondls-remote --symrefresult. If remote HEAD becomes detached or its symref cannot be read while the previously named branch retains the same OID, teardown proceeds without proving that the live default branch name still matches. Preserve whether the initial lookup returned a symref and require the second lookup to return the same non-empty name; also propagatels-remotefailure rather than relying on the pipeline'sawkstatus.🔧 Fix: Close teardown revalidation and remote symref races
1 error still open:
bin/fm-teardown.sh:2843- The Playbot recheck still occurs beforeplaybot_teardown_endpoint, whose adapter stops/archives the live worker and only then deletes the workspace. That worker can write to the worktree after this validation while stop/archive completes, leaving the destructive delete unchecked. Run the full safety callback inside the Playbot teardown flow after confirmed thread quiescence and immediately before each workspace-removal call.🔧 Fix: Recheck Playbot worktrees after endpoint quiescence
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Inspected commit824ef7a65977a1bf3c77a7b5ccf3fe1675db2ab9against base5b9e8629923a0b7623c82d5e151490e8185f59f7and repository guidance to extract intentgit diff --check -- tests/fm-teardown.test.shbin/fm-test-run.sh tests/fm-playbot-backend.test.shbin/fm-test-run.sh tests/fm-teardown.test.shManual evidence run ofbin/fm-teardown.sh task-x1through the Playbot archive-time late-write fixture, capturing refusal output, lifecycle calls, preserved file, records, and Git statusFinalgit diff --checkandgit status --shortcleanup verification✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.