From e76ba61ee6780e1e41793ccb423f0ea2a636e30c Mon Sep 17 00:00:00 2001 From: soul Date: Fri, 20 Nov 2026 15:12:29 +0100 Subject: [PATCH] aetherlight: the clean-log contract of a view read holds in release builds derive_motion asserts, not debug_asserts, that the six partitions the views join have no open log, so a stale view cannot be read silently in a shipped build; the refusal test runs in every profile. Co-Authored-By: Claude Sonnet 5.5 --- native/aetherlight/src/clock.rs | 5 +++-- native/aetherlight/src/golden_tests.rs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/native/aetherlight/src/clock.rs b/native/aetherlight/src/clock.rs index 69994054a..eaee01512 100644 --- a/native/aetherlight/src/clock.rs +++ b/native/aetherlight/src/clock.rs @@ -116,10 +116,11 @@ mod step { /// What is due, and which dependencies fail, is read from `Views` (the one owner /// of both questions: a live subject's due commitments and a live subject's /// unavailable dependencies), so a tick reads the work it does and not the -/// world. A view is true only with clean logs, so both callers (`reduce`, and +/// world. A view is true only with clean logs, so it is read behind a check +/// that holds in every build (six flag tests), and both callers (`reduce`, and /// `apply_effect`'s `TimeAdvanced` arm before its first write) call it clean. pub(super) fn derive_motion(state: &WorldState, to: FictionalMinutes) -> Motion { - debug_assert!(views::readable(state), "the views are read with an open log"); + assert!(views::readable(state), "the views are read with an open log"); motion_of(state, to, &state.views.due_by(to), state.views.failing().copied()) } diff --git a/native/aetherlight/src/golden_tests.rs b/native/aetherlight/src/golden_tests.rs index dcfadfeb9..a7451b3ca 100644 --- a/native/aetherlight/src/golden_tests.rs +++ b/native/aetherlight/src/golden_tests.rs @@ -1511,7 +1511,6 @@ fn a_corrupted_view_is_detected() { /// A view is read only with clean logs: reading one while a partition it joins /// has an open write is refused, not answered from a stale fold. -#[cfg(debug_assertions)] #[test] #[should_panic(expected = "open log")] fn a_view_read_with_an_open_log_is_refused() {