Repository navigation
Claims: a fencing token per grant, the workspace in the key, and the holder kept across a park - #11
Merged
Merged
Conversation
…holder kept across a park A lease (`claim-lasts:`) frees a key a crashed worker held, but cannot stop a call still running when the lease ends. Every grant of a key is now numbered one higher than the key's grant before it (`Taken.fence`); a renewal keeps the number, and expiry and release keep the count, so the system a call writes to can refuse a writer whose number is stale. `SqliteClaims` keeps expired and released rows for their count and gains the column on files written before it. The ledger records the token of each claim it took (`Ledger.fences`). `the-workspace` claims are namespaced by the workspace id a host names (`claims_workspace=`), so two workspaces sharing one store do not refuse each other; without one the key is as before. A parked run comes back as the holder of the claims it took (`Suspension.claim_holder`, carried by `_park_state`, `escalate` and the JSON form): under a new name it could neither renew nor release them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s the claim's holder AND the reactions; counts recomputed (4822) Both code conflicts were two additions at the same place: Suspension's escalate copy and harness._park_state each gained a line from this branch (claim_holder) and a line from master (reactions). Both are kept. The counts were recomputed by scripts/sync-counts.sh: 1623 Rust + 3199 adapter. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
dittops
marked this pull request as ready for review
November 12, 2026 10:37
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.
Closes three of the reference-adapter gaps docs/98 WP-7 left in claims (
claims.py), found while Bud Meta Harness builtclaim-lasts:on its shared-store ledger (its card PK-4).What changes
Taken.fence). A renewal by the same holder keeps the number; expiry and release keep the count, so a later grant is always higher. A lease cannot stop a call still running when it ends, and the number is what lets the system that call writes to refuse the stale writer.SqliteClaimskeeps expired and released rows for their count (a released row has an empty holder) and adds thefencecolumn to a file written before it.Ledger.fencesrecords the token of each claim a run took, for the host to pass on.scoped(…, workspace)namespacesthe-workspaceby the workspace id a host names (run(…, claims_workspace=…), carried to members bydelegate_by_running). Without one the key is exactly as before.Suspension.claim_holdercarriesLedger.holderthrough_park_state,escalateand the JSON form, andrun(…, resume=…)comes back under it. A resumed run under a fresh uuid could neither renew nor release what it claimed before the park. A record from before the field resumes under a new name, as today.Not in this PR
Bud Meta Harness also releases a claim whose call is known not to have happened (its status check says so, or a person does). The reference spends a key on any call that passed
hold, deliberately; changing that needs a status check in the reference first, so it is left for a separate proposal.Tests
tests/test_a_claim_is_fenced_and_kept_across_a_park.py(9): tokens per grant, renewal, expiry and release on both stores; an expired holder cannot release the next holder's claim; an old claims file gains the column; workspace namespacing inscopedand throughLedger.hold; the ledger records the token;claim_holdersurvives JSON and escalation.test_a_park_carries_everything_a_resume_needs.pyholdsclaim_holderto the same field lists asspent_keys.pydantic_ai, the TypeScript port's node toolchain); the same 108 fail identically on masterbcd4e63.🤖 Generated with Claude Code