clickhouse: commit exit-leg/reconstruction/maras DDLs + UV/violet DDLs (M1 vendor reconcile, upstream-first)

This commit is contained in:
Codex
2026-07-12 19:13:25 +02:00
parent d763f77516
commit dc90f6d77e
46 changed files with 1167 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
-- dolphin_uv.exec_journal — Promotion bridge journal
-- Records every bridged and SUPPRESSED intent from the PRIME promotion bridge.
-- T12: promotion bridge (PRIME decision → KernelIntent → T9 seam)
CREATE TABLE IF NOT EXISTS dolphin_uv.exec_journal
(
kind String, -- 'BRIDGE'
suppressed UInt8, -- 0=bridged, 1=suppressed (shadow mode)
timestamp DateTime64(3), -- UTC 'YYYY-MM-DD HH:MM:SS.fff'
scan_number UInt64,
intent_id String,
trade_id String,
slot_id UInt32,
asset String,
side String,
action String, -- ENTER/EXIT
reference_price Float64,
target_size Float64,
leverage Float64,
has_uv_prefix UInt8, -- always 1 (u- prefix)
u_prefix_client_id String, -- u- prefixed clientOrderId
suppress_reason String, -- reason if suppressed
promo_metadata String -- JSON metadata from promotion bridge
)
ENGINE = MergeTree()
ORDER BY (scan_number, timestamp)
-- NO TTL: exec_journal is the audit trail matching venue orders to journaled
-- intents (arming checklist §3.6). Retention doctrine: audit surfaces never
-- auto-expire (same ruling as prime_decisions / prime_scans at T2P1 merge).
SETTINGS index_granularity = 8192