Skip to content

An exclusive claim made on one runtime excludes an overlapping claim on every linked runtime, and concurrent claims resolve to one named winner everywhere

A session on machine A claims apps/majordomus-cli exclusively. A session on machine B

declared statusdeclared status: guaranteed Declared deterministic and blocking, implemented, and naming the behavioural test that is to prove it. Whether a recorded run supports it is the evidence verdict, shown beside it.

recorded evidencerecorded evidence: not run Declared guaranteed, and not supported by a recorded run: the test is named, and no passing run of the current inputs is recorded. how evidence is recorded

Property tests of mesh::state prove the fold is independent of order and duplication and that no interleaving leaves two held exclusive claims meeting; the integration tests refuse a conflicting claim across two processes, across two worktrees and through a relay; the in-process partition test and the lab's network_partition scenario heal a partition into one held and one conflicted claim. Not strong consistency: under a partition both sides may hold, and the conflict is named after healing.

What it means

A session on machine A claims apps/majordomus-cli exclusively. A session on machine B that then claims apps exclusively is refused with claim_conflict, and the refusal names A's claim. The same holds between two sessions of one server, two worktrees of one machine, or three runtimes linked only through the middle one: an exclusive claim excludes everywhere it is known, by the same rule. When two sides of a network partition each claim the same scope — each was right to, since neither could see the other — healing the partition does not leave two holders: every runtime folds the same events and names the same winner, the claim with the lowest (lamport, stream, seq); the other is listed as conflicted with the winner's key.

How it works

Claims are events of the replicated journal (apps/majordomus-cli/src/mesh/journal.rs), signed by the claiming runtime. mesh::state::fold is a pure function over the set of events and each stream's liveness, applying events in (lamport, stream, seq) order, so arrival order and duplicate delivery cannot change the result — property tests hold both. admission_conflicts refuses a new exclusive claim that meets a live exclusive claim of another session; paths meet by peers::claims_meet, the peer board's own predicate. A claim lives while it is unreleased, its session is open, and its runtime's beat keeps rising.

How to see it

majordomus mesh claim apps/majordomus-cli --session s1 --issue '#184'
majordomus mesh state --full               # every claim with held/conflicted/expired
cargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib mesh::state
cargo test --manifest-path apps/majordomus-cli/Cargo.toml --test mesh_cooperation

exclusivity_holds_for_any_interleaving and fold_is_order_and_duplicate_independent are the properties; a_partition_expires_the_far_side_and_healing_reconciles_to_one_winner and test/mesh-lab/run (scenario network_partition) break a real link and heal it.

What it does not cover

It is not a lock service with strong consistency: during a partition both sides may hold the same scope, and the conflict is named after healing rather than prevented. An advisory claim (the peer board's announcements) reports overlaps and refuses nothing.

Why it exists

Several AI sessions on several machines working one repository collide on files unless a claim made anywhere is honoured everywhere — and a promise that held only between sessions of one server would fail exactly when the other worker runs somewhere else.

Detail rendered from docs/claims/mesh-claims-cross-runtime.md.

From the statement to the proof

  1. 1 · the public statement

    An exclusive claim made on one runtime excludes an overlapping claim on every linked runtime, and concurrent claims resolve to one named winner everywhere

    Made on Mesh.

  2. 2 · the canonical claim

    mesh-claims-cross-runtimedeclared status: guaranteed in docs/CLAIMS.yaml

    Defined in .ai/repo/rules/project/mesh-cooperation-is-authenticated.v1.md

  3. 3 · the implementation

    apps/majordomus-cli/src/mesh/state.rs

  4. 4 · the test and the scenarios

    Test: apps/majordomus-cli/tests/mesh_cooperation.rs

  5. 5 · the recorded runs

    recorded evidence: not run how evidence is recorded

Verify it yourself

The test runs in a disposable temporary repository and asserts the behaviour, not a string in the source.

from a clone of the repository
bash test/run.sh apps/majordomus-cli/tests/mesh_cooperation.rs

Searches the titles and descriptions of every page this site publishes.