From bd43291ca87c16e6caeca558eedd2113cd1100fa Mon Sep 17 00:00:00 2001 From: repo-worker-code-k Date: Sun, 8 Nov 2026 20:23:32 -0600 Subject: [PATCH] test(id): journal the fixture issuance in scheduling_actor (#2894 fallout) Two schedule tests (a_fire_the_program_refuses_stays_pending_in_the_journal, replay_reproduces_the_pending_and_fired_sets) failed on main at WorldCore::restore: "journal event at sequence 1 uses participant 1 before it was issued". Root cause: the scheduling_actor fixture mints its participant directly on WorldCore and never journals the Issued entry. Production issuance goes through WorldActor::record_issued, which persists the Issued entry as it mints, so a real journal always records issuance before any event authored by that participant. The fixture's journal was therefore a state no live path can write. Restore only began refusing it when the #2894 author validation merged (PR #4518, 2026-11-08 02:25 CST) -- the validation is correct, the fixture journal was not. Fix: scheduling_actor now appends core.issued_entry(ann.id) to its recorded journal right after minting, exactly as the actor does (the replica tests already journal issuance the same way). No production code changed; the restore validation is untouched. Verification (laptop, pkgs/id): the two tests pass; the full `cargo test` run for the package is green across every target (lib 2478, id_core 329, bin 10, all integration targets, doc tests). Unblocks: nix build of nixosConfigurations.amd toplevel on main, and with it the merged wvkbd deploy (PR #7817). --- pkgs/id/src/world/tests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/id/src/world/tests.rs b/pkgs/id/src/world/tests.rs index ba429e9bfb..50693cb17e 100644 --- a/pkgs/id/src/world/tests.rs +++ b/pkgs/id/src/world/tests.rs @@ -6668,9 +6668,16 @@ mod schedule_tests { WorldCore::new_with_clock(id, WorldLimits::default(), clock.clone()).unwrap(); core.ledger .set_granted(grants.iter().map(|grant| (*grant).to_owned()).collect()); - let (_, token) = core + let (ann, token) = core .issue_capability("ann", WorldScopes::GUEST, CapabilityBounds::default()) .unwrap(); + // Production issuance goes through the actor, which journals the + // `Issued` entry as it mints (`record_issued`). Minting directly on + // the core must record the same entry: without it the journal uses + // the participant before it was issued -- a state no live path can + // write, and restore refuses it (#2894). + let issued = core.issued_entry(ann.id).unwrap(); + journal.0.lock().unwrap().push(issued); let program = Scheduler { refuse_fires, ..Scheduler::default()