Repository navigation
feat(id): region-seam handoff journal foundation (#3900) - #3922
Conversation
Phase 1 of #3870 (design #2818): typed EntityExported/EntityImported world journal entries plus the CoordinatorJournalEntry format, WorldEventKind::EntityInput, journal version 3 with bump-on-first-write via journal_version_required_by, WorldCore handoff transfer state rebuilt by replay (duplicate handoff sides refused, import epoch must advance), and checkpoint/compaction preservation of active handoffs, fences, receipts and owner epochs. EntityInput delivers to programs exactly like Input in the sandbox/native/fixture hosts. No routing behavior changes; phases 2-5 of #3870 build on this format. Tests: 3 new world tests (version pinning + coordinator wire shape, restore + checkpoint compaction round-trip, duplicate export refusal) pass on the laptop; full id lib suite run locally.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
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 20 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 344ce0520e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| JournalEntry::Checkpoint { transfers, .. } => match transfers { | ||
| Some(_) => JOURNAL_VERSION_REGION_HANDOFF, | ||
| None => JOURNAL_VERSION, |
There was a problem hiding this comment.
Include retained entity inputs in checkpoint version detection
When a world has committed EntityInput events but has no handoff transfers, this branch reports version 1 even though the checkpoint's retained events still contain the new event kind. WorldCore::checkpoint_entries derives the compacted header from this helper, so compaction downgrades that journal's header to version 1 (or version 2 with a nondefault execution profile). Older binaries then accept the header but cannot deserialize the checkpoint, violating the bump-on-first-write compatibility contract. Inspect the checkpoint's retained events as well as transfers when determining whether version 3 is required.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d8a40bc: journal_version_required_by now scans a checkpoint's retained events — a checkpoint retaining an EntityInput event requires journal version 3 even with no active handoff transfers, so compaction can no longer downgrade the header. Covered by an added case in handoff_entries_require_journal_version_3 (laptop: 3 handoff tests pass).
Codex P2 on PR #3922: a checkpoint retaining EntityInput events but carrying no handoff transfers reported version 1, so compaction could downgrade the header and an older binary would accept it then fail mid-read. journal_version_required_by now scans the checkpoint retained events (and drops const to do so; all callers are runtime).
|
Verification note (lane D, post-merge): the full id lib suite in the fleet worktree showed one failure in |
|
CORRECTION to my verification note above (lane D): the claim that the lock test passes in clean worktrees was wrong — it rested on garbled tool deliveries. Re-read directly from the saved result files: |
Summary
Phase 1 of #3870 (design #2818,
doc/2026-11-01_design_id2818.md§8 packet 1): the journal/schema/checkpoint foundation for journaled region-seam export/import. Format only — no routing behavior changes; existing worlds are unaffected until a handoff entry is written.pkgs/id/src/world/mod.rs):JournalEntry::EntityExported/EntityImportedwith the design §3 fields (handoff ID, entity ref, regions, owner epochs, module hash, payload schema/digest, embedded host system event; the export carries the complete payload as the durable recovery copy), plus theCoordinatorJournalEntryformat (Started / ExportObserved / ImportObserved / Completed / Cancelled — no entity payloads) for the phase-4 coordinator to build on.WorldEventKind::EntityInput { entity_ref, input }; replay treats it likeInput, and the sandbox / native / fixture program hosts deliver its bytes exactly like unscoped input (entity scoping is host-side fencing metadata, wired in phase 2).JOURNAL_VERSION_REGION_HANDOFF = 3,MAX_JOURNAL_VERSION = 3;journal_version_required_bypins v3 for handoff entries, EntityInput events, and checkpoints carrying transfers — the existing bump-on-first-write / refuse-at-open contract (Define rollback compatibility for world profile journal entries #227) does the rest. v1/v2 journals still open.WorldCore.handoff_transfersis rebuilt by replay (a duplicate export/import for one handoff ID is refused; an import whose epoch does not advance is refused) and rides theCheckpointentry's newtransfersfield through compaction, so an exported entity cannot be resurrected and an import receipt cannot be forgotten. Compacted headers carrying transfers are marked v3.Tests
New laptop-run tests (CI will re-run):
handoff_entries_require_journal_version_3,handoff_transfers_survive_restore_and_checkpoint_compaction,duplicate_handoff_export_in_journal_is_refused— all pass; the v1/v2 header test still passes.Queue: task 5863. Parent: #3870. Design: #2818. Phases 2–5 are #3901–#3904, gated in order.
Need help on this PR? Tag
@codesmith-botwith what you need.