From 4decf9e79c21920aa143b276d615ac8618d74da9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 31 Oct 2026 16:18:46 +0100 Subject: [PATCH] self-session-live tests: a stale spool is wiped at start; the pre-compact block says why Co-Authored-By: Claude Sonnet 5.5 --- crates/mind-body/src/self_run/tests.rs | 10 ++++++++++ crates/mind-body/tests/self_run.rs | 2 ++ 2 files changed, 12 insertions(+) diff --git a/crates/mind-body/src/self_run/tests.rs b/crates/mind-body/src/self_run/tests.rs index e48a52d..36f3e4e 100644 --- a/crates/mind-body/src/self_run/tests.rs +++ b/crates/mind-body/src/self_run/tests.rs @@ -1633,6 +1633,16 @@ fn near_the_cap_an_idle_session_closes_for_rotation_and_a_working_one_is_asked_f assert_eq!(flushes(&before), 0); } +#[test] +fn a_session_starts_with_an_empty_spool_whatever_an_earlier_one_left() { + let hooks = test_hooks(); + inbox::spool(&hooks.spool, &[Brief { id: "eureka-body:follow_up:stale".into(), campaign: "eureka-body".into(), repo: "GameCult/Huginn".into(), item: "Stale.".into(), ordinal: 1 }]).unwrap(); + let mind = with_run(); + let ran = carry_hooked(&Seen::of(&mind), vec![Out(result_line())], (Some(0), None, NO_SIGNALS, false), hooks); + assert!(!inbox::pending(&ran.hooks.spool).unwrap(), "the stale entry is gone"); + assert_eq!(ran.written().len(), 1, "and was never told: {:?}", ran.written()); +} + #[test] fn a_pre_compact_block_leaves_a_marker_and_the_session_asks_for_the_flush_once() { let hooks = test_hooks(); diff --git a/crates/mind-body/tests/self_run.rs b/crates/mind-body/tests/self_run.rs index 98f014f..c76916b 100644 --- a/crates/mind-body/tests/self_run.rs +++ b/crates/mind-body/tests/self_run.rs @@ -74,6 +74,8 @@ fn inject_prints_the_spooled_briefs_as_hook_context_and_blocks_a_compaction() { }; let blocked = inject(&["--pre-compact"], "{}"); assert_eq!((blocked.status.code(), blocked.stdout.is_empty()), (Some(2), true)); + assert!(String::from_utf8_lossy(&blocked.stderr).contains("compaction blocked"), "the block says why"); + assert!(inject(&[], "{}").stderr.is_empty(), "a tell prints nothing on stderr"); let printed = inject(&[], r#"{"hook_event_name":"PostToolBatch"}"#); assert_eq!(printed.status.code(), Some(0)); let text = String::from_utf8_lossy(&printed.stdout);