From 1852ddd896472850aa457f9942e32844139e8d5b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 5 Sep 2026 00:23:00 +0200 Subject: [PATCH] Soul pass 7: bind the boundary digest to its own structure A tick leaves an UnelaboratedDestination's digest where it is, and closing the route it names moves it while the predicate still holds. Co-Authored-By: Claude Opus 5 --- crates/ghostlight-dungeon/src/world/mod.rs | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/crates/ghostlight-dungeon/src/world/mod.rs b/crates/ghostlight-dungeon/src/world/mod.rs index b2c5ada..0f50241 100644 --- a/crates/ghostlight-dungeon/src/world/mod.rs +++ b/crates/ghostlight-dungeon/src/world/mod.rs @@ -11738,4 +11738,48 @@ mod clock_tests { assert_eq!(replayed.commitments, kernel.state.commitments); assert_eq!(replayed.pressures, kernel.state.pressures); } + + /// Soul falsification: a `BoundaryDigest` binds the structure that derives + /// it, and nothing else. The clock is not in the preimage, so a tick leaves + /// it where it is; closing the one route out of the dead end leaves the + /// predicate holding and must still move the digest. + #[test] + fn soul_a_boundary_digest_binds_its_structure_and_not_the_clock() { + let directory = tempfile::tempdir().unwrap(); + let (mut kernel, clockwork, _) = clock_kernel(directory.path(), "Digest"); + let destination = |kernel: &WorldKernel| { + derive_boundaries(&kernel.state) + .unwrap() + .into_iter() + .find_map(|boundary| match boundary { + CausalBoundary::UnelaboratedDestination { place, scope, .. } + if place == clockwork.dead_end => + { + Some(scope) + } + _ => None, + }) + .expect("the dead end") + }; + let before = destination(&kernel); + + // The clock moves; the digest does not. + tick(&mut kernel, 10).expect("the tick commits"); + assert_eq!(destination(&kernel), before, "the clock entered a preimage"); + + // The route's own record moves; the digest must follow. + let snapshot = kernel.snapshot().unwrap(); + submit_owner( + &mut kernel, + &snapshot, + operations(vec![ComponentOp::CloseRoute { + route: Ref::Existing(clockwork.gate), + }]), + ); + assert_ne!( + destination(&kernel), + before, + "the digest ignored the route it names" + ); + } }