From 1ee0085c8bac7bbc35295af46207a123b216bfbc Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Sat, 14 Nov 2026 07:04:23 -0600 Subject: [PATCH] fix(id): grant INPUT scope in world_bench guest_replay journal (#8316) bench_guest_replay issued its synthetic participant JOIN|CHAT only, then hand-built a journal of Committed Input events from that participant. WorldCore::restore validates each event kind against the participant scopes in the Issued entry, so restore refused the first committed event (sequence 1) and the whole bench died before many_worlds could run. Issue the guest scope set (JOIN|CHAT|INPUT) in both the capability and the constructed Issued entry. The restore validator is correct (restore_refuses_* tests pin it); the harness journal was one no real writer could produce. --- pkgs/id/benches/world_bench.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/id/benches/world_bench.rs b/pkgs/id/benches/world_bench.rs index 80caebb38..27362b56f 100644 --- a/pkgs/id/benches/world_bench.rs +++ b/pkgs/id/benches/world_bench.rs @@ -828,7 +828,7 @@ fn bench_guest_replay(events: u64, reps: usize) -> Result> { let mut core = WorldCore::new("bench-replay", WorldLimits::default())?; let (participant, _token) = core.issue_capability( "bench", - WorldScopes::JOIN.union(WorldScopes::CHAT), + WorldScopes::GUEST, CapabilityBounds { expires_at: None, uses: None, @@ -842,13 +842,16 @@ fn bench_guest_replay(events: u64, reps: usize) -> Result> { // expectations: issue through a scratch core and harvest its journal by // replaying chat through the public API instead — simpler: committed // events only need a participant id that exists, and restore validates - // the header + ordering, so issue the capability in the restored core's + // the header + ordering + each event kind against the participant's + // scopes, so the participant is issued the guest set (JOIN|CHAT|INPUT): + // an INPUT-less Issued entry makes restore refuse the first committed + // input event (#8316). Issue the capability in the restored core's // place by using participant 1 events after an Issued entry we construct // from the scratch participant's public fields. journal.push(JournalEntry::Issued { participant, digest: "0".repeat(64), - scopes: (WorldScopes::JOIN.union(WorldScopes::CHAT)).bits(), + scopes: WorldScopes::GUEST.bits(), parent: None, expires_at: None, uses: None,