-- 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);
