Intelligence, Advanced Charting & Trading Platform
main
diagnostics/chartnova-blank-screen-2026-10-15
diagnostics/chartnova-stage2-v27-preview-2026-10-15
docs/chartnova-stage1-reconcile-manifest-2026-10-15
feature/chartnova-ios-widget
feature/chartnova-light-catalog-lazy-series-2026-10-15
feature/chartnova-market-terminal
feature/chartnova-multimarket-chart-ws-foundation
feature/chartnova-neon-direct-history
feature/chartnova-neon-history
feature/paper-trading-risk-controls-2026-10-14
fix/alpha-vantage-live-payload
fix/chartnova-progressive-loading-2026-10-15
fix/live-proof-runner-cwd-2026-10-14
foundation/phase-0
foundation/postgres-core
main
ops/chartnova-emergency-rollback-2026-10-15
phase-1/candle-builder
phase-1/data-proof-artifact
phase-1/data-proof-metrics
phase-1/data-proof-report
phase-1/external-gates-state
phase-1/gold-api-fallback
phase-1/ingestion-pipeline
phase-1/live-proof-runner
phase-1/market-calendar
phase-1/market-domain
phase-1/neon-live-proof
phase-1/persistence-contract
phase-1/postgres-ci
phase-1/provider-adapters
phase-1/provider-recovery
phase-1/quality-propagation
phase-1/spike-detection
phase-1/xau-provider-adapter
risk/chartnova-alert-runtime-atomic-2026-10-22
risk/chartnova-atomic-outbox-2026-10-22
risk/chartnova-seven-track-safety-2026-10-21
safety/p0-triage-2026-10-13
| 1 | BEGIN; |
| 2 | |
| 3 | DO $$ |
| 4 | DECLARE instrument_count INTEGER; |
| 5 | BEGIN |
| 6 | SELECT count(*) INTO instrument_count FROM instruments |
| 7 | WHERE symbol IN ('USD_IRT_FREE','GOLD18_IRT','XAU_USD','GOLD18_THEORETICAL_IRT','GOLD18_PREMIUM_IRT','GOLD18_PREMIUM_PCT'); |
| 8 | IF instrument_count <> 6 THEN |
| 9 | RAISE EXCEPTION 'Expected 6 canonical MVP instruments, got %', instrument_count; |
| 10 | END IF; |
| 11 | END $$; |
| 12 | |
| 13 | -- Invalid candles must be rejected by constraints. |
| 14 | DO $$ |
| 15 | DECLARE usd_id BIGINT; |
| 16 | BEGIN |
| 17 | SELECT id INTO usd_id FROM instruments WHERE symbol='USD_IRT_FREE'; |
| 18 | BEGIN |
| 19 | INSERT INTO candles(instrument_id,timeframe,open_time,close_time,open,high,low,close,observation_count,quality,quality_score) |
| 20 | VALUES(usd_id,'1m','2026-01-01T00:00:00Z','2026-01-01T00:01:00Z',100,90,80,85,2,'GOOD',100); |
| 21 | RAISE EXCEPTION 'Invalid candle unexpectedly accepted'; |
| 22 | EXCEPTION WHEN check_violation THEN |
| 23 | NULL; |
| 24 | END; |
| 25 | END $$; |
| 26 | |
| 27 | ROLLBACK; |