trading/services/kevin_signal_bridge
Viktor Barzin 35707a5c8a
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
fix(kevin_bridge): persist signal to signals table before audit row
End-to-end Phase 2 verification surfaced a FK violation: the bridge
publishes a TradeSignal to the Redis stream and writes
kevin_signal_bridge_state with signal_id, but signal_id has a FK to
the signals table — which was never populated for Kevin-emitted
signals (only the news+sentiment path wrote there).

AuditWriter.persist_signal() inserts the TradeSignal into the
signals table idempotently (on_conflict_do_nothing on the UUID PK)
before the bridge publishes to Redis. Bridge calls it as a new step
right before the XADD, so:
  1. Signal row exists in signals table
  2. XADD to signals:generated
  3. Audit row with signal_id FK now resolves

Verified live: mention #84 (synthetic NVDA buy, conviction 0.85)
emitted a signal, trade-executor consumed and correctly rejected
with outside_market_hours (market was closed at the time).
2026-05-26 21:23:59 +00:00
..
__init__.py feat(kevin_bridge): main orchestrator with dependency injection 2026-05-24 00:59:56 +00:00
aggregator.py feat(kevin_bridge): multi-mention aggregator with capped conviction boost 2026-05-24 01:01:02 +00:00
audit.py fix(kevin_bridge): persist signal to signals table before audit row 2026-05-26 21:23:59 +00:00
blocklist.py feat(kevin_bridge): blocklist + daily risk counters 2026-05-24 01:01:54 +00:00
config.py feat(kevin_bridge): main orchestrator with dependency injection 2026-05-24 00:59:56 +00:00
cursor.py feat(kevin_bridge): exit-scan daily job + cursor + audit writer 2026-05-24 01:03:53 +00:00
exit_scanner.py feat(kevin_bridge): exit-scan daily job + cursor + audit writer 2026-05-24 01:03:53 +00:00
main.py fix(kevin_bridge): persist signal to signals table before audit row 2026-05-26 21:23:59 +00:00
risk_counters.py feat(kevin_bridge): blocklist + daily risk counters 2026-05-24 01:01:54 +00:00