Repository navigation
Conversation
…#13711) Lease entries (LeaseGranted/Renewed/HandedOff/Revoked/WriteRejected) now carry a durable monotonic per-world journal position, stamped by the append authority and recorded in the lease history, so a checkpoint carries every covered position and a successor replaying the journal reports its watermark through it. Positions start at 1; 0 means unstamped (pre-positions entry) and restores as before. - JournalEntry lease variants gain position (serde default 0); stamped positions require journal version 16, unstamped keep 7. - WriteLeaseTransition/LeaseWriteRejection gain position; WriteLease::last_position is the replay watermark. - WorldCore exposes lease_position_watermark and next_lease_position; the actor handoff stamps the next position before its durable append. - Replay refuses a stamped position that does not advance past the highest stamped position already seen. - Property test: positions strictly increase across appends and survive compaction; oracle test: grant at P reports watermark P; legacy and non-monotonic cases covered. Scope note: positions cover lease entries only, per the issue's request; per-entry positions for all entries remain the JournalRecord envelope follow-up (design #2819).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Batch B disposition (oc-code-08, task 21623): not merged this run. Verification needs the laptop shell route, which is down from this lane (bridge hello shell leg: broker connection refused). Rebase of this conflicting branch would need a force push, which this batch excludes, so the next step is a merge-main-in commit once verification is reachable. Named blocker: the PR's own verification (Rust/Fleet dispatch or mdBook build) cannot be run from this lane right now, so it is not merged unverified. Resume when a shell route to the laptop answers. |
Summary
Refs #13711 (prerequisite for #7572 failover barrier). Lease entries
now carry a durable, monotonic per-world journal position, stamped
by the append authority and recorded in the lease history, so a
checkpoint carries every covered position and a successor replaying
the journal reports its watermark through it.
JournalEntrylease variants (LeaseGranted,LeaseRenewed,LeaseHandedOff,LeaseRevoked,LeaseWriteRejected) gainposition: u64(#[serde(default)]—0means unstamped, alease entry written before positions existed).
WriteLeaseTransition/LeaseWriteRejectiongainposition;WriteLease::last_position()is the replay watermark.WorldCoreexposeslease_position_watermark()andnext_lease_position(); the actor handoff stamps the nextposition before its durable append (a failed append drops the
uncommitted lease, so the counter — derived from history — never
advances past a durable record).
highest stamped position already seen.
whose lease history carries one); unstamped entries keep version 7
and restore unchanged.
Scope note (decide-and-proceed): positions cover lease entries only,
per the issue's request ("every journal entry that changes lease
state (and ideally all entries)"). Per-entry positions for all
entries remain the
JournalRecordenvelope follow-up (design #2819).A checkpoint records the last covered lease position through the
lease history it carries (its max is the watermark); no redundant
Checkpoint.positionfield was added.Evidence
lease_positions_are_strictly_increasing_across_appends_and_compaction, proptest over the lease state machine — handoff/renew/revoke/grant sequences): history positions are exactly 1..=n after restore and after compaction + restore; watermark is n.lease_position_watermark_reports_the_grant_position_after_replay): grant at position 3 reports watermark 3, before and after compaction; bootstrap reports 0.Remote verification (narrowest commands, GitHub-hosted runner via
the fleet-command.yml fallback —
fleet queue dispatchitself isblocked by #13185 TLS defect):
cd pkgs/id && cargo test -p id-worlds --lib lease && cargo test -p id-worlds --lib handoff && cargo test -p id-worlds --lib notify_events_require— fleet run 45278328401 (first dispatch, pre-fix): compile failure —
JOURNAL_VERSION_LEASE_POSITIONwas not re-exported fromcrate::worldand the proptest movedexpectedtwice. Fixed by adding the constant to theworld/mod.rsre-export list and cloningexpectedat its first use (amended commit 7cb3750, pushed with an explicit--force-with-leasevalue after verifying the remote was still at the pre-amend commit).— fleet run 45279480155 (re-dispatch after the fix): success —
cargo test -p id-worlds --lib lease: 42 passed, 0 failed;--lib handoff: 22 passed, 0 failed;--lib notify_events_require: 1 passed, 0 failed. All four new tests ran and passed by name:lease_positions_are_strictly_increasing_across_appends_and_compaction,lease_position_watermark_reports_the_grant_position_after_replay,unstamped_lease_entries_still_restore_at_version_7,lease_positions_that_do_not_advance_are_refused. Log: https://github.com/developing-today/fleet/actions/runs/45279480155No new test file, so no test-suite-registry row is needed (tests
added to existing
id-worldstest modules).Merge Danger
Medium-low. The journal format gains an optional field on five
variants plus a new header version; old journals parse unchanged
(
positiondefaults to 0) and old binaries refuse v16 journals atthe header check. Replay now enforces stamped-position monotonicity
(legacy zeros pass through). Revertible: dropping the fields
restores the v15 format, but any journal that already stamped
positions would then lose them at its next checkpoint.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-23T22:39:21Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch/workspace/github-work/code-13711", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch/workspace/github-work/code-13711", "repo": "developing-today/code", "branch": "xaltha/13711-journal-position", "sha": "7cb3750e4ca19a41df6aee089bac88c2a93e4366" }, "auth_subject": "xaltha", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.