pub struct CadenceConfig {
pub cadence_turns: usize,
pub max_overhead_fraction_pct: usize,
}Expand description
Tuning knobs for the #2346 cadence compressor.
Why: A caller needs to control both “how often” (turn-count cadence) and
“how much of the window is overhead” (the budget the cadence + continuous
enforcement together must respect) — bundling them mirrors
CompactionConfig’s own two-knob shape.
What: cadence_turns is the turn-count period maybe_cadence_compress
fires the unconditional compaction pass on (0 disables cadence firing
entirely, though continuous enforcement still applies — see
Transcript::tick_cadence_turn’s docs); max_overhead_fraction_pct is
the whole-number percentage of the model’s real context window
CadenceConfig::overhead_cap_tokens resolves the absolute cap from.
Test: cadence::tests::default_is_sane.
Fields§
§cadence_turns: usizeCompress every this-many completed turns.
max_overhead_fraction_pct: usizeWhole-number percentage of the context window the working transcript may occupy.
Implementations§
Source§impl CadenceConfig
impl CadenceConfig
Sourcepub fn overhead_cap_tokens(&self, context_window: usize) -> usize
pub fn overhead_cap_tokens(&self, context_window: usize) -> usize
Resolve the absolute overhead-token cap for a given context window.
Why: The budget arithmetic (epic #2343: on a 200K window, 40% ->
80K overhead cap, 120K working floor) needs the model’s REAL context
window — a property of the model, resolved separately via
crate::provider::resolve_context_window — combined with this
config’s fraction.
What: context_window * max_overhead_fraction_pct / 100.
Test: cadence::tests::overhead_cap_matches_epic_arithmetic.
Trait Implementations§
Source§impl Clone for CadenceConfig
impl Clone for CadenceConfig
impl Copy for CadenceConfig
Source§impl Debug for CadenceConfig
impl Debug for CadenceConfig
Source§impl Default for CadenceConfig
impl Default for CadenceConfig
impl Eq for CadenceConfig
Source§impl PartialEq for CadenceConfig
impl PartialEq for CadenceConfig
impl StructuralPartialEq for CadenceConfig
Auto Trait Implementations§
impl Freeze for CadenceConfig
impl RefUnwindSafe for CadenceConfig
impl Send for CadenceConfig
impl Sync for CadenceConfig
impl Unpin for CadenceConfig
impl UnsafeUnpin for CadenceConfig
impl UnwindSafe for CadenceConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more