feat: add kill-switch control flow

This commit is contained in:
2026-06-07 14:00:20 +09:00
parent c912c08071
commit 7e23648489
30 changed files with 1424 additions and 51 deletions
@@ -0,0 +1,15 @@
-- BAT-012 / REQ-044: day-scoped kill-switch exclusion overlay.
-- Distinct from snapshot_pause (permanent, resume-until). A row excludes a
-- portfolio (or '*' for global) from strategy execution for ONE trading_date;
-- the next trading day is automatically clear because reads filter by
-- trading_date. Manual resume (REQ-046) deletes the row.
CREATE TABLE IF NOT EXISTS killswitch_exclusion (
portfolio_id TEXT NOT NULL, -- '*' = global exclusion sentinel
trading_date DATE NOT NULL,
actor TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT (now() AT TIME ZONE 'UTC'),
PRIMARY KEY (portfolio_id, trading_date)
);
CREATE INDEX IF NOT EXISTS idx_killswitch_exclusion_trading_date
ON killswitch_exclusion (trading_date);