Repository navigation
Add all-or-nothing multi-target claims - #135
Conversation
ClaimBoard gains acquire_many, renew_many, and release_many. Each reads every key with one ls-remote, applies the per-key checks of the single-key method, and changes all refs in one git push --atomic with a --force-with-lease per ref, so a batch never holds some claims and not others. A lost race or a held claim returns a ClaimBatchResult naming the blocking keys, read from the porcelain status lines or the remote's "cannot lock ref" error. A board that does not support atomic pushes raises ClaimTransportError instead of falling back to separate pushes. autoform claim acquire|renew|release now takes one or more nodes. One node keeps today's code path and output; several print one line per target on success, one error line naming the blockers on failure, and exit 2 on a duplicate target.
The B1 contract separates transport problems, which raise ClaimTransportError, from a lost race or a held or unverifiable claim, which return a failure that names the blocking keys. The batch methods raised MalformedLeaseError for an unverifiable lease, so the CLI printed a bare key-level error instead of the "no claim was <op>ed" line. acquire_many, renew_many and release_many now report such a key as blocking with the reason "malformed lease". When keys block for different reasons, every key is named in batch order and the reasons are joined with "or". The per-key checks and the single-key methods are unchanged, and nothing is pushed. Tests cover each batch method with a malformed key, a batch with mixed reasons, the multi-node CLI line for a malformed claim, and the renew failure line.
|
Exact-head review is complete at Focused claims/CLI tests pass; the branch-push Python, Windows, and real-Lean jobs are green. The PR-merge Python failure is solely the stale README assertion on current |
|
The refreshed exact head |
Extracted from #115 so the claim transport can be reviewed independently. The exact head
21328e99is merged with current main; #137 has removed the former README baseline blocker.Summary
autoform claim acquire,renew, andreleaseaccept several targetsls-remote, apply the existing per-key ownership checks, and update every ref in onegit push --atomic--force-with-leaseto every ref so a lost race changes none of the batchThis supplies the deadlock-free primitive used by the later shared-declaration revision contract; workers acquire the whole target set or none.
Validation
git diff --check: clean