audit(broker-foundation): cycle close 0063 — ledger records the C10 A-side foundation (#113 + #114)

Cycle-close tidy for broker-foundation (InstrumentSpec deploy metadata #113 +
PositionEvent schema #114).

Architect drift review (3638d48..HEAD): code is drift-clean. PositionEvent matches
the C10 column spec field-for-field (no open_ts, unsigned volume, direction-is-action,
bare-i64 action); the engine run-loop is untouched (C14); InstrumentSpec stays Copy
metadata at the ingestion edge (C7/C15); no instrument identity reaches the hot path.
The only drift was stale ledger prose, fixed here:
- C10 realization note: added a cycle-0063 entry recording that the position-event
  *schema* landed (PositionAction/PositionEvent), while derivation (#115) and the
  realistic broker nodes (#116) remain the deferred decoupled layer.
- C15 realization note: replaced "minimal today (pip only)" with the six-field
  deploy-grade floor and the #124 currency-type forward note (quote_currency is
  &'static str; the #124 resolver chooses how its runtime tier carries currency).

Regression (verbatim): cargo test --workspace = 458 passed / 0 failed (exit 0);
cargo clippy --workspace --all-targets -- -D warnings = clean (exit 0).

Carry-on (not actioned, justified): the inline reversal test is a shape-pin only —
the behaviour test arrives with #115's derive, and the E2E twin already exercises the
reversal wire shape. The quote_currency &'static str / #124 resolver concern is logged
on #124 as a deliberate deferred design choice.

This is drift-clean, NOT a milestone close — the realistic-broker milestone needs its
end-to-end fieldtest green, which depends on #115/#116/#120-123 still to land.

Removed the ephemeral cycle artifacts (spec + plan) per the lifecycle convention.
This commit is contained in:
2026-06-22 19:56:18 +02:00
parent b91c89f964
commit 7d7d1f72d9
3 changed files with 20 additions and 730 deletions
+20 -4
View File
@@ -537,6 +537,17 @@ this cycle; it remains the decoupled, derived, deferred layer described above.
lookup — a Rust-authored vetted table in `aura-ingest`, at the ingestion/source
edge where the symbol still exists (never `Aura.toml`, never `Ctx`) — supplies the
divisor; the engine stays domain-free (no instrument identity reaches the hot path).
**Realization (position-event schema, cycle 0063, #114).** The position-management
half's **schema** now landed (its derivation and the brokers remain deferred): a
closed `PositionAction { Buy, Sell, Close }` enum + the `PositionEvent` row
(`event_ts`, `action`, `position_id`, `instrument_id`, unsigned `volume`; no
`open_ts`; direction *is* the action) live in `aura-engine` beside `RunMetrics` as a
post-run value type (not a per-`eval` node — C8). `action` serde-encodes as a bare
`i64` (Buy=0, Sell=1, Close=2), the C7 scalar column form the ledger's table spec
requires, with an out-of-range code rejected on read. Still deferred:
`derive_position_events` (the first-difference reduction over the exposure history,
#115) and the realistic broker nodes that consume the table (#116). The table stays
broker-independent.
The honesty rule is **refuse, don't guess**: a real-data run for a symbol with no
vetted spec is a usage error (`exit 2`), so cross-asset pip equity is comparable by
construction rather than by researcher discipline. Threaded through the CLI
@@ -645,10 +656,15 @@ stream model.
stream; reference data feeds source/session nodes from beside the hot path.
**Realization (instrument specs, 2026-06, #22).** The "instrument specs are
metadata" half of this contract is first realized by `aura-ingest`'s
`InstrumentSpec { pip_size }` + `instrument_spec(symbol)` non-scalar reference
data held beside the hot path, keyed by symbol, feeding the sim-optimal broker's
pip divisor (C10). Minimal today (pip only); extensible to tick size / digits /
quote currency without a signature break.
`InstrumentSpec` (initially a single `pip_size`) + `instrument_spec(symbol)`
non-scalar reference data held beside the hot path, keyed by symbol, feeding the
sim-optimal broker's pip divisor (C10). Extended in cycle 0063 (#113) to a six-field
deploy-grade floor (`instrument_id`, `contract_size`, `pip_value_per_lot`, `min_lot`,
`lot_step`, `quote_currency`) for the realistic broker's currency conversion — the
permanent authored floor of the override hierarchy (#124), the refuse-don't-guess
arm preserved. NB: `quote_currency` is `&'static str` (keeps the struct `Copy`); how
the #124 resolver's runtime-sourced tier carries currency (a distinct resolved type,
or widening the field) is that cycle's decision — see #124.
### C16 — Engine / project separation; three-tier node reuse
**Guarantee.** aura is the reusable **engine**; each research project is a