audit(0083): cycle close — drift-clean (code); C10 cycle-0083 note + lib.rs doc

Architect drift review over 6c7f5dd..HEAD. No regression scripts in this project
→ the architect is the sole gate; verdict: shipped code byte-clean.

What holds (verified against the diff):
- C9 — a CostRunner<F> is a plain downstream Node; the two cost nodes are thin
  factors wired through the same cost_node_builder. No runtime sub-object.
- C18 / byte-identity — the numerator/latched token form is preserved verbatim;
  the two new CLI goldens pin exact net_expectancy_r and pass; the no-cost golden
  is untouched.
- C10 co-temporality + C23 + invariant-4 — the gate-on-PM-geometry-only rule
  (cold factor input → 0 cost, row still emits) is now centralized once in the
  runner; name() dropped cleanly (label() remains the non-load-bearing symbol);
  the 3-field triple is a single source (COST_FIELD_NAMES) read by both producers
  + CostSum + the CLI — the cycle-0082 by-convention lockstep is structurally gone.

Resolution:
- [fix] docs/design/INDEX.md C10 — added the cycle-0083 realization note (each
  prior cost cycle got one; the deferred general CostNode trait is now shipped and
  the lockstep eliminated). Ledger deferred-work tracking re-synced.
- [fix] crates/aura-std/src/lib.rs:5 — module doc now names the CostNode/CostRunner
  authoring surface.
- [carry-on, low debt] vol_slippage_cost.rs still declares its extra-input port
  twice (the cost_node_builder arg and the trait extra_inputs()); a clean unifier
  needs design thought (builder() is static, no factor instance) and is not worth
  forcing at cycle close. Documented here; agreement rests on the helper + a test +
  the harness debug-assert.

Cycle 0083 ephemera removed (docs/specs/0083 + docs/plans/0083).

Verified: cargo build/test --workspace clean (0 failures), clippy -D warnings
clean, cargo doc -p aura-std clean (CostNode/CostRunner intra-doc links resolve).

refs #148
This commit is contained in:
2026-06-28 19:32:07 +02:00
parent 6b53c239dd
commit fc52b4fced
4 changed files with 26 additions and 1176 deletions
+23
View File
@@ -757,6 +757,29 @@ composable with `--cost-per-trade` (their costs sum); sweep / walk-forward / mc
+ `CostSum` (a compiler-unlinked lockstep) — to be unified by the still-deferred
general `CostNode` trait (now justified by two concrete nodes). Decision log: #148.
**Realization (cycle 0083 — CostNode trait + shared cost-record contract, cycle 3,
#148).** The deferred unifier ships. A new `aura-std/src/cost.rs` owns the cost-model
node abstraction: the 3-field cost triple is now **one source of truth**
(`COST_FIELD_NAMES` / `COST_WIDTH`, mirroring `position_management::{FIELD_NAMES,
WIDTH}`), read by both producers + `CostSum` + the CLI wiring — the cycle-0082
by-convention lockstep is **structurally gone** (four restatements collapsed to one).
The `CostNode` **factor trait** carries a cost node's only per-node difference — the
price-unit **cost numerator** (`cost_numerator(&mut self, &Ctx) -> f64`), plus
`extra_inputs` (default none) and `label`; everything else is the generic
`CostRunner<F: CostNode>` **adapter**, which holds the shared `cum`/`out` state and
implements `Node`, writing the co-temporality skeleton (geometry-only gating,
`numerator / latched` R-normalization, the closed/open charge, the running `cum`, the
3-field emit) **once**. `ConstantCost` and `VolSlippageCost` are now thin factors whose
`new()` returns `CostRunner<Self>`. Honours C9 (a `CostRunner<F>` is a plain downstream
`Node`, no runtime sub-object) and C23 (`name()` dropped as dead surface — `label()`
remains the non-load-bearing symbol). **Behaviour-preserving**: the builders emit
unchanged schemas, so the wiring / `net_r_equity` seam / `summarize_r` are untouched and
the `numerator / latched` token form is byte-identical; the existing suite passes
verbatim and two new CLI characterization goldens pin the exact flat/composed
`net_expectancy_r` (the prior tests only asserted `net < gross`). **Still deferred**
(decision E): the multi-node cost-graph composite-builder (wiring sugar over the
already-working edge-wired seam). Decision log: #148.
**Reframe (2026-06-23, #117 — exposure → bias, R as the signal-quality unit).**
[HISTORY — its R spine survives into the 2026-06-28 contract; its Stage-2 currency /
realistic-broker / register / flat-1R-vs-compounding portions are SUPERSEDED by that