I2140 — Paging mesh.events returns every event exactly once
Page mesh.events by the causal key and return the last key returned as the next cursor.
DONE wave 0 · p2 · implementation profile · parallel safe
Objective
Page mesh.events by the causal key and return the last key returned as the next cursor.
Why
EventList.lamport is documented as 'the after of the next page' (apps/majordomus-cli/src/capability/builtin/mesh.rs:594-596) but is the journal's maximum lamport (apps/majordomus-cli/src/mesh/journal.rs:2124-2133), so a truncated page skips the rest of the journal. Paging by the last returned lamport also skips events that share it across streams, because the filter is lamport > after (apps/majordomus-cli/src/capability/builtin/mesh.rs:601-619). No test covers events_after. Baseline audit of 2026-10-09 at master 1fb8d6be44, mesh gap 8 and drift 9.
Current state
A client that follows the documented cursor misses events.
Desired state
Pages are cut by the causal key (lamport, stream, seq) (apps/majordomus-cli/src/mesh/journal.rs:858), the answer carries the last returned key as the next cursor, and mesh events --after accepts it.
Scope
- apps/majordomus-cli/src/capability/builtin/mesh.rs
- apps/majordomus-cli/src/mesh/journal.rs
- apps/majordomus-cli/src/cli/local.rs
- apps/majordomus-cli/tests/mesh.rs
- docs/MESH.md
Dependencies
None. This issue is a root of the graph.
What waits on this
Acceptance criteria
- Walking mesh.events with limit 1 over a journal where several streams share a lamport returns every event once, in causal order
- The cursor the schema documents is the cursor the next page accepts
Validation
- bin/majordomus plan validate
- cargo test --test mesh
- cargo test --lib mesh::journal
Evidence required
- events_paging_test
Evidence
| covers | type | command | result | at commit |
|---|---|---|---|---|
| events_paging_test | test | cargo test --lib -- mesh::; cargo test --test mesh | lib mesh:: 319 passed incl. paging_by_stamp_returns_every_event_exactly_once; --test mesh 8 passed (code on master since f820f5ab02f; re-run at master 01227a0) | 01227a0 |
Timeline
- started
- 2026-10-17T12:05:34Z
- verified
- 2026-10-17T12:05:46Z
- completed
- 2026-10-17T12:05:53Z
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/I2140.yaml. Read it back with majordomus plan show I2140.