Skip to content

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

Closed as not planned

Description

@kyle-sexton

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:

  1. 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.
  2. 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).

Category: bug (race condition / TOCTOU gap).

Activity

  1. added
    needs-triage
    on Jul 20, 2026
  2. kyle-sexton commented on Jul 20, 2026

    @kyle-sexton
    MemberAuthor

    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: 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.

  3. added
    needs-owner-decision
    and removed
    needs-triage
    on Jul 20, 2026
  4. added theissue type on Jul 20, 2026
  5. kyle-sexton commented on Jul 20, 2026

    @kyle-sexton
    MemberAuthor

    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.

  6. kyle-sexton commented on Jul 21, 2026

    @kyle-sexton
    MemberAuthor

    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.

    Today (verified against code):

    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.

  7. added
    needs-human
    on Jul 23, 2026
  8. kyle-sexton commented on Aug 13, 2026

    @kyle-sexton
    MemberAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanneeds-owner-decision

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions