refactor(platform): harden LAB evidence and telemetry

This commit is contained in:
DCCONSTRUCTIONS
2026-08-05 10:03:37 +03:00
parent 67bd96868f
commit 4c763bd8aa
42 changed files with 936 additions and 272 deletions
@@ -0,0 +1,67 @@
# ADR 0036: Configurative laboratory evidence registry
Date: 2026-08-05
Status: accepted and implemented as the first migration slice
## Context
The advanced LAB index grew by adding one result-id regular expression, one root
provider argument, one application wiring block and one tuple for every experiment.
That made the Mission Core control plane structurally dependent on an expanding list
of experiment names. It also made a new frozen evidence source look like a new product
runtime pipeline even when the UI only needed read-only result discovery.
The target product architecture has a stricter dependency direction:
```text
contracts -> providers -> graphs -> experiments
```
Mission Core owns configurations, runs, evidence, health, telemetry and operator
control. Experiment code may invoke production graphs and freeze evidence, but the
core must not import an experiment to discover that evidence.
## Decision
Advanced LAB evidence sources are declared as one versioned JSON definition per
`work_id` under `config/laboratories/`. Each definition contains only:
- a repository-runtime-relative evidence root;
- a digest-bound result-id prefix;
- the bounded identity document name;
- the exact identity-document schema version.
`LaboratoryEvidenceRegistry` discovers these files without importing experiment code.
It rejects unknown keys, unsafe or non-normalized paths, symlinked definitions,
oversized files, invalid identifiers and duplicate work IDs, roots or result prefixes.
The existing advanced index keeps its previous fail-closed evidence validation:
identity digest, schema, creation time and read-only/no-command authority must still
match before a result is published.
The production advanced index now obtains all 27 standard evidence sources through
this registry. Adding another standard source therefore adds data, not another router
parameter or application wiring branch.
## Explicit non-goals
This first slice configures evidence discovery; it does not claim that the historical
experiment implementations are already reusable production graphs. E31-E40 retain
specialized read-model projectors behind their current adapters while those payloads
are converted to canonical contracts. L3/L31/L32/L33 retain bounded legacy identity
adapters because their stored evidence does not yet use the common identity document.
The registry does not select detectors, trackers, planners or command paths and cannot
grant navigation or safety authority. Future executable LAB definitions must reference
versioned provider/graph contracts; they must not contain arbitrary Python imports or
shell commands.
## Consequences
- LAB growth no longer expands the product composition root for standard evidence.
- Evidence location and identity contracts are reviewable, diffable configuration.
- A malformed or ambiguous definition prevents startup instead of silently exposing
the wrong evidence.
- The remaining manual frontend fetch/render map and specialized backend projectors
are visible migration debt, not the intended extension mechanism.
- The next architecture slice can add provider and graph registries against the
canonical perception contracts without making experiments dependencies of core.