AI Gold Trading Intelligence Platform
01 Product Definition and Repository AuditTurn the vision into a precise, testable project definition. COMPLETE100%
Exit criteria
- Scope is documented.README.md, DECISIONS.md
- Live trading is explicitly out of scope for early phases.README, .env.example LIVE_TRADING_ENABLED=false
- Unknowns are visible and assigned for decision.DECISIONS.md; tracker Open decisions
Deliverables
- Product requirements summarydocs/PRODUCT_REQUIREMENTS.md
- Glossarydocs/PRODUCT_REQUIREMENTS.md → Glossary (30 terms)
- Assumptions and unresolved decisions listDECISIONS.md 'Remaining integration decisions'
- Phase checklist and acceptance templatedocs/PHASE_ACCEPTANCE.md generated from roadmap.json
Work
- Inspect the repository and environment before changing anything.
- Create README.md, PROJECT_STATUS.md, DECISIONS.md, CHANGELOG.md, and docs/.
- Record product scope, non-goals, user roles, initial XAUUSD-only scope, and research-first release plan.
- Record the initial choice of historical market data + historical news.
- Record browser dashboard, Windows development PC, dedicated VPS, MT5-first/MT4-later, and Telegram public/private channels.
- List unresolved provider, broker, account, and hosting questions; do not invent answers.
- Define terms consistently.
Tests run
| Command | Result | When |
|---|---|---|
node --no-warnings scripts/roadmap.mjs | passed: tracker + acceptance record generated, required files check live | 2026-10-26 |
npm.cmd run format:check | passed | 2026-10-26 |
Edge screenshot of ROADMAP_TRACKER.html (1500px, 412px) | passed: 0 page errors, no horizontal overflow | 2026-10-26 |
Deliverables added on 2026-10-26: product requirements summary with glossary, generated acceptance record. Tracker (roadmap.json → /roadmap, ROADMAP_TRACKER.html) is the phase checklist.
Last updated 2026-10-26
02 Architecture and Engineering StandardsEstablish maintainable boundaries before feature development. COMPLETE100%
Exit criteria
- Minimal services start locally.node scripts/workspace.mjs start
- Health endpoints work./api/health, /health
- Automated checks run in CI.GitHub Actions run 40287596449: format, typecheck, setup, ruff, pytest, roadmap diff, build, Playwright all success
- No broker credentials or live execution are present.grep: no broker adapter code
Deliverables
- Architecture documentdocs/ARCHITECTURE.md
- Repository scaffoldsrc/, backend/, scripts/, tests/, docs/
- Coding standardsPrettier, tsc, ruff (ruff.toml), pytest, Playwright; docs/TEST_PLAN.md
- Threat modeldocs/THREAT_MODEL.md
- Service/API contract outlinedocs/LOCAL_RESEARCH_CONTRACT.md, FastAPI OpenAPI
Work
- Create repository layout for frontend, Node.js API, Python/FastAPI service, workers, tests, migrations, and docs.
- Define service contracts and ownership.
- Define TypeScript/Python formatting, linting, type checking, and test conventions.
- Define configuration management and environment variables.
- Define logging format, error model, ID strategy, UTC convention, and API versioning.
- Decide single vs multiple repositories.
- Create architecture diagram and threat model.
Tests run
| Command | Result | When |
|---|---|---|
npm.cmd run typecheck | passed | 2026-10-26 |
npm.cmd run lint:backend (ruff) | passed: All checks passed (45 auto-fixes applied first: import order, datetime.UTC, 2 unused imports) | 2026-10-26 |
npm.cmd run test:backend | passed: 180 passed after the lint fixes | 2026-10-26 |
npm.cmd test (Playwright desktop+mobile Edge) | passed: 32 passed, 2 device skips (first run failed on web-server cold start; readiness window raised 45 s → 180 s, rerun clean) | 2026-10-26 |
npm.cmd run build | passed: /roadmap built as a dynamic route | 2026-10-26 |
npm.cmd run format:check | passed | 2026-10-26 |
GitHub Actions `ci` on cbf242d | passed: every step success (format:check, typecheck, setup:backend, lint:backend, test:backend, roadmap diff, build, playwright install, npm test) | 2026-10-26 |
Repository pushed to github.com/mdilshadofficial/Ai-Gold-Trading (main). First CI run green on all steps. Python lint: ruff (E, F, I, B006, B011, UP017; E501 ignored).
Last updated 2026-10-26
03 Secure Authentication and Admin FoundationBuild the private application shell and access control. COMPLETE100%
Exit criteria
- Unauthenticated users cannot access protected pages/APIs.security.py RequestGuard; REQUIRE_OWNER_AUTH
- Privileged endpoints enforce server-side authorization.FastAPI dependency, X-Service-Token + owner session
- No credentials are stored in browser local storage.HttpOnly cookie gold_owner_session
- Security tests pass.9 security tests passed 2026-10-26; 180 backend tests passed
Deliverables
- Login UI/login (setup + sign-in)
- Protected browser routesproxy 401/423 redirect to /login when REQUIRE_OWNER_AUTH=true
- Admin panel shell/settings
- Audit log base/logs, audit_events table
- Security testsbackend/tests/test_security.py (9 tests) + operations auth coverage + proxy host/origin Playwright checks
- Work order Part 4 item 27 (roadmap 5.8): Admin & Settings - users, own sessions and sign-out of others, MFA (TOTP) setup, data-provider status, feature flags (live fixed false), backup status, maintenance mode (migration 022; blocks entries, pauses bot worker and shadow runner; ending needs re-authentication), emergency stopsrc/components/admin-panel.tsx, backend/research/monitoring.py (/admin/status, /admin/maintenance), security.py (/auth/sessions)
Work
- Implement secure login/session handling.
- Add admin role and permission checks.
- Add MFA/TOTP design and implementation before production/live use.
- Add CSRF/XSS protections, rate limits, session expiry, and secure cookies.
- Add audit events for login, logout, configuration changes, and rejected privileged actions.
- Build admin shell and system status page.
- Add secure secret references; do not yet connect a live account.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_security.py -q | passed: 9 passed (setup key 403/409, 423 until owner exists, 401 for missing/forged session, 5-failure lockout 429, logout revocation, MFA enrol/confirm/replay rejection, viewer 403 on writes, password change revokes sessions, audit log free of secrets) | 2026-10-26 |
.venv/Scripts/python -m pytest backend/tests/test_work_order_part4.py -q | 5 passed | 2026-10-29 |
scrypt password hashing (modern KDF; roadmap allows an appropriately configured modern hash). Re-authentication for high-risk actions is owed to the live-path phases (19). Argon2id swap recorded as optional in docs/THREAT_MODEL.md.
Last updated 2026-10-29
04 Database and Migration FrameworkCreate durable, versioned storage. COMPLETE100%
Exit criteria
- Fresh database can be migrated from zero.every test creates a fresh SQLite file
- Migrations are repeatable and tested.backend/tests/test_api.py
- Tests do not depend on production data.tmp_path databases
- Sensitive secrets are not stored as plain text.scrypt hashes; Fernet-encrypted TOTP secrets
Deliverables
- Database schema and migrationsbackend/research/migrations 001-004
- Entity relationship diagramdocs/DATA_DICTIONARY.md (entity map + every table/column)
- Seed/test fixturessynthetic candles/events; tests use tmp databases
- Backup and restore guidedocs/OPERATIONS.md, npm run backup
Work
- Configure the database and migrations.
- Create initial schemas for users, audit events, providers, instruments, jobs, and configuration.
- Define UTC timestamps, indexes, foreign keys, and retention strategy.
- Add connection pooling and safe transaction handling.
- Add backup/restore instructions for development.
- Use synthetic fixtures for tests.
Tests run
| Command | Result | When |
|---|---|---|
npm.cmd run test:backend | passed: 180 passed; every test migrates a fresh SQLite file from zero (001–004) | 2026-10-26 |
backend/tests/test_security.py | passed: hashes and encrypted TOTP verified; no plain-text secret in owner_users | 2026-10-26 |
SQLite instead of PostgreSQL; recorded in DECISIONS.md and the Open decisions list.
Last updated 2026-10-26
05 Historical Gold Data IngestionMake the historical XAUUSD data pipeline reliable. COMPLETE100%
Exit criteria
- Re-running an ingestion does not create duplicates.tests: idempotent incremental, append-only ticks; real incremental runs 2 and 3: 0 duplicate M1 bars, 0 duplicate tick keys
- Missing intervals and bad candles are flagged.real import: 1 weekday gap (2026-09-07 US Labor Day early close), 1 tick price jump, 42 duplicates dropped; weekends/holidays not flagged
- Data coverage and source are visible.Historical Research card + materialized dataset source: provider, server, symbol, bid, UTC convention, offset model, run id, range, quality
- Backtest refuses or warns on unacceptable data quality.materialized datasets carry parse warnings + tick-volume warning; research results stay INCONCLUSIVE
Deliverables
- Historical data adapterbackend/research/dukascopy_csv.py: Dukascopy JForex tick CSV (research history, owner 2026-10-28), streamed, resumable, SHA-256, day tick files; backend/research/mt5_history.py: read-only MT5 broker reference (Exness primary, XM)
- Ingestion workerfull and incremental modes, append-only ticks with hole filling, M1 replace from the first re-fetched bar, lock file, never starts the terminal; hourly task 'AI Gold MT5 History'
- Candle tables/migrationsmarket store: mt5_bars (M1..D1, UTC, bid, spread, tick volume), mt5_ticks, mt5_history_runs (provenance)
- Data quality reportexisting tick audit + M1 checks into quality_events; Historical Research card: coverage per timeframe, ticks, quality flags, last run, Dukascopy inactive
- Provider setup instructionsdocs/DATA_SOURCES.md section 0 (MT5 source, measured import, Max bars note, commands)
- Work order Part 2: Dukascopy/Exness selector in every research view (Dukascopy default; Live Gold and Overview on Exness), data explorer per year (coverage, gaps, quality), synthetic data only in tests/CIbackend/research/history.py (source, explorer), src/components/dataset-select.tsx, market-coverage.tsx; backend/tests/test_work_order_part1.py
Work
- Select a legal/usable data provider only after coverage, cost, granularity, and licensing are reviewed.
- Implement provider adapter and a normalized candle format.
- Ingest available historical OHLCV data for initial timeframes.
- Store source, retrieval time, instrument, timeframe, and coverage metadata.
- Add duplicate, gap, invalid OHLC, outlier, and timestamp checks.
- Add resumable/idempotent ingestion jobs.
- Add data coverage and quality report in the dashboard.
- Keep provider-specific assumptions explicit.
Tests run
| Command | Result | When |
|---|---|---|
npm.cmd test (Playwright desktop+mobile Edge) | passed: 32 passed, 2 device skips with the Dukascopy coverage card on Analytics | 2026-10-26 |
npm.cmd run typecheck / lint:backend / format:check / build | passed: all four; build warning-free | 2026-10-26 |
ruff check backend | passed: All checks passed! | 2026-10-27 |
httpx GET datafeed.dukascopy.com/datafeed/XAUUSD/2024/00/02/10h_ticks.bi5 (single requests, several User-Agents) | refused: 429 {"error": "Too Many Requests..."} for generic User-Agents; 503 "No server is available" for the project's plain and for browser User-Agents; no Retry-After; same for EURUSD and metadata/HistoryStart.bi5. No data downloaded. | 2026-10-27 |
GitHub Actions ci #3 (commit 2444d69) | passed: completed successfully, 3m 7s | 2026-10-27 |
dukascopy sync --from 2024-01-01 --to 2024-12-31 --rate 5 --workers 4 (mobile hotspot, stop on first block) | stopped: probe 200 (21 048 bytes), then 8 requests in 32 s, 4 hour files archived (76 954 bytes), first HTTP 503 → block → run stopped as instructed; 0 days complete, 2 days failed/pending. No sample-year measurement. | 2026-10-27 |
.venv/Scripts/python -m pytest backend/tests/test_dukascopy.py -q | passed: 15 passed (adds fixed-pause job throttle that never gives up, newest-first order, backfill loop resuming after a 503 with archived-hour reuse and progress report, single-instance lock, month/year progress) | 2026-10-27 |
npm.cmd run check (format, typecheck, ruff, backend tests, roadmap, build, Playwright) | passed: Prettier clean, typecheck ok, ruff clean, 214 backend tests passed, build compiled, Playwright 32 passed / 2 device skips | 2026-10-27 |
.venv/Scripts/python -m pytest backend/tests/test_mt5_history.py -q | passed: 7 passed (UTC conversion, D1 at 00:00 UTC, idempotent incremental, append-only holes, quality, never starts the terminal, Dukascopy disabled) + API test on the MT5 store | 2026-10-27 |
python -m backend.research.mt5_history full (real, XM demo) | 100 016 M1 bars 2026-07-17 00:49Z → 2026-10-27 15:45Z; M5 20 022, M15 6 675, M30 3 338, H1 1 670, H4 451, D1 88; 39 320 863 ticks 2026-05-22 → 2026-10-27, 42 duplicates dropped; quality: 1 weekday gap, 1 price jump; 4.0 GB; 548 s; terminal max bars 100 000 | 2026-10-27 |
python -m backend.research.mt5_history incremental (real, runs 2 and 3) | 1.1 s; only new data added; 0 duplicate M1 bars and 0 duplicate tick keys; current-day ticks before 15:30 UTC not yet in the terminal (append-only, filled later) | 2026-10-27 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 239 backend tests passed, build compiled | 2026-10-27 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 38 passed, 2 device skips (desktop + mobile Edge, clean dev cache) | 2026-10-27 |
GitHub Actions ci #13 (commit 46d82c4: format, typecheck, ruff, backend tests on Linux with the Windows-only MetaTrader5 marker, roadmap diff, build, Playwright) | passed: completed successfully, 4m 35s | 2026-10-27 |
.venv/Scripts/python -m backend.research.dukascopy_csv import (data/market/jforex/XAUUSD_Ticks_2003.10.28_2026.10.28.csv, 4 workers) | passed: 735,725,966 rows read and kept, 7,170 days, 2003-10-28T00:00:01.648Z .. 2026-10-27T23:59:56.830Z, 1,234 s, file SHA-256 5215ac7118597dc7d858e5019219696e4ae58f9469a939eb040bc8cc4c8218eb, CSV unchanged | 2026-10-28 |
.venv/Scripts/python -m backend.research.dukascopy_csv verify | passed: 7,170 day files, hash and tick count match, 0 problems, 123 s | 2026-10-28 |
Re-run on Dukascopy: /market/technical M5..D1 (5000 bars) and /events/studies NFP, Jobless Claims, CPI m/m, /events/cot-studies | passed: detector runs 6-10; NFP 230 used (Exness 110, XM 3), Jobless Claims 1,013 (Exness 487, XM 14), CPI m/m 233 (Exness 111), COT 741 weeks (XM 12) | 2026-10-28 |
.venv/Scripts/python -m pytest backend/tests/test_work_order_part1.py -q | 9 passed | 2026-10-29 |
Closed again on 2026-10-28 with the owner's Dukascopy JForex CSV as the research history: bid and ask M1..D1 (D1 = 00:00 UTC), quality flags 111 gaps, 14 price jumps, 15 missing weekdays (Good Fridays, 2021-12-24), per-day tick spreads; 3.5 GB tick files + 2.75 GB bars. MT5 terminal history (Exness XAUUSDm primary, XM GOLD) stays a separate broker reference. Dukascopy datafeed downloading stays disabled.
Last updated 2026-10-29
06 Historical News and Economic Calendar PipelineStore news and macro events with trustworthy provenance. COMPLETE100%
Exit criteria
- Every event has a source and timestamps where available.every event row has source, scheduled_at UTC, source_time, retrieval times and snapshot ids; COT rows carry release_basis + release_source
- Conflicting/missing data is marked, not fabricated.MT5 ↔ FF conflicts stored and flagged (both values kept); MT5 years without events listed as missing; COT weeks without a CFTC-published release time stored as unknown and never used
- Provider limits and errors are handled.ForexFactory: hourly schedule, local guard ≤ 2 downloads / 5 min, denied/HTML/invalid/HTTP/network errors recorded with exponential backoff; CFTC: daily check, errors recorded. Tests in backend/tests/test_news_sources.py
- Daylight-saving transitions are tested.tests: FF offsets across 2026-11-01; New York rules 2006/2007+; MT5 server offset model (US and EU DST transitions, fixed) and event conversion either side of 2026-11-01; COT release times
Deliverables
- News/event schema and migrationsnews_events (CSV) + migration 005 (feed_snapshots, economic_events, cot_reports) + migration 006 (cot release times, cot_release_dates, mt5_exports, mt5_server_offsets, event_name_map, event_links; rows preserved)
- Source adaptersForexFactory weekly JSON + CFTC COT (backend/research/news_sources.py); MT5 calendar: read-only MQL5 service mt5/AIGoldCalendarExport.mq5 (0 errors/0 warnings) + import backend/research/mt5_calendar.py with detected server offset and per-year DST model; MT5 ↔ ForexFactory merge with name-mapping table and conflict flags
- Historical event importer where availablePOST /news/import (CSV); COT history 2006-06-13 → 2026-10-20 (1 063 weeks) imported from the CFTC API
- News calendar APIGET /news, GET /news/calendar, GET /news/cot, GET /news/sources
- Source freshness dashboardAnalytics → Events 'Calendar and COT sources': FF/COT/MT5 freshness and stale warning, COT unknown-release weeks, MT5 broker/server/demo, detected offset + model check, missing years, links/conflicts, both values side by side
- Work order #3 item 2: a stale export never erases a stored actual (cause of release delays of 4 442 s median / 86 282 s max); delays before and after the fix reported separately with our pipeline timebackend/research/mt5_calendar.py; mt5/AIGoldCalendarExport.mq5 default every minute
Work
- Evaluate official/licensed economic-calendar and news sources.
- Implement adapters with rate limits and terms-compliant access.
- Normalize scheduled events, actual/forecast/previous values, source timestamps, and headlines.
- Keep source publication time separate from retrieval time.
- Support UTC and correct US Eastern/local display conversions.
- Deduplicate stories/events without erasing provenance.
- Store source reliability and verification status.
- Add ingestion monitoring and missing-data reports.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_news_sources.py backend/tests/test_mt5_calendar.py -q | passed: 19 passed (FF 6 incl. failure matrix, COT schedule parsing + release rules + known_at + API, MT5 import, offset model fit us/eu/fixed, DST transitions, detected-offset check, incomplete files, merge + conflicts, number normalisation) | 2026-10-27 |
MetaEditor64.exe /compile:AIGoldCalendarExport.mq5 | Result: 0 errors, 0 warnings (build 5660) | 2026-10-27 |
python -m backend.research.news_sources all --force (real data, after migration 006) | ForexFactory unchanged (97 events); CFTC COT 1 063 weeks, release times 1 049 known / 14 unknown, schedule page 52 dates; MT5 export file not present yet (service not started) | 2026-10-27 |
COT release audit on real data | no duplicate release times, strictly increasing, every lag outside 3–7 days is a documented CFTC exception (2013, 2019, 2023 ION, 2025 shutdown) | 2026-10-27 |
npm.cmd run check | passed up to build: Prettier clean, typecheck ok, ruff clean, 223 backend tests passed, roadmap rendered, build compiled; local Playwright not run because port 3100 was taken by another project's server (D:\MD Digital USA), left untouched; Playwright result taken from GitHub CI | 2026-10-27 |
GitHub Actions ci #7 (commit 0352fe4: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed: completed successfully, 12m 40s | 2026-10-27 |
npm.cmd run news:sync -- mt5 (owner, first real export) | calendar_full.tsv ok: 213 241 values, 836 weeks sampled, model_check agrees, demo, XMGlobal-MT5 10, detected offset +7200 s | 2026-10-27 |
calendar_recent.tsv check | written by the service 2026-10-27 12:54:23Z (one 60-min interval after the full export, as designed; 536 values), imported automatically by the hourly task at 13:00:52Z, model check agrees | 2026-10-27 |
link_events on real data after merge fixes + 4 verified USD mapping entries | mapping 4, only_candidate 22, name_overlap 33 (59 linked, 0 MT5 events linked twice), conflicts 35, ambiguous 8, unmatched 30 | 2026-10-27 |
.venv/Scripts/python -m pytest backend/tests/test_mt5_calendar.py backend/tests/test_news_sources.py -q | passed: 20 passed | 2026-10-27 |
GitHub Actions ci #9 (commit 6177929: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed: completed successfully, 6m 1s | 2026-10-27 |
link_events after owner-approved mappings, AUTO_MAP learning/elimination and bound handling (real data) | mapping 13, only_candidate 20, name_overlap 33 (66 linked), conflicts 38, ambiguous 1 (JPY BOJ Core CPI y/y, owner to choose), unmatched 30 | 2026-10-27 |
MT5 service log + feed_snapshots around the Fed decision (18:00Z), one service instance | calendar_recent.tsv exported 17:45:39Z and 17:46:39Z (1-minute hot window), imported 17:46:03Z and 17:47:04Z; no cannot-open error since the duplicates were removed (last at 20:05 terminal time) | 2026-10-28 |
Fed Interest Rate Decision 2026-10-28T18:00Z, release-to-actual delay | not measurable yet: at 18:17Z the MT5 calendar (Exness-MT5Trial15) still had no actual or forecast for the event, although the row was re-exported and re-imported every minute (last 18:17:03Z). Recorded automatically when the actual arrives. | 2026-10-28 |
.venv/Scripts/python -m pytest backend/tests/test_mt5_calendar.py -q | 14 passed | 2026-10-29 |
measured after the fix (live, 2026-10-29 23:00 UTC releases) | export -> database (our pipeline) 1 s; release -> export 902 s for low-importance events (hourly export outside the high-impact hot window; minute export needs the service input changed in MT5) | 2026-10-29 |
Owner decisions 2026-10-26/27. The MT5 calendar uses the demo account logged in to this PC's terminal (XM Global, XMGlobal-MT5 10), read-only through an MQL5 service; the app never handles MT5 credentials. COT release times come only from CFTC-published dates. The pre-news SL rule proposal is sent at Phase 14. Closed 2026-10-27 after the first real MT5 export: every exit criterion has evidence. Open for the owner (not blocking): ForexFactory titles for NFP, CPI, Core CPI, Retail Sales, ISM and Unemployment Rate are added to the mapping table when they appear in the weekly file; remaining ambiguous/unmatched pairs are listed in the 0.8.0 report.
Last updated 2026-10-29
07 Browser Dashboard Shell and Core UI/UXDeliver the main private web application. COMPLETE100%
Exit criteria
- All main pages load under authenticated access.Playwright: all 16 routes load with the correct heading and active link (desktop + mobile)
- Empty and failure states are handled.panel empty states, service-failure retry test, pending sections without values
- Mock values are never confused with live account or market data.synthetic data labelled; delayed feed labelled; pending sections show no values
- Browser tests pass.passed: 36 passed, 2 device skips (cold dev server, desktop + mobile Edge)
Deliverables
- Working browser dashboard16 routes: the 15 roadmap 5.2 sections + Roadmap; research sections share one workspace; later-phase sections state their phase and show no values
- Navigation and layout componentssrc/lib/sections.ts (roadmap 5.2 order), dashboard-shell.tsx (scrolling sidebar and mobile drawer), src/app/(research)/layout.tsx, section-pending.tsx
- Reusable panel/chart/table componentsterminal-widgets, terminal-topology, home-dashboard charts
- UI test suitetests/dashboard.spec.ts: every route direct entry/reload/active link, history, keyboard, collapsed sidebar, mobile drawer + overflow on all routes, pending sections, shared research workspace
- Work order 2026-10-29 Part 1: sidebar 240/64 px, one-line labels, vertical scroll only; real kill switch, adapter and broker state everywhere; Exness XAUUSDm price with GC=F as reference; dated, newest-first activity; real counters; report loading/details; News layout and synthetic block removedsrc/components/dashboard-shell.tsx, home-dashboard.tsx, reports-center.tsx, logs-dashboard.tsx, research-events.tsx, settings-dashboard.tsx; backend/research/terminal.py, monitoring.py; tests/work-order.spec.ts
- Work order #3 Parts B-D: readable activity, real Overview state and Exness demo block, live interactive charts (1m-1D, zoom/pan/scale, live overlays), neural shell driven by recorded events at the top of the Overviewsrc/components/home-dashboard.tsx, structure-chart.tsx, brain-shell.tsx; backend/research/terminal.py (/live/chart), shell.py (/brain/activity)
- Work order #4 Part A: Overview redesign - organic neural shell (real events, core glows while the LLM thinks), full-width live chart (~60% viewport, timeframe buttons, wheel/drag/double-click, labels drawer), level ladder, live news & speeches (official embeds, countdown, auto switch), wallet | latency row, cone, paper + demo execution tape, status tiles, latest 5 wire eventssrc/components/home-dashboard.tsx, brain-shell.tsx, live-news.tsx, structure-chart.tsx, video-sources.tsx; backend/research/shell.py; migration 028
Work
- Build responsive dark trading-terminal layout.
- Create navigation for Overview, Gold Chart, News, Research, Backtesting, Strategies, Demo, Accounts, Risk, Telegram, Reports, Admin, and Health.
- Add loading, empty, error, stale-data, and disconnected states.
- Add accessible contrast, keyboard navigation, responsive resizing, and clear status labels.
- Build initial overview with actual data only; use explicit mock-data labels for fixtures.
- Add live updates via authenticated WebSocket/SSE if appropriate.
Tests run
| Command | Result | When |
|---|---|---|
npx playwright test (local, temporary copy on ports 3300/8300 because 3100/3200 belong to another project) | passed: 36 passed, 2 device skips (cold dev server, desktop + mobile Edge) | 2026-10-27 |
GitHub Actions ci #9 (commit 6177929: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed: completed successfully, 6m 1s | 2026-10-27 |
npx playwright test -c playwright.e2e.config.ts (ports 3300/8300) | Full suite: 62 passed, 1 failed (sidebar width read before hydration; fixed with expect.poll, then 3/3 passed), 3 device skips. Earlier run: 58 passed / 5 failed (brittle assertions fixed; registry test timed out under worker load and passed on rerun: work-order + research specs 25 passed, 1 skip). | 2026-10-29 |
npx playwright test (ports 3300/8300) | Part A 69 passed; Part B 71 passed; Parts C-E 71 passed + 2 new tests fixed for exact names (4/4); 3 device skips | 2026-10-29 |
npx playwright test (ports 3300/8300) | 79 passed, 3 device skips | 2026-10-30 |
screenshots of the Overview on localhost at 1920, 1366 and Pixel 7 | no horizontal overflow at any width | 2026-10-30 |
Navigation per roadmap 5.2. Sections built by later phases (Live Gold and Market Structure: 08; Demo/Paper and Positions: 13; Risk: 14; Accounts: 15; Telegram: 17; Reports: 20) say so and show no values. Live updates use polling; SSE is not needed while no source changes faster than the polls (DECISIONS 2026-10-27).
Last updated 2026-10-30
08 Technical Indicators and Market StructureBuild transparent, testable technical analysis. COMPLETE100%
Exit criteria
- Each label is reproducible from documented rules.every emitted kind has a rule text (test asserts it); hand-built fixtures reproduce each label
- Historical signals do not use future candles unavailable at decision time.prefix tests: events known by bar n never change when bars are appended; HTF alignment never ahead of the lower bar's close
- UI shows method/version and timestamp.chart header and label details: method version, run id, computed time, observed and known-at timestamps; detector_runs stores each run
- Edge-case tests pass.ATR warm-up, gaps reset levels, incomplete HTF windows excluded, invalid higher timeframe rejected
Deliverables
- Feature/structure engineadvanced.technical_analysis advanced-0.4.0: EMA12/20/26/50, ATR14, RSI, MACD, volatility, swings, HH/HL/LH/LL, BOS/CHoCH, FVG, S/R, liquidity, order-block hypotheses, session labels, higher-timeframe alignment
- Detector documentationdocs/TECHNICAL_ANALYSIS_RULES.md (advanced-0.4.0 table) + `rules` text returned with every calculation
- Unit testsbackend/tests/test_advanced.py + test_structure_detectors.py (hand-calculated ATR, S/R, liquidity, order blocks, prefix invariance, HTF alignment)
- Chart overlayssrc/components/structure-chart.tsx on Market Structure and Live Gold: overlays, toggles, confirmation-delay connectors, replay, label details
Work
- Implement EMA, ATR, volatility, swing highs/lows, HH/HL/LH/LL, support/resistance, BOS, CHoCH, FVG, order-block hypotheses, liquidity zones, and session features.
- Define exact rules and invalidation logic for each detector.
- Add multi-timeframe alignment without future-data leakage.
- Add unit tests with known synthetic candles and edge cases.
- Store detector version and parameters.
- Add chart overlays and details explaining why each label exists.
- Make repainting/confirmation delays visible.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_advanced.py backend/tests/test_structure_detectors.py -q | passed: 45 passed | 2026-10-27 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 234 backend tests passed, build compiled | 2026-10-27 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 38 passed, 2 device skips (desktop + mobile Edge, clean dev cache) | 2026-10-27 |
GitHub Actions ci #11 (commit 04b524d: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed: completed successfully, 5m 54s | 2026-10-27 |
advanced-0.4.0. Default tolerances are conventions recorded with each run, not optimised values. Chart workspace replaces the Phase 07 placeholders for Live Gold (Dukascopy store, historical bars) and Market Structure (saved datasets). News-event markers on the chart and COT studies belong to Phase 09.
Last updated 2026-10-27
09 News Impact and Gold Event StudiesMeasure how gold historically behaved around macro/news events. COMPLETE100%
Exit criteria
- Reports show sample size and data limitations.counts block (selected / outside bar window / incomplete / overlapping / used / baseline) + limitations list incl. small-sample warning under 10
- Overlapping events are flagged.occurrence.overlaps lists every other high-impact release from the pre-window to the longest horizon (same minute included); include-and-flag or exclude; clean-only statistics alongside
- Results are descriptive/statistical, not presented as guaranteed causal effects.first limitation states association only and not a trading rule; surprise never labelled good/bad for gold
- Reproducible event studies are saved.event_studies table (migration 009): parameters, event ids, bar range, SHA-256 fingerprint; test asserts identical fingerprint and occurrences on rerun
Deliverables
- Event-study enginebackend/research/event_studies.py (event-study-1): MT5 calendar releases joined to MT5 M1 bid bars; pre-move, returns per horizon, range, max up/down, volatility; surprise vs MT5 forecast, session, prior 24 h regime; baseline windows. Per-dataset engine.event_study kept for imported journals
- News impact reportPOST /events/studies and /events/cot-studies, GET /events/studies/{id}: counts, overall and grouped statistics (n, mean, median, 95% interval, share up), baseline comparison, analogues, every occurrence, limitations
- Dashboard visualizationsNews & Economic Calendar → Calendar event studies panel: horizon table vs quiet days, surprise/session/regime groups, historical analogues, every release with overlap flags, saved studies list
- Event-study testsbackend/tests/test_event_studies.py (4) + test_engine event_study tests + Playwright panel/endpoint check
Work
- Join event timestamps with quality-checked gold prices.
- Calculate configurable pre/post-event returns, volatility, range, and adverse/favourable movement where granularity permits.
- Compare event outcomes by surprise size, session, and prior market regime where data supports it.
- Track sample size, uncertainty, event overlap, and missing data.
- Compare with baseline windows.
- Create a news-event report and historical analogue view.
- Do not encode a universal rule such as 'strong USD always means gold falls.'
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_event_studies.py backend/tests/test_mt5_calendar.py -q | passed: 15 passed | 2026-10-28 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 243 backend tests passed, build compiled | 2026-10-28 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 38 passed, 2 device skips (desktop + mobile Edge) | 2026-10-28 |
Real data: POST /events/studies (NFP, Jobless Claims, all USD high) and /events/cot-studies on a copy of the workspace | passed: NFP 3 used (232 outside the M1 window), 15-min median |move| 1.32% vs 0.21% on quiet days; all USD high 121 used, 100 flagged overlapping; COT 12 weeks used; rerun gives the same fingerprint | 2026-10-28 |
GitHub Actions ci #15 (commit df875f1: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed: completed successfully, 6m 41s | 2026-10-28 |
event-study-1. MT5 calendar times corrected (export-time offset, migration 008): summer events had been one hour early. M1 history starts 2026-07-17, so samples are small (NFP 3, Jobless Claims 14, COT 12 weeks); every report says so. Conventions (5-min staleness, ±0.5 surprise z, ±0.5% regime, 5 baseline days) are recorded with each study, not optimised.
Last updated 2026-10-28
10 Strategy Registry and Research MemoryTrack hypotheses, experiments, and learning in a structured way. COMPLETE100%
Exit criteria
- Every experiment is reproducible from stored configuration and data references.data_ref must resolve to a stored dataset (sha256 pinned) or a market range; result_ref must exist; backtests keep parameters + dataset sha256
- Approved versions are immutable.rules never updated; new versions are new rows in the lineage with rules_sha256; AI actor refused (403) on APPROVED/LIVE_LIMITED/PAUSED and on approval
- State transitions are validated and audited.roadmap 9.1 states, one gate at a time, evidence gates (backtest, walk-forward), closed gates for demo/shadow/live; strategy_transitions rows + audit events, refusals audited
Deliverables
- Strategy registry API/UIbackend/research/registry.py: /strategies (search by text, state, lineage), /strategies/{id}/versions, /transition, /transitions; Strategies tab with next-state moves, reasons and new versions
- Experiment databaseexperiments table (migration 010): hypothesis, data_ref with pinned dataset sha256 or market range, feature set, configuration, result_ref, one-time outcome; /experiments search + Experiment registry panel
- Research memory recordsevidence_snapshots (hashed, insert-only), research_notes kind note/failure_review with what_failed / suspected_cause / lesson
- State-transition testsbackend/tests/test_registry.py (5) + Playwright registry test
- Work order Part 3 items 20, 21, 26: bot strategies S1 SMC, S2 volume profile (demo priority), S3 session breakout, S4 news pulse (research only) as versioned engine-'bot' registry entries; buy and sell; reward:risk 1:3 editable as a new version; S1/S2 only in London/New York; normal gates; Case B offbackend/research/bot.py, migration 021, docs/TECHNICAL_ANALYSIS_RULES.md (Trading bot strategies), docs/STRATEGY_LIFECYCLE.md
Work
- Create strategy and strategy-version entities.
- Store immutable rule snapshots and configuration.
- Add experiment registry, hypothesis, data range, feature set, and outcome.
- Store decision-time evidence snapshots for each signal.
- Add failure-review records and research notes.
- Create lifecycle states and allowed transitions.
- Add search/filter UI for experiments and versions.
- Prevent an AI model from overwriting an approved strategy version.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_registry.py backend/tests/test_mt5_history.py -q | passed: 15 passed | 2026-10-28 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 251 backend tests passed, build compiled | 2026-10-28 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 40 passed, 2 device skips (desktop + mobile Edge) | 2026-10-28 |
GitHub Actions ci #17 (commit 229d714: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed: completed successfully, 4m 45s | 2026-10-28 |
Migration 010 rebuilds strategies (old research/archived -> RESEARCH/RETIRED, each its own lineage). SHADOW, PENDING_APPROVAL and LIVE_LIMITED gates stay closed until demo/shadow evidence exists (Phases 15-18). Promotion thresholds remain an open owner decision. Also in 0.12.0: Exness XAUUSDm primary dataset (owner 2026-10-28), news markers on the chart.
Last updated 2026-10-29
11 Backtesting EngineEvaluate strategies with realistic and reproducible assumptions. COMPLETE100%
Exit criteria
- Re-running a fixed experiment produces consistent results within documented tolerances.deterministic engine; dataset sha256, parameters, cost profile version and code commit stored
- Cost assumptions are visible.per-unit costs, measurement basis (ticks/days, spec capture), slippage multiple and swap in every result and the UI; sensitivity table
- Data leakage tests pass.next-open execution; stop/target from the signal bar's ATR; out-of-sample split by bar index; existing leakage tests
- Inadequate sample size returns INCONCLUSIVE, not PASS.fewer than 200 trades, no profit factor, < 4 walk-forward windows, no demo/shadow records, synthetic data -> INCONCLUSIVE (test_promotion)
Deliverables
- Backtesting serviceengine.run_backtest 0.3.0: next-open fills, ATR stop/target (stop first on a same-bar touch, gap fills at the open), timeout, swap per weekday rollover with triple day, cost sensitivity; POST /backtests
- Report/metrics schemabacktests result: metrics + out_of_sample block + buy-and-hold benchmark + sensitivity + promotion gates + code_version (engine + git commit) + cost_profile_version
- Backtest UIBacktesting Lab: owner cost profile button, exits & financing inputs, PASS/FAIL/INCONCLUSIVE with gates, out-of-sample, benchmark, sensitivity; cost profile & threshold editor
- Regression datasets and teststest_engine (stop/target same bar, gap, timeout, swap nights, out-of-sample, benchmark, sensitivity), test_promotion, test_registry gates
- Work order Part 3 items 23-25: tick-level backtester (bid/ask fills, slippage, swap, SL/TP/breakeven on ticks, pre-news Case C/A, weekend close, 1% lots on the Exness spec, all Risk Center limits), results by year/session/side/news/regime, out-of-sample and walk-forward against the owner thresholds; continuous background worker over 2003-2026; daily preparation before London; live signal path that never waits for a backtestbackend/research/bot.py; scheduled task 'AI Gold Bot Research' (10 min); Backtesting Lab and Strategy Registry 'Trading bot · S1-S4'
- Work order #2 Part A: S1-S4 diagnostics - gross R before costs, net R, costs as % of risk, win rate, average win/loss, MFE/MAE quartiles, 2015-2026 separately, best reward:riskbackend/research/bot.py diagnose()/excursion(); Backtesting Lab -> Trading bot -> Details -> Diagnosis
- Work order #3 item 3: per-setup statistics of ALL setups for S1-S4 and discovered strategies on the Backtesting Lab and Strategy Registry/bot/diagnostics, discovery.rule_diagnostics, src/components/trading-bot.tsx
Work
- Build a deterministic bar-based backtest engine.
- Support entries, exits, SL/TP, partial exits if defined, timeouts, and position state.
- Include spread, commission, slippage, swap/financing and broker symbol rules where data is available.
- Handle bars where SL and TP could both be touched using conservative assumptions or finer data.
- Prevent look-ahead and leakage.
- Store data snapshot, strategy version, configuration, code version, metrics, warnings, and logs.
- Add backtest job queue and resource limits.
- Add benchmark, sensitivity, and walk-forward support.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_engine.py backend/tests/test_promotion.py backend/tests/test_registry.py backend/tests/test_dukascopy_csv.py -q | passed: 51 + 5 + 5 + 3 | 2026-10-28 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 263 backend tests passed, build compiled | 2026-10-28 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 42 passed, 2 device skips (desktop + mobile Edge) | 2026-10-28 |
Real data (copy of the workspace): Dukascopy H4 bid 2003-2026 (36,930 bars), EMA 20/50, stop 2 ATR, target 4 ATR, owner cost profile v1 (spread 0.420, slippage 0.420, commission 0, swap long -0.49 USD/oz/night) | passed (engine) / strategy FAIL: 341 trades (PASS), out-of-sample PF 0.80 on 109 trades (FAIL), max drawdown 10.85% (PASS), walk-forward 1 of 4 windows profitable (FAIL); buy-and-hold -4.42% with swap; 2.0 s | 2026-10-28 |
GitHub Actions ci #19 (1100039) and #20 (db7fa5e: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | #19 failed in 33 s: numpy was installed only on Windows (MetaTrader5 dependency); #20 passed after numpy became a direct requirement, 4m 6s | 2026-10-28 |
.venv/Scripts/python -m pytest backend/tests/test_bot.py -q | 10 passed | 2026-10-29 |
python -m backend.research.bot work (live workspace, Dukascopy 2003-2026) | Full pass 2003-2026 in 32 min (all 4 strategies, 24 years each). Setups: S1 3 205, S2 55 211, S3 5 104, S4 3 146. With all rules (15% drawdown pause) every whole-history account pauses within 12-25 trades; no year is profitable from a fresh account; mean setup R is negative in every session and side (S4 New York -0.27 R best). Promotion: S1-S4 FAIL (walk-forward 0/5). Main cause: spread + 1x-spread slippage against tight M5 stops (2004: 0.44 USD spread vs 1.45 USD stop). | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_bot.py -q | 14 passed | 2026-10-29 |
python -m backend.research.bot work (diagnostics, 2003-2026) | gross R per setup ~0 before costs (S1 -0.056, S2 -0.031, S3 -0.043, S4 +0.011); costs 28-79% of risk (tight M5 stops); no reward:risk with a positive expectancy (best: S1 2015-2026 1:1.25 at -0.078 R, S4 -0.148 R) | 2026-10-29 |
Owner decisions 2026-10-28 for costs and promotion thresholds (migration 011). Commission 0 cannot be confirmed from the terminal (no commission field in the MT5 symbol spec; no trade deal yet). Backtests are bounded synchronous jobs (<= 50,000 candles); walk-forward/bootstrap/ML use the durable single-worker queue (max 10). Partial exits: no strategy defines them yet. Work order 2026-10-29 Part 3: none of S1-S4, as specified, passes the owner thresholds on 2003-2026; nothing is promoted automatically. Work order #2 Part A: S1-S4 have no edge before costs and the spread + slippage take 28-79% of the risk; this led the discovery engine to wider ATR stops, setup targets and filters.
Last updated 2026-10-29
12 Model Evaluation and Controlled ML ResearchAdd machine learning only where it improves evidence-based research. COMPLETE100%
Exit criteria
- Models are evaluated on unseen periods.walk-forward test blocks after train/validation with embargo; the stored artifact never saw its last block; drift checks only on samples after calibration
- Baseline comparison is documented.rule-based baselines (up-frequency, last-bar persistence) in every block and pooled; docs/RESEARCH_GUIDE.md Phase 12
- No model can directly bypass strategy promotion or risk controls.only app/evaluations/ml read the registry (test); approval changes no strategy (test)
- Models with weak/insufficient evidence remain research-only.approve returns 409 unless evidence PASS; synthetic, fewer windows, non-significant after Bonferroni = not PASS (tests)
Deliverables
- ML experiment frameworkml.evaluate (ml-walk-forward-1) on the durable evaluation queue, kind ml_walk_forward; Strategy Registry panel
- Model registrymigration 013 ml_models + ml_drift_checks; /models register, approve (PASS + owner re-auth), retire, drift
- Evaluation reportsper-block model/baseline metrics, pooled significance, calibration table, regimes, PSI drift; stored with SHA-256 and exportable
- Leakage and reproducibility teststest_ml.py: causal features, chronological splits with leakage guard, identical reports for identical inputs
- Work order Part 3 item 22: per-strategy meta-label filter (TAKE/SKIP) on session, news distance, COT bias, volume, trend strength, volatility, spread; chronological 50/20/30 split, walk-forward, Bonferroni; filter only, never a gatebackend/research/bot.py meta_label; backend/tests/test_bot.py::test_meta_label_only_filters; test_ml.py guard narrowed to ml.fit/ml.predict
- Work order #2 Part B: strategy discovery engine - building blocks (structure, OB/FVG, liquidity sweep, volume profile, sessions, news timing, COT, volatility, candle patterns, H4->M5), stops from structure/ATR, targets at R multiples or the setup's level, tick outcomes, train/validation/test with Bonferroni, walk-forward, account gates; survivors versioned in the registry; runs every 15 minutesbackend/research/discovery.py, migration 023, task 'AI Gold Strategy Discovery', Backtesting Lab -> Strategy discovery, docs/AI_TRADER.md
- Work order #2 Part C: AI brain - Claude (official SDK), Gemini, OpenAI-compatible (Grok, OpenRouter, Groq, local); providers/models editable in the dashboard; encrypted key manager with priority, automatic failover, statuses, Test key and alerts; versioned prompt files with input contract and output schema; schema validation with fallback; call journal; no LLM in backtestsbackend/research/brain.py, backend/research/prompts/, migration 024, /ai page, monitoring check ai_keys
- Work order #3 Part E: LLM cost control - cost per call, daily budget per key with failover and alert, credit and days left, prompt caching of the static part, model routing per purpose, explain and ideas endpointsbackend/research/brain.py, migration 027, /ai page
- Work order #4 Part D: LLM only when needed (news window asked once per phase), routed key answers first and shows active, Groq /models picker, duplicate key warningbackend/research/brain.py (_order, list_models, duplicate_of), autopilot.llm_reason
Work
- Establish rule-based baseline before ML.
- Define feature generation and target labels without leakage.
- Split data chronologically into training, validation, and test sets.
- Add walk-forward evaluation, calibration, robustness checks, and drift monitoring.
- Store model artifacts and metadata securely.
- Prevent arbitrary online learning from directly changing live strategy behaviour.
- Compare ML with simple baselines and account for multiple-testing/overfitting risks.
- Require reproducible experiments and model approval.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_ml.py -q | passed: 6 passed | 2026-10-28 |
.venv/Scripts/python -m pytest backend/tests/test_mt5_calendar.py -q (release delay, owner decision 4) | passed: 12 passed | 2026-10-28 |
Real data, Dukascopy bid, ml_walk_forward 4 blocks (read-only, market store) | H4 2003-10-28..2026-10-27 (36,930 bars): INCONCLUSIVE, 1 of 4 blocks beat the better baseline, p = 0.49, max PSI 0.89 (volatility); H1 2019-01-01..2026-10-27 (46,262 bars): FAIL, pooled log loss 0.69963 vs prior 0.69078, max PSI 2.69; D1: no 20-bar gap-free run (weekends), refused. No ML edge found; nothing leaves research. | 2026-10-28 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 270 backend tests passed, build compiled | 2026-10-28 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 44 passed, 2 device skips (desktop + mobile Edge) | 2026-10-28 |
GitHub Actions ci #22 (be560d5: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed, 4m 58s | 2026-10-28 |
.venv/Scripts/python -m pytest backend/tests/test_discovery.py backend/tests/test_brain.py -q | 10 passed | 2026-10-29 |
python -m backend.research.discovery work (2003-2026) | 122 658 events, 97 008 candidates, 27 kept after training, 4 tested on unseen data (alpha 0.0125), 1 survivor D-c6b350 (VP acceptance buy, Asia, COT with, normal volatility, 2 x ATR M15 stop, level target; test p 0.012, walk-forward 4/5) - account gate INCONCLUSIVE (45 trades, PF 0.60): stays at BACKTEST, nothing reached DEMO | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_brain.py -q | 7 passed | 2026-10-29 |
replay of the recorded M5 scans 2026-10-29 18:45 - 2026-10-30 05:30 UTC under the new rules | 9 LLM calls (5 London/NY reviews, 4 setups) instead of 101 recorded decision calls in the last 24 h ($1.39) | 2026-10-30 |
.venv/Scripts/python -m pytest backend/tests/test_brain.py -q | 8 passed | 2026-10-30 |
Section 24 report. 1) Implemented: ml-walk-forward-1 (causal features, next-bar labels, chronological train/validation/test with embargo and leakage guard, L2 logistic + Platt calibration on validation, rule-based baselines, per-block and pooled metrics, Bonferroni significance, regimes, calibration, PSI drift), model registry with approval gate and drift checks, UI panel. 2) Files: backend/research/ml.py, evaluations.py, app.py, migration 013; src/components/research-models.tsx, research-strategies.tsx, research-types.ts, proxy route; tests test_ml.py, research.spec.ts; docs RESEARCH_GUIDE, DATA_DICTIONARY, DECISIONS. 3) DB/API: ml_models, ml_drift_checks; POST /evaluations kind ml_walk_forward; GET/POST /models, /models/{id}/approve|retire|drift. 4) Tests: see the table. 5) Limits: one feature set and one label (next-bar direction); the pooled z-test assumes independent samples; a PASS is classification evidence only, not a strategy. 6) Security/risk: approval needs owner re-authentication and PASS evidence; no strategy, risk or order code reads models. 7) All exit criteria met. 8) Next: Phase 13; no owner decision needed to start. Conventions chosen here (not owner values): L2 1.0, alpha 0.05 with Bonferroni, PSI 0.25, defaults 50 % history / 25 % validation / embargo 1.
Last updated 2026-10-30
13 Demo/Paper Trading EngineEvaluate signals in a non-live environment. COMPLETE100%
Exit criteria
- Demo orders never reach a live account.no order function exists (test); broker read refuses non-demo accounts (test); LIVE/DEMO flags false
- State reconciliation works.paper journal replay MATCH, tampering MISMATCH (test); Exness demo terminal MATCH (real)
- All trades and rejected orders are recorded.paper_orders FILLED/REJECTED with reasons, blocked previews, reconciliations table
- Environment label is visible everywhere.PAPER header/badge and Mode column on /paper and /positions; mode field in every paper/demo API result
Deliverables
- Demo/paper engineoperations.py previews/fills/rejections/closes + demo.py journal, reconciliation
- Demo account UI/paper and /positions (PAPER), broker demo check (read-only)
- Trade journalGET /paper/accounts/{id}/journal: signal snapshot, fills, outcomes, rejections, P&L, drawdown, execution costs
- Environment-isolation teststest_demo.py: non-demo accounts refused unread; no order function in backend or MQL5
Work
- Create explicit paper mode and, when available, connect to a broker demo account.
- Simulate order lifecycle, spread/slippage assumptions, rejected orders, and fills.
- Reconcile demo account positions with the internal state.
- Record signal-time snapshots and trade outcomes.
- Add demo P&L, drawdown, and execution-quality views.
- Label every screen and message with DEMO/PAPER.
- Add tests proving demo configuration cannot route to live credentials.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_demo.py -q | passed: 4 passed | 2026-10-28 |
.venv/Scripts/python -m backend.research.demo (read-only, real terminal) | MATCH: Exness Technologies Ltd, Exness-MT5Trial15, demo, USD; 0 positions, 0 pending orders | 2026-10-28 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 274 backend tests passed, build compiled | 2026-10-28 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 46 passed, 2 device skips (desktop + mobile Edge) | 2026-10-28 |
GitHub Actions ci #23 (52e666e) and #24 (b43498d: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed: #23 5m 36s, #24 passed | 2026-10-28 |
Section 24 report. 1) Implemented: trade journal with signal-time snapshots, P&L, realized drawdown, execution costs; paper reconciliation by journal replay; read-only broker demo reconciliation (demo accounts only); PAPER UI on /paper and /positions; tick size/value in the recorded symbol spec. 2) Files: backend/research/demo.py, app.py, mt5_history.py, migration 014; src/components/paper-trading.tsx, pages paper/positions, sections.ts, research-types.ts, proxy route; tests test_demo.py, research.spec.ts; docs. 3) DB/API: reconciliations; GET /paper/accounts/{id}/journal, POST /paper/reconcile, POST /demo/reconcile, GET /reconciliations. 4) Tests: see the table. 5) Limits: paper is long-only, cash-funded, no mark-to-market or automatic stops (unchanged engine); paper orders need a risk policy, which the Risk Center sets in Phase 14; broker demo orders start in Phase 15. 6) Security/risk: no order function anywhere; non-demo accounts are refused unread; no account number stored. 7) All exit criteria met. 8) Next: Phase 14; stop point: the pre-news 'likely to hit SL' rule proposal needs owner approval.
Last updated 2026-10-28
14 Risk, Money Management, and Lot SizingBuild an independent hard-gate risk engine before broker execution. COMPLETE100%
Exit criteria
- Invalid/stale inputs reject an order.stale quote/equity, missing fields, unset thresholds, bad prices and specs block (tests)
- Hard limits cannot be bypassed by a strategy or model.settings written only by the re-authenticated endpoint (test); no strategy/model code calls it
- Risk preview matches test fixtures.1040 USD per lot -> 0.09 lots; USC 104000 -> 0.09; EUR at 0.5 -> 0.19
- No live orders are enabled yet.mode live always blocks; no order function exists
Deliverables
- Risk enginerisk.assess, pre_news_decision (Case A, B, C), news_state, breakeven_stop; Case B off by default (owner)
- Lot-sizing previewPOST /risk/check with explanation; Risk Center preview from the terminal spec
- Risk configuration UI/risk: owner settings with re-authentication, kill switch, resume
- Risk audit trailrisk_decisions with input snapshots; audit events for every check, change, halt and resume
- Extensive unit teststest_risk.py: fixtures, USC, conversion, rounding, stale/missing, limits, news, Case A/C
- Work order #4 Part C: news window currencies and medium/low impact options in the Risk Center (default high-impact USD), re-authentication + auditbackend/research/risk.py news_filter, src/components/risk-center.tsx
Work
- Implement lot-size calculation using actual symbol specifications, stop distance, account currency, tick/contract value, cost assumptions, broker volume step and margin constraints.
- Round volume down and reject if minimum permitted volume exceeds risk policy.
- Implement per-trade/open-risk/daily/weekly/drawdown/exposure/margin/news/spread/stale-data limits.
- Add preview API and risk explanation.
- Store each decision and input snapshot.
- Add kill switch and pause state.
- Add tests for missing data, stale equity, currency conversion, unusual contract specs, and rounding boundaries.
- Ensure AI cannot alter hard limits.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_risk.py -q | passed: 9 passed | 2026-10-28 |
.venv/Scripts/python -m backend.research.news_backtest (Dukascopy, read-only) | 9,235 USD high-impact releases, 39 event codes, 59 s. Stop 1/TP 2 ATR: keep mean +0.029 ATR; Case A 25 closes, 15 SL-first (60%), saved -0.088 ATR. Stop 2/TP 4 ATR: keep mean -0.008 ATR; Case A 26 closes, 16 SL-first (62%), saved +0.290 ATR. Case B not run (definitions pending). | 2026-10-28 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 284 backend tests passed, build compiled | 2026-10-28 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 48 passed, 2 device skips (desktop + mobile Edge) | 2026-10-28 |
GitHub Actions ci #26 (e5c5611: format, typecheck, ruff, backend tests, roadmap diff, build, Playwright) | passed, 6m 35s | 2026-10-28 |
.venv/Scripts/python -m pytest backend/tests/test_risk.py -q (owner values, Case B) | passed: 10 passed | 2026-10-29 |
.venv/Scripts/python -m backend.research.news_backtest (Case A/B/C, Dukascopy) | 9,235 releases, 28.5 s. Case B applies to 102 positions: stop 1 ATR B a +0.039 vs keep +0.059 ATR (23 wins/42 losses); stop 2 ATR B a -0.114 vs keep -0.064 (27/57); B c: 58 confirmed, 35 continued (60%), 23 failed. Case A/C unchanged. | 2026-10-29 |
Exness XAUUSDm spread reference (last 24 h of stored M1) | median 0.240, average 0.240 over 1,378 bars (2026-10-27T19:04Z..2026-10-28T19:04Z): max spread 0.72, max slippage 0.24 | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_risk.py -q | 10 passed | 2026-10-30 |
Section 24 report. 1) Implemented: owner risk settings with re-auth + audit, risk engine with lot sizing (USD/USC/conversion), all owner limits, stale/missing input blocks, news blackout, kill switch and drawdown pause, pre-news Case A + C, breakeven rule, decisions store, Risk Center UI, Case A/C backtest. 2) Files: backend/research/risk.py, news_backtest.py, app.py, mt5_calendar.py (BOJ), migration 015; src/components/risk-center.tsx, risk page, sections.ts, proxy; tests test_risk.py, dashboard.spec.ts. 3) DB/API: risk_settings, risk_halt, risk_decisions, risk_backtests; /risk/settings, halt, resume, news, check, pre-news, decisions, news-backtest. 4) Tests: see the table. 5) Limits: Case B is off (owner decides after the backtest); B b only unit-tested; spread reference = last 24 h of stored Exness M1 bars; the older paper engine keeps its own policy. 6) Security/risk: only re-authenticated owner changes limits; live always blocked. 7) All exit criteria met. 8) Next: Phase 15 read-only adapter.
Last updated 2026-10-30
15 MT5 Broker Adapter (Demo First)Establish real broker/terminal integration safely. COMPLETE100%
Exit criteria
- Read-only sync is reliable.real Exness demo sync ok in 0.44 s; failures become unavailable/refused, never exceptions (tests)
- Demo order lifecycle is tested with explicit confirmation.Owner authorized demo orders in writing (work order #2 item 11). Previews a02d3ca1 and b350de17 BLOCKED by the risk engine (news blackout; 0.01 lot over 1% of 100 USD). First demo order through the demo AI path: ticket 2659776381 buy 0.01 XAUUSDm @ 4024.782, SL 4024.222, TP 4027.222, retcode 10009 FILLED; closed at the stop -0.56 USD (-1.0 R), synced from the broker deals.
- No secret appears in logs.password encrypted, never returned; audit and snapshot checked (test)
- Live execution remains disabled.real accounts refused before sending (test); LIVE_TRADING_ENABLED=false
Deliverables
- MT5 adapterbrokers.Mt5Adapter behind the common interface; read-only sync, health, reconciliation, demo-only orders
- Demo integration teststest_brokers.py with a mocked terminal; real read-only sync on Exness demo; first real demo order awaits the owner
- Broker setup guidedocs/BROKER_ADAPTERS.md
- Connection/health UI/accounts
- Work order #2 Part D: demo AI mode - demo-only guard, kill switch and maintenance stop it, live snapshot, LLM decision checked before execution, open/move SL-TP/breakeven/trail/partial/close with a reason each, broker_orders + trade journal + decision journal, R from deals, demo report pagebackend/research/autopilot.py, migration 025, task 'AI Gold Demo AI' (1 min), /demo-ai page
- Work order #3 Part A/E: rule scans on every closed M5 bar, LLM called only when needed (setup, open trade, news window, 30-minute London/New York review), journal states the actual fill and riskbackend/research/autopilot.py (llm_reason, strategy_scans, migration 026)
- Work order #4 Part B: demo evidence mode - S1-S4 and all discovered strategies on demo, prompt trader-v2 (negative evidence is no reason to refuse; AI chooses SL/TP/risk and may exceed owner settings on demo)backend/research/autopilot.py, prompts/trader/v2
Work
- Confirm exact broker, MT5 terminal environment, account type, server, and symbol naming.
- Implement a separate adapter behind the common broker interface.
- Connect read-only first; retrieve account metadata, symbol specifications, quotes, positions, and orders.
- Add connection health, timeouts, reconnection, and reconciliation.
- Test demo order placement only after read-only checks and risk preview pass.
- Handle partial fills, rejections, disconnects, and ambiguous order acknowledgements.
- Keep live order path disabled.
- Document installation and terminal dependencies on Windows VPS.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_brokers.py backend/tests/test_demo.py -q | passed: 9 passed | 2026-10-29 |
brokers.sync(Mt5Adapter(), 'XAUUSDm') on the real terminal (read-only) | ok: Exness-MT5Trial15 demo, equity 100 USD, leverage 2000, tick 0.001 = 0.1 USD, margin 203.01/lot, ping 259 ms, 0.44 s, AutoTrading off | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_autopilot.py -q | 6 passed | 2026-10-29 |
python -m backend.research.autopilot first-order (Exness-MT5Trial15 demo) | FILLED ticket 2659776381, closed at SL -1.0 R; demo AI mode switched on; cycle: no_decision (no API key yet) | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_autopilot.py -q | 8 passed | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_autopilot.py -q | 9 passed | 2026-10-30 |
.venv/Scripts/python -m pytest backend/tests -q (work order #5) | passed: 385 passed | 2026-11-03 |
brokers.sync(Mt5Adapter(), 'XAUUSDm') on the real terminal (read-only) | ok: Exness-MT5Trial15 demo, balance 208.16 USD, build 6230, ping 253 ms, 0.22 s | 2026-11-03 |
Section 24 report. 1) Common broker interface, MT5 adapter, sync/health/reconciliation, owner-confirmed demo-only order lifecycle, /accounts UI, setup guide. 2) Files: backend/research/brokers.py, app.py, migration 017; src/components/broker-connections.tsx, accounts page, sections, proxy; tests test_brokers.py, test_demo.py, dashboard.spec.ts; docs. 3) DB/API: broker_connections, broker_syncs, broker_orders; /brokers, /brokers/{id}, /sync, /orders/preview, /orders/{order}/confirm. 4) Tests: see the table. 5) Limits: close/modify/cancel exist in the adapter but have no endpoint yet; one terminal per connection. 6) Security: no secret in logs; demo-only send re-checked at send time; live refused. 7) Open: the first real demo order (owner). 8) Next: Phase 16. Work order #5 re-verification 2026-11-02/03: every exit criterion re-checked (read-only sync ok in 0.22 s; demo orders FILLED by the demo AI and the drills; no secret in logs; real accounts refused unless the live pilot creates the adapter with allow_real after every precondition). Nothing was missing.
Last updated 2026-10-30
16 MT4 Adapter and Broker Compatibility FrameworkAdd MT4 support without assuming it behaves like MT5. PARTIAL90%
Exit criteria
- Supported MT4 setup passes demo tests.everything built and tested with mocks (9 tests); the last test needs the owner's MT4 demo terminal with the EA attached (docs/BROKER_ADAPTERS.md, 9 steps)
- Unsupported configurations fail safely and explain why.missing/stale/unreadable bridge, wrong symbol, no secret, real account, foreign ticket, bad signature, expired command: refused with the reason (tests)
- MT4 and MT5 credentials/adapters remain isolated.separate adapters, connection rows and secrets (bridge secret encrypted per connection)
Deliverables
- MT4 adapter or a documented compatibility blockermt4_bridge.Mt4Adapter + AIGoldBridge.mq4 (read-only); blocker: no MT4 terminal to validate
- Bridge security designdocs/BROKER_COMPATIBILITY.md
- Compatibility test suitetest_mt4_bridge.py on fixture files
- Broker compatibility matrixdocs/BROKER_COMPATIBILITY.md
- Work order #5: signed command bridge - EA v2 executes HMAC-SHA256-signed commands (open with SL/TP, close, modify, cancel), demo-only on both sides, 30 s command lifetime, at-most-once ids, magic-number guard, stop always set; adapter submit/close/modify/cancel, deals from closed orders, UNKNOWN on a lost answermt4/AIGoldBridge.mq4 v2, backend/research/mt4_bridge.py, brokers.py (MT4 previews), Accounts form (bridge secret)
Work
- Evaluate the selected broker's MT4 interface and terminal requirements.
- Implement a separate MT4 bridge/EA/API adapter as technically supported.
- Define message schema, authentication, heartbeat, retries, idempotency, and reconciliation.
- Test account information, symbol specs, quotes, orders, fills, stops, and error cases.
- Add a compatibility matrix by broker, terminal version, and account type.
Blockers / decisions needed
- Owner: open an Exness MT4 demo account, install MT4, compile and attach mt4/AIGoldBridge.mq4 with a bridge secret (docs/BROKER_ADAPTERS.md 'MT4 demo terminal and bridge EA'), add the MT4 connection with the same secret, Sync now, one demo order preview -> confirm.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_mt4_bridge.py -q | passed: 4 passed | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_mt4_bridge.py -q | passed: 9 passed (fixtures + Python stand-in for the EA command loop, RFC 4231 HMAC vector) | 2026-11-03 |
Section 24 report. 1) Read-only MT4 bridge EA and adapter, compatibility matrix, bridge security design. 2) Files: mt4/AIGoldBridge.mq4, backend/research/mt4_bridge.py, tests/test_mt4_bridge.py, docs/BROKER_COMPATIBILITY.md, BROKER_ADAPTERS.md. 3) No DB change; MT4 connections use broker_connections (platform mt4). 4) Tests: see the table. 5) Limits: EA not compiled or run here; MT4 orders not bridged. 6) Security: EA writes no account number or credential, reads no command. 7) Open: MT4 demo validation (owner terminal). 8) Next: Phase 17.
Last updated 2026-11-03
17 Telegram Public and Private Channel IntegrationDeliver reliable, secure trade/news notifications. PARTIAL95%
Exit criteria
- Public and private destinations cannot be confused.explicit visibility; public only when approved and sanitised (test)
- Retries do not create duplicate messages.UNIQUE(event_id, destination_id); a SENT row is never resent (test)
- Messages distinguish signal, simulated trade, demo execution, and live execution.mode line SIGNAL/PAPER/SHADOW/DEMO; live refused (test)
- No secret or private account identifier is published.tokens encrypted and masked; public text without balance/account/ticket (test)
Deliverables
- Telegram settings UI/telegram
- Outbox/workertelegram_outbox + telegram.deliver (python -m backend.research.telegram)
- Public/private message templatestelegram.render for all roadmap 14 kinds, public sanitised
- Delivery history and testsoutbox table and UI; test_telegram.py with a mocked Bot API
- Work order #5: send test message per destination, bot enable/disable, destination removal (history kept), demo AI trade events (opened with chart screenshot, SL/TP, partial, TP hit/closed with R) from broker confirmations, LIVE messages only while the live switch is on, confidence + live state in the daily reportbackend/research/telegram.py (send_test, notify), autopilot.py, monitoring.py, telegram-center.tsx
- Telegram test message SENT on the Contabo VPS (bot 'MD Gold Trading', private destination, purposes signals/alerts/system)owner, 2026-11-12, Telegram Center 'Send test message' on https://gold.mdclothstore.com (release 0.34.2); reports bot still open
- 0.34.3 (work order #14 D): a network failure shows its underlying reason (for example 'network: URLError: ... CERTIFICATE_VERIFY_FAILED ...') in the outbox and the test result, the token maskedtelegram.deliver / send_test; test_network_errors_keep_the_reason_but_never_the_token
Work
- Create Telegram bot configuration using a server-side secret.
- Configure separate private and public destinations.
- Implement persistent outbox, retries, deduplication, delivery receipts/status, and message IDs.
- Build templates for every lifecycle event and the daily report.
- Public messages must be sanitized and explicitly approved for publication.
- Only report actual fills and SL/TP changes after broker confirmation.
- Prevent Telegram outages from blocking risk decisions or order safety.
Blockers / decisions needed
- Owner: the reports bot (token and its destination) - add it in Telegram Center, then press 'Send test message'. The signals bot 'MD Gold Trading' is set up and its test message was sent on the VPS (2026-11-12).
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_telegram.py -q | passed: 5 passed (mocked Bot API) | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_telegram.py -q | passed: 7 passed (mocked Bot API) | 2026-11-03 |
.venv/Scripts/python -m pytest backend/tests/test_telegram.py -q | passed: 8 passed (mocked Bot API) | 2026-11-13 |
Section 24 report. 1) Bot registry, destinations, templates, outbox with dedupe/retries/backoff/failure alerts, chart screenshots with trade overlay, /telegram UI. 2) Files: backend/research/telegram.py, app.py, migration 018; scripts/chart-shot.mjs; src/components/telegram-center.tsx, structure-chart.tsx (overlay), telegram page, sections, proxy; tests. 3) DB/API: telegram_bots, telegram_destinations, telegram_outbox; /telegram/bots, destinations, events, outbox, deliver. 4) Tests: see the table. 5) Limits: not sent to real Telegram yet; chart capture needs the running workspace. 6) Security: tokens encrypted, masked in errors; public sanitised. 7) Open: bot tokens and chat ids (owner). 8) Next: Phase 18.
Last updated 2026-11-12
18 Live-Market Shadow Testing and Promotion GatesProve the system can monitor live conditions without submitting orders. COMPLETE100%
Exit criteria
- Shadow mode demonstrably sends no broker orders.runner calls only bars and quote; fake terminal records no submit (test); isolation test
- Promotion requires all configured gates.approve refused unless every gate PASS (test)
- Approval/rejection is auditable.promotion_decisions with evidence + audit events (test)
- Insufficient evidence cannot pass automatically.INCONCLUSIVE below thresholds or without shadow trades; registry cannot approve (tests)
Deliverables
- Shadow runnershadow.run_all / run_strategy, task every 5 min, /shadow/run, /shadow/status
- Promotion gate serviceshadow.evidence with demo/shadow gates from real records
- Evidence reportGET /promotion/evidence and the Strategy Registry panel
- Approval and rollback workflowPOST /promotion/approve, reject, rollback (re-authentication, audit, stored evidence)
- Work order #2 Part E: shadow runs for bot (S1-S4) and discovered strategies in DEMO/SHADOW on the live signal path (hypothetical fills, stop/target on M5 bars, intraday close)backend/research/shadow.py run_rule_strategies; backend/tests/test_autopilot.py
Work
- Run approved research versions against live market/news data in shadow mode.
- Save signal-time snapshots, hypothetical entries/exits, estimated costs, and later outcomes.
- Measure data delays, spread, missed signals, and simulated slippage.
- Implement promotion checklist and evidence report.
- Require owner approval and re-authentication for promotion.
- Add pause/revoke/rollback to previous strategy version.
- Define minimum observation and evidence criteria before the first live pilot.
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_shadow.py backend/tests/test_registry.py backend/tests/test_promotion.py -q | passed | 2026-10-29 |
Mt5Adapter.get_bars('XAUUSDm', 'M5', 3) on the real terminal (read-only) | ok: newest closed bar 2026-10-28T19:55Z, quote 4073.097/4073.337 | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests/test_shadow.py backend/tests/test_registry.py backend/tests/test_promotion.py -q (work order #5) | passed (part of 385) | 2026-11-03 |
Section 24 report. 1) Shadow runner, demo/shadow evidence gates, evidence report, owner approve/reject/rollback, UI panel, scheduled tasks. 2) Files: backend/research/shadow.py, promotion.py, registry.py, brokers.py, mt4_bridge.py, app.py, migration 019; src/components/promotion-panel.tsx, research-strategies.tsx, proxy; tests. 3) DB/API: shadow_runs, shadow_trades, promotion_decisions, broker_orders.strategy_id; /shadow/run, /shadow/status, /promotion/evidence|approve|reject|rollback. 4) Tests: see the table. 5) Limits: no strategy is in DEMO/SHADOW yet, so no shadow evidence exists; shadow uses the strategy's latest backtest timeframe. 6) Security: shadow has no order path; approvals re-authenticated. 7) All exit criteria met. 8) Next: Phase 20 local parts (Phase 19 stays disabled). Work order #5 re-verification: every exit criterion re-checked against the tests and code; nothing missing. Shadow trades now also feed the confidence score.
Last updated 2026-10-29
19 Controlled Live Pilot, Monitoring, and Emergency ControlsOnly after earlier phases pass, enable a tightly constrained live pilot. PARTIAL90%
Exit criteria
- All live preconditions are explicitly checked.pilot.preconditions + tests (test_pilot.py)
- No critical security, data, risk, or reconciliation defects remain.11 live/confidence tests; demo drills passed; live refused without MFA/confirmation/preconditions; owner limits enforced on live (tests)
- Owner approval is recorded.by design: only the owner switches live on (Live Pilot) after 2-3 months of demo results; the approval is then recorded in live_audit and live_settings
- Kill-switch and recovery drills pass in a non-live environment first.2026-11-02 on Exness-MT5Trial15 demo: kill switch PASSED (position opened, risk engine blocked, flatten closed it, switch restored), cancel pending PASSED (buy limit placed, seen, cancelled), safe restart PASSED (order sent, row left SENDING, recovery -> FILLED, no re-send, idempotency key, live stays off)
Deliverables
- Live feature flag and approval workflowlive_settings (OFF), POST /live/enable: owner password + MFA code (MFA must be enrolled), exact typed confirmation, REAL broker account + ONE approved version, every precondition; Live Pilot page
- Live execution audit traillive_audit (append-only, no update/delete path): enable/refusal, send, order, block, error, pause, recover, review, emergency, drills
- Emergency controlskill switch; POST /live/emergency (kill switch + live off + close system positions + cancel pending); disable without password
- Runbook and incident checklistdocs/RUNBOOK.md, docs/INCIDENT_RESPONSE.md (work order 2026-10-29 item 29)
- Preconditions checklistpilot.preconditions: MFA, REAL account synced <15 min, reconciliation MATCH, one approved version, no other live version, overall confidence >= threshold, 3 demo drills <30 days, halt clear, no critical alert, backup <26 h
- Live cycle: idempotency, reconciliation, automatic blocks and pauses, owner limitspilot.cycle: client_key UNIQUE per signal, recover SENDING/UNKNOWN from the broker, block on stale data / disconnection / spread / risk engine, pause on state mismatch / 3 errors in 60 min / drawdown / daily loss / confidence below threshold, risk.assess(live_enabled) with the Risk Center limits; unverified deployment switches live off
- Daily reviewpilot.daily_review in the daily report task (orders, blocks, errors, equity change, confidence, drills; daily-loss pause)
Work
- Keep live disabled by default until owner explicitly authorizes it.
- Require MFA, re-authentication, confirmation, and documented broker/account selection.
- Enable only one approved strategy version at first.
- Use strict, pre-agreed risk limits and minimal permitted exposure.
- Require risk engine approval for every order.
- Add order idempotency and broker reconciliation.
- Block new orders on stale data, disconnection, state mismatch, excess spread, repeated errors, or risk breach.
- Test kill switch, cancel-pending flow, and safe restart in demo/staging first.
- Add daily review and automatic pause conditions.
Blockers / decisions needed
- Owner: switching live on is the owner's own action in Live Pilot after the demo results (overall confidence >= 80 % and every precondition).
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_pilot.py -q | passed: 11 passed | 2026-11-03 |
python -m backend.research.pilot drill (Exness-MT5Trial15 demo) | kill_switch PASSED, cancel_pending PASSED, safe_restart PASSED (tickets 2682582744, 2682582836, 2682582893; all closed/cancelled) | 2026-11-03 |
Section 24 report (work order #5 Part B, 2026-11-03). 1) Live pilot complete and OFF: approval workflow (MFA, re-authentication, typed confirmation, account and one approved version), preconditions, live cycle with idempotency, reconciliation, automatic blocks and pauses, owner limits, append-only audit, daily review, emergency stop, demo drills. 2) Files: backend/research/pilot.py, confidence.py, risk.py (live_enabled), brokers.py (allow_real, place_pending), telegram.py, monitoring.py, migration 029; src/components/live-pilot.tsx, confidence-panel.tsx; tests test_pilot.py, tests/work-order5.spec.ts. 3) DB/API: live_settings, live_audit, live_orders, live_equity, live_reviews, drills, confidence_settings, confidence_history; /live/status|enable|disable|resume|emergency|drills|audit, /confidence. 4) Tests: see the table. 5) Limits: live never ran on a real account (by design). 6) Security: MFA mandatory, switching off never needs a password, code change switches live off. 7) Open: the owner's decision to switch live on. 8) Next: Phase 20 on the VPS.
Last updated 2026-11-03
20 Production Hardening, Backup, Reporting, and MaintenanceMake the platform maintainable and resilient. PARTIAL90%
Exit criteria
- Backups can be restored.restore-test passed (local); off-site copy needs the owner's destination
- Alerts cover critical failures.database, disk, data freshness, jobs, broker, Telegram, kill switch (tests)
- A clean deployment can be reproduced from documentation.reproduced by the owner on the Contabo Windows VPS from docs/DEPLOYMENT.md on 2026-11-12 (C:\AiGold, user aigold, release 0.34.2, https://gold.mdclothstore.com, MFA on, demo AI running); the four problems found there are fixed in 0.34.3 (work order #14)
- Live mode starts disabled after recovery or unverified deployment.no live path; restore-test reports live disabled
Deliverables
- Production runbookdocs/RUNBOOK.md, DEPLOYMENT.md, OPERATIONS.md
- Backup/restore evidencescripts/backup.py restore-test passed 2026-10-28 on the newest backup (migrations applied, counts read)
- Monitoring dashboards and alertsmonitoring.py checks/alerts, /reports health panel, private Telegram alerts
- Release checklistdocs/RUNBOOK.md
- Maintenance plandocs/RUNBOOK.md
- Dashboard no longer waits for the history explorer: coverage keyed by store file, refreshed in the background (2 s wait, else the last report); explorer has its own lockbackend/research/history.py; /dashboard 60 s timeout -> 0.06 s
- Work order #5 Part F: single Windows VPS deployment (no Docker) - install.ps1 (machine env, build, firewall, auto-start tasks), release.ps1 (backup, update, build, restart, health check, automatic return; -Ref rollback), Caddyfile with log rolling, server.env templatedeploy/windows/, docs/DEPLOYMENT.md (15 steps, memory and disk budget, release checklist, rollback)
- Worker resource limits and log retentionscripts/run_task.py: Windows Job Object hard memory + CPU caps for research workers (verified: 300 MB cap -> MemoryError), logs/<task>/YYYY-MM-DD.log with retention
- Off-site backups (configurable destination), market-store backup, restore commandscripts/backup.py --offsite / BACKUP_OFFSITE_DIR, --market, restore FILE (live OFF); monitoring 'Backups' check
- Load and failure test scriptsscripts/load_test.py, scripts/failure_test.py
- 0.34.3 (work order #14, found on the VPS): A periodic tasks run on their schedule right after install.ps1 / -TasksOnly / release.ps1 without a logon (time trigger with the repetition beside AtLogOn); B install.ps1 resets the ACLs under the project folder and gives the -User account Modify (copied files had no write access for aigold); C install.ps1 updates the machine root certificates from Windows Update (Python CERTIFICATE_VERIFY_FAILED to api.telegram.org); D Telegram network errors keep their reason; DEPLOYMENT.md steps 3, 7 (copy + size/SHA256 check) and 9deploy/windows/install.ps1, docs/DEPLOYMENT.md; on this PC: temporary task 'ZZ WO14 Repeat Test' ran every minute without a logon (02:22:54, 02:23:54; re-registered: 02:25:55, 02:26:55; result 0), then deleted; ACL reset + grant on a scratch copy of the VPS's broken ACL (workspace.sqlite3 and service-token writable again); certutil -generateSSTFromWU produced 555 roots incl. Go Daddy
- 0.34.4 (work order #15): release.ps1 and install.ps1 -TasksOnly run as the non-admin aigold - an elevated install.ps1 (or install.ps1 -TasksOnly once on an installed server) gives the -User account full control of each AI Gold task it registers (no other user, no other task); the elevated install also makes -User the owner of the project files (git refused the repository owned by Administrators); DEPLOYMENT.md 'Administrator or aigold' with the one-time steps for a server installed before 0.34.4deploy/windows/install.ps1 Grant-TaskControl, icacls /setowner; on this PC (elevated, temporary non-admin user zzwo15test and ZZ WO15 tasks, all deleted): a task registered the old way -> disable, enable, re-register 'Access is denied' as the user (the VPS error); with the grant -> disable, stop, enable, start, re-register (periodic and monthly) all OK and the grant kept; git status as the user: 'dubious ownership' after the 0.34.3 sequence, OK after /setowner; owner's AI Gold tasks unchanged
Work
- Add production monitoring, alerting, log retention, disk/database growth alarms, and worker resource limits.
- Configure encrypted off-VPS backups and test restore.
- Run load and failure tests.
- Review security, dependency updates, permissions, and secrets rotation.
- Add daily/weekly/monthly reports.
- Add release/rollback process and change approval.
- Document incident response, VPS replacement, broker outage, data provider outage, and database recovery.
- Review performance and add time-series/object storage only when measured need justifies it.
Blockers / decisions needed
- Owner: choose the off-site backup destination (BACKUP_OFFSITE_DIR) and run the off-site backup on the VPS.
- Owner: restore test and load/failure tests on the VPS (docs/DEPLOYMENT.md steps 14-15).
Tests run
| Command | Result | When |
|---|---|---|
.venv/Scripts/python -m pytest backend/tests/test_monitoring.py -q | passed: 3 passed | 2026-10-29 |
python scripts/backup.py --encrypt; python scripts/backup.py restore-test | verified backup + encrypted copy; restore test passed (213,422 calendar events, risk settings 2, halt off) | 2026-10-29 |
monitoring.checks on the live workspace | 11 checks ok (database 90 MB, 72.5 GB free disk, M1 history 0.1 h old, calendar import, feeds, jobs, Telegram, risk, halt) | 2026-10-29 |
npm.cmd run format:check / typecheck / lint:backend / test:backend / build | passed: Prettier clean, typecheck ok, ruff clean, 306 backend tests passed, build compiled | 2026-10-29 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 53 passed, 2 device skips; the reports test locator then fixed (exact region name) and re-run: 2 passed | 2026-10-29 |
GitHub Actions ci #27-#33 (decbd98, e526676, 45ee020, 27aa093, 1d5e1da, 6548552, 799a5f3) | all passed (5m 13s to 7m 27s each); #33 = Phase 20 | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests -q | 330 passed | 2026-10-29 |
npm run format:check / typecheck / lint:backend / roadmap / build | all passed | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests -q | 349 passed | 2026-10-29 |
npx playwright test (ports 3300/8300) | 65 passed, 2 failed (AI brain test selectors: label containing a select, duplicate region name; fixed, then 4/4 passed), 3 device skips | 2026-10-29 |
npm run format:check / typecheck / lint:backend / roadmap / build | all passed | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests -q | 357 passed (+2 live chart / brain activity tests) | 2026-10-29 |
npm run format:check / typecheck / lint:backend / roadmap / build | all passed | 2026-10-29 |
.venv/Scripts/python -m pytest backend/tests -q | 363 passed | 2026-10-30 |
npm run format:check / typecheck / lint:backend / roadmap / build | all passed | 2026-10-30 |
scripts/run_task.py captest --capped (300 MB cap, 1 GB allocation) | MemoryError: cap enforced | 2026-11-03 |
python scripts/backup.py restore-test | passed (live switch in the backup off) | 2026-11-03 |
PowerShell parser on deploy/windows/install.ps1 and release.ps1 | 0 parse errors each | 2026-11-03 |
npm run format:check / typecheck / ruff check backend scripts | passed | 2026-11-03 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | passed: 85 passed, 3 device skips (incl. tests/work-order5.spec.ts) | 2026-11-03 |
GitHub Actions ci #43 (commit bd4096f, 0.27.0) | passed: completed successfully in 7m 47s (format, typecheck, ruff, backend tests, roadmap sync, build, Playwright) | 2026-11-03 |
Section 24 report (local parts). 1) Monitoring checks and alerts, periodic reports, encrypted backups with restore test, runbook/release checklist/maintenance plan, /reports page, tasks. 2) Files: backend/research/monitoring.py, app.py, migration 020; scripts/backup.py; src/components/reports-center.tsx, reports page, sections (section-pending removed); docs/RUNBOOK.md; tests. 3) DB/API: ops_alerts, ops_reports; /monitoring/status, /monitoring/check, /reports, /reports/{period}. 4) Tests: see the table. 5) Limits: VPS deployment, load tests and off-site backups need the VPS and owner decisions. 6) Security: encrypted backups use the workspace key, kept apart. 7) Open: VPS items. 8) Phase 19 stays disabled until the owner's written authorization. Work order 2026-10-29 Part 4: docs/TELEGRAM_INTEGRATION.md, docs/BACKUP_AND_RECOVERY.md, docs/INCIDENT_RESPONSE.md (required files 25/25); stale notes on data depth and the Dukascopy network corrected. Work order #2: docs/AI_TRADER.md; tasks AI Gold Strategy Discovery (15 min) and AI Gold Demo AI (1 min) in the runbook.
Last updated 2026-11-13
21 Open-Source Skills LayerWrap proven open-source trading libraries as audited skills on closed bars only (causal test, method/version on every output), shown on the dashboard and given to the AI trader only when the owner allows it. COMPLETE100%
Exit criteria
- Every skill passes the causal test before it can be registered; outputs carry method/version, as_of and lag.registry register: 3/3 passed (catalogue with 9 exclusions)
- No skill reaches the AI unless the owner switched it to ai_input (re-authentication, audit).all skills research_only after registration; tests
- LIVE_TRADING_ENABLED stays false; S1-S4, discovery, risk engine, live pilot, demo AI behaviour and Telegram unchanged.git diff: autopilot.py adds only the optional skills block; full backend suite
- Parts F-G built.Parts B-G built (0.29.0-0.34.1); x2strategy dropped by owner decision (0.34.1); phase marked complete by the owner
Deliverables
- Part A1: Phase 21 in roadmap.json with parts A-G (only A has deliverables); tracker and acceptance record regeneratedroadmap.json, ROADMAP_TRACKER.html, docs/PHASE_ACCEPTANCE.md (npm.cmd run roadmap)
- Part A2: skill contract (id, name, category, version, source repo + exact package version + licence, run() on closed bars only -> one JSON result with skill id/version, symbol, timeframe, as_of, computed_at, input fingerprint, status ok/stale/error, confirmation_lag_bars per output, rule text, outputs)backend/research/skills/contract.py; test_result_carries_the_contract_fields_and_uses_closed_bars_only
- Part A2: migration 030 - skills (mode research_only / ai_input / disabled, default research_only) and skill_runs; causal_test column keeps the last test report (DECISIONS 2026-11-09)backend/research/migrations/030_skills.sql; test_migration_030_creates_the_registry_tables
- Part A2: generic causal harness for all skills (bars[:n] vs bars[:n+k], 6 cuts x k 1/3/25/150 = 24 cases, exact equality of every value known at bar n after its lag); a failing skill cannot be registered (a failing new version is disabled)contract.causal_test, registry.register; tests catch a centred mean, whole-range scaling, a lag-0 swing that needs lag 2 and a skill reading the next close
- Part A2: mode changed only by the owner from the dashboard with re-authentication; every change audited (category Skills)PUT /skills/{id}/mode (security.reauthenticate); test_the_skills_page_lists_every_skill_and_only_the_owner_changes_a_mode
- Part A3: main .venv gets only TA-Lib 0.8.3 (bundled C library wheel) and talipp 2.7.0, pinned in requirements.txt and requirements-lock.txt; research .venv-research with requirements-research.txt (pandas-ta-classic 0.9.0, pandas 3.1.1, numpy 2.5.4, python-dateutil 4.0.0, tzdata 2026.6)backend/requirements*.txt; node scripts/workspace.mjs setup creates and updates both
- Part A3: the main backend calls the research environment only as a worker subprocess through scripts/run_task.py --capped (JSON in / JSON out files, CPU/RAM caps)skills/catalogue.py call(); logs/skills-research: 'caps: memory 3072 MB, CPU 35 %, below-normal priority (applied)'
- Part A3: install.ps1, release.ps1 and docs/DEPLOYMENT.md create/update both environments, register the skills and add the task 'AI Gold Skills Live'; server.env.example unchanged (no new setting needed); Start Workspace.cmd and npm.cmd run workspace keep workingdeploy/windows/install.ps1, release.ps1 (PowerShell parser: 0 errors), docs/DEPLOYMENT.md steps 9 and Release; workspace setup run on this PC
- Part A4: indicators-talib - ATR, ADX, +DI/-DI, RSI, MACD, Bollinger Bands, EMA 12/20/26/50/200, Stochastic (fast), CCI, OBV on tick volume, all 61 TA-Lib candlestick patterns (data only, never signals), any timeframe M1-D1, Dukascopy or Exness XAUUSDmskills/indicators.py; registry run indicators-talib --source exness --timeframe M15 (as_of 2026-11-03T08:00:00Z, ok)
- Part A4: cross-check against advanced.technical_analysis (advanced-0.4.0, unchanged): EMA20/EMA50/RSI equal (max 4.5e-12); ATR max 1.4e-3 and MACD/signal max 0.18/0.38 from different seeds (TA-Lib skips the first bar's true range; aligns the MACD fast EMA with the slow one), below 1e-11 after 500 bars - documentedtest_talib_against_advanced_py_on_the_same_bars; docs/SKILLS_LAYER.md
- Part A5: indicators-live - talipp incremental update on every CLOSED M1 and M5 Exness XAUUSDm bar (never the forming bar), no recomputation; warm-up from stored history on start and after a reconnectskills/live.py; test_live_worker_warms_up_adds_each_closed_bar_and_rewarms_after_a_reconnect; 75 s run on the open MT5 terminal: warmed up M1 2012 / M5 2001 bars, new M1 bar 09:18 stored at 09:19:02 (scratch database)
- Part A5: incremental talipp values equal the TA-Lib batch values on the same bars after the 500-bar warm-up: owner's 7,658 stored Exness M15 bars EMA50 max difference 7.3e-12, every indicator <= 1e-9 (CCI 9.9e-10)test_incremental_talipp_values_equal_talib_batch_values, test_talipp_equals_talib_on_the_owner_7658_stored_m15_bars
- Part A6: features-catalogue in the research environment - 403 pandas-ta-classic columns incl. 62 candlestick patterns (7,658 M15 bars: 10.8 s under the 35 % CPU cap); causal harness on every column, 9 excluded with the reason (DPO_20, ICS_26, 7 x TOS_STDEVALL), whitelist 394 stored with its version; not connected to the discovery engineskills/catalogue.py, catalogue_worker.py; registry register (25.5 s) and run features-catalogue; test_features_catalogue_runs_in_the_research_environment_and_excludes_non_causal_columns
- Part A7: optional skills block in the trader input (input_contract trader-v4) with only ai_input skills; empty -> the trader receives exactly today's input; prompt trader-v4 explains as_of, confirmation lag and status; the active prompt stays v3autopilot.py (trader_prompt), skills/registry.ai_block, prompts/trader/v4/*; test_the_trader_input_is_unchanged_while_no_skill_is_in_ai_input_mode, test_an_ai_input_skill_adds_the_skills_block_and_prompt_v4
- Part A8: sidebar page Skills - per skill name, category, mode, version, source repo link, package version, licence, last run, as_of, duration, status, causal test result, expandable latest output; owner-only mode switch with re-authentication; Indicators panel (Exness XAUUSDm from indicators-live with as_of)src/app/skills/page.tsx, src/components/skills-center.tsx; tests/work-order6.spec.ts at 1920, 1366 and phone width
- Part A9: docs/SKILLS_LAYER.md, docs/THIRD_PARTY.md, DECISIONS.md (private personal use), CHANGELOG 0.28.0, PROJECT_STATUS.md, README handofffiles in this release
- Part B0: DECISIONS entry for the three Part A answers (causal_test column approved; no schedule for indicators-talib / features-catalogue, Part F decides; indicators-live without candlestick patterns)DECISIONS.md 2026-11-09
- Part B0b: indicators-live warm-up reads >= 500 closed bars per timeframe (2,000 stored; unchanged) on start and after a reconnect; results published before 500 bars have status stale with null valuesskills/live.py store(); test_live_warm_up_needs_500_closed_bars_and_earlier_values_are_stale
- Part B1: skill smc (smartmoneyconcepts 0.0.27, MIT, SMC_CREDIT=0) in .venv-research: swings, BOS, CHoCH, FVG + mitigation event, order blocks with strength, liquidity and sweeps, previous day/week/month high-low, sessions and ICT kill zones with DST, retracement %; causal adapter with lags swing 5 / FVG 1 / events 0skills/smc.py; raw library FAILS the harness (swing, bos, choch, ob, liquidity, fvg mitigation; 116 swing labels changed on 1,200 synthetic bars), adapter passes 24/24 (test_raw_smc_output_fails_the_causal_harness_and_the_adapter_passes); DST tests
- Part B1: agreement report smc vs advanced.technical_analysis (advanced-0.4.0, unchanged) on Dukascopy and Exness M15/H1, stored and shown on the Skills pageregistry report smc_agreement (5,000 bars each): e.g. Exness M15 swings 575 smc / 552 advanced / 485 within 1 bar, FVG 1051/1022/1022, BOS 171/107/75, CHoCH 98/69/34, OB 233/176/60, liquidity 88/9/6
- Part B2: py-market-profile licence confirmed from its LICENSE file (BSD 2-clause) - used as PyPI MarketProfile 0.2.0; skill auction: per completed session (London, New York, day) POC/VAH/VAL 70 %, IB, OR, HVN/LVN on tick volume; developing session separate with as_of; completed sessions never changeskills/auction.py; test_completed_sessions_never_change_and_the_developing_session_is_separate
- Part B2: OrderFlow-Analysis-Pro (MIT) ported in our own code - shape bias P/b/D/double, qualified levels, merged multi-day value area, value accepted higher/lower, VAH rejection, failed-auction hooks; no delta/footprint/orderbook/Bybit/MT5 feed codeskills/auction_port.py; test_profile_shapes_on_hand_built_histograms, test_failed_auction_hooks_value_acceptance_and_merged_value_area; attribution docs/THIRD_PARTY.md
- Part B2: cross-check auction vs S2 levels on the same days (S2 unchanged)registry report auction_vs_s2 (20 days): Dukascopy 42 sessions POC mean |diff| 2.90 (52 % within 2 rows), Exness 40 sessions POC 4.42 (50 %); causes in the report
- Part B3: skill levels-trendlines (trendln 0.1.18) on the trailing 125-bar window (configurable), confirmed extrema only (METHOD_NAIVE, no edge), slope/intercept/touches/errors, projected price at the current barskills/trendlines.py; test_trend_lines_use_only_the_trailing_window; causal harness passed
- Part B4: stolgo 0.2.0 in .venv-research with --no-deps (owner decision; bandl not installed); S3 implemented once in stolgo with next-open fills, our spread and commission, compared trade by trade with our engine (engine unchanged)skills/stolgo_rules.py, registry report stolgo_vs_engine --year 2025: 192 our setups / 192 stolgo trades, 192 same signal bar and side, 167 same exit kind, R difference mean 0.108 / mean abs 0.533 / max abs 3.875; 20 of our exits were the pre-news rule (not in the port)
- Part B4: stolgo level/relation/pattern grammar and presets consolidation_breakout, breakout_intraday, failed_break_intraday callable as the research-only rule set rules-stolgo (not connected to discovery)worker action rules_eval; test_stolgo_grammar_evaluates_relations_combinators_and_presets; causal harness passed
- Part B5: references only - KVignesh122/MT5-SMC-trading-bot filters vs S1 (ATR displacement no, ADX/ER regime no, session gate yes, spread cap only in the risk engine); EarnForex/MarketProfile MT5 install steps for a visual comparisondocs/SKILLS_LAYER.md 'References only (B5)'
- Part B6: every Part B package installs beside the pinned .venv-research packages (stolgo only with --no-deps, owner decision); full research lock installed with --no-deps; long-running capped worker 'AI Gold Skills Structure' (smc + trendlines on M5/M15/H1/H4, auction M5, every closed M5 bar); install.ps1 registers it, release.ps1 re-registers tasks (install.ps1 -TasksOnly); Dukascopy on demand onlybackend/requirements-research.txt, structure_worker.py, feed.py; fresh venv from the lock imported every package; 3-minute run on the open MT5 terminal stored 9 runs per closed M5 bar (scratch database)
- Part B7: the four new skills on the Skills page with the Part A fields plus the SMC agreement, auction vs S2 and stolgo vs engine reports; no new page, no chart overlaysrc/components/skills-center.tsx; tests/work-order7.spec.ts at 1920, 1366 and phone width
- Part B8: docs/SKILLS_LAYER.md, docs/THIRD_PARTY.md, DECISIONS.md, CHANGELOG 0.29.0, PROJECT_STATUS.md, this recordfiles in this release
- Part C0: causal rule - published_at (source) and known_at (our fetch, whole seconds rounded up) on every news item and Fed text; research reads by known_at only; macro = ALFRED vintages known from the end of the vintage day in New Yorkskills/macro_news.py (headlines_known, fed_known, macro_as_of, Vintages); tests test_research_reads_news_by_known_at_never_by_published_at, test_alfred_values_are_never_used_before_their_vintage_was_published, test_a_skill_reading_items_by_published_at_would_see_the_future
- Part C1: skill macro - FRED/ALFRED DFII10, T10YIE, DGS10, DFF, DTWEXBGS, CPIAUCSL (fredapi 0.5.2, all vintages, owner key encrypted) and Yahoo daily DX-Y.NYB, ^TNX, GC=F (yfinance 1.8.0, labelled 'Yahoo, delayed, personal research use'); snapshot with value, as_of, known_at, 1- and 5-observation change; task AI Gold Skills Macro daily 22:30 UTC + Refresh nowskills/macro_worker.py, providers.py (macro CLI, POST /skills/macro/refresh), Skills page Macro snapshot; Yahoo terms in docs/THIRD_PARTY.md
- Part C2: OpenBB evaluated in a throwaway environment (openbb 5.0.0): providers for gold spot, DXY, US yields, real yields, economic calendar, keys vs free; not added to the botdocs/SKILLS_LAYER.md 'OpenBB evaluation'
- Part C3: existing COT import checked - Disaggregated managed money present, history only from 2006-06-13; cot_reports 0.1.3 fills exactly the gap: Legacy gold 1986-01-15 -> 2006-06-06 (876 weeks, table cot_legacy), same release rule (no CFTC-published dates -> never used); skill cotmigration 032 cot_legacy, macro_worker cot-legacy, news_sources.release_for(backfill=False), news_sources cot-legacy; tests test_legacy_cot_fills_only_the_gap_before_the_disaggregated_history, test_legacy_weeks_without_a_cftc_published_date_are_never_used
- Part C4: skill news - owner feed list (seeded with verified Fed press, Fed speeches, ECB press, BoE news; feedparser every minute, ETag/Last-Modified, backoff), Google News (newspaper4k GoogleNewsSource) and GDELT DOC (gdeltdoc: articles, raw volume and tone) for the owner keyword list, trafilatura full text once per item (robots.txt; failure keeps the headline), dedupe with every source listed, spike flag owner setting OFF without a thresholdskills/news_worker.py, migration 032 (news_feeds, news_keywords, news_settings, news_items, news_item_sources, news_polls, gdelt_timeline); tests on saved fixtures in backend/tests/fixtures/part_c
- Part C5: skill fed - FOMC-RoBERTa (CC BY-NC 4.0) on new Fed statements, minutes and speeches from the Fed feeds, sentence labels stored, Fed index = (hawkish - dovish) / sentences; FOMC statements and minutes history 2003+ from federalreserve.gov (343 documents); FOMC event study with the Phase 9 moduleskills/fed_worker.py, fed_documents, reports.fomc_event_study; test test_fed_index_formula_on_a_hand_labelled_statement. Scoring and the event study wait for the owner's access to the gated model
- Part C6: finBERT model card read - licence cc-by-nc-sa-4.0 (personal use allowed); every headline scored on CPU (label + probabilities), data onlynews_worker.finbert (revision 0bc2ac1), news_items.sentiment; docs/THIRD_PARTY.md
- Part C7: tasks AI Gold Skills News (every minute, research environment, capped; Fed scoring of new Fed texts in the same cycle) and AI Gold Skills Macro (daily); install.ps1, release.ps1, DEPLOYMENT.md step 9a; not left running on this PCdeploy/windows/install.ps1, release.ps1, docs/DEPLOYMENT.md
- Part C8: Skills page (macro, news, fed, cot cards, macro snapshot, Fed index history, FOMC event study), News page Headlines section with GDELT volume/tone per keyword, Settings -> Data providers (FRED key, feed list, keyword list, GDELT spike setting OFF)src/components/skills-part-c.tsx, news-headlines.tsx, data-providers.tsx; tests/work-order8.spec.ts
- Part C9: docs/SKILLS_LAYER.md, docs/THIRD_PARTY.md, DECISIONS.md, CHANGELOG 0.30.0, PROJECT_STATUS.md, this recordfiles in this release
- Part D1: decision context check - multi-timeframe data and SL/TP of open trades were already in the snapshot; exposure, drawdown, recent P&L and consecutive losses added in contract trader-v5trader_flow.exposure / performance, prompts/trader/v5/input_contract.json, docs/AI_TRADER.md D1 table
- Part D2: trader-v5 output schema with falsifier {condition, price} and horizon_utc; an OPEN without both is rejected by the validator and becomes WAIT; WAIT is a first-class answertrader_flow.open_problems; test_open_without_falsifier_or_horizon_becomes_wait
- Part D3: Bull and Bear analysts (routine tier, route debate) only before a new OPEN, 1-3 rounds, then the trader's final decision (decision tier)trader_flow.debate, prompts bull/v1, bear/v1; test_a_full_open_flow_debates_challenges_and_executes
- Part D4: Challenger after the final OPEN on another provider, else another model of the same provider (labelled), else no trade; reject = WAITtrader_flow.challenger_target, prompt challenger/v1; tests for reject, fallback and no second model
- Part D5: owner settings on the AI Brain page (debate on/off, rounds 1-3, Challenger on/off, prompt v3/v4/v5) and the budget check before the flow with the existing budget alertmigration 033, PUT /autopilot/trader-settings, trader-settings.tsx; test_the_budget_is_checked_before_the_flow
- Part D6: decision log (decision_flows) with snapshot reference, debate, falsifier, horizon, Challenger, odds, calls, costs, prompt versions, advisory checks; automatic scoring after the horizon (real R, counterfactual on M1, falsifier hit); shown on the Demo AI page, not used elsewheretrader_flow.log / score_due / scores, GET /autopilot/flows, decision-flows.tsx; test_counterfactual_score_on_hand_built_m1_bars
- Part D7: skill odds-timemachine (10,000 same-time-of-day replays in ATR units, seed 19, plus the same setup on every past pool day), Dukascopy history, Exness live as_ofskills/timemachine.py; test_time_machine_is_reproducible_with_its_seed_and_uses_only_earlier_days
- Part D8: licence confirmed (Apache-2.0 covers the OpenMobius cards); skill knowledge: 726 concept cards indexed in ChromaDB with its local model, our smc/auction terms matched to definitions and rulesskills/knowledge.py, knowledge_worker.py, migration 034 knowledge_terms, backend/research/data/openmobius (LICENSE, NOTICE)
- Part D9: cot-contrarian, news-reaction-failure, macro-regime, drawdown-breaker and discipline-gate (advisory) ported with our data; risk-engine overlap listed; post-trade reviews (postmortem, coach, weekly digest) on the Reports page; the other 65 skills of the repository listedskills/trading.py, reviews.py, docs/SKILLS_LAYER.md Part D; tests in test_trader_skills.py
- Part D10: prompts trader v5, bull v1, bear v1, challenger v1, postmortem v1, coach v1, digest v1 with JSON schemas; v3 and v4 selectable for rollback; v5 active on the demo AI after all tests passedbackend/research/prompts; autopilot_settings.trader_prompt = v5 on the owner's workspace (audit log, 2026-11-09T21:5x UTC)
- Part D11: Demo AI decision flow panel, AI Brain trader settings, Skills page (7 new skills), Reports trade reviewsdecision-flows.tsx, trader-settings.tsx, trade-reviews.tsx; tests/work-order9.spec.ts
- Part D12: docs/AI_TRADER.md, docs/SKILLS_LAYER.md, docs/THIRD_PARTY.md, DECISIONS.md, CHANGELOG 0.31.0, PROJECT_STATUS.md, DEPLOYMENT.md, this recordfiles in this release
- 0.31.1 (owner decisions after Part D) 1: demo AI may OPEN inside the USD high-impact news window only within the Risk Center limits news_window_max_sl_atr / news_window_max_tp_atr (M5 ATR14 multiples, empty by default = WAIT 'news SL/TP limits not set'), enforced in code for trader v3, v4 and v5; the live pilot keeps the hard blockrisk.RiskSettings, autopilot.news_limits / news_issue, trader_flow; prompts trader v3/v4/v5 News policy; risk-center.tsx; test_owner_decisions_part_d.py
- 0.31.1 2: weekly AI self-review (decision tier, prompt self_review-v1) after at least self_review_min_scored scored decisions (default 30, AI Brain page) may change only debate on/off, rounds 1-3 and Challenger on/off, with reasons on the AI Brain page and in the audit logreviews.py, migration 035 (applied on this PC's workspace 2026-11-10T05:44:49Z by the scheduled tasks; schema checked against the file), prompts/self_review/v1, trader-settings.tsx
- 0.31.1 3-4: Challenger skips a provider whose keys are all failing (then another model of the trader's provider, labelled); knowledge sends only exact-name card matches to the trader, nearest matches listed on the Skills page for reviewtrader_flow.challenger_target, skills/knowledge.py, skills-center.tsx; test_owner_decisions_part_d.py
- 0.31.2 A: Risk Center values for the demo AI by the owner's written instruction of 2026-11-10 (risk per trade 10 %, reward:risk 2, 4 trades per day, 1 open trade, daily loss 10 %, weekly loss 20 %, every other value unchanged) saved through the Risk Center write path as settings version 3 with the audit note; the same values on a fresh install; the live pilot and the research account simulations keep the unchanged six limits; live pilot OFFrisk.save / apply_owner_instruction / account_settings, migrations 036-037, pilot.risk_settings, bot.py, discovery.py, news_backtest.py; workspace audit entry 2026-11-10T10:40:34Z; test_release_0_31_2.py
- 0.31.2 B1: a Challenger model with no known price is not available (next provider, then a priced model of the trader's provider); a missing price never blocks a trade by itselftrader_flow.challenger_target / flow_estimate; on the owner's workspace the Challenger is now claude-sonnet-5-5 (the Groq and Gemini models have no price)
- 0.31.2 B2: the path-test trade (ticket 2659776381) is marked 'test' in the journal and left out of demo statistics, confidence inputs, the trader's performance block, the advisory skills and the reviewsdatabase.TEST_STRATEGY / NOT_TEST, autopilot.report, confidence.trades, trader_flow.performance, reviews.run, trading.load_account, demo-ai.tsx, home-dashboard.tsx; workspace: 7 trades in the statistics, 1 marked test
- 0.31.2 B3: automatic read-only MT5 sync of the saved connections in the monitoring task (every 5 minutes) and a correct Overview adapter status (connected / LAST SYNC OLD / SYNC ERROR only for a failed sync; unconfigured adapters not counted)brokers.sync_connection / auto_sync, monitoring.main, operations.integrations, home-dashboard.tsx; on this PC the sync reports 'unavailable' while the MT5 terminal is closed
- 0.31.2 B4: drawdown-breaker and discipline-gate 1.1.0 use the owner's Risk Center daily loss, weekly loss and losses-in-a-row values known at the bar (monthly rule not evaluated, 24 h cooldown kept); advisoryskills/trading.py breaker / limits_at / load_account; re-registered on this PC (causal test 24/24 each); live run: limits source 'owner Risk Center' 10 / 20 / 3
- Part E1: skill volatility - GARCH(1,1) with Student-t errors on closed M5, M15 and H1 bars, fitted once per UTC day on the trailing 2,000 bars closed before the day and only filtered forward; forecast for 1, 3 and 12 bars in $ and ATR units with the ATR baseline; reports onlyskills/volatility.py (arch 8.0.0), risk_ml.VolatilitySkill; test_garch_is_fitted_on_a_trailing_window_before_the_day_and_only_filtered_forward; causal harness 24/24
- Part E1 evaluation (walk-forward, Dukascopy 2003-10-28 to 2026-10-27; 1,643,944 M5, 552,497 M15, 138,539 H1 bars): GARCH beats the 24-bar std on correlation and error (owner check confirmed: H1 next bar 0.350 against 0.324, mean of yearly correlations 0.256 against 0.200) but not the ATR14 baseline on error: FAIL in all 9 timeframe x horizon cellsskill_reports volatility_walk_forward 2026-11-10T12:51:33Z (777 s); docs/SKILLS_LAYER.md Part E table
- Part E2: LightGBM (4.7.0, library defaults, research environment) as a second model type in ml.py; meta-labeling of S1-S4 and discovered-strategy setups (label = take-profit before stop-loss on the engine's tick outcomes), 427 causal features (setup features, return features, 394 features-catalogue columns, volatility forecasts), the same walk-forward split with embargo and outcome purging, Platt calibration, Bonferroni verdict and model registry gates (migration 038)ml.meta_setups / meta_matrix / meta_evaluate / run_meta, POST /models with meta_evaluation_id, GET /models/meta; tests for labels on hand-built ticks, the purged walk-forward and the registry gates
- Part E2 results (7 strategies x 2 model types, stored in meta_evaluations): S2 PASS for logistic and LightGBM, S3 PASS for LightGBM and INCONCLUSIVE for logistic, S4 INCONCLUSIVE for LightGBM and FAIL for logistic, S1 and the three discovered versions FAIL; no model improves the net R of taking every setup; no model registered or approvedpython -m backend.research.ml meta (2026-11-10); docs/RESEARCH_GUIDE.md Meta-labeling table (precision, recall, calibration, net R)
- Part E3: skill regime - Gaussian HMM with 2 and with 3 states on H1 log returns and the 24-bar realised volatility, fitted once per ISO week on the trailing 3,000 bars; only FILTERED (forward) probabilities, never Viterbi or smoothed; plain description of each stateskills/regime.py (hmmlearn 0.3.3), risk_ml.RegimeSkill; test_hmm_filtered_probabilities_never_change_when_future_bars_are_added; causal harness 24/24
- Part E3 evaluation (138,539 H1 bars): the states separate the next hour's absolute move (2 states: 0.1214 % against 0.1934 %, 24 of 24 years, PASS; 3 states PASS) and S2's and the pooled S1-S4 results (PASS), not S1, S3 or S4 (FAIL): INCONCLUSIVE overall; the owner's Jul-Oct 2026 check: 0.190 % (1,687 bars) against 0.236 % (261 bars)skill_reports regime_walk_forward 2026-11-10T12:45:04Z (386 s)
- Part E4: skill forecast - zero-shot 10 / 50 / 90 % quantiles of the close and of the high-low range for 1, 4 and 12 bars on closed H1 and H4 bars from Chronos-Bolt small, Chronos-2 small (autogluon/chronos-2-small), Kronos mini and Kronos small (vendored MIT code), CPU only, weights pinned to one revision and cached, one model in memory at a time, model version and CPU time in the outputskills/forecast.py, backend/research/vendor/kronos (LICENSE, NOTICE.md), risk_ml.ForecastSkill; stub-model test (ordered quantiles, causal); causal harness with the real models 24/24, 72 outputs
- Part E4: TimesFM 2.5 - built and measured (crash while loading under the 3072 MB worker cap, works under 4096 MB), then removed by the owner's decision of 2026-11-10 (redundant with Chronos and Kronos; no memory cap raised): model, package pin and weights download removedDECISIONS.md 2026-11-10 point 7; forecast.MODELS has four models; test asserts no TimesFM
- Part E4 evaluation: INCOMPLETE by owner decision (the run stopped when the PC ran low on memory) - H1 done (400 points Chronos-Bolt small and Chronos-2 small, 300 Kronos mini, 200 Kronos small), H4 not done; checkpoint kept, the run continues from itskill_reports forecast_walk_forward 2026-11-10 with incomplete = 'H1: chronos-bolt-small, chronos-2-small, kronos-mini, kronos-small done; H4: not done'; data/skills/forecast/evaluation-H1.json. H1: every close forecast FAIL against 'no change'; range PASS for Chronos-2 small at 1 and 4 bars and Chronos-Bolt small at 1 bar
- Part E5: skill drift - ADWIN and Page-Hinkley (river defaults) on the R of closed demo AI trades overall and per strategy (test trades excluded) and on spread, ATR14 and realised volatility of closed M5 bars; a detection is a warning on the existing monitoring alert path and is shown on the Skills page with each detector's sample size; it never stops tradingskills/drift.py (river 0.26.1), risk_ml.DriftSkill / drift_alert, monitoring.checks key drift; tests on synthetic series with a known change (stub and real detectors)
- Part E6: running - tasks AI Gold Skills Risk and AI Gold Skills Forecast (long-running research workers under run_task.py --capped with their own read-only feed) and AI Gold Skills Drift (15 minutes); install.ps1 / release.ps1 download the weights and register the tasks; evaluations on demand (CLI, Skills page button); nothing left running on the PCskills/risk_ml_worker.py serve risk|forecast|download, skills/risk_ml.py drift|evaluate, POST /skills/{id}/evaluate, deploy/windows/install.ps1 and release.ps1 (0 parse errors), docs/DEPLOYMENT.md 9b
- Part E7: Skills page - the four new skills with the same fields, each evaluation report (metrics against baselines, PASS / FAIL / INCONCLUSIVE, sample sizes, CPU time, incomplete note) with a run button, and the drift detectors; ML page - LightGBM vs logistic regression vs take every setup per strategy with calibration and a register button; no new pageskills-part-e.tsx, skills-center.tsx, research-meta.tsx, research-models.tsx; tests/work-order10.spec.ts
- Part E8: docs/SKILLS_LAYER.md, docs/THIRD_PARTY.md (versions, licences, model cards), docs/RESEARCH_GUIDE.md (Meta-labeling), docs/DEPLOYMENT.md, DECISIONS.md, CHANGELOG 0.32.0, PROJECT_STATUS.md, this record; the answered 'Owner to confirm (0.31.2)' blocker removedfiles in this release
- Part F0: the five research packages (vectorbt 1.2.0, optuna 5.0.0, tsfresh 0.21.2, shap 0.54.1, ruptures 1.1.10) install into .venv-research alongside the existing pins (resolved with the pinned file as constraints, --no-deps, 36 new exact pins, no existing pin changed, no new environment); licences read from each LICENSE filebackend/requirements-research.txt; docs/THIRD_PARTY.md (Part F); DECISIONS.md 2026-11-11 (vectorbt Commons Clause: private, personal use)
- Part F0: free-memory check - every lab job, the Part E evaluations and the lab-enabled discovery search ask for free RAM first; below the job's measured need (peak of its last finished run at that size, else the worker cap) it does not start and the reason is stored (lab_runs 'refused'), audited and shown; worker caps unchangedlab.refusal / lab.recorded / lab.need_mb, skills/risk_ml.py evaluate, discovery.work; migration 039; test_a_heavy_job_does_not_start_without_enough_free_memory_and_says_why
- Part F1 + F7: vectorbt stage at the start of the discovery engine - the stolgo presets consolidation_breakout, breakout_intraday and failed_break_intraday (five families with sides) swept on training-period M5 bars over 4 stops x 5 take profits with costs (spread per hour of day from the Dukascopy bid / ask bars, commission as in our engine); the survivors become triggers whose tick events are built by our own engine and go through the same search and gateslab.discovery_stage / screen / keep / build_events, skills/lab_worker.py screen / sweep / signals, discovery.work and load_tables(lab=True); test_vectorbt_survivors_go_to_our_tick_engine_and_every_screened_candidate_is_counted, test_stolgo_candidates_pass_the_same_search_and_registry_gates
- Part F1: every run records candidates screened, survivors, time, peak memory and the screening rule (the search's own training rule: at least 150 trades and mean R after costs above 0, training period only); every screened candidate is added to the Bonferroni count of the test-period gatelab_reports kind 'screen', lab_runs, discovery_runs.result.lab and multiple_testing; discovery.search(extra_tests)
- Part F1 cross-check: S3 of one year of Dukascopy M5 in vectorbt against our engine with the differences and their causes (as with stolgo in Part B)lab.vectorbt_s3_job, lab_reports kind 'vectorbt_s3'; smoke result in the tests table; test_real_vectorbt_runs_the_engines_s3_setups_on_bars
- Part F2: Optuna (TPE; pruning for LightGBM) instead of a grid - (a) the parameters of the stolgo presets in the screening, on training bars only (the worker refuses a bar at or after the training end); (b) LightGBM hyperparameters of the meta-labeling (third model type lightgbm_optuna) on the first fold's training rows only; studies in the separate file data/optuna.sqlite3; every trial counts in the Bonferroni count and the trial counts are shown next to every resultskills/lab_worker.py screen / lightgbm_tune, lab.tune, ml.meta_evaluate (tune) and run_meta (tests count); test_optuna_sees_training_rows_only_and_its_trials_are_counted, test_real_optuna_and_vectorbt_screen_training_bars_only_and_resume
- Part F3: Hansen's SPA and StepM over all candidates tested in a discovery run and over the model types of an ML evaluation, stationary-bootstrap confidence intervals of expectancy (R) and Sharpe; shown next to the Bonferroni result with 'what would change'; the promotion gates are not changedskills/lab_worker.py stats / bootstrap_interval (arch 8.0.0), lab.discovery_stats / loss_stats / stats_job, ml.evaluate(stats) and run_meta; test_spa_stepm_and_the_bootstrap_on_cases_with_a_known_answer, test_the_promotion_gates_are_unchanged
- Part F4: skill features-tsfresh (research_only) - tsfresh features on rolling windows of 64 closed M5, M15 and H1 bars; the columns pass the causal harness and the whitelist is stored with its version; relevance filtering fitted on training folds onlyskills/catalogue.py FeaturesTsfresh, skills/lab_worker.py tsfresh_causal / tsfresh_rows / relevance, lab.tsfresh_rows / relevance; test_the_tsfresh_whitelist_passes_the_causal_harness_and_the_relevance_filter_finds_the_signal, test_the_tsfresh_relevance_filter_is_fitted_on_each_folds_training_rows_only
- Part F4: the features-catalogue whitelist and the tsfresh whitelist are candidate features of the discovery search (one more filter cut at the training median; a rule with a feature filter gives no live signal) and of the ML research; scheduling of features-catalogue decided: computed inside discovery and ML runs, on demand, no schedulelab.feature_matrix / catalogue_rows / event_features / persist_features, discovery.feature_candidates and Table.mask, ml.meta_frames (meta-features-2); test_feature_candidates_use_a_training_median_and_keep_the_rule_reproducible, test_tsfresh_rows_are_cached_per_year_and_asked_once
- Part F5: SHAP for every LightGBM and logistic model in the registry - global importance and per-prediction explanations of the meta-label probabilities; leakage flags for a dominant feature, a time / date / row identifier name, or values strictly rising or falling with time; shown on the ML pageml.shap_job, skills/lab_worker.py shap_report / leakage_flags (shap 0.54.1), lab_reports kind 'shap'; test_shap_flags_a_planted_leak_and_a_row_identifier_for_both_model_types
- Part F6: offline PELT regimes (ruptures) of the Dukascopy H1 volatility and trend; results of S1-S4 and the discovered strategies per regime as a research report only - never live and never an AI-trader inputlab.regimes_job, skills/lab_worker.py regimes (ruptures 1.1.10), lab_reports kind 'regimes'; test_ruptures_regimes_are_a_research_report_and_never_reach_the_ai_trader
- Part F8: running - no new task: with AIGOLD_LAB_SIZE=full the existing AI Gold Strategy Discovery task (scripts/run_task.py --capped) runs the lab stage inside its schedule and budget, resumable; ML evaluations, SPA / StepM, tsfresh and ruptures reports on demand from the dashboard as capped background tasks; install.ps1, release.ps1, server.env.example and docs/DEPLOYMENT.md 9c updated; nothing left running on the PClab.start / run_job / POST /lab/jobs/{job}, python -m backend.research.lab run JOB, python -m backend.research.ml meta|shap; deploy/windows/*; test_the_scheduled_discovery_is_the_old_engine_unless_the_machine_is_set_to_the_full_size, test_the_lab_api_lists_jobs_and_starts_one_as_a_background_task, test_a_lock_left_by_a_killed_job_is_cleared_and_the_run_marked_failed, test_a_cache_write_that_is_stopped_leaves_the_readable_file_in_place
- Part F9: dashboard, no new page - Backtesting Lab (research lab panel: screening counts, Optuna trial counts, survivors, the S3 cross-check, job buttons with the free-memory state; SPA / StepM and bootstrap intervals next to each discovery result), Strategy Registry (results per regime; ML page: Optuna-tuned LightGBM vs the Part E fixed version vs logistic vs take every setup, trial counts, SHAP views and leakage flags), Skills page (tsfresh whitelist and the features-catalogue connection)src/components/research-lab.tsx, discovery-panel.tsx, research-meta.tsx, skills-center.tsx, analytics-dashboard.tsx; GET /lab, POST /lab/jobs/{job}; tests/work-order11.spec.ts
- Part F10: docs/SKILLS_LAYER.md (Part F), docs/THIRD_PARTY.md, docs/RESEARCH_GUIDE.md, docs/BACKTESTING_RULES.md, docs/DEPLOYMENT.md 9c, DECISIONS.md, CHANGELOG 0.33.0, PROJECT_STATUS.md, this record; the answered 'Owner questions of 0.32.0' blocker removedfiles in this release
- Part F full-size runs on the VPS (the screening, the lab triggers' tick events, the feature caches, then the on-demand jobs): not run on the PC by the owner's rule (smoke sizes only)owner: docs/DEPLOYMENT.md 9c; the smoke results are in the tests table
- 0.33.1 (owner answers to the Part F questions): Bonferroni gate unchanged; one count for lab and engine candidates with the StepM decision shown beside the Bonferroni decision on every discovery result; M5, M15 and H1 caches kept; fix - the lab stage checks its time budget before every chunk inside a yearDECISIONS.md 2026-11-11 (answers); lab.tsfresh_rows (FEATURE_CHUNK, OutOfTime), lab.discovery_stage; discovery-panel.tsx; test_the_time_budget_is_checked_before_every_chunk_inside_a_year_and_the_next_run_continues; tests/work-order11.spec.ts
- 0.33.2 (owner answers after 0.33.1): StepM over the full family of the Bonferroni count - every screened candidate run by vectorbt on the test period for this comparison only, inside the research worker after the search is finished; each discovery result shows StepM over the full family, StepM over finalists only and Bonferroni (count N); gates unchanged; the approved Playwright teardown fix also in the work-order7 and work-order8 specsDECISIONS.md 2026-11-11 (0.33.2); skills/lab_worker.py family_losses / stepm_family / sweep_trades, lab.stepm_family_payload / discovery_stats; discovery-panel.tsx; test_the_full_family_stepm_uses_every_screened_candidate_and_its_test_returns_never_reach_selection, test_real_full_family_stepm_runs_every_screened_candidate_on_the_test_period_and_returns_only_the_result; tests/work-order11.spec.ts
- G1: one shared chart component on TradingView lightweight-charts 5.3.0 used on Overview, Live Gold and Market Structure, with every feature of the old hand-drawn chart (23-row parity list), demo AI entries / SL / TP / exits and AI decisions as markers and price lines, the TradingView attribution logo; the old SVG chart code removed after the parity tests passedsrc/components/gold-chart.tsx, structure-chart.tsx; docs/SKILLS_LAYER.md Part G (parity list with the test of each row); tests/work-order12.spec.ts (7 chart tests, desktop and phone), tests/work-order.spec.ts, tests/research.spec.ts
- G1: the two official lightweight-charts agent skills copied into .claude/skills.claude/skills/lightweight-charts, lightweight-charts-plugin-authoring (tradingview/lightweight-charts b4b036e, Apache-2.0); SOURCES.md
- G2: structure overlays from our skills drawn only with the renderer primitives of lightweight-charts-indicators 0.20.3 (boxes, lines, labels, background zones): smc order blocks and FVG, sessions and kill zones, auction POC/VAH/VAL/HVN/LVN, trend lines, previous day/week high-low; each a toggle with its skill, version and as_of; nothing computed in the browserGET /skills/overlays (skills/registry.chart_overlays); smc.windows (session_windows, kill_zone_windows, left out of the AI input); test_chart_overlays_return_the_latest_stored_result_per_skill_and_null_without_one, test_chart_only_outputs_never_reach_the_ai_trader_input, test_smc_reports_session_and_kill_zone_windows_with_the_range_of_their_bars; work-order12.spec.ts G2 tests
- G3: Telegram trade images for a trade open and close, rendered from the G1 chart (headless, chart only) with the mplfinance / matplotlib fallback; made without a bot token, shown in the Telegram Center preview and the outbox, attached when a destination existsmigration 040 telegram_images; telegram.request_image / render_images / fallback_chart; scripts/chart-shot.mjs; trade-images.tsx; test_trade_images_are_requested_without_any_bot_and_rendered_by_the_worker, test_the_fallback_image_needs_the_three_levels_and_bars, test_a_stored_image_is_sent_and_a_slow_chart_falls_back_at_delivery; work-order12.spec.ts G3
- G4: weekly and monthly QuantStats tear sheets of the demo AI (test trades excluded), overall and per strategy: Sharpe, Sortino, drawdowns, monthly table, streaks, Monte Carlo; on Reports, in the weekly / monthly report and in the Telegram outbox; shown only, not in the confidence scorebackend/research/tearsheets.py, skills/tearsheet_worker.py (quantstats 0.0.86, research environment), migration 040 performance_reports, performance-reports.tsx; test_tear_sheets_exclude_test_trades_are_stored_and_reported, test_weekly_report_carries_the_tear_sheet_status, test_quantstats_worker_computes_the_statistics_and_the_html_sheet; work-order12.spec.ts G4
- G5: aiomql 4.1.2 async wrapper with automatic reconnection for the READ side of the MT5 adapter (bars, quote, symbol info, account, positions, pending orders, deals, history import, read-only sync); orders keep the existing code path; bridge state in Accountsbackend/research/mt5_bridge.py; brokers.Mt5Adapter.read, terminal._module, mt5_history.Terminal; test_adapter_reads_give_the_same_answers_through_the_read_bridge, test_reads_reconnect_after_the_terminal_was_closed_and_reopened, test_a_lost_connection_is_restored_inside_one_read, test_a_closed_terminal_is_never_started_by_a_reconnect, test_the_order_path_does_not_use_the_read_bridge; the unchanged broker tests; work-order12.spec.ts G5
- G6: read-only MT5 MCP server for research chats (mcp-metatrader5-server 0.1.8) in its own environment, stdio only, order tools not exposedbackend/research/mt5_mcp.py (allowlist of 21 read tools), backend/requirements-mcp.txt, docs/MT5_MCP.md, backend/tests/test_mt5_mcp.py
- G7: lot-size cross-check with EarnForex/PositionSizer's formula on 13 cases; our result correct on all; no code changedocs/LOT_SIZE_CHECK.md, backend/tests/test_lot_size_check.py
- G8: coding-agent skills from anthropics/skills (skill-creator, mcp-builder, claude-api, webapp-testing) and tradermonty/claude-trading-skills (mt5-robot-tester, skill-designer, skill-integration-tester, dual-axis-skill-reviewer); every skill's source, commit and licence recorded; vectorbt-backtesting-skills listed as a reading reference only.claude/skills/SOURCES.md, docs/THIRD_PARTY.md (work order #12)
- G8: ALAGENT-HKU/x2strategy as an optional skill - dropped by owner decisionOwner answer 2026-11-11 (DECISIONS.md, 0.34.1): dropped; the repository has no LICENSE file and the skill was optional
- G9: documentationdocs/SKILLS_LAYER.md Part G, docs/THIRD_PARTY.md, docs/MT5_MCP.md, docs/LOT_SIZE_CHECK.md, docs/DEPLOYMENT.md 9d, DECISIONS.md 2026-11-11 (work order #12), CHANGELOG 0.34.0, PROJECT_STATUS.md
- 0.34.1 (owner answers to the Part G questions): Monte Carlo ruin level = Risk Center max drawdown pause, shown with each report; scheduled task AI Gold Monthly Report with the monthly tear sheets; smc 1.1.0 (research_only); MCP server approved with its read-only extra tools; close-trade notify change approved; x2strategy droppedDECISIONS.md 2026-11-11 (0.34.1); tearsheets.ruin_level; deploy/windows/install.ps1 (MonthlyAt, AI Gold Monthly Report); skills/structure.py SmcSkill 1.1.0; test_the_ruin_level_follows_the_risk_center_max_drawdown_pause, test_smc_1_1_0_registers_over_1_0_0_and_keeps_research_only; tests/work-order12.spec.ts
- 0.34.2 (owner work order #13): AI Gold Monthly Report registers on Windows - the monthly trigger (last day of every month 23:59) is set through the task XML instead of MSFT_TaskMonthlyTrigger, which Task Scheduler rejected (HRESULT 0x80070057) and which stopped install.ps1 before AI Gold Daily Backup and AI Gold Weekly Market Backupdeploy/windows/install.ps1 Set-LastDayOfMonthTrigger; verified on this PC with a temporary test task (Export-ScheduledTask: ScheduleByMonth, Day Last, 12 months, 23:59; next run 2026-11-30 23:59; registered twice; deleted); existing AI Gold tasks untouched
Work
- Part A - Skills foundation + indicators: skill contract and registry, causal harness, two Python environments, indicators-talib, indicators-live, features-catalogue, AI trader input plumbing (OFF), Skills page, documentation (0.28.0: done).
- Part B - Market structure: smc (causal adapter), auction (MarketProfile + OrderFlow-Analysis-Pro port), levels-trendlines (trendln), rules-stolgo (grammar, presets, S3 cross-check), structure worker, reports on the Skills page (0.29.0: done).
- Part C - Macro and news: macro (FRED/ALFRED point-in-time + Yahoo daily), news (official feeds, Google News, GDELT, full text, finBERT), fed (FOMC-RoBERTa Fed index, FOMC history, event study), cot (Legacy history gap), OpenBB evaluation, tasks, dashboard (0.30.0: done; Fed scoring waits for the owner's access to the gated model).
- Part D - AI trader upgrades: trader v5 flow (falsifier, horizon, WAIT, bull/bear debate, Challenger, budget check, decision log with automatic scores), odds-timemachine, knowledge, cot-contrarian, news-reaction-failure, macro-regime, drawdown-breaker and discipline-gate (advisory), post-trade reviews (0.31.0: done).
- Part E - Risk and ML: skills volatility (GARCH), regime (HMM, filtered probabilities), forecast (Chronos-Bolt small, Chronos-2 small, Kronos mini / small) and drift (ADWIN, Page-Hinkley), each research_only with a walk-forward evaluation on the Dukascopy history; LightGBM as a second model type of the ML research with meta-labeling of every strategy's setups under the same registry gates (0.32.0: done; the forecast evaluation is incomplete - H1 done, H4 not done - and TimesFM 2.5 was removed by owner decision).
- Part F - Research lab: vectorbt + Optuna screening of the stolgo rule presets before the discovery search (survivors go to our tick engine; every screened candidate counts in the Bonferroni count), Optuna-tuned LightGBM, Hansen's SPA / StepM and stationary-bootstrap intervals next to the Bonferroni result (gates unchanged), the tsfresh feature factory and the features-catalogue connection, SHAP with leakage flags, offline PELT regimes for research reports, a free-memory check before every heavy job (0.33.0: done; the full-size runs are the owner's on the VPS).
- Part G - Charts, reports and MT5: one shared lightweight-charts chart on Overview, Live Gold and Market Structure (full parity with the old SVG chart, demo AI trades and decisions on it), structure overlays drawn from our skills with the lightweight-charts-indicators renderer, Telegram trade images (dashboard chart, matplotlib fallback), QuantStats tear sheets, the aiomql MT5 read bridge, a read-only MT5 MCP server, the lot-size cross-check and the coding-agent skills. Built in 0.34.0; x2strategy not copied (no LICENSE file).
Blockers / decisions needed
- Forecast evaluation incomplete: H1 done, H4 not done. It continues from its checkpoint (data\skills\forecast) when run again on the VPS (Skills page, forecast card).
- Owner: FRED key and access to the gated FOMC-RoBERTa (Part C); for news-reaction-failure the per-event direction map (empty); a second provider with a working key AND prices for its model in AI Brain (the Groq and Gemini models have no price, so the Challenger uses claude-sonnet-5-5 of the trader's provider).
- Owner: the news window SL/TP limits in the Risk Center are empty, so every demo OPEN inside the USD news window waits.
- Owner: open the MT5 terminal on this PC (closed on 2026-11-10: the demo AI cannot trade and the automatic sync reports 'unavailable'); start the indicators-live, structure, news, reviews, risk, forecast and drift workers when wanted; on the VPS the 'AI Gold ...' tasks run them.
- Part F: the full-size lab runs are the owner's on the VPS (AIGOLD_LAB_SIZE=full, docs/DEPLOYMENT.md 9c): the screening, the feature caches (about 112,000 engine events on three timeframes: many discovery cycles), then the on-demand jobs. On the PC only smoke sizes ran; at smoke size no stolgo candidate passed the screening.
- Owner to decide after the full-size VPS runs: whether StepM replaces or joins the Bonferroni gate (kept as it is now; lab and engine candidates in one count).
- Open item (owner 2026-11-11, not built): discovered rules that use features-catalogue or tsfresh features cannot trade on the demo until a live feature feed exists; such a rule gives no signal.
- Part G on this PC: the skill overlays have no stored result until the structure worker runs (VPS task AI Gold Skills Structure).
Tests run
| Command | Result | When |
|---|---|---|
.venv-research/Scripts/python -m backend.research.skills.catalogue_worker (causal_test, 1,200 stored Exness XAUUSDm M15 bars) | 24 cases, 403 columns (62 patterns), 394 whitelisted, 9 excluded: DPO_20, ICS_26, TOS_STDEVALL_LR, TOS_STDEVALL_L_1..3, TOS_STDEVALL_U_1..3 (25.3 s) | 2026-11-09 |
python -m backend.research.skills.registry register (scratch database, stored Exness M15 fixture) | indicators-talib passed (24 cases, 81 outputs), indicators-live passed (24 cases, 20 outputs), features-catalogue passed (9 columns excluded); research worker caps applied (3072 MB, 35 % CPU) | 2026-11-09 |
python -m backend.research.skills.registry run indicators-talib --source exness --timeframe M15 / run features-catalogue --bars 7658 | ok, as_of 2026-11-03T08:00:00Z; catalogue 394 columns x 7,658 rows in 10.8 s (capped), matrix csv.gz written | 2026-11-09 |
backend.research.skills.live serve 75 s on the open MT5 terminal (scratch database) | warmed up M1 2012 / M5 2001 bars; new closed M1 bar 09:18 stored at 09:19:02, status ok | 2026-11-09 |
pytest backend/tests/test_skills.py -s | 15 passed. talipp vs TA-Lib after 500 bars: 7,658 stored M15 bars EMA50 7.3e-12, EMA200 3.1e-11, CCI 9.9e-10, OBV 0. TA-Lib vs advanced.py: EMA20 1.4e-12, EMA50 4.5e-12, RSI 5.7e-14; ATR 1.4e-3 / MACD 0.18 / signal 0.38 overall (seed), < 3e-15 / 1.8e-12 / 1.5e-12 after 500 bars | 2026-11-09 |
npm.cmd run test:backend | 400 passed in 726 s (385 before + 15 new) | 2026-11-09 |
npm.cmd run format:check / typecheck / lint:backend | passed: Prettier clean, typecheck ok, ruff clean | 2026-11-09 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | 89 passed, 3 device skips (incl. tests/work-order6.spec.ts: Skills page at 1920, 1366 and phone width; mode switch requires re-authentication) | 2026-11-09 |
npm.cmd run build | passed (/skills route built) | 2026-11-09 |
PowerShell parser on deploy/windows/install.ps1 and release.ps1 | 0 parse errors each | 2026-11-09 |
GitHub Actions ci #46 (commit 59a17dd, 0.28.0) | passed: completed successfully in 10m 16s (format, typecheck, ruff, backend tests incl. the research environment, roadmap sync, build, Playwright) | 2026-11-09 |
pip install --dry-run (each Part B package, constrained by backend/requirements-research.txt) | smartmoneyconcepts 0.0.27, trendln 0.1.18, MarketProfile 0.2.0 install; stolgo 0.2.0: ResolutionImpossible (bandl needs pandas<3) - asked the owner: install --no-deps | 2026-11-09 |
fresh venv: pip install --no-deps -r backend/requirements-research.txt; import pandas_ta_classic, smartmoneyconcepts, market_profile, trendln, stolgo | all import; pip check reports only bandl and pyarrow missing (by decision) | 2026-11-09 |
python -m backend.research.skills.registry register (scratch database, stored Exness M15 fixture) | 7/7 passed: indicators-talib, indicators-live, features-catalogue (9 excluded), smc 24 cases 2.5 s, auction 24 cases 43 s (600 bars), levels-trendlines 24 cases 79 s (500 bars), rules-stolgo 24 cases 1.0 s | 2026-11-09 |
registry run smc / auction / levels-trendlines / rules-stolgo --source exness --timeframe M15 --bars 1200 | all ok, as_of 2026-11-09T11:00:00Z | 2026-11-09 |
registry report smc_agreement / auction_vs_s2 / stolgo_vs_engine --year 2025 | stored; smc vs advanced Exness M15 swings 575/552 (485 matched), stolgo vs engine 192/192 signals matched, 167 same exit kind, R mean diff 0.108 | 2026-11-09 |
structure_worker serve on the open MT5 terminal (scratch database, ~3 min) | 9 runs per closed M5 bar (smc M5/M15/H1/H4, auction M5, levels-trendlines M5/M15/H1/H4), all ok | 2026-11-09 |
pytest backend/tests/test_skills_structure.py -s | 16 passed; raw smc fails the harness (bos, bos_broken_index, choch, fvg_mitigated_index, liquidity, liquidity_swept, ob, swing), 116 swing labels changed; adapted smc 24/24 | 2026-11-09 |
npm.cmd run test:backend | 416 passed in 460 s (400 before + 16 new) | 2026-11-09 |
npm.cmd run format:check / typecheck / lint:backend | passed | 2026-11-09 |
npx playwright test (temporary copy on ports 3300/8300, clean .next/dev) | 93 passed, 3 device skips (incl. tests/work-order7.spec.ts at 1920, 1366 and phone width) | 2026-11-09 |
npm.cmd run build | passed | 2026-11-09 |
PowerShell parser on deploy/windows/install.ps1 and release.ps1 | 0 parse errors each | 2026-11-09 |
GitHub Actions ci #48 (commit d29fc8e, 0.29.0) | passed: completed successfully in 15m 26s (format, typecheck, ruff, backend tests incl. the research environment installed --no-deps from the lock, roadmap sync, build, Playwright) | 2026-11-09 |
pip install --dry-run --report (69 new research packages, the pinned file as constraints) | passed: resolved, no existing pin changed; installed --no-deps; torch 2.15.0+cpu from the PyTorch CPU index | 2026-11-09 |
npm.cmd run format:check | passed: All matched files use Prettier code style! | 2026-11-09 |
npm.cmd run typecheck | passed | 2026-11-09 |
npm.cmd run lint:backend (ruff) | passed: All checks passed! | 2026-11-09 |
npm.cmd run test:backend | passed: 433 passed in 466.93s (17 new in test_skills_part_c.py) | 2026-11-09 |
python -m pytest backend/tests/test_skills_part_c.py | passed: 17 passed (ALFRED as-of, known_at rule, feed parsing + dedupe, trafilatura failure keeps the headline, GDELT on saved responses, Fed index on a hand-labelled statement, causal harness of macro/news/fed/cot, encrypted FRED key, spike OFF, Legacy COT gap and release rule) | 2026-11-09 |
causal harness on this PC (stored Exness XAUUSDm M15, last 1200 bars to 2026-11-09T18:00Z + data fixture seed 32) | passed: macro 24 cases / 9 outputs, news 24 / 5, fed 24 / 1, cot 24 / 2; all registered research_only | 2026-11-09 |
npx playwright test (desktop + mobile Edge; Part C at 1920, 1366 and phone width) | passed: 99 passed, 3 device skips (6 new in tests/work-order8.spec.ts) | 2026-11-09 |
npm.cmd run build | passed | 2026-11-09 |
PowerShell parser on deploy/windows/install.ps1 and release.ps1 | 0 parse errors each; 22:30 UTC -> 03:30 on this PC (Pakistan Standard Time) | 2026-11-09 |
Live check FRED/ALFRED | waiting for owner key (no FRED key entered; recorded as waiting_for_key for all six series) | 2026-11-09 |
Live check Yahoo (macro refresh 2026-11-09 18:07 UTC) | passed: DX-Y.NYB 14,181 days (1971-01-04 → 2026-11-06), ^TNX 16,201 (1962-01-02 →), GC=F 6,573 (2000-08-30 →); macro run as_of 2026-11-08 ok; Yahoo answered 429 to the crumb request and the data still came | 2026-11-09 |
Live check feeds (2026-11-09 18:08 UTC) | passed: fed-press 20, fed-speeches 15, ecb-press 15, boe-news 50 new items; next cycle 19:11 UTC: Fed feeds 304 not modified, ECB/BoE 0 new | 2026-11-09 |
Live check Google News | passed: 'gold' 20 results / 20 links resolved (18:09 UTC); 'XAUUSD' 20 results / 18 resolved (19:13 UTC) | 2026-11-09 |
Live check GDELT | rate-limited by GDELT in the worker at 18:09, 19:13 and 19:26 UTC (HTTP 429 'Please limit requests to one every 5 seconds'), each recorded and backed off; single requests at 18:16, 18:59 and 19:10 UTC succeeded and are the saved fixtures (timelinevol, timelinetone, artlist). Owner question in the report. | 2026-11-09 |
Live check trafilatura full text | passed: 10 of 10 pages per cycle (federalreserve.gov after reading robots.txt with our user agent: 404 = allowed) | 2026-11-09 |
Live check finBERT (download + scoring) | passed: ProsusAI/finbert downloaded, 120 + 18 headlines scored on CPU | 2026-11-09 |
Live check FOMC-RoBERTa download and one scored statement | waiting for owner access: the model is gated on Hugging Face (401 'Access to model gtfintechlab/FOMC-RoBERTa is restricted'); 360 Fed texts are stored and pending | 2026-11-09 |
Live check Fed history (fed_worker history --from 2003) | passed: 19 calendar pages, 343 documents (151 statements, 90 with a release time on the page; 189 minutes, 149 with a 'Released' date), 918 s | 2026-11-09 |
Live check Legacy COT (news_sources cot-legacy) | passed: 876 weeks 1986-01-15 → 2006-06-06; release times: legacy_unknown 876 (none used); Disaggregated unchanged known 1051 / unknown 14 | 2026-11-09 |
Live check FOMC event study (registry report fomc_event_study) | ran: 0 events - no scored statement yet (waits for the model); stored as skill_reports fomc_event_study | 2026-11-09 |
OpenBB evaluation (throwaway venv, openbb 5.0.0) | federal_reserve.treasury_rates OK (25 rows), nasdaq.economy.calendar OK (216 events), fred tips_yields without key: Missing credential 'fred_api_key' | 2026-11-09 |
GitHub Actions ci #50 (commit 7892672, 0.30.0) | passed: completed successfully in 14m 32s (format, typecheck, ruff, backend tests incl. the research environment with torch CPU and the Part C packages installed --no-deps, roadmap sync, build, Playwright) | 2026-11-09 |
pip install --dry-run --report chromadb (the pinned research file as constraints) | passed: resolved, no existing pin changed; 47 new exact pins installed --no-deps | 2026-11-10 |
npm.cmd run format:check | passed: All matched files use Prettier code style! | 2026-11-10 |
npm.cmd run typecheck | passed | 2026-11-10 |
npm.cmd run lint:backend (ruff) | passed: All checks passed! | 2026-11-10 |
npm.cmd run test:backend | passed: 459 passed in 605.54s (25 new: test_trader_flow.py 9, test_trader_skills.py 16 incl. 6 parametrized) | 2026-11-10 |
test_trader_flow.py (mocked LLMs) | passed: full OPEN flow (2 rounds: trader, bull, bear, bull, bear, trader, challenger; cost 0.07); OPEN without falsifier/horizon -> WAIT (4 cases); bull, bear, final trader and Challenger failure -> no trade; first call failure -> no_decision; Challenger reject -> WAIT; same-provider fallback labelled and single-model provider -> no trade; budget 0.12 left runs, 0.08 left blocked before any debate call with the AI keys warning; kill switch during the flow -> blocked_risk; management identical to v3 (same breakeven, no debate); counterfactual target / stop / both / neither / sell / incomplete bars and score_due + scores | 2026-11-10 |
test_trader_skills.py | passed: Time Machine reproducible with seed 19 and no use of later bars; causal harness 24/24 for all 7 new skills (research_only, no ai_block); COT index hand fixture (-100,-50,-20,100 -> 100.0; flat -> None; 90/10 boundaries; gate table); released-reports-only; news-reaction boundaries of the original; no event without the owner's direction map; drawdown breaker defaults; discipline/drawdown advisory only (trade still executed, advisory COOLDOWN / NO_GO logged); reviews (postmortems, coach, digest; digest fixture 0.5 / 25.0 / 2.0 / 50.0 / R 0.25 / 1.0607); every Part D skill runs on stored data | 2026-11-10 |
causal harness on this PC (stored Exness XAUUSDm M15, last 1200 bars + data fixtures) | passed: odds-timemachine 24/4, knowledge 24/1, news-reaction-failure 24/12, cot-contrarian 24/6, macro-regime 24/5, drawdown-breaker 24/3, discipline-gate 24/2 (cases/outputs); all research_only | 2026-11-10 |
knowledge index build (knowledge_worker, live) | passed: 726 cards, 19 terms, 15 exact (initial balance, P-shape, b-shape, double distribution are nearest matches; two are wrong cards, shown with the method) | 2026-11-10 |
npx playwright test (desktop + mobile Edge; Part D at 1920, 1366 and phone width) | passed: 107 passed, 3 device skips (8 new in tests/work-order9.spec.ts; the AI Brain status-role clash fixed) | 2026-11-10 |
npm.cmd run build | passed | 2026-11-10 |
PowerShell parser on deploy/windows/install.ps1 and release.ps1 | 0 parse errors each | 2026-11-10 |
Live demo run on this PC (trader v5, real provider, 2026-11-09 21:56 UTC) | WAIT (no platform setup, late session, mixed structure): 1 call claude/claude-opus-5-5 trader-v5, ok, 14.5 s, cost $0.089627; no debate or Challenger (not an OPEN); journal status wait, decision_flows outcome wait | 2026-11-10 |
GitHub Actions ci #53 (commit 57a2517, 0.31.0) | passed: completed successfully in 18m 18s (format, typecheck, ruff, backend tests incl. the research environment with chromadb installed --no-deps, roadmap sync, build, Playwright) | 2026-11-10 |
0.31.1: npm.cmd run format:check / typecheck / lint:backend (ruff) | passed: All matched files use Prettier code style!; types generated, tsc clean; All checks passed! | 2026-11-10 |
0.31.1: npm.cmd run test:backend | passed: 470 passed in 655.75s (11 new in test_owner_decisions_part_d.py) | 2026-11-10 |
0.31.1: npx playwright test (desktop + mobile Edge; pages at 1920, 1366 and phone width) | passed: 106 passed, 3 device skips, 1 failure on the first run that is not a product defect (mobile 'healthy pages' test: the dev server's HMR WebSocket failed with net::ERR_NO_BUFFER_SPACE on this PC); that test re-run alone: 2 passed (desktop + mobile) | 2026-11-10 |
0.31.1: npm.cmd run build | passed | 2026-11-10 |
0.31.1: migration 035 on data/workspace.sqlite3 (read-only check) | applied 2026-11-10T05:44:49Z by the scheduled tasks; autopilot_settings.self_review_min_scored (INTEGER NOT NULL DEFAULT 30, CHECK >= 1, value 30) and table self_reviews match the migration file | 2026-11-10 |
GitHub Actions ci #55 (commit f86a149, 0.31.1) | passed: completed successfully in 13m 1s | 2026-11-10 |
0.31.2: npm.cmd run format:check / typecheck / lint:backend (ruff) | passed: All matched files use Prettier code style!; types generated, tsc clean; All checks passed! | 2026-11-10 |
0.31.2: npm.cmd run test:backend | passed: 477 passed in 593.35s (7 new in test_release_0_31_2.py). The run before it had 22 failures caused by this release (a migration audit row in the empty audit log of a fresh install, the research account simulation reading the new Risk Center values, the expected settings version): the migration audit row was removed, research and the live pilot read risk.account_settings, test_risk.py and the test_bot.py helper updated | 2026-11-10 |
0.31.2: test_release_0_31_2.py | passed: fresh install = version 3 with the six values, other values unchanged, live pilot limits 1 / 2 / 2 / 1 / 3 / 6 and OFF, research = live pilot limits; owner instruction through risk.save: version 3, one audit entry with the note and the changed fields, second run unchanged, snapshot owner_risk_settings = new values; endpoint path still saves a version with its audit entry; Challenger: unpriced second provider skipped, priced one chosen, no priced candidate = used and left out of the estimate; path-test trade marked test and out of summary, confidence, performance and breaker; automatic sync read-only (nothing sent), stale / connected / error status, audit only on a status change; breaker on the owner's values (2 % day allowed, 10 % halted, 20 % week, streak 3, settings version by time) and advisory only | 2026-11-10 |
0.31.2: npx playwright test (desktop + mobile Edge; pages at 1920, 1366 and phone width) | passed: 107 passed, 3 device skips (the Risk Center test expects risk per trade 10) | 2026-11-10 |
0.31.2: npm.cmd run build | passed | 2026-11-10 |
0.31.2 on this PC's workspace (backup workspace-20261110T104025159632Z.sqlite3 first) | python -m backend.research.risk owner-instruction-2026-11-10 -> {status: saved, version: 3}; audit 'Risk settings version 3 by coding agent (owner's written instruction 2026-11-10) (set by the coding agent on the owner's written instruction of 2026-11-10): risk_per_trade_pct 1.0 -> 10.0, max_trades_per_day 2 -> 4, daily_loss_pct 3.0 -> 10.0, weekly_loss_pct 6.0 -> 20.0'; migrations 036-037 applied (037 changed nothing); live_settings enabled 0 with limits 1 / 2 / 2 / 1 / 3 / 6. Side effect found and fixed: the scheduled bot research re-summarized S1-S4 with the new values at 10:41 UTC (1-2 trades each); after the fix the 11:11 UTC run restored 25 / 12 / 14 / 16 trades (PF 0.38 / none / 0.14 / 0.0) and the 11:16 UTC discovery search gave the earlier result (97008 candidates, 4 tested, 1 survivor) | 2026-11-10 |
GitHub Actions ci #56 (commit f2e307e, 0.31.2) | passed: completed successfully in 18m 27s (format, typecheck, ruff, backend tests incl. the research environment, roadmap sync, build, Playwright) | 2026-11-10 |
pip install --dry-run --report for arch, lightgbm, hmmlearn, river, chronos-forecasting (the pinned research file as constraints), then pip install --no-deps -r backend/requirements-research.txt and pip check | passed: every package resolved with no existing pin changed; 15 new exact pins (wrapt pinned to the stable 2.5.2 instead of the pre-release pip resolved); pip check shows only the two known stolgo notes (bandl, pyarrow) | 2026-11-10 |
0.32.0: npm.cmd run format:check / typecheck / lint:backend (ruff) | passed: All matched files use Prettier code style!; types generated, tsc clean; All checks passed! (the vendored Kronos folder is excluded from ruff) | 2026-11-10 |
0.32.0: npm.cmd run test:backend | passed: 497 passed in 968.21s (20 new in test_skills_part_e.py) | 2026-11-10 |
0.32.0: test_skills_part_e.py | passed: GARCH fit reads only bars closed before the day, at most 2,000, one fit per day, hand-checked forward filter, prefix-causal; HMM forward probabilities identical when later bars are added or changed, weekly fits, states ordered by volatility; forecast stub: ordered quantiles, context ends at the bar, causal harness 18 outputs, one failing model does not hide the others, no TimesFM; drift streams standardise with earlier values only, detect a known ATR jump only after it, sample sizes; verdict rule PASS / FAIL / INCONCLUSIVE and Bonferroni; regime evaluation on filtered states; meta labels [1, 0] from hand-built ticks; purged chronological meta walk-forward against take-every-setup; LightGBM model registered RESEARCH_ONLY, approval refused without owner / with weak evidence / wrong password, approved with PASS + re-authentication; feature matrix reads the last closed bar only; new skills research_only, ai_block None, demo AI trade identical (prompt trader-v3, no skills key), Risk Center unchanged, drift warning on the monitoring path without a Telegram alert; evaluate endpoint 200 / 409 / 404; live worker one run per new closed bar. Research environment (real libraries): causal harness of volatility, regime and drift 24/24; forecast harness with the cached models; real GARCH, HMM and river detect a known change; volatility evaluation on a small market store; real LightGBM deterministic with library defaults | 2026-11-10 |
0.32.0: npx playwright test (desktop + mobile Edge; Skills page and ML page at 1920, 1366 and phone width) | passed: 116 passed, 3 device skips, 1 timeout on the first run that is not a product defect (the first test, 'every route supports direct entry', 60 s timeout during the cold dev-server compile while the PC was low on memory); that test run again alone: 2 passed (desktop + mobile). 10 new tests in tests/work-order10.spec.ts | 2026-11-10 |
0.32.0: npm.cmd run build | passed | 2026-11-10 |
PowerShell parser on deploy/windows/install.ps1 and release.ps1 | 0 parse errors each | 2026-11-10 |
causal harness on this PC (stored Exness XAUUSDm M15, last 1200 bars; forecast: the last 600) and one run of each skill on stored bars | passed: volatility 24 cases / 9 outputs, regime 24 / 5, drift 24 / 12, forecast 24 / 72 with the four real models (4 forecast points, 255 s); all research_only. Runs: volatility M5 / M15 / H1 ok, regime H1 ok, drift ok | 2026-11-10 |
python -m backend.research.skills.risk_ml evaluate volatility (Dukascopy 2003-2026, under the worker caps) | FAIL in 776.6 s: 9 of 9 cells FAIL against the better baseline (ATR14 x sqrt(bars)); GARCH above the 24-bar std on correlation in 8 of 9 cells; owner check confirmed on the full history (H1 next bar 0.350 against 0.324) | 2026-11-10 |
python -m backend.research.skills.risk_ml evaluate regime (Dukascopy H1 2003-2026, under the worker caps) | INCONCLUSIVE in 386.4 s: next-hour move PASS for 2 and 3 states (24 of 24 years), S2 and pooled setups PASS, S1 / S3 / S4 FAIL | 2026-11-10 |
python -m backend.research.ml meta (S1-S4, D-AIOWN v1 and v2, D-c6b350; logistic and LightGBM) | 14 evaluations stored: PASS S2 logistic, S2 LightGBM, S3 LightGBM; INCONCLUSIVE S3 logistic, S4 LightGBM; FAIL the other 9. 427 features; catalogue rows found for every setup | 2026-11-10 |
python -m backend.research.skills.risk_ml evaluate forecast (Dukascopy, H1 and H4) | INCOMPLETE: the run was stopped when the PC ran low on memory; H1 finished for the four models (400 / 400 / 300 / 200 points), H4 not started. Report stored from the checkpoint and marked incomplete (owner decision). H1: close FAIL for every model and horizon against 'no change'; range PASS for Chronos-2 small (1 and 4 bars) and Chronos-Bolt small (1 bar) | 2026-11-10 |
TimesFM 2.5 memory measurement (isolated process inside the Job Object caps) | 3072 MB: the process crashes while loading (exit 139); 4096 MB: loads and forecasts (about 1,970 MB in use afterwards). Removed by owner decision; no cap changed | 2026-11-10 |
GitHub Actions ci #59 (commit 444ab33, 0.32.0) | passed: completed successfully in 17m 42s (format, typecheck, ruff, backend tests incl. the research environment with the Part E packages installed --no-deps, roadmap sync, build, Playwright) | 2026-11-10 |
Part F: pip install --dry-run then pip install --no-deps (vectorbt, optuna, tsfresh, shap, ruptures; constrained by backend/requirements-research.txt) | installed into .venv-research: vectorbt 1.2.0, optuna 5.0.0, tsfresh 0.21.2, shap 0.54.1, ruptures 1.1.10 and 31 dependencies (36 new exact pins); pip freeze before / after: no existing pin changed | 2026-11-11 |
Part F smoke (scratch copy of the workspace, smoke size): python -m backend.research.lab run tsfresh | finished in 28 s, peak 63 MB: causal harness passed, 504 columns whitelisted, 273 excluded. Also run on this PC's workspace: features-tsfresh 1.0.0 registered research_only, whitelist version 1.0.0+tsfresh-0.21.2+w64+e844d23acb73 | 2026-11-11 |
Part F smoke: python -m backend.research.lab run vectorbt_s3 --year 2025 | finished in 10 s, peak 332 MB: 70,893 M5 bars, 192 engine setups, 192 vectorbt trades, 192 matched, 147 with the same exit kind; total R engine -79.70, vectorbt -37.05; R difference per setup mean 0.222, mean absolute 0.722, largest 3.94; engine exits not modelled in vectorbt: 24 breakeven stop, 16 pre-news Case C, 4 pre-news Case A | 2026-11-11 |
Part F smoke: python -m backend.research.lab run stats (latest stored discovery run, 200 bootstrap repetitions) | finished in 12 s, peak 702 MB: 4 candidates, 1,201 weekdays; SPA p (lower / consistent / upper) 0.05 / 0.05 / 0.05; StepM superior set D-c6b350; Bonferroni pass D-c6b350 - no difference between the two; 95 % interval of expectancy: D-c6b350 0.034 to 0.304 R (n 242), D-3b406d -0.010 to 0.288 R (n 241), D-3cbb4a -0.365 to 0.185 R (n 87), D-3a9ea7 -0.263 to 0.282 R (n 87) | 2026-11-11 |
Part F smoke: python -m backend.research.lab run regimes | finished in 18 s, peak 714 MB: 138,539 H1 bars, 7,169 days (2003-10-28 to 2026-10-27), 27 volatility segments and 25 trend segments; mean R per volatility regime (high / normal / low): S1 -0.359 / -0.457 / -0.503, S2 -0.584 / -1.015 / -0.579, S3 -0.701 / -1.063 / -0.679, S4 -0.189 / -0.259 / -0.296, D-c6b350 0.055 / 0.083 / 0.045 | 2026-11-11 |
Part F smoke: lab.discovery_stage with a 900 s budget (smoke size: 2 Optuna trials per family, the last 366 days of the training period) | screening 77 s, peak 467 MB: 71,013 M5 bars (2016-08-14 to 2017-08-15), 10 trials, 200 candidates screened, 0 passed the screening rule, so no trigger was kept and 0 lab events were built for 2003-2026; then the feature caches of the engine's events: 2003 and 2004 done when the budget ended (status 'working: features', the run took 1,260 s because one year is finished before the budget is checked); about 16 tsfresh windows per second under the caps on this PC | 2026-11-11 |
Part F smoke: discovery.search with tsfresh M15 feature candidates for the trigger asia_breakout | 369 s, peak 701 MB: 9,864 base candidates tried, 0 kept by the training rule, so 0 feature candidates were tried and nothing was tested on the unseen period | 2026-11-11 |
Part F smoke: python -m backend.research.ml meta S1 (three model types, 4 Optuna trials) | finished in 386 s, peak 719 MB: logistic FAIL (pooled test log loss 0.25847 against take-every-setup 0.23462), lightgbm FAIL (0.25185), lightgbm_optuna FAIL (0.25528; 4 trials, inner rows 170 / 57, m = 9); SPA p (consistent) 0.905, StepM superior set empty, Bonferroni pass none. The first attempt failed with 'File is not a zip file': a cache file left half-written by the run stopped the night before - fixed (year caches are written whole or not at all) and run again | 2026-11-11 |
Part F smoke: python -m backend.research.ml shap (five smoke models registered in the scratch copy) | finished in 31 s, peak 734 MB: 5 models explained on 611 setups each, 0 leakage flags; largest share of mean |SHAP|: lightgbm_optuna catalogue_VHF_28 6.8 %, lightgbm catalogue_BR_26 6.0 %, logistic catalogue_HILOl_13_21 2.0 % | 2026-11-11 |
npm.cmd run format:check / typecheck / lint:backend (0.33.0) | passed: Prettier clean, typecheck ok, ruff clean | 2026-11-11 |
npm.cmd run test:backend (0.33.0) | 515 passed in 1083.60s (0:18:03) (497 before + 18 new in backend/tests/test_skills_part_f.py, 6 of them with the real vectorbt, Optuna, arch, tsfresh, shap and ruptures in the research environment) | 2026-11-11 |
npx playwright test (0.33.0, temporary copy on ports 3300/8300, clean .next/dev) | 127 passed, 3 skipped (5.9m), incl. 10 new in tests/work-order11.spec.ts: Backtesting Lab, Strategy Registry, ML page and Skills page at 1920, 1366 and phone width | 2026-11-11 |
npm.cmd run build (0.33.0) | passed | 2026-11-11 |
PowerShell parser on deploy/windows/install.ps1 and release.ps1 (0.33.0) | 0 parse errors each | 2026-11-11 |
GitHub Actions ci #62 (commit e533a94, 0.33.0) | passed: completed successfully in 15m 2s (format, typecheck, ruff, backend tests incl. the research environment, roadmap sync, build, Playwright) | 2026-11-11 |
npm.cmd run format:check / typecheck / lint:backend (0.33.1) | passed: Prettier clean, typecheck ok, ruff clean | 2026-11-11 |
npm.cmd run test:backend (0.33.1) | 516 passed in 1021.90s (0:17:01) (515 before + 1 new: the time budget checked before every chunk inside a year) | 2026-11-11 |
npx playwright test (0.33.1, temporary copy on ports 3300/8300, clean .next/dev) | 127 passed, 3 skipped (5.5m) | 2026-11-11 |
npm.cmd run build (0.33.1) | passed | 2026-11-11 |
GitHub Actions ci #63 (commit d1c53b7, tracker record) and #64 (commit d013c3f, 0.33.1) | FAILED, both on the same Playwright test: tests/work-order10.spec.ts:165 'the evaluation button starts the capped background run and reports it' - Error: apiResponse.json: Response has been disposed (#63: 1 failed, 1 flaky, 125 passed; #64: 1 failed, 126 passed); every other step passed. Cause: a teardown race in the test (the page's reload of /skills still inside the test's route handler when the test ended) | 2026-11-11 |
npx playwright test tests/work-order10.spec.ts tests/work-order11.spec.ts (after the test fix: page.unrouteAll before the test ends; no assertion changed) | 20 passed (55.2s) | 2026-11-11 |
GitHub Actions ci #65 (commit 00b3f00, 0.33.1 with the test fix) | passed: completed successfully in 15m 9s (format, typecheck, ruff, backend tests incl. the research environment, roadmap sync, build, Playwright) | 2026-11-11 |
0.33.2 smoke: lab.discovery_stats with the full family on the scratch copy (stored discovery run, smoke screening of 10 trials = 200 candidates, 200 repetitions) | first attempt: the worker stopped on the 3072 MB cap (one vectorbt run of 334,138 bars x 20 columns) - fixed by running every sweep in day-aligned pieces of about 80,000 bars; then 23 s, worker peak 808 MB: family 204 (4 finalists + 200 screened, 0 without a test trade), StepM over the full family: superior set empty; StepM over finalists only: D-c6b350 | 2026-11-11 |
npm.cmd run format:check / typecheck / lint:backend (0.33.2) | passed: Prettier clean, typecheck ok, ruff clean | 2026-11-11 |
npm.cmd run test:backend (0.33.2) | 518 passed in 1023.49s (0:17:03) (516 before + 2 new: the full-family StepM uses every screened candidate and its test returns never reach selection; the real vectorbt + arch run returns only the StepM result) | 2026-11-11 |
npx playwright test (0.33.2, temporary copy on ports 3300/8300, clean .next/dev) | 127 passed, 3 skipped (5.7m) | 2026-11-11 |
npm.cmd run build (0.33.2) | passed | 2026-11-11 |
GitHub Actions ci #66 (commit 6874812, tracker record) and #67 (commit fb6b79a, 0.33.2) | passed: #66 completed successfully in 17m 57s, #67 in 25m 11s (format, typecheck, ruff, backend tests incl. the research environment, roadmap sync, build, Playwright) | 2026-11-11 |
npm.cmd run format:check (0.34.0) | passed: All matched files use Prettier code style! | 2026-11-11 |
npm.cmd run typecheck (0.34.0) | passed: Types generated successfully; tsc --noEmit without errors | 2026-11-11 |
npm.cmd run lint:backend (0.34.0) | passed: All checks passed! | 2026-11-11 |
npm.cmd run test:backend (0.34.0, full suite incl. the research environment) | 551 passed, 4 warnings in 950.11s (0:15:50). New: backend/tests/test_part_g.py (15: chart overlays, chart-only outputs out of the AI input, smc windows, aiomql read paths and reconnect after the terminal was closed and reopened, a closed terminal never started, order path unchanged, trade images and the matplotlib fallback, QuantStats tear sheets without test trades, the real QuantStats worker), test_mt5_mcp.py (3: order tools not exposed), test_lot_size_check.py (15: the 13-case table) | 2026-11-11 |
npm.cmd run build (0.34.0) | passed | 2026-11-11 |
npx playwright test (0.34.0, desktop-edge and mobile-edge; 1920, 1366 and phone width in the Part G spec) | 149 passed, 3 skipped (5.8m). New: tests/work-order12.spec.ts (11 tests x 2 projects): every row of the G1 parity list, the G2 overlays, attribution visible, Reports tear sheets, Telegram Center trade images, Accounts bridge state | 2026-11-11 |
GitHub Actions ci #69 (commit 37fcf74, 0.34.0) | failed on the runner, not in our code: format, typecheck, backend setup, ruff, backend tests, roadmap sync and build passed; then 'npx playwright install --with-deps' stopped with apt 'Temporary failure resolving security.ubuntu.com' (exit 100), so Playwright did not start. The next push runs CI again | 2026-11-11 |
GitHub Actions ci #70 (commit 23523a9, tracker record of #69) | failed in Playwright only: 148 passed, 3 skipped, 1 failed (10.9m). Every earlier step passed. The failing test was the new Part G overlay test (tests/work-order12.spec.ts): it read the FVG count (74) before the chart had reported its settled view (29 zones in view), a race in the test. Fixed: the chart writes data-window when its view settles and the tests wait for it; the spec passed twice over locally (44 passed) | 2026-11-11 |
GitHub Actions ci #71 (commit d9698a4, 0.34.0 with the test fix) | passed: completed successfully in 25m 23s (format, typecheck, ruff, backend tests incl. the research environment, roadmap sync, build, Playwright) | 2026-11-11 |
npm.cmd run format:check (0.34.1) | passed: All matched files use Prettier code style! | 2026-11-11 |
npm.cmd run typecheck (0.34.1) | passed: Types generated successfully; tsc --noEmit without errors | 2026-11-11 |
npm.cmd run lint:backend (0.34.1) | passed: All checks passed! | 2026-11-11 |
npm.cmd run build (0.34.1) | passed: Compiled successfully in 13.0s | 2026-11-11 |
npm.cmd run test:backend (0.34.1, full suite incl. the research environment) | 553 passed, 4 warnings in 1225.39s (0:20:25). New: test_the_ruin_level_follows_the_risk_center_max_drawdown_pause, test_smc_1_1_0_registers_over_1_0_0_and_keeps_research_only | 2026-11-11 |
npx playwright test (0.34.1, desktop-edge and mobile-edge) | 149 passed, 3 skipped (7.5m) | 2026-11-11 |
PowerShell parser on deploy/windows/install.ps1 and release.ps1 (0.34.1) | 0 syntax errors each; the monthly trigger (MSFT_TaskMonthlyTrigger, RunOnLastDayOfMonth, MonthOfYear 4095) was built into an unregistered task definition on this PC; no task was registered here | 2026-11-11 |
GitHub Actions ci #72 (commit 91d7e4c, tracker record) and #73 (commit bf7d3f9, 0.34.1) | passed: #72 completed successfully in 26m 20s, #73 in 21m 37s (format, typecheck, ruff, backend tests incl. the research environment, roadmap sync, build, Playwright) | 2026-11-12 |
Section 24 report, Part A. 1) Skills layer foundation: contract, registry, causal harness, two Python environments, three skills, AI input plumbing OFF, Skills page. 2) Files: backend/research/skills/ (contract, indicators, live, catalogue, catalogue_worker, registry), migration 030, prompts/trader/v4, autopilot.py, app.py, requirements*.txt, scripts/workspace.mjs, deploy/windows/*.ps1, src/app/skills, src/components/skills-center.tsx, sections, proxy allowlist, tests. 3) DB/API: skills, skill_runs; GET /skills, PUT /skills/{id}/mode. 4) Tests: see the table. 5) Limits: TA-Lib/talipp seeds differ for ATR, ADX/DI, MACD in the first ~500 bars (documented); indicators-talib and features-catalogue run on request (CLI), no schedule is set for them. 6) Security: mode change needs owner re-authentication and is audited; the research environment runs capped. 7) Open: Parts B-G. 8) Live trading stays disabled. Build technique applied from the owner's 'Very Professional Techniques.md' (adapter-style contract, milestone with tests/docs/tracker, one runnable check per rule); the file is not in this workspace - the copy in D:\MD Digital USA was analysed, nothing copied. Part B (0.29.0): smc causal adapter, auction (MarketProfile + OrderFlow-Analysis-Pro port), levels-trendlines, rules-stolgo, the structure worker and three stored cross-check reports; migration 031 skill_reports; stolgo installed --no-deps by owner decision. Section 24 report, Part C (0.30.0). 1) macro, news, fed, cot skills with the published_at/known_at rule and ALFRED vintages; OpenBB evaluated, not added. 2) Files: skills/macro_news.py, macro_worker.py, news_worker.py, fed_worker.py, providers.py, reports.py, news_sources.py, migration 032, three dashboard components, deploy scripts, docs, tests. 3) DB/API: migration 032; GET /providers, PUT|DELETE /providers/fred-key, POST/PUT/DELETE /providers/feeds, PUT /providers/keywords, PUT /providers/gdelt-spike, POST /skills/macro/refresh, GET /news/headlines. 4) Tests: see the table. 5) Limits: Fed scoring waits for the gated model; GDELT throttles this IP well beyond its published 5-second rule; statements before ~2008 and 40 minutes have no release time and are not in the event study. 6) Security: FRED key Fernet-encrypted, write-only, given only to the worker process; nothing reaches the AI trader (all research_only). 7) Live trading stays OFF. 8) Next: owner inputs above, then Part D. Section 24 report, Part D (0.31.0). 1) trader v5 flow on the demo AI (falsifier, horizon, WAIT, debate, Challenger, budget, decision log and scores) and 7 skills; reviews. 2) Files: trader_flow.py, reviews.py, autopilot.py (cycle_v5), brain.py (force_model), skills/timemachine.py, knowledge.py, knowledge_worker.py, trading.py, registry.py, migrations 033-034, prompts, 3 dashboard components, deploy, docs, tests. 3) DB/API: decision_flows, trade_reviews, knowledge_terms, news_reaction_directions; PUT /autopilot/trader-settings, GET /autopilot/flows, GET /reports/reviews. 4) Tests: see the table. 5) Limits: the Challenger needs a working second provider; news-reaction-failure needs the owner's direction map; macro-regime has one of six components; price-action confirmation not ported. 6) Security: demo only, fail closed, risk engine final say, advisory checks never block. 7) Live stays OFF. 8) Next: owner answers, then Part E. 0.31.1 (owner decisions after Part D): news trading on the demo AI inside the owner's news SL/TP limits (empty = WAIT), weekly AI self-review of debate / rounds / Challenger, Challenger provider health, knowledge exact matches only; migration 035. Live stays OFF. 0.31.2 (owner's written instruction and dashboard review of 2026-11-10): Risk Center values for the demo AI (version 3, audited, same on a fresh install), live pilot and research on the unchanged limits (migration 036, risk.account_settings), Challenger needs a known price, test-only trades out of statistics, automatic read-only MT5 sync, drawdown-breaker on the Risk Center values. Live stays OFF. Section 24 report, Part E (0.32.0). 1) Four research_only skills (volatility, regime, forecast, drift) with walk-forward evaluations recorded as they came, and LightGBM meta-labeling in the ML research under the same registry gates. 2) Files: skills/volatility.py, regime.py, forecast.py, drift.py, risk_ml.py, risk_ml_worker.py, risk_ml_eval.py, vendor/kronos, ml.py, monitoring.py, registry.py, feed.py, catalogue_worker.py, migration 038, requirements-research.txt, deploy scripts, three dashboard components, docs, tests. 3) DB/API: meta_evaluations, ml_models rebuilt (model_type, meta_evaluation_id); GET /models/meta, POST /models (meta_evaluation_id), POST /skills/{id}/evaluate. 4) Tests: see the table. 5) Limits: forecast evaluation incomplete (H4); TimesFM removed; fixed windows and library defaults, nothing tuned; drift warnings are frequent with the defaults. 6) Security: every skill research_only, nothing reaches the AI trader, no stop or lot size changes, models research-only without PASS and owner approval. 7) Live stays OFF. 8) Next: owner answers, the H4 forecast evaluation on the VPS, then Part F. Section 24 report, Part F (0.33.0). 1) Research lab: vectorbt + Optuna screening of the stolgo presets before the discovery search, Optuna-tuned LightGBM, SPA / StepM and bootstrap intervals, features-tsfresh and the features-catalogue connection, SHAP with leakage flags, offline PELT regimes, a free-memory check before every heavy job. 2) Files: lab.py, skills/lab_worker.py, discovery.py, ml.py, evaluations.py, skills/catalogue.py, registry.py, risk_ml.py, risk_ml_eval.py, app.py, migration 039, requirements-research.txt, research-lab.tsx and four dashboard components, deploy scripts, docs, tests. 3) DB/API: lab_runs, lab_reports, lab_candidates, lab_progress, lab_event_features; GET /lab, POST /lab/jobs/{job}; GET /discovery/status and GET /models/meta extended. 4) Tests: see the table. 5) Limits: only smoke sizes ran on the PC and no stolgo candidate passed the smoke screening, so the path survivors -> tick engine -> gates is proven by tests, not by a real result; the feature caches need many discovery cycles on the VPS; a discovered rule with a feature filter gives no live signal; fixed documented values, nothing tuned on the test period. 6) Security: nothing promotes or approves by itself, gates unchanged, every new skill research_only, offline regime labels never reach the AI trader, heavy libraries only in the capped research environment. 7) Live stays OFF. 8) Next: the owner's full-size runs on the VPS and answers, then Part G. 0.33.1 (owner answers to the Part F questions): gate unchanged, one count with StepM shown beside Bonferroni per result, three timeframes kept, time budget checked per chunk inside a year, open item: live feature feed for rules with feature filters (not built). Live stays OFF. 0.33.2 (owner answers after 0.33.1): full-family StepM (screened candidates on the test period by vectorbt, for the comparison only, never for selection), three decisions shown per discovery result, gates unchanged; teardown fix in two more Playwright specs. Live stays OFF. Section 24 report, Part G (0.34.0). 1) One shared lightweight-charts chart on Overview, Live Gold and Market Structure with full parity (23-row list, each row with its Playwright test), demo AI trades and decisions on it, skill overlays with the lightweight-charts-indicators renderer, Telegram trade images with a matplotlib fallback, QuantStats tear sheets, the aiomql MT5 read bridge, a read-only MT5 MCP server, the lot-size cross-check, the coding-agent skills. 2) Files: src/components/gold-chart.tsx, structure-chart.tsx, performance-reports.tsx, trade-images.tsx; backend/research/mt5_bridge.py, tearsheets.py, mt5_mcp.py, skills/tearsheet_worker.py, telegram.py, brokers.py, terminal.py, mt5_history.py, skills/registry.py, skills/smc.py; migration 040; docs. 3) Tests: see the Part G test records. 4) Data: no new market data; the tear sheets use closed demo AI trades without test trades. 5) Assumptions: Monte Carlo ruin = 20 % drawdown; weekly = 7 days, monthly = 30 days. 6) Security: orders never use the read bridge; a reconnect never starts the terminal; the MCP server exposes an allowlist of read tools over stdio only; the tear sheet opens in a sandboxed frame; chart-only smc outputs are left out of the AI input. 7) Live stays OFF. 8) Next: the owner's answers (x2strategy, the MCP licence, the ruin threshold, a monthly task) and the VPS runs. 0.34.1 (owner answers to the Part G questions): x2strategy dropped and Phase 21 marked complete; MCP server approved; Monte Carlo ruin = Risk Center max drawdown pause; monthly report task; smc 1.1.0 research_only. Live stays OFF.
Last updated 2026-11-11
Statuses reflect commands actually run; see each phase's test table. Live trading disabled. Research output, not financial advice.