Skip to main content

Module baselines

Module baselines 

Source
Expand description

The daily baseline pass (spec 3.2 §7.10, §9.2 K-I20, §13 Q4; feature proc-baselines).

Once a local day has ended, the kernel’s maintenance tick enqueues one Maintenance process, the durable run kernel.proc (PROC_TARGET) keyed by the day, so replicas sharing a run store run it once. It calls adk-eval’s ledger statistics — no statistics live here — for each partition and each day since its last pass:

StepRuleWhere
Seriesone value per local day and dimension, from the partition’s rows; the kernel’s own rows (KERNEL_AGENT) and observations are left outadk_eval::ledger::daily_series
Baselinemedian and MAD per dimension and day class over 28 days, after a 14-day warm-upadk_eval::ledger::check_series
Deviation|recent − baseline| > max(k·MAD, floor), k = 2.5, in both the 7- and the 14-day windowadk_eval::ledger::check_series
Meaningfultwo dimensions, or one for ten daysadk_eval::ledger::DriftState::advance
Cooldownseven days per dimension after an observation names itadk_eval::ledger::DriftState::advance
Wordingthe model phrases what was detected, within the daily budget; a reply that is not a neutral question falls back to the kernel’s templateObservationPhraser, is_neutral_question, template_question

The model sees only the dimension names, their directions, run lengths and the comparison windows — never a ledger row — and is used only after the deterministic detection found something (K-I20). Each observation is stored, published as KernelEvent::Observation and audited as kernel.observation.

Structs§

BaselinePass
The daily baseline pass over a Ledger (spec 3.2 §7.10): what the kernel’s kernel.proc process runs, and what a test or a tool runs directly.
BaselinePolicy
How the kernel runs the daily baseline pass (spec 3.2 §7.10).
BaselineSnapshot
A partition’s baselines on the day its last pass tested (spec 3.2 §7.10): the deviation test of every dimension, with its baseline per day class, warm-up and windows. Stored as PassState::baselines and served at GET /api/kernel/proc/baselines.
Detection
What the deterministic detection found, as the phraser sees it (spec 3.2 §7.10): the dimensions, which way they moved and for how long, and the windows — no value, no row.
LlmPhraser
An ObservationPhraser over any adk_core::Llm (spec 3.2 §7.10): one request with PHRASING_INSTRUCTION as its system message and the Detection::prompt as its user message, its output capped by the budget’s token limit (at most 1 024) and no sampling parameters.
PassOutcome
What one pass did (spec 3.2 §7.10).

Constants§

PHRASING_INSTRUCTION
The instruction a model phrases an observation under (spec 3.2 §7.10).
PROC_TARGET
The workflow target of the daily pass’s Maintenance process (spec 3.2 §7.10).

Traits§

ObservationPhraser
Words a detection as a question (spec 3.2 §7.10): a model, used only after the deterministic detection found something. The kernel keeps a reply only when it is a neutral question (is_neutral_question) and uses its template otherwise.