From 94ab5115ba67388ba81362156c9db20ca14751c0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 31 Oct 2026 16:14:07 +0100 Subject: [PATCH] self-session-live: the journal's decision line carries the inputs the decision was made on Co-Authored-By: Claude Sonnet 5.5 --- crates/mind-body/src/self_run.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/mind-body/src/self_run.rs b/crates/mind-body/src/self_run.rs index 348fce3..72a891c 100644 --- a/crates/mind-body/src/self_run.rs +++ b/crates/mind-body/src/self_run.rs @@ -612,6 +612,8 @@ fn drive( } while let Some(heard_event) = events.pop_front() { let counted = state.requests; + // The decision's inputs, as they stood when the event came. + let (ttl_s, inbox, idle_s) = (state.ttl_s, state.inbox, state.idle_s(now)); let (next, action) = decide(state, heard_event, now); state = next; if state.requests != counted { @@ -639,8 +641,8 @@ fn drive( Action::Finish(_) => {} } if !matches!(action, Action::None | Action::Finish(_)) { - let idle = state.idle_s(now).map_or_else(|| "working".to_string(), |seconds| seconds.to_string()); - writeln!(out, "decision {action:?} prefix {} ttl_s {} idle_s {idle} inbox {}", state.prefix, state.ttl_s, state.inbox)?; + let idle = idle_s.map_or_else(|| "working".to_string(), |seconds| seconds.to_string()); + writeln!(out, "decision {action:?} prefix {} ttl_s {ttl_s} idle_s {idle} inbox {inbox}", state.prefix)?; } if let Action::Finish(outcome) = action { return Ok(outcome);