Skip to content

A runtime that stops beating — crashed, killed or partitioned — expires on its peers within the declared expiry, its claims stop excluding, and its restart reconnects as the same runtime without a duplicate

Presence is current, never "seen once this morning". A runtime killed without a shutdown

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

A server process is killed with SIGKILL and restarted in the same checkout; its peer lists it once with restarts counted and its previous run's claim stays expired. Beats are aged on each runtime's own monotonic clock. The lab repeats it with docker kill and a network disconnect.

What it means

Presence is current, never "seen once this morning". A runtime killed without a shutdown releases nothing, yet within cooperation.expiry_seconds its link is expired on every peer, its sessions are expired, and its exclusive claims no longer refuse anyone. When it restarts in the same checkout with the same node key it is the same runtime — a new instance of it — and it reconnects: its peers list it once, with restarts counted, and the claims of its previous run stay expired rather than coming back to life.

How it works

Every heartbeat a runtime raises its own beat; sync rounds relay every stream's beat with how long ago the sender saw it rise, so liveness is computed on each runtime's own monotonic clock and no two machines' wall clocks are compared (apps/majordomus-cli/src/mesh/journal.rs). A link with no exchange for half the expiry is unreachable, past the expiry expired and dropped; the dialer backs off exponentially, capped at the expiry, and says hello again when the peer answers (apps/majordomus-cli/src/mesh/cooperation.rs). A reloaded journal restores events but no freshness, so nothing is alive until it beats again.

How to see it

majordomus mesh peers                       # link state and "beat Ns ago" per runtime
curl 'http://127.0.0.1:8741/api/v1/mesh/state?view=full' | jq '.streams'
cargo test --manifest-path apps/majordomus-cli/Cargo.toml --test mesh_cooperation a_killed_runtime

a_killed_runtime_expires_and_its_restart_reconnects_as_the_same_runtime kills a server process with SIGKILL and restarts it; test/mesh-lab/run (scenarios process_crash_recovery and network_partition) kills a container and disconnects one from the network.

What it does not cover

Expiry is bounded by the declared expiry plus one heartbeat per relay hop; it is not instantaneous. A runtime that is alive but unreachable from one peer and reachable from another stays alive through the relay, by design.

Why it exists

A claim that outlives its holder blocks work forever; a claim that is released by a timeout on one machine but not another is two truths. Liveness from beats that expire on every runtime's own clock is what makes a dead holder's claims end everywhere without anyone releasing them.

Detail rendered from docs/claims/mesh-liveness-expiry.md.

From the statement to the proof

  1. 1 · the public statement

    A runtime that stops beating — crashed, killed or partitioned — expires on its peers within the declared expiry, its claims stop excluding, and its restart reconnects as the same runtime without a duplicate

    Made on Mesh.

  2. 2 · the canonical claim

    mesh-liveness-expirydeclared status: guaranteed in docs/CLAIMS.yaml

    Defined in read it on this site · docs/MESH.md

  3. 3 · the implementation

    apps/majordomus-cli/src/mesh/cooperation.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

Related claims same implementation

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