diff --git a/core/continuum-cognition/src/cognition/llm_deliberation_faculty/prompt/epoch.rs b/core/continuum-cognition/src/cognition/llm_deliberation_faculty/prompt/epoch.rs index 8e71a8555c..4f3e88cfcb 100644 --- a/core/continuum-cognition/src/cognition/llm_deliberation_faculty/prompt/epoch.rs +++ b/core/continuum-cognition/src/cognition/llm_deliberation_faculty/prompt/epoch.rs @@ -444,6 +444,14 @@ pub(in super::super) fn turnover_due( next_act_tokens: Option, would_restore: impl FnOnce() -> Result, ) -> Result { + // NO GRANT, NO TURNOVER: a turn sized before her served window is known (the spawn's + // placeholder MIN_SERVE_CTX, 2048) allows her view nothing, and turning over against that + // started her view empty; the next act re-appended every item her sources hold (~2,000 + // items, 20-56M chars on the M5, 2026-11-02 22:29-22:31Z) and turned over again. Her held + // view is kept; the turn itself is refused for capacity. + if allowed == 0 { + return Ok(Turnover::Keep); + } if view_tokens > allowed { return Ok(Turnover::Overflow); } diff --git a/core/continuum-cognition/src/cognition/llm_deliberation_faculty/prompt/epoch/tests.rs b/core/continuum-cognition/src/cognition/llm_deliberation_faculty/prompt/epoch/tests.rs index 94c6d8bd04..0b3cc9fee7 100644 --- a/core/continuum-cognition/src/cognition/llm_deliberation_faculty/prompt/epoch/tests.rs +++ b/core/continuum-cognition/src/cognition/llm_deliberation_faculty/prompt/epoch/tests.rs @@ -131,3 +131,14 @@ fn a_fitting_view_restores_only_when_the_next_act_would_turn_it_over() { assert_eq!(turnover_due(33_000, 32_000, Some(5_000), never), Ok(Turnover::Overflow), "over its grant: turn over"); assert_eq!(turnover_due(30_000, 32_000, Some(5_000), || Err("mismatch")), Err("mismatch"), "a broken allocation refuses"); } + +// what this catches: a turn sized before her window is known (granted nothing) turning her view +// over to an empty start, after which the next act re-appends every item her sources hold and +// turns over again (2026-11-02, every M5 resident at boot). With nothing allowed the view is kept. +#[test] +fn a_view_granted_nothing_is_kept_never_started_empty() { + let due = turnover_due::<()>(33_165, 0, Some(10_000), || Ok(true)).expect("pure"); + assert_eq!(due, Turnover::Keep, "no grant is not an overflow"); + let due = turnover_due::<()>(33_165, 29_000, Some(10_000), || Ok(true)).expect("pure"); + assert_eq!(due, Turnover::Overflow, "a real grant it outgrew still turns over"); +}