You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
source-control:babysit-prs: worker lease doesn't prevent a concurrent lane duplicating work, and a non-force push after merge resurrects the auto-deleted branch #645
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.needs-owner-decisionAwaiting a human or maintainer judgment call.
Lane: babysit, observed on #634, session 2026-07-20.
What happened: a babysit worker held #634's worker lease and was independently fixing the same chatgpt-codex-connector finding ("truncated review-thread pages") that a separate concurrent kyle-sexton lane was also fixing at the same time. The other lane finished first, replied, resolved the thread, and squash-merged the PR (mergeCommit 3f428074, head bb55a5db, merged 07:57:45Z) — which triggers GitHub's auto-delete-branch-on-merge. Moments later the babysit worker, unaware the PR had just merged, pushed its own equivalent (but not identical) fix commit b914d56 to the same branch name. A non-force push to a branch name that doesn't exist on the remote creates it fresh — so this resurrected fix/534-babysit-shared-classifier as a zombie branch on a MERGED, closed PR, containing a commit that never reached main.
Two distinct gaps:
Lease contention is per-PR-in-this-lane only. It does nothing to prevent a different concurrent lane (this session observed at least 4: "work lane", "work-2 lane", "control tower", this babysit lane) from doing the same work at the same time. No cross-lane coordination mechanism exists.
No merged/closed re-check immediately before push. The worker checked out, fixed, and pushed without re-verifying the PR was still OPEN right before the push — a real TOCTOU gap given how fast concurrent lanes are landing merges this session (15 merges in ~5 hours).
Expected: before any worker pushes a commit, re-fetch the PR's state (note: gh pr view --json merged is an invalid field — use state/mergedAt) immediately beforehand and abort the push if it's no longer OPEN, reporting the race instead of resurrecting a dead branch. Cross-lane lease coordination is a bigger ask (would need a shared lock surface across all lanes, not just this skill's own lease file) — flagging as a known limitation rather than proposing a fix here.
Cleanup needed: the resurrected branch fix/534-babysit-shared-classifier @ b914d56e still exists on melodic-software/claude-code-plugins as of this filing — its content never merged (the branch protection cross-tier invariant against deleting unmerged branches means this lane won't delete it itself; left for a human to clean up).
Triage — status: needs-decision, recommend close: duplicate of #524.
#524 (already status: ready, open) covers the identical root cause: a per-PR worker lease does not prevent a different concurrent lane from doing the same work at the same time. This lane's rule 6 forbids closing issues directly, so recommending closure to a human rather than closing it myself.
The genuinely new, non-duplicate angle here — the TOCTOU gap (a worker pushes without re-checking the PR is still OPEN immediately beforehand, resurrecting an auto-deleted branch on an already-merged PR) — has been relayed as a comment on #524 instead of edited into #524's body, since #524 is already status: ready and this lane's rule 6 forbids editing items already in that state.
The cross-lane lease-coordination gap (no shared lock surface across lanes) is explicitly flagged by the reporter as a known limitation, not a proposed fix — no action needed from this lane.
Confirming example — worse severity, babysit lane, 2026-07-20, PR #643.
A worker held #643's worker lease validly throughout (its own release call later succeeded with the same token — no contention detected on acquire or release). A separate concurrent actor (also authenticated as kyle-sexton) fully processed the same PR within that held lease window: replied to both open threads, resolved both, and filed tracking issue #654 for one of them — all while this lane's worker was mid-diagnosis on the very same findings.
Unlike #634 (where the losing side's work simply never landed), this one produced live contradictory state: the babysit worker independently fixed the same finding (fenced-code-block false-positive) with an inline patch, pushed 828669a, and replied "Fixed in 828669a" — landing on a thread the other actor had already marked resolved on the basis of "tracked in #654, not fixed inline." Both claims are now sitting on GitHub for a human to reconcile: is the finding closed by the inline commit, or still open pending #654's broader refactor?
Confirms #645's root cause (no lease exclusivity across lanes — this lane's leases only coordinate within itself) but demonstrates real GitHub-visible fallout, not just wasted compute: divergent resolutions can both land and contradict each other on the same thread.
This was generated by AI (decide lane — decision-brief pass).
Decision brief (2-minute read) — close as dup of #524, or split?
Problem.#645 raises two facets: (a) the worker lease gives no mutual exclusion across independent lanes/sessions, so a concurrent lane duplicates work (a TOCTOU claim-race); and (b) after the other lane merged (auto-deleting the branch), the babysit worker's plain non-force git push of its own fix resurrected the deleted branch as a zombie on the already-merged PR. The live question is whether both facets are just #524, or whether facet (b) should be pulled out and fixed on its own.
Facet (b): the fix-push site has no PR-lifecycle recheck. The worker's fix push is agent-driven (SKILL.md:352 Step 5; reference/loop.md:~220). The only adjacent recheck before it is a head-SHA freshness check (SKILL.md:276 "re-check the head SHA, push") — it does not re-fetch the PR's state. A plain git push recreates a deleted upstream ref; --force-with-lease would not save you either (the ref is gone, not diverged). So a PR that merged in the check→push gap gets its branch resurrected.
The guard primitive already exists, just not at the push site.babysit_gh.py:675 already applies a state.casefold() != "open" skip. Re-fetching state/mergedAt and aborting the push if not OPEN is a read + abort, reusing logic already in the codebase.
Options (both directions trivially reversible — reopen/close — so stakes are low; the tiebreaker is which keeps the cheap fix actionable now):
RECOMMENDED — Split: re-scope #645 to the branch-resurrection pre-push state-recheck only; mark facet (a) a duplicate of #524 (cross-link, don't re-track).
Rationale: facet (a) is already fully owned by #524 (whose acceptance criteria explicitly cover "any other session regardless of session/machine/state-dir" — #645's "lane" is in scope). Facet (b)'s guard is cheap, reuses babysit_gh.py:675's existing check, is root-cause-aligned, and — critically — is not blocked by #440 the way #524 is. Closing #645 as a pure duplicate buries this unblocked guard behind a heavy, #440-blocked substrate redesign, so it inherits blocked status and does not ship. Splitting lets it land independently. Honest caveat: a pre-push state-recheck narrows but does not close the window (a merge can still land in the check→push gap — the same GitHub-as-lock lag #524 admits about itself); it is still worth it as a large, cheap window reduction. Reversibility: HIGH.
The question's default and this lane's own earlier triage recommendation. Defensible — both facets share the TOCTOU root class and #524 already notes facet (b). Tradeoff: the cheap, #440-unblocked branch-resurrection guard gets absorbed into #524's blocked scope and won't ship until the whole substrate/marker design clears #440. What changed since the prior "close as dup" call: recognizing that facet (b)'s fix is a read (not an outward write) makes it #440-unblocked — which is precisely why it should not inherit #524's blocked status. Reversibility: HIGH.
Tradeoff: duplicates #524's exclusivity tracking and re-opens a design already ratified and blocked-by-#440; adds tracker drift with no benefit over the split. Not recommended.
Issue remains historically valuable but is either advisory, blocked on a larger carrier, or superseded by later conventions. Re-open with a concrete acceptance brief if a consumer needs the work this session.
Title: source-control:babysit-prs: worker lease doesn't prevent a concurrent lane duplicating work, and a non-force push after merge resurrects the auto-deleted branch
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.needs-owner-decisionAwaiting a human or maintainer judgment call.
Activity
kyle-sexton commentedon Jul 20, 2026
This was generated by AI during triage.
Triage — status: needs-decision, recommend close: duplicate of #524.
#524 (already
status: ready, open) covers the identical root cause: a per-PR worker lease does not prevent a different concurrent lane from doing the same work at the same time. This lane's rule 6 forbids closing issues directly, so recommending closure to a human rather than closing it myself.The genuinely new, non-duplicate angle here — the TOCTOU gap (a worker pushes without re-checking the PR is still OPEN immediately beforehand, resurrecting an auto-deleted branch on an already-merged PR) — has been relayed as a comment on #524 instead of edited into #524's body, since #524 is already
status: readyand this lane's rule 6 forbids editing items already in that state.The cross-lane lease-coordination gap (no shared lock surface across lanes) is explicitly flagged by the reporter as a known limitation, not a proposed fix — no action needed from this lane.
kyle-sexton commentedon Jul 20, 2026
Confirming example — worse severity, babysit lane, 2026-07-20, PR #643.
A worker held #643's worker lease validly throughout (its own release call later succeeded with the same token — no contention detected on acquire or release). A separate concurrent actor (also authenticated as
kyle-sexton) fully processed the same PR within that held lease window: replied to both open threads, resolved both, and filed tracking issue #654 for one of them — all while this lane's worker was mid-diagnosis on the very same findings.Unlike #634 (where the losing side's work simply never landed), this one produced live contradictory state: the babysit worker independently fixed the same finding (fenced-code-block false-positive) with an inline patch, pushed
828669a, and replied "Fixed in 828669a" — landing on a thread the other actor had already marked resolved on the basis of "tracked in #654, not fixed inline." Both claims are now sitting on GitHub for a human to reconcile: is the finding closed by the inline commit, or still open pending #654's broader refactor?Confirms #645's root cause (no lease exclusivity across lanes — this lane's leases only coordinate within itself) but demonstrates real GitHub-visible fallout, not just wasted compute: divergent resolutions can both land and contradict each other on the same thread.
kyle-sexton commentedon Jul 21, 2026
This was generated by AI (decide lane — decision-brief pass).
Decision brief (2-minute read) — close as dup of #524, or split?
Problem. #645 raises two facets: (a) the worker lease gives no mutual exclusion across independent lanes/sessions, so a concurrent lane duplicates work (a TOCTOU claim-race); and (b) after the other lane merged (auto-deleting the branch), the babysit worker's plain non-force
git pushof its own fix resurrected the deleted branch as a zombie on the already-merged PR. The live question is whether both facets are just #524, or whether facet (b) should be pulled out and fixed on its own.Today (verified against code):
acquire()(babysit_lease.py:180) decides purely from a record read out of the localstate_dir(load_leasebabysit_lease.py:108,lease_pathbabysit_lease.py:87,active_workers_dir=<state-dir>/active-workersbabysit_lease.py:64). No GitHub-side lock —babysit_lease.pyimports only parse helpers frombabysit_gh, no network. So exclusivity holds only among sessions sharing one filesystem/state-dir; two independently-launched lanes each read an absent record and both getacquired: true. That is source-control:babysit-prs: worker-scope per-PR lease did not prevent a concurrent worker on the same PR (duplicate P1 fixes) #524's root cause verbatim.SKILL.md:352Step 5;reference/loop.md:~220). The only adjacent recheck before it is a head-SHA freshness check (SKILL.md:276"re-check the head SHA, push") — it does not re-fetch the PR'sstate. A plaingit pushrecreates a deleted upstream ref;--force-with-leasewould not save you either (the ref is gone, not diverged). So a PR that merged in the check→push gap gets its branch resurrected.babysit_gh.py:675already applies astate.casefold() != "open"skip. Re-fetchingstate/mergedAtand aborting the push if not OPEN is a read + abort, reusing logic already in the codebase.statebefore pushing, abort if not OPEN" TOCTOU note (and flags--json mergedas invalid; usestate/mergedAt). So this brief is not surfacing a missed facet — it argues about where the cheap guard should live.status: readybutblocked by #440— its chosen fix is a GitHub-visible worker-claim marker, which is an outward write that source-control: no read/consume-only posture — "safe" babysit tier and pull-request monitor write to GitHub autonomously #440'soutward_write_mode: report-onlydefault would suppress. Facet (b)'s fix is a read + abort, not an outward write → it is genuinely source-control: no read/consume-only posture — "safe" babysit tier and pull-request monitor write to GitHub autonomously #440-unblocked and shippable now. That asymmetry is the whole case for splitting.Options (both directions trivially reversible — reopen/close — so stakes are low; the tiebreaker is which keeps the cheap fix actionable now):
RECOMMENDED — Split: re-scope #645 to the branch-resurrection pre-push state-recheck only; mark facet (a) a duplicate of #524 (cross-link, don't re-track).
Rationale: facet (a) is already fully owned by #524 (whose acceptance criteria explicitly cover "any other session regardless of session/machine/state-dir" — #645's "lane" is in scope). Facet (b)'s guard is cheap, reuses
babysit_gh.py:675's existing check, is root-cause-aligned, and — critically — is not blocked by #440 the way #524 is. Closing #645 as a pure duplicate buries this unblocked guard behind a heavy, #440-blocked substrate redesign, so it inherits blocked status and does not ship. Splitting lets it land independently. Honest caveat: a pre-push state-recheck narrows but does not close the window (a merge can still land in the check→push gap — the same GitHub-as-lock lag #524 admits about itself); it is still worth it as a large, cheap window reduction. Reversibility: HIGH.Close #645 as a pure duplicate of #524.
The question's default and this lane's own earlier triage recommendation. Defensible — both facets share the TOCTOU root class and #524 already notes facet (b). Tradeoff: the cheap, #440-unblocked branch-resurrection guard gets absorbed into #524's blocked scope and won't ship until the whole substrate/marker design clears #440. What changed since the prior "close as dup" call: recognizing that facet (b)'s fix is a read (not an outward write) makes it #440-unblocked — which is precisely why it should not inherit #524's blocked status. Reversibility: HIGH.
Keep #645 open covering both facets.
Tradeoff: duplicates #524's exclusivity tracking and re-opens a design already ratified and blocked-by-#440; adds tracker drift with no benefit over the split. Not recommended.
Cross-links.
status: ready,blocked by #440) — owns facet (a) cross-session/cross-lane lease exclusivity; already ingested source-control:babysit-prs: worker lease doesn't prevent a concurrent lane duplicating work, and a non-force push after merge resurrects the auto-deleted branch #645's PR refactor(source-control): one shared babysit authorship/finding/approval classifier + golden fixtures (#534) #634 example and the facet-(b) TOCTOU note. Facet (a) here is its duplicate.outward_write_mode: report-onlydefault; the reason source-control:babysit-prs: worker-scope per-PR lease did not prevent a concurrent worker on the same PR (duplicate P1 fixes) #524's marker-based fix is blocked and the reason facet (b)'s read-only guard is not. The load-bearing distinction for the split.isOutdatedstate (own-push displacement); adjacent pre-push-recheck discipline, same "re-check lifecycle state before the push mutates" family as facet (b).work-items:workrule 3b). The losing actor in these babysit examples is an independent Claude lane; cross-link as the cross-lane-coordination cousins, distinct from the intra-babysit lease.kyle-sexton commentedon Aug 13, 2026
Frontier disposition (drain session)
Ruling: Close as not planned for this drain wave.
Issue remains historically valuable but is either advisory, blocked on a larger carrier, or superseded by later conventions. Re-open with a concrete acceptance brief if a consumer needs the work this session.
Title: source-control:babysit-prs: worker lease doesn't prevent a concurrent lane duplicating work, and a non-force push after merge resurrects the auto-deleted branch