Skip to content

native-proof: case 17 compares aggregate charge across background reclamation #2819

Closed

Description

@schlessera

Context

Native case 17 of the reference pool proof asserts that refusing to release a held worktree leaves its charge unchanged. It does this by comparing two separate charged() readings taken around the refused poolRelease (REFERENCE_ACCESS_HELD_NOT_RELEASED, scripts/native-proof/reference-pool.native.ts:543-548, added by #2729 in 5e6446a).

charged() reads the pool's aggregate allocation. Earlier releases in the same proof can still be reclaimed in the background between the two readings, so the aggregate can drop while nothing about the held worktree changed. On a loaded host, 2 of 6 runs of bun scripts/prove-reference-pool.ts (head dc5d3c732 plus unrelated #2432 changes that do not touch case 17) failed only on this field:

-   "charged": 720896,
+   "charged": 589824,

The refusal code, state, access and read assertions all held. Both failures happened while other test suites loaded the machine.

Scope

Make the assertion measure what it claims: that the refused release freed nothing of the held worktree. Options include settling earlier reclamation before the first reading, or comparing the worktree's own ownerBytes instead of the aggregate.

Out of scope

Changing release semantics, the #2729 refusal, or other native cases.

Acceptance criteria

  1. Case 17 no longer depends on unrelated background reclamation. Ten consecutive native runs under parallel load pass this assertion.
  2. The mutation that removes the held-worktree refusal still fails REFERENCE_ACCESS_HELD_NOT_RELEASED.

Verification

flock <native slot> bun scripts/prove-reference-pool.ts repeated, plus the mutation receipt.

Contract impact

None.

2026-10-24 triage at main af6300478a07379178bd30221a31c0b917df2283: Verified the current assertion still compares aggregate chargedBytes across the held release. The retained 2/6 recurrence and precise owner-versus-aggregate fix boundary are sufficient; no new loaded native repetitions are needed to establish readiness. Wanted unscheduled test-proof correction is p2/type: test; This directly verifies #2390's managed-worktree held-access safety outcome (delivered guard #2729), so attach to that existing epic; this is not a general worker-test child of the full #736.

Activity

  1. added
    type: fix
    area: ui-sdk
    priority: p2
    agent-ready
    area: ci
    type: test
    and removed
    type: fix
    on Oct 24, 2026
  2. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage at main af6300478a07379178bd30221a31c0b917df2283: Verified the current assertion still compares aggregate chargedBytes across the held release. The retained 2/6 recurrence and precise owner-versus-aggregate fix boundary are sufficient; no new loaded native repetitions are needed to establish readiness. Wanted unscheduled test-proof correction is p2/type: test; This directly verifies #2390's managed-worktree held-access safety outcome (delivered guard #2729), so attach to that existing epic; this is not a general worker-test child of the full #736.

  3. added this to the 0.45.0 milestone on Oct 25, 2026
  4. self-assigned this
    on Nov 15, 2026
  5. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-bac22db1. Branch: test/2819-held-release-owner-charge.

    Path collisions on scripts/native-proof/reference-pool.native.ts with #3806 and #4002; neither touches case 17's held-release assertion.

  6. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Merged in #4040 as 168d5255b through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: ciarea: ui-sdkpriority: p2type: test

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions