atlas_kernels/behavior_defaults.rs
1// SPDX-License-Identifier: AGPL-3.0-only
2//
3// `[behavior]` defaults that MUST be identical at build time and at run
4// time. This file is a plain-`mod` of `lib.rs` AND `include!`d by the
5// build script (`build_parse_behavior.rs`) — the build script cannot
6// import the library it is building, and keeping two literals in sync by
7// hand is exactly how #328 shipped: P2-1 (2026-07-09) raised the
8// spark-server default to 3072 while the build-time parse default stayed
9// 384, so every model without an explicit MODEL.toml pin kept truncating
10// agentic prose at 384 tokens for another month. One literal, two
11// consumers, no drift. Doc comments here use `//` only: `//!` is illegal
12// at an `include!` site.
13
14/// Default cap on free-text tokens between successive tool calls on a
15/// tool-armed request (`[behavior].max_inter_tool_prose`).
16///
17/// 3072 is the P2-1 value (2026-07-09): 384 was tuned as an
18/// `<invoke>`-dormant-opener wander bound, but agent frontends arm tools
19/// on every turn, so a legitimate plan/analysis turn was guillotined
20/// mid-sentence (#328: Pi.dev, opencode). Repeating wander is caught by
21/// the content-loop + SimHash watchdogs independently; this budget's
22/// residual job is the non-repeating dormant-opener burn, for which 3072
23/// still sits well below a typical `max_tokens`. A model with measured
24/// evidence for a tighter bound pins it in MODEL.toml (see
25/// kernels/strix/qwen3.6-35b-a3b, 2026-06-10). 0 is reserved by the
26/// runtime resolver to mean "guard disabled".
27pub const DEFAULT_MAX_INTER_TOOL_PROSE: u32 = 3072;
28
29/// Default `[behavior].max_thinking_budget` — the effort-ladder anchor E and
30/// the budget for budgetless thinking-on requests. 256 is the historical
31/// built-in every model inherited before MODEL.toml could override it.
32/// Lifted here (2026-08-14, effort-ladder work) because it was three
33/// hand-synced literals (lib.rs default, build-parse default, build-parse
34/// `unwrap_or`) — the exact drift shape that shipped #328's 384-vs-3072 bug.
35pub const DEFAULT_MAX_THINKING_BUDGET: u32 = 256;
36
37/// Default `[behavior].effort_capped_at_ceiling` — whether qualitative
38/// `reasoning_effort` levels are clamped at the model's effective ceiling E
39/// (`max_thinking_budget` / `--max-thinking-budget`).
40///
41/// `false` preserves the historical ladder shape: high = 2E and xhigh = 4E
42/// EXCEED the ceiling, exactly as the pre-symbolic absolutes did (512/1024
43/// over the built-in 256). Parity at defaults is pinned by
44/// `effort_ladder_at_default_ceiling_matches_the_historical_absolutes`.
45///
46/// `true` is for models with MEASURED non-monotonic degradation above their
47/// ceiling — where a bigger thinking budget scores WORSE, so a client's
48/// boilerplate `reasoning_effort: high` must not double a deliberately small
49/// E (e.g. Qwen3.5-397B NVFP4, 2026-05-07 sweep: budget 256 is worse than
50/// 128). The clamp binds ONLY the server-policy effort ladder; an explicit
51/// client token budget (`thinking_token_budget` etc.) is never touched by it.
52pub const DEFAULT_EFFORT_CAPPED_AT_CEILING: bool = false;