VIOLET V3.4b/V3e: journal the full-sizing breakdown (DDL + row guard)

ShadowDecision already carries the V3.4 5-factor breakdown (base_leverage,
dc_lev_mult, regime_size_mult, market_ob_mult, esof_size_mult), but the journal
row and CH DDL dropped it — so a DARK soak would record decisions WITHOUT the
factor decomposition that V3.4 exists to expose. Thread it through:

- 22_violet_decisions.sql: 5 additive Nullable(Float64) breakdown columns. NULL
  on the legacy base-only path; populated once the launcher feeds live factor
  planes. Note added: on a pre-existing table use ALTER ... ADD COLUMN instead of
  the CREATE IF NOT EXISTS (no live table yet — VIOLET is DARK, never soaked).
- shadow_journal.py: DecisionRow gains the 5 Optional[float] fields (ge=0.0,
  finite-guarded); journal() populates them via getattr(..., None) so the
  base-only path and duck-typed reject tests stay NULL/rejected rather than
  raising on attribute access.
- test_violet_shadow_journal.py: breakdown round-trips on the full path; NULL on
  base-only; a negative multiplier is rejected at the row guard. The existing
  DecisionRow-fields == DDL-columns parity test still holds with the new columns.

violet-only; no shared-file edits; no soak. 29 violet tests green
(7 journal + 22 engine/DDL-apply).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-06-16 13:04:30 +02:00
parent 6d08e97e28
commit 722fd9f054
3 changed files with 69 additions and 1 deletions

View File

@@ -19,7 +19,16 @@ CREATE TABLE IF NOT EXISTS dolphin_violet.violet_decisions
`target_exposure` Float64,
`ars_score` Float64,
`bucket_idx` UInt8,
`actuated` UInt8
`actuated` UInt8,
-- V3.4 full-sizing breakdown: conviction = base × dc × regime(ACB) × ob × esof,
-- capped @9. NULL on the legacy base-only path (no live SizingFactors); populated
-- when the launcher feeds live factor planes. Additive columns — on a pre-existing
-- table apply the matching `ALTER TABLE ... ADD COLUMN IF NOT EXISTS` instead.
`base_leverage` Nullable(Float64),
`dc_lev_mult` Nullable(Float64),
`regime_size_mult` Nullable(Float64),
`market_ob_mult` Nullable(Float64),
`esof_size_mult` Nullable(Float64)
)
ENGINE = MergeTree
ORDER BY (asset, ts)