Skip to content

Add all-or-nothing multi-target claims - #135

Merged
Deicyde merged 4 commits into
mainfrom
split/multi-target-claims
Oct 5, 2026
Merged

Deicyde merged 4 commits into
mainfrom
split/multi-target-claims

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Extracted from #115 so the claim transport can be reviewed independently. The exact head 21328e99 is merged with current main; #137 has removed the former README baseline blocker.

Summary

  • let autoform claim acquire, renew, and release accept several targets
  • read every target with one ls-remote, apply the existing per-key ownership checks, and update every ref in one git push --atomic
  • attach one --force-with-lease to every ref so a lost race changes none of the batch
  • report every known blocker in input order, including malformed leases, while preserving the exact single-target path and output
  • refuse remotes without atomic-push support instead of falling back to partial updates

This supplies the deadlock-free primitive used by the later shared-declaration revision contract; workers acquire the whole target set or none.

Validation

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.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 5, 2026
@Deicyde Deicyde added the blocked Waiting for prerequisite work before implementation can proceed label Oct 5, 2026
@Deicyde
Deicyde marked this pull request as ready for review October 5, 2026 19:43
@Deicyde Deicyde added the review: ready Review complete with no known merge blockers label Oct 5, 2026
@Deicyde

Deicyde commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head review is complete at d7384653. The batch path preserves the single-key contract, reads all refs once, validates every lease before writing, uses one atomic push with a force-with-lease per ref, refuses unsupported atomic remotes, and reports malformed or contended keys without partial ownership.

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 main and is fixed by #137. No claim-transport blocker remains; merge #137 first.

@Deicyde Deicyde removed the blocked Waiting for prerequisite work before implementation can proceed label Oct 5, 2026
@Deicyde
Deicyde merged commit 80caaed into main Oct 5, 2026
13 checks passed
@Deicyde
Deicyde deleted the split/multi-target-claims branch October 5, 2026 22:10
@Deicyde

Deicyde commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

The refreshed exact head 21328e99 is fully green against current main: Python 3.10/3.13, Windows, real Lean, and CLA all pass. The atomic multi-target claim primitive is mergeable and no longer order-blocked.

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. review: ready Review complete with no known merge blockers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant