Recent improvements to 1CandleTrader Mirror — backend engine, report pages, and test coverage.
27 May 2026
Admin panel — Reset all data & Delete user
Backend
Frontend
- Reset all data button — new amber header button wipes all 23 user-data tables (trades, runs, evidence, memory, snapshots, persona, progress) while keeping user accounts. Previous "Clear all trades" only covered 10 tables.
- Delete user button (per row) — permanently removes a user account and every associated row across 19 tables including
email_users. Two-step confirmation required.
- Refactored delete logic — shared
_delete_user_rows() helper ensures both Clear data and Delete user cover the same comprehensive table list.
- New endpoints —
DELETE /api/v1/admin/reset-all-data and DELETE /api/v1/admin/users/{email}.
Commits: 1b17e7f, fd4177a
26 May 2026
Cost removed from Critical gating + MT4/MT5 auto-analysis trigger
Backend
Fix
Tests
- Cost is now evidence, not a gate —
apply_cost_gate() no longer demotes statistically-eligible Critical candidates to Watchlist. Dollar cost is shown as context alongside the pattern. Previously zero patterns reached Critical in production because XAUUSD small-account losses sat below the $20 threshold.
- cost_context field — candidates now carry
cost_context ("costly" or "not_costly_in_sample") and cost_gate_suppressed: false so reports can frame cost evidence appropriately without blocking the finding.
- MT4/MT5 auto-analysis trigger — after a terminal sync saves trades, the backend now checks: ≥ 5 pending trades AND ≥ 6 h since last run → fires analysis automatically in the background. New
analysis_status values: analysis_triggered, analysis_pending_threshold, analysis_pending_cooldown, analysis_trigger_failed.
- Root markdown cleanup — all 28 root-level planning docs reviewed, annotated, renamed with
_reviewed_may26_2026 suffix, and archived to docs/ or PRODUCT/.
- 470 tests passing after all changes.
Commits: c09481c, e13c5c0, b12cf54
25 May 2026
Chart embed replay — daily report & full report
Frontend
Backend
Tests
- Daily report replay card — now shows an inline
/embed/replay chart for every run, including older uploads where the backend embed URL wasn't previously verified. Fallback chain: backend iframe → client-built /embed/replay → /embed/chart.
- Full report — new Pivotal Moment section —
renderBehaviorReplay() added to the critical, systematic, and default render paths. Shows the selected moment with 16:9 inline iframe, narration beats, comparison flash, and a direct chart button.
- Chart base URL —
CHART_EMBED_BASE_URL updated from localhost:8001 to https://1candletrader.com in .env and .env.local. Backend now builds live chart URLs for new uploads.
- Frontend contract tests — 55-test file (
tests/test_template_frontend_contract.py) covers chart URL safety, JS function presence, embed URL patterns, modal IDs, button wiring, and replay fallback logic for both pages. Registered in --suite ui.
Commits: f1944eb
25 May 2026
Documentation sync + test coverage for recent modules
Docs
Tests
Fix
- CLAUDE.md / AGENTS.md rewritten — shorter, innovation-friendly, distinct roles (dev reference vs product guide).
- cross_session_analysis.py bug fix —
dominant_pattern() queried non-existent fpc.title column; replaced with json_extract(fpc.candidate_json, '$.title').
- New test files —
test_eng__pipeline__costly_watchlist.py (costly-watchlist selector regression guard), test_eng__cross_session_analysis.py (DB-integrated), test_pydantic_v2_schema.py (schema import smoke tests).
- Existing tests extended —
test_eng__primary_case__contract.py adds watchlist_preview + missed_continuation cases; test_eng__report_payload__contract.py adds receipt price-field assertions.
- test_comparison_stage.py registered — was silently excluded from the test runner; now included in
--suite engineering.
- TEST_COVERAGE_BY_STAGE.md — 5 new rows, 2 updated, 3 gaps closed, 2 new gaps documented.
- full_upload_pipeline.md — Returning-User Path section added documenting
comparison_stage.py and cross_session_analysis.py.
Commits: 9fdafc7, b8a32d3
23 May 2026
Backend stage quality pass
Backend
Tests
- Primary focus evidence refresh — rebuilt after comparison/routing context exists so copy distinguishes first baseline from returning comparison and current upload vs account-memory scope.
- report_claims_v1 — centralises hero claim, proof summary, costs, comparison state, and evidence actions. Full report prefers this contract with fallback to older fields.
- Behavior memory snapshot persistence — additive write; used by later uploads to classify comparable reports and build transformation/returning-report states.
- May 24 hardening —
MARKET_DATA_DIR env propagation, env-key tests, daily blank screen fix, chart modal z-index fix, replay chart status tests.
Commits: 5a7b623, d9d1372, 2bcecac
22 May 2026
Full report proof flow + report service extraction
Backend
Frontend
- full_report_service.py — extracted report resolution and rebuild path from the router into a dedicated service module.
- primary_focus_evidence contract — implemented and attached inside
reveal and v4_report. Full report hero prefers this over scattered reveal fields.
- Report hero rewrite — full report prefers
report_claims_v1 and backend claim/proof fields; older fields remain as fallback.
- Comparison stage + cross-session analysis —
comparison_stage.py builds period-over-period deltas for returning users; cross_session_analysis.py supplies dominant_pattern() and losing_day_frequency() to comparison router.
- Habit frequency card + losing streak detector —
_PATTERN_CONFIG modularised; losing streak detection added.
Commits: 35544d6, 2bcecac
21 May 2026
Upload & report UI — partials, chart embeds, MT5 assets
Frontend
- Upload partials —
upload_modal.html and upload_home.html extracted as reusable partials served via /upload-modal and /upload-home routes.
- Inline evidence strips — trade receipt strips with Chart buttons added to daily report story cards and proof panel.
- Pydantic v2 migration — six schema files migrated to Pydantic v2
ConfigDict / Field wrapper pattern.
- MT4/MT5 logo assets — plugin tile UI added to upload screen.
- Pattern evidence report — compact card design, undetected patterns toggle, upload trigger in header.
Commits: 78a3b49, 87a5cc7
19 May 2026
Trade traceability — DB helper, candidate trades API, report element IDs
Backend
Frontend
Tests
- Candidate trades API —
GET /runs/{run_id}/candidates/{candidate_id}/trades returns affected and counterexample trade lists for any analysis run.
- Report element
candidate_id — elements now carry candidate_id and trade_count so the frontend can load trades on demand.
- Upload UI in full report — drag-and-drop upload modal added to
report.html for in-report re-upload.
- Trade traceability tests —
scripts/test_trade_traceability.py covers DB helper, API endpoint, and report element contract.
Commits: part of 87a5cc7
17 May 2026
Pattern evidence report — undetected patterns, chart modal
Frontend
Docs
- Pattern evidence report — single-page archive report at
/pattern-evidence-report showing all detected and undetected patterns with evidence receipts.
- Undetected patterns panel — lists all known patterns that were checked but didn't qualify for the current upload.
- Chart modal — chart URL registration and iframe modal added to pattern evidence, focus reveal, and full report pages.
patterns.json — static reference dataset added; consumed by the pattern evidence page.
14 May 2026
Skill map coverage audit + behavioral metrics plan
Backend
Tests
- 43 test suites passing — all phase scripts green after behavior metrics pass.
- Detectors verified — max daily loss compliance, breakeven stop, drawdown behavior, win streak overconfidence, and lot escalation detectors confirmed present and covered.
- Performance statistics card —
report_elements.py builds performance_stats as supporting evidence in the v4 report.