Home / Projects / Orchestrata Ultimate / Decisions / ADR index / ADR-0007

ADR-0007: Traces are structurally validated, never model-declared

field value
Status Accepted
Date 2026-07-23
Register factory (docs/adr, 4-digit ids)
Source docs/adr/0007-traces-are-structurally-validated.md — permalink at bdafa201a (unchanged on master since that commit)
Wiki register entry ADR-0007 (wiki status: Accepted)

← ADR-0006 · ADR-0008 →

The record

Context

Generated code carries @traces(spec, req, design_node, adr), and the "completeness tripwire" holds that untraceable code is an orphan = an ungoverned path.

But the annotation is emitted by the model, and the existing validation (verification/traceability.py::validate_traces) computes set differences over requirement-ID strings: it checks that an ID the model wrote also appears in the spec. It never checks that the annotated unit implements that requirement, nor that the trace is attributed to the correct unit.

Consequences of that as-built design:

A completeness detector whose input is a self-report is not a detector — the entity being governed authors the evidence that clears the gate.

Decision

A trace is valid only if both hold, checked structurally:

  1. The traced unit's AST lies within the cited design node's contract (so an arbitrary node cannot be cited — signatures must match), and
  2. the unit is reached by a test that asserts on it.

Presence of an annotation is necessary and not sufficient.

Alternatives rejected

Consequences

Provenance

Round-1: all reviewers independently identified the circularity, code-verified against validate_traces. Round-2 accepted the structural definition; Round-3 Opus insisted the "breaks the circularity" phrasing be downgraded to "relocates" — reflected above.

Rulings cited

None.

Specs cited