Files
Aura/docs/design/contracts/c16-engine-project-split.history.md
T
claude 8688a60ded docs(ledger): split the design ledger into an INDEX map, per-contract live files, and history sidecars
The single-file ledger had grown to 2968 lines / ~42k tokens, mixing
current design law with accreted history: 59 cycle-stamped realization
blocks, 18 [HISTORY] passages, 22 supersession markers, and the C10 /
C22 / C24 reframe sagas layered several supersessions deep. A
code-grounding audit (31 agents, adversarially verified) confirmed 11
defects stated as current truth: stale crate homes from the C28 #288
roster split (cost nodes, PositionManagement, PositionEvent, Session),
the renamed InputSpec->PortSpec, the pre-#241 project model in C16 and
the open-threads section, a stale HarnessKind retirement deferral in
C24, and three C28-internal inconsistencies.

New shape, per the ailang precedent:

- INDEX.md stays the sole addressable entry point: foundation, external
  components, a C-id-keyed contract map (one line per contract), and
  only the genuinely open architectural threads.
- contracts/cNN-<slug>.md carries each contract's current truth only:
  Guarantee / Forbids / Why with ratified refinements integrated, plus
  a code-anchored Current state. All confirmed defects are fixed here;
  crate anchors were re-verified against the tree.
- contracts/cNN-<slug>.history.md (18 sidecars) and INDEX.history.md
  preserve every superseded block verbatim, stamps and issue refs
  intact, under a frozen-record banner. Nothing was deleted: superseded
  design intent remains an addressable working-tree artifact, off the
  per-cycle audit walk.
- Ledger discipline is now stated in INDEX.md: live files are edited in
  place at cycle close, superseded text moves verbatim to the sidecar,
  and a supersession marker in a live file is itself an audit finding.

Every contract file was verified against its old text by an independent
zero-loss pass (statement-by-statement) plus a code-accuracy spot check;
C-ids and contract titles are unchanged, so existing C-id citations in
code, tests, and issues resolve as before.
2026-07-21 16:40:36 +02:00

61 lines
4.3 KiB
Markdown

# C16 — Engine / project separation; three-tier node reuse: history
> FROZEN HISTORICAL RECORD. Each block below was true as of its cycle/date
> stamp and may be superseded; this file is NOT current truth and NOT a
> grounding surface. Current contract:
> [c16-engine-project-split.md](c16-engine-project-split.md).
**Realization (cycle 0079, #136 — the analysis leaf becomes its own crate).** The
trading-domain **analysis** layer — the post-run reductions that are pure functions of a
run's recorded data (`RunMetrics`, `RMetrics`, the R reduction `summarize_r` /
`r_metrics_from_rs`, the position-event table `PositionEvent` / `PositionAction` /
`derive_position_events`, and the multiple-comparison hurdle math `inv_norm_cdf` /
`expected_max_of_normals`) — is extracted out of `aura-engine`'s `report` module into a
dedicated **`aura-analysis`** crate (deps: `aura-core` + `serde` only; `serde_json` is a
dev-dependency, test-only). This sharpens the engine↔domain seam: the run loop's crate no
longer *defines* the trading metrics — it `pub use`-re-exports them for source
compatibility this cycle, and still hosts the trace-coupled `summarize`, `RunReport`,
`RunManifest`, and the columnar trace utils. The non-node engine-workspace crates are now
`aura-engine` (run loop), `aura-cli` (`aura` binary), `aura-ingest` (ingestion edge),
`aura-composites` (composite-builder convenience layer), and `aura-analysis` (post-run
domain reductions + selection provenance). Behaviour-preserving (C1): every serde shape
is byte-identical (C18 goldens green).
**Realization (cycle 0080, #136 — engine-side extraction complete).** The last
trading-domain types still *defined* in `aura-engine`'s `report` module — the
selection-provenance types `FamilySelection` / `SelectionMode` — also move to
`aura-analysis` (the only non-cyclic home: `RunManifest.selection` needs the type and the
engine already depends on `aura-analysis`; the registry/CLI reach them unchanged via the
re-export). Behaviour-preserving (C1; suite 665/0). **Settled (2026-06-27, user-ratified
in the #136 thread):** the `aura-registry` `Metric` / `metric_cmp` / deflation vocabulary
**stays in the registry by design** — the registry is the trading *selection* layer, not
the domain-free engine, and its deflation statistics branch irreducibly on metric
identity (R-bootstrap vs. `total_pips` dispersion floor); forcing genericity would be a
one-implementor abstraction. *(Superseded 2026-07-20: measurement's IC became the second
implementor — #290 — and the vocabulary moved behind the `MetricVocabulary` trait
supplied by the outer rungs; see the C28 #147 disposition.)* **Deferred to the World /
C21 layer (explicitly *not* #136):**
making `RunReport` generic over a metric type and turning the orchestration/registry layer
into a reusable domain-agnostic substrate — until then `RunReport` / `RunManifest` /
`summarize` stay trace-coupled in the engine.
**Realization (cycle 0107, #198 — the campaign-execution leaf).** The non-node engine
workspace gains **`aura-campaign`**: campaign-execution *semantics* (cell enumeration,
preflight, gate evaluation, winner selection, walk-forward rolling, realization assembly —
see C18) as a leaf library crate whose deps deliberately exclude `aura-ingest` /
`aura-std` / `aura-composites`; harness construction and data binding enter only through
the one-method `MemberRunner` seam, so consumers (the `aura` CLI today; the playground and
tests tomorrow) bind their own runners while the semantics live here once. It is
explicitly NOT C21's World (a project-side program): it realizes one campaign document
and owns no topology, no data sources, no UI.
**Realization (2026-07-12 — wiring-only tier, #241).** The smallest project
is now data-only: `Aura.toml` + `blueprints/` + `runs/`, no crate. The load
boundary tier-selects (a `[nodes]` pointer list in `Aura.toml` → load that
crate; a root `Cargo.toml` → the pre-#241 native project, unchanged; neither
→ std-vocabulary-only). `aura new` scaffolds the data-only tier;
`aura nodes new` scaffolds a node crate **beside** the project and attaches
it — the visible role-2 switch (C25 role model). Provenance widened
additively: a data-only run stamps commit-only. Invariant 9's "a project is
always a Rust crate" was deliberately amended (user decision, 2026-07-12).