Skip to content

ci: let only the holding process release or renew an integration lease #3303

Closed

Description

@schlessera

Part of #2934.

Problem

bun scripts/integrate.ts release <id> releases any live lease whose actor matches the caller. Every agent here uses the same GitHub login, so actor cannot tell holders apart. Lease ids are public in reservation.json on refs/heads/brain-integration-reservation. So any agent can release another agent's live confirmation.

On 2026-11-02 the reservation ref recorded this sequence for lease 1b428124…, held by confirm 3279:

The holding confirm process was still in its proof wait loop. Its next renewal failed with No reservation to renew. Its own code releases only after a merge or in its exit cleanup, and neither had run. Its candidate proof run 41483475829 was still in progress and was wasted.

Acceptance criteria

  • A lease carries a holder token that never appears in the public ref. Examples: a random secret kept by the holding process, or a hash of one stored in the ref. renew, release and merge --lease require it.
  • release without the token is refused while the lease is live. An expired lease still needs no release. An operator override stays available through revoke <reason>, which records its reason.
  • integrate.ts acquire prints the token once, for callers that hold the lease explicitly. confirm keeps it in memory only.
  • Tests: a second process with the same actor and the lease id cannot release or renew a live lease. The holder can. revoke still works and records its reason.
  • Mutation receipt: dropping the token check fails the cross-process release test.

Out of scope

Lease length, the renewal interval, and transient renewal failures (#3302).

Activity

  1. added this to the 0.45.0 milestone on Nov 2, 2026
  2. added
    type: fix
    area: ci
    priority: p1
    agent-ready
    on Nov 2, 2026
  3. self-assigned this
    on Nov 4, 2026
  4. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    Claimed (claim-3303-88e7a6). Branch fix/3303-lease-holder-token from main 5c9b23d4. Collision check on scripts/integrate.ts and scripts/integration-reservation.ts: closure reports only, no open PR changes either path. #3302 follows from the new main once this lands, per the proof-system lane (#3269).

  5. added a commit that references this issue on Nov 4, 2026
    d683a24
  6. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    Delivered by #3571, squash 3853e24f on main: parent 28c5af58, tree 25bea3c0, the same tree candidate run 41871035401 tested on the ready_for_review merge checkout. The confirm that landed it held a token lease with a published holder digest. A first confirmation was refused because the newest contract run had been cancelled while pending. That gap is filed as #3573. Main CI run 41875126361 is in progress; #3302 merges only after it is green (proof-system lane).

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: cipriority: p1type: fix

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions