Skip to content

I2139 — A sync message stays under the link bound whatever the marks weigh

Budget each sync message as the link bound minus its marks, and stop sending tombstone marks the peer does not hold.

DONE wave 0 · p1 · implementation profile · runs alone

Part of mesh-journal-converges — The cooperation journal is durable, converges under any delivery order, and never lets a stale claim win.

Objective

Budget each sync message as the link bound minus its marks, and stop sending tombstone marks the peer does not hold.

Why

The 600 KiB event budget of a sync ignores the size of the marks sent with it (apps/majordomus-cli/src/mesh/journal.rs:1734-1766). 1024 live marks of about 340 B, plus 4096 tombstones of about 95 B, plus 600 KiB of events exceeds MAX_LINK_MESSAGE of 900 KiB (apps/majordomus-cli/src/mesh/link.rs:67,70). This is the audit's arithmetic, not observed at runtime. Past that size the answerer refuses the message (apps/majordomus-cli/src/mesh/cooperation.rs:1769-1779, 2010-2020), and a busy journal would stop replicating with no typed explanation. Baseline audit of 2026-10-09 at master 1fb8d6be44, mesh gap 7.

Current state

The event budget is a constant that does not account for the marks.

Desired state

sync_with and accept_sync compute the event budget as MAX_LINK_MESSAGE minus the serialized marks, omit tombstone marks the peer does not hold, and the message builder asserts the bound.

Scope

  • apps/majordomus-cli/src/mesh/journal.rs
  • apps/majordomus-cli/src/mesh/cooperation.rs
  • apps/majordomus-cli/src/mesh/link.rs
  • apps/majordomus-cli/tests/mesh_cooperation.rs

Dependencies

None. This issue is a root of the graph.

Acceptance criteria

  • A journal with 1024 live marks and 4096 tombstones replicates to an empty peer over several rounds, every message under MAX_LINK_MESSAGE
  • No sync message the dialer or the answerer builds exceeds MAX_LINK_MESSAGE, asserted where it is built

Validation

  • bin/majordomus plan validate
  • cargo test --lib mesh
  • cargo test --test mesh_cooperation

Evidence required

  • sync_at_the_mark_bound_test

Evidence

coverstypecommandresultat commit
sync_at_the_mark_bound_testtestcargo test --locked --manifest-path apps/majordomus-cli/Cargo.toml --test mesh_sync_bound sync_at_the_mark_bound_testtest result: ok. 1 passed; 0 failed (run 2026-10-14 between 07:40Z and 07:58Z on master ce5959db59)ce5959d

Timeline

started
2026-10-14T08:01:37Z
verified
—
completed
2026-10-14T08:01:43Z

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I2139.yaml. Read it back with majordomus plan show I2139.

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