Trade Accountability System

Architecture hub — how every property fits together, what's live, what's next. Paste this URL into any new Claude session to catch up instantly.
🎯 Start here · one screen Morning Command — what to trade today Posture → today's edge → the trades. MGP + MTF + SIP reconciled into one call. Open →
⚠ Phase 0 — Foundation freeze in effect
No new features until the plumbing ships.
6 deliverables: (1) freshness dashboard · (2) pipeline orchestrator · (3) main.daily_summary view · (4) identity function · (5) Param Surface as strategy registry · (6) indicator_alerts DDL audit. See phase-0 tasks →

The mental model: spine, cockpit, lenses

The spine is the PostgreSQL database (trsports_tradingjournal_dev). It owns all facts: trades, alerts, journal notes, users. The cockpit is the Accountability HUD — the daily landing page that enforces rules across all 6 traders. Everything else is a lens onto the spine — different views for different jobs. If the spine dies, everything dies. If a lens dies, you rebuild it in a weekend.

The 14 properties

Accountability HUD v2 Cockpit
Daily rule enforcement for all 6 traders. Primary landing page. Tracks DML violations, streaks, week bans, buying power, ticket meter.
prod → dev →
  • Covers: James, Enrique, Preston, Nolan, Brian, Thomas
  • Grain: Day / Week
  • SMB Risk Plan: 10 numbered rules
Daily Review LIVE · Primary daily review surface
The actual daily review entry point — “what happened today?” One page per trading day: every fill/sequence, machine-hypothesis and volume-at-entry classification, canonical-model comparison stats, and a deep link into the Strategy Lens per trade. This is the foundation the next-generation Execution Scorecard is being built on top of — it is not itself the finished scorecard (see Scorecards below).
all days → today →
  • Route: /playbooks/daily/<date>.html
  • Built nightly by daily_lens.sh → validated + promoted to production by publish_day.py (unvalidated days are HELD, not published)
  • Every fill/sequence deep-links into the Strategy Lens
Scorecards Lens
Per-day execution quality. Per-trade strategy tags, journal notes, grading. Currently James only — multi-trader is Phase 4.
open →
  • Grain: Day, one trader
  • Generated by gen_scorecard.py
  • Journal writes to main.daily_report_cards
Monthly Reports Lens
P&L history and trend. Equity curve, by-symbol breakdown, win/loss heatmap.
open →
  • Grain: Month
  • Generated by gen_reports.py
Param Surface Registry + Lens
Canonical strategy registry. Every strategy — built-in and user-uploaded — gets a row with its own optimization grid, backtest, live performance. VWAP bands 3×4 is the first strategy; others follow the same shape. All trades in the DB get scored against every registered strategy.
vwap static → vwap db-live → strategy registry → strategy bar →
  • Feeds: strategy decisions, playbook math, MGP pick
  • Consumes: Strategy Library (user-uploaded JSON rules)
  • Strategy Registry: 7 playbooks seeded in main.trade_playbooks (2026-04-21)
  • Strategy Bar: visual entry/stop/target bars — drop-in component for Accountability + Scorecards
  • Data freshness: reads live from main.journal + indicator_alerts — must see every trade, every day
Playbooks Lens
Template-driven narrative playbooks for best trades of week/month. QQQ 3/31 is the reference.
open →
  • Generated by gen_playbook.py
  • Fed by select_best_trades.py (stubbed)
Playbook Lens (MTF Strategy Lens) Lens · Canonical viewer
The canonical trade-review viewer every playbook inherits: one trade object per session (canonical minute bars → TF aggregation → per-frame σ + AM ATR engines → events + reconciled fills at absolute timestamps). Chart TF / Strategy TF controls, MY TRADING DAYS → SETUP OCCURRENCES → CASE CHRONOLOGY separation, and a Candle/Event Inspector (hover scrubs, click pins: OHLCV, rule-level WHY per event, lifecycle state, lens values, executions). 11 tickers live.
open →
Backtests + Walk-Forward Lens · Registry row
FL2 V2 Multi-Band Trail backtest (Mar 30 – Apr 10) + walk-forward. This is strategy row 1 in the Param Surface registry — the same strategy needs to run over live trades, not just its backtest window. Every new strategy added follows this same shape.
FL2 band trail → walk-forward →
  • Needs: gen_walkforward.py to read live trades via main.daily_summary + indicator_alerts (not a fixed window)
  • Publishes: strategy registry row with params, backtest stats, live-performance delta
  • Data freshness: must advance as new trades land; currently static (2-week window)
Morning Game Plan LIVE
Daily pre-market doc. 7 sections: Technical Bias (ChipHazzard multi-TF), Vital Dawn snapshot, Ned Davis breadth composite (8 indicators, KITE top-100), Stocks In Play with Planned vs Actual, Flagged Names, Earnings, Econ Calendar. Calendar nav + date dropdown.
open →
  • Generator: gen_mgp.py + vital_dawn_parser.py + chiphazzard.py + breadth.py
  • Inputs: Vital Dawn (gmail MCP), 8-indicator breadth (KITE top-100), investing.com fallback
  • Multi-TF Risk Read: SPY/QQQ/IWM × 5m/15m/30m/65m ChipHazzard state
  • Planned vs Actual: Would-Have sim on untraded picks (5-min bars)
  • Output: /mgp/YYYY-MM-DD.html before market open (daily 05:47 ET)
Risk Manager HUD Cockpit · New
Stop-utilization gauge per trader. Summary row: # clear / warning / danger / breach. Risk View sort (worst first). 60s auto-refresh countdown. Currently on mock data — awaiting live API endpoint from smb subdomain.
open →
  • 4-tier color system: green <50%, yellow 50–80%, orange 80–99%, red ≥100%
  • Pending: wire to smb.a1prospect.com live trader blotter endpoint
  • Built: 2026-04-21
Live Classifier HUD Cockpit · Live
Real-time playbook-match HUD over 14 watched symbols. Each symbol's live SD position scores against six playbooks (backside-long / backside-scalp / vwap-pull-in / vwap-pull-in-short / trend-trade / fl2-fash-late) returning TRIGGERED / TARGET_MET / NOT_APPLICABLE with gates_passed/total + canonical entry/stop/target + r_to_target_now. Shipped 2026-05-05. Producer cron pending — JSONs static since 5/5 14:41 ET (see roberto-classifier-refresh-cron).
open → watchlist json →
  • 14 per-symbol JSONs at /scorecards/classify/<SYMBOL>.json
  • Manual override layer: strategy_tag_overrides.json (flat file, single-user; promote to DB)
  • Companion state: personal_tod_baseline.json, positions_snapshot.json
Daily Stop tool Cockpit · Sizer
Trader control dashboard for intraday risk discipline. Sets daily limits (max loss, trade count, sizing), tracks real-time P&L + win rate, logs trades by playbook + HTF setup. Danger Zone halts trading at max loss requiring acknowledgment. Backed by shared user_settings endpoint — same daily_stop value seeds MGP Max Risk + Accountability HUD.
open → sizing calc →
  • Storage: main.user_settings via /scorecards/api/user_settings.php (CORS-enabled for smb subdomain)
  • Linked to: Sizing Calculator (Strategy Bar v1.1.0), MGP Max Risk calc
  • Outstanding: register dot on hub freshness signal · wire MGP risk pipe to read this endpoint instead of hardcoded settings
MTF VP Scanner NEW · In Progress
Multi-timeframe volume profile confluence scanner. DB scaffold applied, BTCUSD backfill seeded. Live TradingView hookup pending.
  • DB scaffold applied: 2026-04-21
  • Pending: live TradingView webhook → DB write
Strategy Library Lens · Scientific Layer
Curated catalog — LIVE 2026-04-30. All setups, one page. Filterable by family (VWAP/Pullback, Counter-trend, Level Breakout, Event-Driven, Gap Fade), direction, timing. The "what am I trading?" answer that precedes Scorecards' "how did I trade it?".
open →
  • Sibling pages: Sizing Calc, Playbooks, Strategy Bar, Param Surface
  • Defines the family taxonomy used by Playbooks + Scorecards
User Strategy Upload NEW · Proposed
Self-service: upload your own strategy as JSON rules → backtest against your journal → admin approval → row in Param Surface. Plugs into the curated Strategy Library above.
  • New table: main.user_strategies
  • Reuses backtest engine (kti backtest-*)
  • Adds role and is_approved to main.users

Infrastructure · Machine Roster

Tailscale-mesh networking. IPs in the 100.x.x.x range are stable regardless of DHCP / network / ISP. SSH aliases configured on domino-1 — any agent can use ssh jimdo / ssh a2 directly.

domino-1
This machine · primary scheduled-task runner
Windows · user: jtdom
Runs: mgp-daily, mgp-midday, mgp-recap, nightly-project-manager, todos-scan-twice-daily. kti CLI installed.
jimdo (Jim's machine)
Warm backup runner (planned)
Windows · 100.84.208.115 · desktop-1adremn
ssh jimdo · key-based auth · added 2026-05-13. Will mirror scheduled tasks once warm-backup script ships.
a2 (cloud / a1prospect.com)
Postgres source-of-truth · web host · accountability daemons
Linux · user: trsports
ssh a2 · serves trsportsacademy.com + smb.a1prospect.com. No kti (Windows-only).
james-trader (planned)
James's new dedicated trading machine
Windows · runs Gr8Trade, IBKR, eTrade clients
Tailscale + SSH setup pending. Will host the Execution Gateway.

Projects · the 9 initiatives

Locked 2026-06-20. Codenames are aligned to descriptive titles (no metaphor decoding required). Each card shows live open-task count from todos.json. Click for the per-project Gantt.

Reading /todos/todos.json…

Live freshness

Source 1: /system/freshness.json (local property mtimes). Source 2: App Watchdog (cross-host a2 probe every 30 min via Task Scheduler on domino-1 — covers 14 apps).
Reading /system/freshness.json…

How it all connects — the 30-second pitch

One database is the spine. All trades, all alerts, all journal notes live in PostgreSQL. One page is the daily cockpit — the Accountability HUD — where the whole team lands each morning to see rule compliance. The lenses read left-to-right as the trader's lifecycle: Strategy Library (what am I trading?) → Playbooks (how do I teach it?) → Morning Game Plan (what's the plan today?) → Accountability HUD (did everyone obey the rules?) → Scorecards (how did I execute?) → Monthly Reports (what's the trend?) → Param Surface (which strategy works best?). Same data, ordered by when in the trader's day each lens earns attention.

Same-day review has its own mini-lifecycle inside GRADE: Daily Review (what happened today?) → Strategy Lens (why did this setup happen?) → Execution Scorecard (how well did I execute? — next-gen, in progress). Daily Review is now the actual daily-review entry point — trades, sequences, machine/model observations, volume-at-entry, review notes, and links into the Lens; the existing Scorecards lens above still stands while that richer workflow evolves into its replacement. Scorecards/review data ultimately rolls up into Monthly Reports and Param Surface for longer-term trend and process analysis.

TradingView SETUP / ENTRY webhooks Gr8Trade Broker trade fills SMB Newsletter Morning email (gmail MCP) Ned Davis Breadth CMT model (user-supplied) User Input Journal notes, strategies KTI CLI Price data SPINE — PostgreSQL trsports_tradingjournal_dev The single source of truth. Every page below reads from here. main.users id, name, role, is_approved + identity() fn main.journal trades, fills, P&L keyed by user_id alerts_tradingview. indicator_alerts VWAP bands, regime playbook_type main.daily_report_cards journal notes, self-grade per day main.user_ strategies NEW uploaded + main.daily_summary VIEW — every property reads aggregates from here (Phase 0) DEFINE TEACH PLAN EXECUTE GRADE ANALYZE OPTIMIZE LENS Strategy Library “what am I trading?” curated catalog, 5 families filterable VWAP / Counter-trend Breakout / Event / Gap LIVE 2026-04-30 + user upload (proposed) LENS Playbooks “how do I teach this?” narrative per best trade template-driven consumes Strategy Library family taxonomy LENS Morning Game Plan “plan today?” SMB email + breadth + econ → pre-market doc LIVE 5:47 ET wk-days COCKPIT Accountability HUD “obeying the rules?” • 6 traders, daily • 10 SMB rules • user selector • intraday log daily landing page whole team lands here LENS Scorecards “how did I execute?” per-trade grade journal save per-day, per-trader LENS Monthly Reports “what's the trend?” equity curve heatmap by symbol MTD / monthly REGISTRY + LENS Param Surface “which works best?” r1: FL2 V2 Band Trail r2: VWAP bands 3×4 r3+: user uploads backtest + walk-forward live Param Surface "best trades" loops back → Playbook narrative PRE-TRADE LIVE COCKPIT POST-TRADE SAME-DAY REVIEW WORKFLOW (feeds Scorecards) the day's fills LENS · LIVE Daily Review “what happened today?” fills, sequences, machine hypothesis, volume-at-entry /playbooks/daily/<date>.html LENS · CANONICAL VIEWER Strategy Lens “why did this setup happen?” chart, Adaptive Mean + σ, AM ATR, VWAP/levels, volume = Playbook Lens (MTF Strategy Lens) above NEW · IN PROGRESS Execution Scorecard “how well did I execute?” next-gen — Daily Review + Strategy Lens are its foundation existing Scorecards lens stands until it ships feeds / evolves into

■ spine · ■ cockpit · ■ lens · ■ proposed / user-uploaded · grey = input / source · read lenses left-to-right as the trader's lifecycle

Data layer — the spine

Table / View Owns Notes
main.users Identities Needs role (trader/admin) and is_approved columns added for strategy library + approval gate.
main.journal Trades (fills, P&L) Single source of truth for executions. Keyed on trade_id + user_id.
main.daily_report_cards Journal notes, self-grade Target for scorecard Save button. market_conditions + emotional_state columns pending migration.
main.daily_summary Day-level aggregates View to build. Accountability + Scorecards + Monthly all read this for shared numbers.
main.user_strategies Uploaded strategy rules NEW. (id, user_id, name, json_rules, is_approved, created_at).
alerts_tradingview.indicator_alerts Signals from TradingView NOT empty (verified 2026-04-18). Has entry_price, vwap, bands, market_regime, playbook_type. Likely missing: stop_price, tp1, tp2, grade, rvol, ema_slope.

Non-negotiable rules (the fix-it-once contract)

System status at a glance updated 2026-04-22

Accountability HUD — live, data freshness unverified
Risk Manager HUD — UI built (gauges, sort, auto-refresh); on mock data until smb live API wired
Scorecards (James) — generator runs; 4/1–4/13 manifest gaps; DB enrichment requires server-side run or SSH tunnel
Monthly reports — freshness unknown; gen_reports.py runs in EOD batch
Param Surface — static + db-live pages exist; Strategy Registry seeded (7 playbooks, 2026-04-21); Strategy Bar drop-in ready
Backtests / Walk-Forward — running live through today (OOS window advances daily)
Journal persistence — code shipped, waiting on user: run add_scorecard_columns.sql + confirm save
indicator_alerts enrichment — works on server; needs SSH tunnel or a2 run from dev box
Morning Game Plan — LIVE. 7 sections, ChipHazzard multi-TF, Ned Davis breadth composite, Planned vs Actual Would-Have sim. Runs 05:47 ET weekdays.
MTF VP Scanner — DB scaffold applied, BTCUSD backfill seeded; live TradingView hookup pending
Strategy Library (catalog) — LIVE 2026-04-30 at /strategies/; 5 families, filterable
User Strategy Upload (JSON workflow) — proposed, not started
Multi-trader scorecards — Phase 4
Playbook chart bugs — known, parallel track
Phase 0 foundation — all 6 deliverables still open: freshness dashboard, orchestrator, daily_summary view, identity fn, param surface registry, indicator_alerts DDL audit
HTF Portfolio (new) — Strategy Library tag htf-portfolio · Scorecards lens · Playbook