L3 · deep doc 1 of 5
L3 — Detection runtime
as-built
- Status
- as-built
- Conceptual layer
- ③ Analytics
- Repo layer
- L3
intelligence-core(stamped_l3_core) - Source
- architecture section 3.6.3, section 3.3b jobs 1–5
Pipeline#
L3 detection runtime
How to read it.
- L2 data enters on hot, warm or cold paths;
PathSchedulerensures cold never blocks hot. - Engines build Finding 1.2.0; classifiers and suppressions run before dual-lane routing.
- Only
status=emittedanddelivery=l4reach L4; all other rows stay in LabLog / RunArtifact 1.1.0.
Build now: this slow-loop pipeline. Later: router abstain and Evidence 2.0.0 per section 5.2.
View Mermaid source
flowchart TB
%% house-style: l3-detection-runtime
l2["L2 query HTTP / fixtures"]
subgraph core["intelligence-core"]
direction LR
sched["PathScheduler<br/>hot ~900s / warm ~3600s / cold ~86400s"]
eng["Engines → Finding 1.2.0"]
wc["waste_classifier / value_domain"]
sup["SuppressionService"]
end
lane{{"publish: emitted ∧ delivery=l4 only"}}
out["TransactionalOutbox"]
lab["LabLog"]
l4["L4 inbox"]
l2 --> sched --> eng --> wc --> sup
sup --> lane --> out --> l4
sup --> lab
classDef govc fill:#fff4d6,stroke:#c99a2e,color:#000
classDef agentc fill:#e8f0ff,stroke:#5b7bd5,color:#000
classDef loopc fill:#eef7ee,stroke:#4f9a4f,color:#000
class lane govc
Paths#
| Path | Interval (default) | Does | Notes |
|---|---|---|---|
| Hot | ~900s | MD (+ PF/TOD when configured); registered hot engines; CNC fleet if ENABLE_CNC | Must not stall behind cold |
| Warm | ~3600s · lookback P7D | EWMA / CUSUM residuals → unexplained draw | Lab by default; outbox if ENABLE_WARM_EMIT / PROOF_RUN |
| Cold | ~86400s · lookback P30D | TOW-P baseline fit; TimesFM / TabPFN / LGBM shadow only | Shadows are not L4 work (D8) |
| Dual-mode | on demand | Same engines on live lookback or historian [from_ts,to_ts] | Evidence tags carry data_source: / window: only |
PathScheduler ensures cold never blocks hot.
Dual-lane#
| Lane | Condition | Destination |
|---|---|---|
| L4 | status=emitted and delivery=l4 | Outbox → L4 inbox |
| Lab | everything else (suppressed, shadow, hypothesis, …) | LabLog / RunArtifact 1.1.0 |
Invariant (detection_lane.py): delivery == l4 iff status == emitted. There is no promote-Lab-to-L4 path in core.
Money#
| Concern | Behavior |
|---|---|
| Tariff | get_active_tariff from L2 → stamp l2:{tariff_id}: or tagged fallback: |
| Decomposition | Engines attach INR / kWh bands with bill_line hints where applicable |
| Guard | Outbox blocks forged INR ≥ 1M without decomposition |
Fail-closed#
| Gate | Effect |
|---|---|
No L2_DATABASE_URL | Core never opens Timescale |
| Missing tags | Engine KeyError / empty — no invented points |
| Schema | Outbox rejects Finding ≠ 1.2.0; requires ops_clearance |
| Suppressions | startup / maintenance / mix / data_quality |
Related modules (as-built)#
| Area | Package path |
|---|---|
| Scheduler | stamped_l3_core.scheduler |
| Engine registry | stamped_l3_core.engines.registry |
| Dual-lane | stamped_l3_core.detection_lane |
| Outbox | stamped_l3_core.outbox |
| L2 client | stamped_l3_core.clients.l2 |
Fast path (direction)#
A second deployable, stamped-l3-twin, runs a per-second loop on the Plant BoxPlant-side computer for the fast loop (direction; D4) (D4): read the plant broker, check freshness and bounds, load the context's parameter row, predict and update, run accepted procedures, checkpoint, send records to L2 (D3). It holds no outbox and emits no Findings; scheduled engines pick up its records from L2. Detail: 05-twin-and-fast-loop.md · ../fast-loop/01-twin-runtime.md.
Next: 02-engines.md.
Page history: last 3 changes
- docs(technical): rewrite l3/ to the architecture
4a28bbd - docs(l3): twin runtime, twin-record engines, packs and replay as direction
28255e9 - docs(l3): document detection runtime and engines
0a02a37