Repository navigation
Description
Summary
WorldCore::restore (pkgs/id/src/world/core.rs) treats the journal as untrusted input and validates handoff state strictly when it arrives as standalone entries — but a JournalEntry::Checkpoint's transfers list is installed verbatim with none of those checks. A journal whose checkpoint carries duplicate handoff sides, a non-advancing import epoch, or a transfer event that claims a sequence/participant is restored successfully, while the identical facts as standalone entries are refused. The checkpoint path is exactly the path compaction produces, so this is the durable-state trust boundary for the region-seam handoff state added in #3870 phase 1 (PR #3922).
Evidence (current main c1675d6)
Standalone arms validate (core.rs restore):
EntityExportedarm (core.rs:322-330): refuses whensource_event.sequence != 0 || source_event.participant_id != 0("journal export event claims a sequence"), and refuses a second export with the samehandoff_id("journal exports handoff … twice").EntityImportedarm (core.rs:363-375): same event check, plusnew_owner_epoch == prior_owner_epoch + 1("does not advance the owner epoch"), plus the duplicate-import refusal.
Checkpoint arm (core.rs:502-504):
// A checkpoint comes first in its journal, so its
// transfer list is the whole active-handoff state.
core.handoff_transfers = transfers.unwrap_or_default();No duplicate check, no epoch check, no transfer-event check, no bound. (The same arm does validate the checkpoint's execution_profile, caps_ceiling, and schedule agreement — transfers are the unvalidated remainder.)
Verified this run with a laptop probe calling the real WorldCore::restore (transient integration test in the laptop clone ~/git/code at c1675d6, pkgs/id/tests/probe_ckpt_transfers.rs, since removed; log at ~/git/fleet/probe-2026-11-01-laneA-ckpttransfers/run.log; sandbox and laptop core.rs/mod.rs md5-identical):
- CONTROL standalone duplicate export → Err "journal exports handoff "h1" twice"
- CONTROL standalone import epoch 5 → 5 → Err "does not advance the owner epoch"
- CONTROL standalone export event sequence 7 / participant 9 → Err "journal export event claims a sequence"
- CONTROL standalone valid import 5 → 6 → Ok
- CASE checkpoint, one valid export transfer → Ok
- CASE checkpoint, duplicate export transfers (same
handoff_id) → Ok (expected Err) - CASE checkpoint, import transfer epoch 5 → 5 → Ok (expected Err)
- CASE checkpoint, export transfer event sequence 7 / participant 9 → Ok (expected Err)
Why it matters
Restore is the journal's trust boundary everywhere else in this function: forged Issued entries for participant 0 (#2972), duplicate issues, out-of-bounds delegation expiry, unknown caps, and schedule disagreement are all refused at restore, precisely so a corrupt or crafted journal cannot resurrect state the live writers would never produce. Checkpoint-carried handoff state is the exception. Duplicate export records break the dedupe invariant the coordinator phases of #3870 rely on (an exact retry returns the existing receipt; two export sides for one handoff_id make that ambiguous), a non-advancing import epoch defeats the epoch fencing the design (#2818 §3) uses to stop a stale source region from re-owning an entity, and a transfer event claiming a sequence/participant violates the host-event invariant replay assumes. Because compaction rewrites the journal behind a checkpoint, any bad transfer state that ever reaches a checkpoint is laundered into the canonical durable form.
Acceptance criteria
WorldCore::restoreapplies the same validation to checkpoint-carried transfers as to standaloneEntityExported/EntityImportedentries: no duplicate (handoff_id, direction) pair, import records advance the owner epoch (new_owner_epoch == prior_owner_epoch + 1), export records carry nonew_owner_epoch, and each transfer'seventhassequence == 0andparticipant_id == 0.- Restore refuses (with a clear error naming the handoff) a checkpoint exhibiting any of: duplicate export side, duplicate import side, non-advancing import epoch, or a transfer event claiming a sequence/participant — matching the standalone-arm error style.
- New world tests cover each refused checkpoint case plus a control: a checkpoint with valid export and import transfers restores, and the checkpoint/compaction round-trip test from PR feat(id): region-seam handoff journal foundation (#3900) #3922 still passes.
- Existing world/journal tests still pass; no change to the journal wire format or to what
checkpoint_entrieswrites for live (valid) state.
Dedup notes
Filed by new-issue-creator-code-a. Searched open + closed issues for checkpoint/handoff/restore validation: #3900/#3870 (the phase-1 implementation and its umbrella — this is a validation gap in that landed code, not one of the phase 2-5 implementation issues #3901-#3904), #3911 (WaitingPool::restore duplicate guards — different type), #3373 (journal restore under revoked parent — different invariant). None covers checkpoint-carried transfer validation.
Activity
dezren39 commentedon Nov 1, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 1, 2026
🤖 Agent note · adopted as Phase 1 of design #4000
source/design-architect. Existing queued triage packet stands.13 remaining items
dezren39 commentedon Nov 2, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 3, 2026
🤖 Agent note · escalated
developing-today commentedon Nov 3, 2026
agent-note:v1
state: reviewed (coverage loop-back)
Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 6824 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
Found via: coverage loop-back 2026-11-03
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 3, 2026
🤖 Agent note · triage disposition
origin/mainate425b6af52c35067a452c0c4526fef47f00c7f01.pkgs/id/src/world/core.rsdefinesvalidate_handoff_transferand uses it for standalone export/import entries and for each checkpoint-carried transfer (list-order validation before installation). It rejects duplicate(handoff_id, direction)pairs, non-successor import epochs usingchecked_add, export records carrying a new epoch, and transfer events with nonzero sequence/participant.checkpoint_handoff_transfers_validate_duplicates_epochs_and_events,checkpoint_accepts_valid_export_and_import_transfers, andhandoff_transfers_survive_restore_and_checkpoint_compactioninpkgs/id/src/world/tests.rs.dezren39 commentedon Nov 3, 2026
🤖 Agent note · done
already_done; issue Phase 3 (audit) of #4000 — closing reconstruction-admission inventory for pkgs/id #4001 records the moved gate. Its parked task 5934 remains gated only on id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time #3911.