Expand description
STEL L2 economics controller — evaluate StelPlan → StelDecision / StelEstimate.
Phase 2 P2-S3: normative admission states (serve | degrade | bypass | cache_hit).
Re-exports§
pub use crate::stel_core::consts::COMPACT_INVOKE_TOKENS;pub use crate::stel_core::consts::COMPACT_SCHEMA_TOKENS;pub use crate::stel_core::consts::STATIC_MANUAL_FLOOR;pub use crate::stel_core::consts::STATIC_RESPONSE_FLOOR;
Structs§
- Economics
Breakdown - Token economics breakdown for one planned invocation.
Constants§
- DEGRADE_
DEFAULT_ MAX_ TOKENS - Default capped response budget applied on degrade when request omits
max_tokens. - DEGRADE_
MARGIN_ LOW_ TOKENS - Predicted net at or below this (but above zero) triggers
degrade(margin_low). - SERVE_
MARGIN_ TOKENS - Minimum predicted net vs manual before
serve(schemamargin_high).
Functions§
- active_
tuning_ in_ force - Select the tuned constants that are IN FORCE for the current estimator (R3).
- build_
estimate - Build preview economics for
preview: true(L1+L2 only). - decision_
matches_ golden - Golden-row helper: L2 decision should match fixture
expected_decisionfor representative rows. - detect_
pff_ bypass - Policy P-FF: whole-file review queries bypass SymForge serve (A-012 / golden corpus).
- economics_
for_ bypass - estimate_
economics - Sum step estimates + compact surface overhead into a manual-vs-symforge comparison.
- estimate_
economics_ tuned - Economics with an optional validated tuning in force (feature 013, T032, D8-ROOT).
- evaluate_
edit_ plan - Evaluate L2 admission for a structural edit plan (no NL P-FF bypass path).
- evaluate_
plan - Evaluate L2 admission for a draft plan (does not execute L3).
- evaluate_
plan_ tuned - Evaluate L2 admission with an optional validated tuning in force (feature 013,
T032 / FR-006). When
tunedisSome, the economics that drive the serve/degrade/bypass branches use the tuned constants, so the adaptive decision reflects better-grounded numbers; whenNone, the static floors apply and the decision is byte-identical to the pre-013 path. Routing correctness, policy/deny, and safety guards are untouched — only the token-estimate inputs change (FR-007). The caller must pass only an in-force tuning (seeactive_tuning_in_force). - evaluate_
plan_ with_ session - Evaluate L2 admission with optional in-process session context for cache-hit detection.
- index_
ref_ for_ target - Build a grounded
IndexReffor a resolved target. Used by the index-aware serve path to stamp real byte sizes onto plan steps before the L2 gate.