baseline_check_in_context
Check readings against the learned baseline band for one declared context. Unknown contexts are refused rather than judged against another band, so unseen regimes are not silently passed.
Instructions
[READ][risk=low] Check readings against the band for ONE declared context.
A reading whose context was never learned comes back `unknown_context` and
stops there. It is **not** compared against the global band or the nearest
one, and that refusal is the entire point of the tool: borrowing a band turns
"we have never seen this regime" into "this regime is normal" — a silent
pass, in the direction nobody reports. The response lists the contexts that
do have bands so the gap is actionable.
Otherwise the usual conservative rules apply: a violation needs values beyond
the band by more than `margin_mad` × MAD AND sustained over `sustain_n`
consecutive samples, and every flag cites the baseline it was judged against.
Args:
samples: [{ts, value, ...}] readings to check.
contextual: A `baseline_learn_contextual` result.
context: Which declared context these readings belong to.
margin_mad: MAD margin beyond the band before flagging (default 3.0).
sustain_n: Consecutive samples required (default 3 — no single-spike flags).
Returns dict (known context): the `baseline_check` shape plus {context,
context_key}. (unknown): {status:"unknown_context", tag, context,
known_contexts, checked_samples, reason, note}.
Example: baseline_check_in_context(samples=[...], contextual={...}, context="recipe-B").
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"samples": "<samples>",
"contextual": "<contextual>",
"context": "<context>"
},
"name": "baseline_check_in_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | Yes | ||
| samples | Yes | ||
| sustain_n | No | ||
| contextual | Yes | ||
| margin_mad | No |