SR-AUDIT — Phase 7.4 System Readiness Audit¶
To: Vesper (she/her), Orion (he/him) From: Atlas (he/him) CC: Katja (Captain) Date: 2026-04-19
Purpose: Formal audit gate before scaling, automation, or extended runtime. Objective: verify that the engine is truth-aligned, fully wired, observable, and fails safely. This is NOT exploratory. This is a pass/fail readiness gate with evidence.
Audit Preconditions (must be true before starting)¶
- Wallet truth reconciliation active and stable
- Anchor Saturation Guard implemented
- Directional Drift Guard implemented
- Inventory Corridor Guard implemented
- At least 1–2 clean live sessions completed with guards active
- No active DEGRADED/HALT at session end
If these are not met → do not run SR-AUDIT.
Domain 1 — Truth & State Integrity (CRITICAL)¶
Goal: System state MUST match on-chain reality at all times.
Checks:
- Startup reconciliation — Expected: status=ok, deltas ~0. Evidence: logs + inventory_truth_snapshots
- Runtime reconciliation stability — Expected: no drift accumulation beyond tolerance. Evidence: periodic checks across full session
- Shutdown reconciliation — Expected: final state matches on-chain. Evidence: end-of-session snapshot vs API
- Restart determinism — Restart engine → balances identical. Evidence: before/after restart comparison
- Realignment safety — Realignment does not break basis accounting, PnL, or capital events. Evidence: DB + metrics consistency
Pass criteria: No unexplained delta. No drift accumulation. Restart produces identical state.
Domain 2 — Execution & Lifecycle Wiring (CRITICAL)¶
Goal: No silent failures in order lifecycle.
Checks:
- Order lifecycle completeness — submit → active → fill/cancel → reconcile. Evidence: orders table + logs
- No dropped orders — Every order ends in a terminal state. Evidence: no orphan states
- Cancel paths — Manual + automatic cancel verified. Evidence: cancel_tx_hash + ledger confirmation
- DEGRADED transitions — Trigger → cancel → stop quoting. Recovery path works. Evidence: logs + engine_state
- Session lifecycle — start → run → close_session → ended_at written. Evidence: valuation_snapshots + sessions table
Pass criteria: No silent transitions. No missing states. No lifecycle gaps.
Domain 3 — Metrics & Calculations (CRITICAL)¶
Goal: All reported numbers are correct and internally consistent.
Checks:
- VW spread — Matches fill-level calculations. Evidence: recompute from fills table
- Fill attribution — session_id correct, no NULL-session leakage. Evidence: fills table
- PnL — realized vs unrealized consistent, matches inventory + price. Evidence: DB vs dashboard
- Inventory valuation — matches on-chain + pricing. Evidence: reconciliation + valuation_snapshots
- Anchor error — computed correctly per tick. Evidence: system_metrics
- Summary vs raw data — session summary = aggregated raw data. Evidence: cross-check
Pass criteria: All metrics recompute cleanly from raw data. No mismatches between layers.
Domain 4 — Strategy Signal Validity (IMPORTANT)¶
Goal: Signals reflect market reality, not artifacts.
Checks:
- Anchor behavior — matches CLOB vs AMM conditions. Evidence: anchor_error distribution
- Bias detection — positive/negative regimes correctly visible. Evidence: session stats
- Fill distribution — matches expected skew + offsets. Evidence: fills by side + timing
- Distance-to-touch (if available) — consistent with market spread. Evidence: per-tick telemetry
- Skew behavior — responds correctly to inventory. Evidence: order placement vs wallet state
Pass criteria: Signals explain observed behavior. No contradictions between signal and fills.
Domain 5 — Safeguards & Failure Modes (CRITICAL)¶
Goal: System fails safely, not silently.
Checks:
- Anchor Saturation Guard — triggers under sustained bias, enters DEGRADED. Evidence: forced test or session behavior
- Directional Drift Guard — detects burst fills / imbalance, triggers DEGRADED. Evidence: fill sequence test
- Inventory Corridor Guard — prevents extreme wallet skew. Evidence: threshold enforcement
- DEGRADED behavior — cancels orders, stops quoting, recovers cleanly. Evidence: logs + engine_state
- HALT behavior — blocks execution, requires intervention. Evidence: startup/pre-trade gate
- Reconciler anomaly logging — logs all anomalies, no silent phantom fills. Evidence: reconciler_anomaly_log
- FLAG-037 behavior (if implemented) — young vs old order logic correct. Evidence: anomaly classification
Pass criteria: All safeguards trigger correctly. No silent failure paths.
Audit Output Format¶
For each check: - Expected: - Observed: - Evidence (logs / DB query / metric): - Status: PASS / FAIL - Notes:
Severity Classification¶
- CRITICAL → blocks Phase 8 (must fix now)
- IMPORTANT → schedule next phase
- OBSERVATION → track, no immediate action
Final Gate¶
SR-AUDIT passes ONLY if: - All CRITICAL checks = PASS - No unresolved truth or lifecycle inconsistencies - Safeguards verified in live or controlled conditions
Final Note¶
This audit is not about perfection. It is about confidence.
If SR-AUDIT passes: the system can be trusted to operate → Phase 8 (scaling, longer runs, automation) unlocks. If it fails: we fix with precision, not guesswork.
— Atlas