22_violet_decisions.sql (dolphin_violet.violet_decisions, DDL-first) + shadow_journal.py: VioletDecisionJournal validates each actuated ShadowDecision via DecisionRow (V-TYPES, allow_inf_nan=False) before the CH sink -- malformed dies at source, never at the spool head. NEVER an order. DecisionRow field set == DDL columns (asserted). 4 tests pass. Launcher wiring + DARK soak = operator step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
27 lines
1.0 KiB
SQL
27 lines
1.0 KiB
SQL
-- VIOLET V3e: shadow decision journal. One row per ACTUATED ShadowDecision the
|
|
-- VioletDecisionEngine emits (the muted "what BLUE would do this scan"). NEVER an
|
|
-- order — execution stays off behind the ObserveOnlyVenue guard. session_id is a
|
|
-- boot-time UUID (mono_ns is meaningless across restarts without it).
|
|
-- Apply via apply_violet_ddl.py (one statement per HTTP POST).
|
|
|
|
CREATE TABLE IF NOT EXISTS dolphin_violet.violet_decisions
|
|
(
|
|
`ts` DateTime64(3, 'UTC'),
|
|
`session_id` String,
|
|
`scan_number` UInt64,
|
|
`mono_ns` UInt64,
|
|
`asset` LowCardinality(String),
|
|
`side` LowCardinality(String),
|
|
`vel_div` Float64,
|
|
`fraction` Float64,
|
|
`conviction_leverage` Float64,
|
|
`notional_fraction` Float64,
|
|
`target_exposure` Float64,
|
|
`ars_score` Float64,
|
|
`bucket_idx` UInt8,
|
|
`actuated` UInt8
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY (asset, ts)
|
|
TTL toDate(ts) + toIntervalDay(180);
|