VIOLET V1a: dolphin_violet DDL set + statement-wise applier (applied + verified)

14 tables consolidated from the LIVE post-ALTER dolphin_pink schema
(maras_tp + provenance folded into base CREATEs — a fresh DB never replays
ALTER chains) + violet_feed_divergence (scan-vs-venue divergence metric,
session_id + plane seqs + mono_ns). apply_violet_ddl.py posts ONE statement
per HTTP request (multi-statement posts fail — proven on pink 08), is
idempotent (all IF NOT EXISTS, double-apply tested live), and verifies the
expected table set. Applied to live CH: verify all 14 present.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-06-12 15:40:05 +02:00
parent 4b52fff8dd
commit 99e529c32a
19 changed files with 753 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
-- dolphin_violet DDL — consolidated from the LIVE dolphin_pink schema
-- (post-ALTER: includes maras_tp + provenance columns). Generated 2026-06-12.
-- Apply via apply_violet_ddl.py (one statement per HTTP POST).
CREATE TABLE IF NOT EXISTS dolphin_violet.account_events
(
`ts` DateTime64(6, 'UTC'),
`event_type` LowCardinality(String),
`strategy` LowCardinality(String),
`posture` LowCardinality(String),
`capital` Float64,
`peak_capital` Float64,
`drawdown_pct` Float32,
`pnl_today` Float64 DEFAULT 0,
`trades_today` UInt16 DEFAULT 0,
`open_positions` UInt8 DEFAULT 0,
`boost` Float32 DEFAULT 1.,
`beta` Float32 DEFAULT 0.,
`current_open_notional` Float64 DEFAULT 0,
`current_account_leverage` Float32 DEFAULT 0,
`exchange_leverage` UInt8 DEFAULT 0,
`exchange_leverage_mode` LowCardinality(String) DEFAULT '',
`leverage_mapping_rule` LowCardinality(String) DEFAULT '',
`notes` String DEFAULT '',
`runtime_namespace` LowCardinality(String) DEFAULT '',
`strategy_namespace` LowCardinality(String) DEFAULT '',
`event_namespace` LowCardinality(String) DEFAULT '',
`actor_name` LowCardinality(String) DEFAULT '',
`exec_venue` LowCardinality(String) DEFAULT '',
`data_venue` LowCardinality(String) DEFAULT '',
`capital_source` LowCardinality(String) DEFAULT '',
`account_event_seq` UInt64 DEFAULT 0
)
ENGINE = MergeTree
ORDER BY (ts, event_type)
SETTINGS index_granularity = 8192;