Skip to main content

Module claim_sync

Module claim_sync 

Source
Expand description

Git-remote Protocol impl for state-branch lifecycle pushes.

bl-2148 introduced this wire for the claim path: local claim commit on balls/tasks must land on origin before the worktree is created, with non-fast-forward rejections driving a fetch + field-level merge + retry. bl-2bf7 generalizes it to review and close — same wire, same retry-merge loop, only post_merge’s claim-vs-lost ownership check is event-specific.

Wired in per event only when the corresponding require_remote_on_<event> policy is true; otherwise the event stays local-only. The propose-merge-retry primitive itself lives in crate::negotiation; this module supplies the wire hooks and push_claim / push_state_for wrappers.

The remote is resolved (not hardcoded) through the per-clone/committed state_remote seam (bl-19aa); default origin. This is where a client repo retargets balls/tasks at a shared task hub.

Re-exports§

pub use crate::claim_push::push_state_classified;

Structs§

GitRemoteClaimProtocol
Protocol implementation for the git-remote state-branch lifecycle push. One concrete struct serves every event because the wire is the same git push <state_remote> balls/tasks either way; the only branching is post_merge’s claim-only ownership check. remote is resolved once at construction so every attempt in one negotiation targets a stable peer.
GitRemoteParticipant
The git origin remote as a SPEC §5 Participant. Carries no wire state itself — the per-event Protocol owns state for one negotiation. Subscriptions are caller-controlled: for_claim() is the bl-2148 shape (claim only); for_lifecycle(events) is the bl-2bf7 generalization for review and close. The caller’s policy resolution (per-event require_remote_on_* plus non-stealth) is what decides whether to subscribe at all.

Enums§

SyncedClaimResult
Outcome of the claim-sync negotiation.

Functions§

push_claim
Push the freshly-committed claim through origin/balls/tasks. Caller has already (a) committed the claim locally on the state branch and (b) released no locks that the merge step needs. The negotiation runs through the SPEC §5 Participant surface so the claim path shares one set of semantics with future participants.
push_state_for
Push the freshly-committed state-branch transition for event through <state_remote>/balls/tasks. Required-policy generalization of push_claim for review and close: same wire, same retry-merge loop, same unreachable-aborts-loud stance. The error_prefix is folded into the Err message so callers don’t all wrap the same way.