{"openapi":"3.1.0","info":{"title":"1CandleTrader Behavioral Engine","description":"v3 Upload -> Evidence -> Focus Pattern -> Reveal -> Progress API","version":"3.0.0"},"paths":{"/ingest/eml":{"post":{"tags":["Ingest: EML"],"summary":"Ingest Eml","description":"Parse an Exness Monthly Statement .eml into Stage 1-ready trade inputs.","operationId":"ingest_eml_ingest_eml_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ingest_eml_ingest_eml_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EMLIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ingest/eml":{"post":{"tags":["Ingest: EML"],"summary":"Ingest Eml","description":"Parse an Exness Monthly Statement .eml into Stage 1-ready trade inputs.","operationId":"ingest_eml_api_v1_ingest_eml_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ingest_eml_api_v1_ingest_eml_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EMLIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/trade-review/analyze":{"post":{"tags":["Trade Review Engine"],"summary":"Analyze Trade Review","description":"Deep single-trade review endpoint.\nMixes statement fields with candle windows and returns the combined trade-review contract.","operationId":"analyze_trade_review_api_v1_trade_review_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimalTradeInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/trade-review/batch-enrich":{"post":{"tags":["Trade Review Engine"],"summary":"Batch Enrich Trade Reviews","description":"Normalize and enrich multiple trades.\nThis is the bridge between the deep single-trade engine and the focus-pattern API.","operationId":"batch_enrich_trade_reviews_api_v1_trade_review_batch_enrich_post","requestBody":{"content":{"application/json":{"schema":{"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/focus/candidates":{"post":{"tags":["Focus Pattern Engine"],"summary":"Focus Candidates","description":"Build focus-pattern candidates from either:\n- raw trade payloads\n- pre-enriched trade-review output","operationId":"focus_candidates_api_v1_focus_candidates_post","requestBody":{"content":{"application/json":{"schema":{"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/focus/reveal":{"post":{"tags":["Focus Pattern Engine"],"summary":"Focus Reveal","description":"Build the one Critical reveal from either:\n- raw trade payloads\n- enriched trade-review output","operationId":"focus_reveal_api_v1_focus_reveal_post","requestBody":{"content":{"application/json":{"schema":{"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/uploads":{"post":{"tags":["v3 Focus Flow"],"summary":"Upload And Analyze","description":"v3 upload-first endpoint.\n\nThe MVP accepts JSON trade arrays or {\"trades\": [...]} and returns one Critical\nreveal or a no-Critical state.","operationId":"upload_and_analyze_api_v1_v3_uploads_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array"},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"},"examples":{"trade_array":{"summary":"Raw trade array","value":[{"instrument":"XAUUSD","direction":"LONG","entry_time":"2026-01-01T08:00:00Z","exit_time":"2026-01-01T08:03:00Z","entry_price":2645.2,"exit_price":2641.8,"volume":0.1,"profit":-34.0}]},"wrapped_payload":{"summary":"Wrapped upload payload","value":{"account_id":"demo","broker":"exness","symbol":"XAUUSD","source_type":"json","review_window":"January 2026","trades":[{"instrument":"XAUUSD","direction":"LONG","entry_time":"2026-01-01T08:00:00Z","exit_time":"2026-01-01T08:03:00Z","entry_price":2645.2,"exit_price":2641.8,"volume":0.1,"profit":-34.0}]}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V3UploadAnalysisResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/reset":{"delete":{"tags":["v3 Focus Flow"],"summary":"Reset V3 State","description":"Clear only the v3 product-flow tables and preserve legacy analysis history.\nAlso clears cached parquet data so the next upload re-reads local files.","operationId":"reset_v3_state_api_v1_v3_reset_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V3ResetResponse"}}}}}}},"/api/v1/v3/clear-trades":{"delete":{"tags":["v3 Focus Flow"],"summary":"Clear Uploaded Trades","description":"Clear uploaded trades and reveal/progress state used by the focus-reveal page.\nLegacy analysis tables remain untouched.","operationId":"clear_uploaded_trades_api_v1_v3_clear_trades_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V3ResetResponse"}}}}}}},"/api/v1/v3/compatibility":{"get":{"tags":["v3 Focus Flow"],"summary":"Compatibility","operationId":"compatibility_api_v1_v3_compatibility_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V3CompatibilityResponse"}}}}}}},"/api/v1/v3/reveals/latest":{"get":{"tags":["v3 Focus Flow"],"summary":"Latest Reveal","operationId":"latest_reveal_api_v1_v3_reveals_latest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LatestRevealResponse"}}}}}}},"/api/v1/v3/candidates/latest":{"get":{"tags":["v3 Focus Flow"],"summary":"Latest Candidates","operationId":"latest_candidates_api_v1_v3_candidates_latest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V3CandidatesResponse"}}}}}}},"/api/v1/v3/candidates/{analysis_run_id}":{"get":{"tags":["v3 Focus Flow"],"summary":"Get Candidates","operationId":"get_candidates_api_v1_v3_candidates__analysis_run_id__get","parameters":[{"name":"analysis_run_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V3CandidatesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/reveals/{analysis_run_id}":{"get":{"tags":["v3 Focus Flow"],"summary":"Get Reveal","operationId":"get_reveal_api_v1_v3_reveals__analysis_run_id__get","parameters":[{"name":"analysis_run_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevealPayload"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/rules/{rule_id}/accept":{"post":{"tags":["v3 Focus Flow"],"summary":"Accept Rule","operationId":"accept_rule_api_v1_v3_rules__rule_id__accept_post","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleAcceptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/rules/{rule_id}/progress":{"get":{"tags":["v3 Focus Flow"],"summary":"Rule Progress","operationId":"rule_progress_api_v1_v3_rules__rule_id__progress_get","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleProgressResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/stages/0/data-quality":{"post":{"tags":["v3 Internal Stages"],"summary":"Stage0 Data Quality","description":"Internal v3 Stage 0: audit data quality before detector inference.","operationId":"stage0_data_quality_api_v1_v3_stages_0_data_quality_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array"},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"},"examples":{"wrapped_payload":{"summary":"Wrapped upload payload","value":{"account_id":"demo","broker":"exness","symbol":"XAUUSD","trades":[{"instrument":"XAUUSD","direction":"LONG","entry_time":"2026-01-01T08:00:00Z","exit_time":"2026-01-01T08:03:00Z","entry_price":2645.2,"exit_price":2641.8,"volume":0.1,"profit":-34.0}]}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage0DataQualityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/stages/1/normalize":{"post":{"tags":["v3 Internal Stages"],"summary":"Stage1 Normalize","description":"Internal v3 Stage 1: parse and normalize uploaded trade data.","operationId":"stage1_normalize_api_v1_v3_stages_1_normalize_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array"},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"},"examples":{"trade_array":{"summary":"Raw trade array","value":[{"instrument":"XAUUSD","direction":"LONG","entry_time":"2026-01-01T08:00:00Z","exit_time":"2026-01-01T08:03:00Z","entry_price":2645.2,"exit_price":2641.8,"volume":0.1,"profit":-34.0}]}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage1NormalizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/stages/2/evidence":{"post":{"tags":["v3 Internal Stages"],"summary":"Stage2 Evidence","description":"Internal v3 Stage 2: build trade evidence packages, including MAE/MFE when candles exist.","operationId":"stage2_evidence_api_v1_v3_stages_2_evidence_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array"},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage2EvidenceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/stages/3/candidates":{"post":{"tags":["v3 Internal Stages"],"summary":"Stage3 Candidates","description":"Internal v3 Stage 3: detect focus-pattern candidates.","operationId":"stage3_candidates_api_v1_v3_stages_3_candidates_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array"},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage3CandidatesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/stages/4/priority":{"post":{"tags":["v3 Internal Stages"],"summary":"Stage4 Priority","description":"Internal v3 Stage 4: build the priority decision before reveal formatting.","operationId":"stage4_priority_api_v1_v3_stages_4_priority_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array"},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage4PriorityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/stages/4/reveal":{"post":{"tags":["v3 Internal Stages"],"summary":"Stage4 Reveal","description":"Internal v3 Stage 4: build exactly one Critical reveal or no-Critical state.","operationId":"stage4_reveal_api_v1_v3_stages_4_reveal_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array"},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage4RevealResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/stages/5/progress":{"post":{"tags":["v3 Internal Stages"],"summary":"Stage5 Progress","description":"Internal v3 Stage 5: check accepted-rule compliance against a new upload.","operationId":"stage5_progress_api_v1_v3_stages_5_progress_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage5ProgressResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/reports/catalog":{"get":{"tags":["v3 Reports"],"summary":"Get Catalog","operationId":"get_catalog_api_v1_v3_reports_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}}}}}},"/api/v1/v3/reports/{analysis_run_id}/dashboard":{"get":{"tags":["v3 Reports"],"summary":"Get Dashboard","operationId":"get_dashboard_api_v1_v3_reports__analysis_run_id__dashboard_get","parameters":[{"name":"analysis_run_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/reports/{analysis_run_id}/{slug}":{"get":{"tags":["v3 Reports"],"summary":"Get Report","operationId":"get_report_api_v1_v3_reports__analysis_run_id___slug__get","parameters":[{"name":"analysis_run_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Run Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/reports/{slug}/preview":{"post":{"tags":["v3 Reports"],"summary":"Preview Report","description":"Preview a single report against an upload payload without persisting\nanything.","operationId":"preview_report_api_v1_v3_reports__slug__preview_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/UploadTradeRow"}},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"},"examples":{"wrapped_payload":{"summary":"Preview a report from a wrapped upload payload","value":{"account_id":"demo","broker":"exness","symbol":"XAUUSD","trades":[{"instrument":"XAUUSD","direction":"LONG","entry_time":"2026-01-01T08:00:00Z","exit_time":"2026-01-01T08:03:00Z","entry_price":2645.2,"exit_price":2641.8,"volume":0.1,"profit":-34.0}]}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/truth-discovery/evaluate":{"post":{"tags":["Truth Discovery"],"summary":"Evaluate","description":"Evaluate a normalized TruthInputBundle without depending on v3 internals.","operationId":"evaluate_api_v1_truth_discovery_evaluate_post","parameters":[{"name":"persist_memory","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Persist Memory"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruthInputBundle"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruthEvaluateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/truth-discovery/evaluate-from-v3":{"post":{"tags":["Truth Discovery"],"summary":"Evaluate From V3","description":"Adapter endpoint: run the current v3 upload analysis, then evaluate it through the independent kernel.","operationId":"evaluate_from_v3_api_v1_truth_discovery_evaluate_from_v3_post","parameters":[{"name":"expected_issue","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Issue"}},{"name":"persist_memory","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Persist Memory"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/UploadTradeRow"}},{"$ref":"#/components/schemas/UploadPayload"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruthEvaluateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/truth-discovery/memory/{account_ref}":{"get":{"tags":["Truth Discovery"],"summary":"Read Memory","operationId":"read_memory_api_v1_truth_discovery_memory__account_ref__get","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"pattern_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruthMemoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/truth-discovery/memory/events":{"post":{"tags":["Truth Discovery"],"summary":"Append Memory Event","operationId":"append_memory_event_api_v1_truth_discovery_memory_events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryEvent"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruthMemoryAppendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/truth-discovery/state/{account_ref}":{"get":{"tags":["Truth Discovery"],"summary":"State","operationId":"state_api_v1_truth_discovery_state__account_ref__get","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruthStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/persona/run/{analysis_run_id}":{"get":{"tags":["Persona"],"summary":"Get Persona For Run","operationId":"get_persona_for_run_api_v1_v3_persona_run__analysis_run_id__get","parameters":[{"name":"analysis_run_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Persona For Run Api V1 V3 Persona Run  Analysis Run Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/persona/account/{account_id}/latest":{"get":{"tags":["Persona"],"summary":"Get Latest Persona","operationId":"get_latest_persona_api_v1_v3_persona_account__account_id__latest_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Latest Persona Api V1 V3 Persona Account  Account Id  Latest Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/v3/persona/account/{account_id}/tiebreak":{"post":{"tags":["Persona"],"summary":"Apply Tiebreak Answer","operationId":"apply_tiebreak_answer_api_v1_v3_persona_account__account_id__tiebreak_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TiebreakRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Apply Tiebreak Answer Api V1 V3 Persona Account  Account Id  Tiebreak Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/mailgun/inbound":{"post":{"tags":["Notifications"],"summary":"Mailgun inbound email webhook","description":"Mailgun inbound webhook receiver.\n\nConfigure your Mailgun Route action to:\n  forward(\"https://mirror.1candletrader.com/api/v1/notifications/mailgun/inbound\"\n          \"?secret=<_WEBHOOK_SECRET>\")\n\nOn each inbound email:\n1. Validates the ?secret query parameter (403 if missing or wrong).\n2. Parses the sender name + email from the \"From\" header.\n3. Creates or updates an email_user record in the DB.\n4. Inserts an inbound_emails log row (metadata only — no raw body stored).\n5. Appends to the flat-file email log (MAILGUN_LOG_FILE).\n6. Tries to parse the body-mime field as a broker EML statement;\n   if trades are found, saves them via the standard upload pipeline.\n7. Returns 200 so Mailgun marks the delivery as successful.","operationId":"receive_inbound_mailgun_email_api_v1_notifications_mailgun_inbound_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Receive Inbound Mailgun Email Api V1 Notifications Mailgun Inbound Post"}}}}}}},"/api/v1/intelligence/summary":{"get":{"tags":["Intelligence: Behavioral Forensics"],"summary":"Get Intelligence Summary","description":"Quick overview of what's in the database.","operationId":"get_intelligence_summary_api_v1_intelligence_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/intelligence/phase1-report":{"get":{"tags":["Phase 1: Deep Behavioral Intelligence"],"summary":"Get Phase1 Report","description":"Full Phase 1 behavioral report — 24 detections from pure trade-sequence analysis.","operationId":"get_phase1_report_api_v1_intelligence_phase1_report_get","parameters":[{"name":"instrument","in":"query","required":false,"schema":{"type":"string","title":"Instrument"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/status":{"get":{"summary":"Status","operationId":"status_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/stage1/physics":{"post":{"tags":["Legacy: Stage 1 Physics"],"summary":"Deprecated: use /api/v1/trade-review/analyze","description":"Deprecated legacy endpoint.\nAnalyzes the mechanical physics of a single trade (MAE, MFE, Duration).\nPrefer `/api/v1/trade-review/analyze`.","operationId":"extract_trade_physics_api_v1_stage1_physics_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimalTradeInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage1PhysicsOutput"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/stage2/context":{"post":{"tags":["Legacy: Stage 2 Context Fetch"],"summary":"Deprecated: use /api/v1/trade-review/analyze","description":"Deprecated legacy endpoint.\nFetches structured multi-timeframe context for a trade.\nPrefer `/api/v1/trade-review/analyze`.","operationId":"fetch_historical_context_api_v1_stage2_context_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimalTradeInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage2ContextOutput"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/stage3/extraction":{"post":{"tags":["Legacy: Stage 3 Context Extraction"],"summary":"Deprecated: use /api/v1/trade-review/analyze","description":"Deprecated legacy endpoint.\nAnalyzes the 500 candles to extract Trend, Volatility, and FOMO triggers.\nPrefer `/api/v1/trade-review/analyze`.","operationId":"extract_behavioral_triggers_api_v1_stage3_extraction_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimalTradeInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage3ContextOutput"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/stage3/classification":{"post":{"tags":["Legacy: Stage 3 Context Extraction"],"summary":"Deprecated: use /api/v1/trade-review/analyze","description":"Deprecated legacy endpoint.\nClassifies a trade setup from Stage 3 facts only.\nPrefer `/api/v1/trade-review/analyze`.","operationId":"classify_trade_context_api_v1_stage3_classification_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Stage3 Output"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage3ClassificationOutput"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/stage4/regret":{"post":{"tags":["Legacy: Stage 4 Post-Trade Regret"],"summary":"Deprecated: use /api/v1/trade-review/analyze","description":"Deprecated legacy endpoint.\nFetches 50 candles after the exit to find if they cut a winner early or panic sold.\nPrefer `/api/v1/trade-review/analyze`.","operationId":"analyze_exit_psychology_api_v1_stage4_regret_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimalTradeInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/stage5/matrices":{"post":{"tags":["Legacy: Stage 5 Aggregation"],"summary":"Deprecated: legacy matrix output; use /api/v1/focus/candidates","description":"Deprecated legacy endpoint.\nComputes True Edge, Bleed Locator, and Psychological Frequency matrices.\nPrefer `/api/v1/focus/candidates`.","operationId":"calculate_matrices_api_v1_stage5_matrices_post","requestBody":{"content":{"application/json":{"schema":{"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/stage5/candidates":{"post":{"tags":["Legacy: Stage 5 Aggregation"],"summary":"Deprecated: use /api/v1/focus/candidates","description":"Deprecated legacy endpoint.\nReturns focus-pattern candidates with eligibility metadata.\nPrefer `/api/v1/focus/candidates`.","operationId":"calculate_candidates_api_v1_stage5_candidates_post","requestBody":{"content":{"application/json":{"schema":{"title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/test/trades":{"get":{"tags":["Legacy: Interactive Testing"],"summary":"Deprecated: debug helper only","description":"Deprecated debug helper. Fetch the most recent enriched trades from the database.","operationId":"get_trades_api_v1_test_trades_get","deprecated":true,"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/test/latest-report":{"get":{"tags":["Legacy: Interactive Testing"],"summary":"Deprecated: use /api/v1/v3/reveals/latest","description":"Deprecated debug helper. Prefer `/api/v1/v3/reveals/latest`.","operationId":"get_latest_report_api_v1_test_latest_report_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"deprecated":true}},"/api/v1/test/generate":{"post":{"tags":["Legacy: Interactive Testing"],"summary":"Deprecated: debug helper only","description":"Randomly slice the parquet data to generate realistic mock trades.\nThen, pass them through the full pipeline.","operationId":"generate_mock_data_api_v1_test_generate_post","deprecated":true,"parameters":[{"name":"count","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Count"}},{"name":"instrument","in":"query","required":false,"schema":{"type":"string","default":"XAUUSD","title":"Instrument"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/test/process-real":{"post":{"tags":["Legacy: Interactive Testing"],"summary":"Deprecated: use /api/v1/v3/uploads","description":"Accept real trades from ICMarkets (or any source) in JSON array format.\nExtra fields like volume, profit, position_id are silently ignored.\nCandle proof is optional; statement-only patterns run even when candles are unavailable.","operationId":"process_real_trades_api_v1_test_process_real_post","requestBody":{"content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Payload","examples":[{"summary":"Legacy real-trade payload","value":{"instrument":"XAUUSD","direction":"LONG","entry_time":"2026-01-02T09:48:06","exit_time":"2026-01-02T09:48:20","entry_price":4376.87,"exit_price":4376.96,"volume":1.0,"profit":9.0,"position_id":"3416594946"}}]}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/test/clear":{"delete":{"tags":["Legacy: Interactive Testing"],"summary":"Deprecated: debug helper only","description":"Deprecated debug helper. Clear all trades and reports from the database (fresh start).","operationId":"clear_all_trades_api_v1_test_clear_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"deprecated":true}},"/api/v1/intelligence/evolution":{"get":{"tags":["Intelligence: Behavioral Forensics"],"summary":"Deprecated: use /api/v1/v3/uploads and /api/v1/v3/reveals/latest","description":"Legacy single-module view. Prefer the v3 focus reveal.","operationId":"get_evolution_api_v1_intelligence_evolution_get","deprecated":true,"parameters":[{"name":"instrument","in":"query","required":false,"schema":{"type":"string","title":"Instrument"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/emotional-state":{"get":{"tags":["Intelligence: Behavioral Forensics"],"summary":"Deprecated: replaced by evidence-backed state proxies in mentor_reveals","description":"Legacy single-module view. Prefer phase1-report / mentor_reveals.","operationId":"get_emotional_state_api_v1_intelligence_emotional_state_get","deprecated":true,"parameters":[{"name":"instrument","in":"query","required":false,"schema":{"type":"string","title":"Instrument"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/habit-fingerprint":{"get":{"tags":["Intelligence: Behavioral Forensics"],"summary":"Deprecated: use /api/v1/intelligence/phase1-report repeating_patterns","description":"Legacy single-module view. Prefer phase1-report / mentor_reveals.","operationId":"get_habit_fingerprint_api_v1_intelligence_habit_fingerprint_get","deprecated":true,"parameters":[{"name":"instrument","in":"query","required":false,"schema":{"type":"string","title":"Instrument"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/streak-analysis":{"get":{"tags":["Intelligence: Behavioral Forensics"],"summary":"Deprecated: use /api/v1/intelligence/phase1-report behavior chains","description":"Legacy single-module view. Prefer phase1-report / mentor_reveals.","operationId":"get_streak_analysis_api_v1_intelligence_streak_analysis_get","deprecated":true,"parameters":[{"name":"instrument","in":"query","required":false,"schema":{"type":"string","title":"Instrument"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/timing-heatmap":{"get":{"tags":["Intelligence: Behavioral Forensics"],"summary":"Deprecated: use /api/v1/intelligence/phase1-report grey_zones","description":"Legacy single-module view. Prefer phase1-report / mentor_reveals.","operationId":"get_timing_heatmap_api_v1_intelligence_timing_heatmap_get","deprecated":true,"parameters":[{"name":"instrument","in":"query","required":false,"schema":{"type":"string","title":"Instrument"}},{"name":"detailed","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Detailed"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/self-sabotage-report":{"get":{"tags":["Intelligence: Behavioral Forensics"],"summary":"Deprecated: use /api/v1/intelligence/phase1-report mentor_reveals","description":"Legacy single-module view. Prefer phase1-report / mentor_reveals.","operationId":"get_self_sabotage_report_api_v1_intelligence_self_sabotage_report_get","deprecated":true,"parameters":[{"name":"instrument","in":"query","required":false,"schema":{"type":"string","title":"Instrument"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/exit-quality":{"get":{"tags":["Intelligence: Behavioral Forensics"],"summary":"Deprecated: use Stage 4 post-trade reality and Stage 7 mentor_reveals","description":"Legacy single-module view. Prefer Stage 4 / Stage 7 mentor_reveals.","operationId":"get_exit_quality_api_v1_intelligence_exit_quality_get","deprecated":true,"parameters":[{"name":"instrument","in":"query","required":false,"schema":{"type":"string","title":"Instrument"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ActiveRule":{"properties":{"rule_ref":{"type":"string","title":"Rule Ref","example":"rule_abc123"},"account_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Ref","example":"demo"},"pattern_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern Type","example":"post_loss_fast_reentry"},"accepted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted At"},"status":{"type":"string","title":"Status","default":"active","example":"active"},"machine_check":{"additionalProperties":true,"type":"object","title":"Machine Check"}},"additionalProperties":true,"type":"object","required":["rule_ref"],"title":"ActiveRule"},"Body_ingest_eml_api_v1_ingest_eml_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"public_filename":{"type":"string","title":"Public Filename","default":"Monthly Statement.eml"},"instrument":{"type":"string","title":"Instrument","default":"XAUUSD"}},"type":"object","title":"Body_ingest_eml_api_v1_ingest_eml_post"},"Body_ingest_eml_ingest_eml_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"public_filename":{"type":"string","title":"Public Filename","default":"Monthly Statement.eml"},"instrument":{"type":"string","title":"Instrument","default":"XAUUSD"}},"type":"object","title":"Body_ingest_eml_ingest_eml_post"},"CandidateCost":{"properties":{"primary_cost_type":{"type":"string","enum":["realized","missed_continuation","hypothetical_filter","none"],"title":"Primary Cost Type","default":"none","example":"realized"},"realized":{"anyOf":[{"$ref":"#/components/schemas/TruthCostRealized"},{"type":"null"}]},"missed_continuation":{"anyOf":[{"$ref":"#/components/schemas/TruthCostMissedContinuation"},{"type":"null"}]},"hypothetical_filter":{"anyOf":[{"$ref":"#/components/schemas/TruthCostHypotheticalFilter"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"CandidateCost"},"CandidateCostHypotheticalFilter":{"properties":{"blocked_trades":{"type":"integer","title":"Blocked Trades","default":0,"example":42},"blocked_loss_sum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Blocked Loss Sum","example":-83.75},"blocked_win_sum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Blocked Win Sum","example":31.08},"net_estimate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Estimate","example":52.67},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","example":"if_pattern_removed_v1"}},"additionalProperties":true,"type":"object","title":"CandidateCostHypotheticalFilter"},"CandidateCostMissedContinuation":{"properties":{"available":{"type":"boolean","title":"Available","default":false,"example":true},"estimated_total":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Estimated Total","description":"Estimated missed continuation in current post-exit units. Not account-currency USD unless method says so.","example":8193.0},"trade_count":{"type":"integer","title":"Trade Count","default":0,"example":16},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","example":"post_exit_window_v1"}},"additionalProperties":true,"type":"object","title":"CandidateCostMissedContinuation"},"CandidateCostRealized":{"properties":{"affected_net_result":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Net Result","example":-52.67},"affected_loss_sum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Loss Sum","example":-83.75},"affected_win_sum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Win Sum","example":31.08},"loss_share":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Loss Share","example":0.229}},"additionalProperties":true,"type":"object","title":"CandidateCostRealized"},"CandidateCostV1":{"properties":{"realized":{"$ref":"#/components/schemas/CandidateCostRealized"},"missed_continuation":{"$ref":"#/components/schemas/CandidateCostMissedContinuation"},"hypothetical_filter":{"$ref":"#/components/schemas/CandidateCostHypotheticalFilter"},"cost_classification":{"type":"string","enum":["realized_loss","missed_continuation","hypothetical_filter","not_costly"],"title":"Cost Classification","default":"not_costly","example":"realized_loss"},"is_costly":{"type":"boolean","title":"Is Costly","default":false,"example":true},"suppression_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suppression Reason","example":"not_costly_in_sample"},"cost_version":{"type":"string","title":"Cost Version","default":"candidate_cost_v1","example":"candidate_cost_v1"}},"additionalProperties":true,"type":"object","title":"CandidateCostV1"},"CandidateEligibility":{"properties":{"eligible":{"type":"boolean","title":"Eligible","default":false,"example":true},"surface_priority":{"anyOf":[{"type":"string","enum":["critical","watchlist"]},{"type":"null"}],"title":"Surface Priority","example":"critical"},"gate_failures":{"items":{"type":"string"},"type":"array","title":"Gate Failures"}},"additionalProperties":true,"type":"object","title":"CandidateEligibility"},"CandidateProof":{"properties":{"receipt_refs":{"items":{"type":"string"},"type":"array","title":"Receipt Refs"},"example_trade_refs":{"items":{"type":"string"},"type":"array","title":"Example Trade Refs"},"counterexample_refs":{"items":{"type":"string"},"type":"array","title":"Counterexample Refs"},"evidence_fragment_refs":{"items":{"type":"string"},"type":"array","title":"Evidence Fragment Refs"}},"additionalProperties":true,"type":"object","title":"CandidateProof"},"CandidateRule":{"properties":{"available":{"type":"boolean","title":"Available","default":false,"example":true},"rule_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Ref","example":"rule_template_post_loss_gap"},"machine_checkable":{"type":"boolean","title":"Machine Checkable","default":false,"example":true}},"additionalProperties":true,"type":"object","title":"CandidateRule"},"CandidateStrength":{"properties":{"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","example":0.91},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size","example":54},"affected_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Affected Count","example":17},"affected_share":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Share","example":0.31},"priority_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Priority Score","example":0.88}},"additionalProperties":true,"type":"object","title":"CandidateStrength"},"CandidateTruth":{"properties":{"truth_ref":{"type":"string","title":"Truth Ref","example":"cand_abc123"},"pattern_type":{"type":"string","title":"Pattern Type","example":"post_loss_fast_reentry"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","example":"Fast re-entry after a losing trade"},"source_family":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Family","example":"statement_sequence"},"evidence_mode":{"type":"string","enum":["statement_only","candle_confirmed","mixed","unknown"],"title":"Evidence Mode","default":"unknown","example":"statement_only"},"eligibility":{"$ref":"#/components/schemas/CandidateEligibility"},"strength":{"$ref":"#/components/schemas/CandidateStrength"},"cost":{"$ref":"#/components/schemas/CandidateCost"},"proof":{"$ref":"#/components/schemas/CandidateProof"},"rule":{"$ref":"#/components/schemas/CandidateRule"},"audit":{"additionalProperties":true,"type":"object","title":"Audit"}},"additionalProperties":true,"type":"object","required":["truth_ref","pattern_type"],"title":"CandidateTruth"},"CatalogEntry":{"properties":{"report_id":{"type":"string","title":"Report Id"},"slug":{"type":"string","title":"Slug"},"priority":{"type":"integer","title":"Priority"},"name":{"type":"string","title":"Name"},"support_tier":{"$ref":"#/components/schemas/ReportTier"},"core_question":{"type":"string","title":"Core Question"},"required_data":{"items":{"type":"string"},"type":"array","title":"Required Data"},"default_status":{"$ref":"#/components/schemas/ReportStatus"},"builder_available":{"type":"boolean","title":"Builder Available","description":"True when a real builder is bound in the registry.","default":false},"endpoint_run":{"type":"string","title":"Endpoint Run"},"endpoint_preview":{"type":"string","title":"Endpoint Preview"}},"type":"object","required":["report_id","slug","priority","name","support_tier","core_question","default_status","endpoint_run","endpoint_preview"],"title":"CatalogEntry","description":"One row in the GET /reports/catalog response."},"CatalogResponse":{"properties":{"reports":{"items":{"$ref":"#/components/schemas/CatalogEntry"},"type":"array","title":"Reports"},"total":{"type":"integer","title":"Total"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["reports","total"],"title":"CatalogResponse"},"DashboardResponse":{"properties":{"analysis_run_id":{"type":"string","title":"Analysis Run Id"},"primary":{"items":{"$ref":"#/components/schemas/ReportResponse"},"type":"array","title":"Primary"},"fallback_used":{"items":{"type":"string"},"type":"array","title":"Fallback Used"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["analysis_run_id","primary"],"title":"DashboardResponse","description":"Top-N MRI homepage payload. Always returns top-3 fixed slots, with\nfallback to the next available report if a slot returns insufficient_data."},"DataQualityAudit":{"properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","example":0.91},"grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grade","example":"strong"},"ingest_quality":{"$ref":"#/components/schemas/DataQualitySection"},"evidence_quality":{"$ref":"#/components/schemas/DataQualitySection"},"issues":{"items":{"type":"string"},"type":"array","title":"Issues"},"recommended_actions":{"items":{"type":"string"},"type":"array","title":"Recommended Actions"}},"additionalProperties":true,"type":"object","title":"DataQualityAudit"},"DataQualitySection":{"properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","example":0.92},"grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grade","example":"strong"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","example":"Candle review was disabled for this run."},"parse_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parse Status","example":"ok"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"}},"additionalProperties":true,"type":"object","title":"DataQualitySection"},"EMLIngestMetadata":{"properties":{"instrument":{"type":"string","title":"Instrument","example":"XAUUSD"},"parsed_rows":{"type":"integer","title":"Parsed Rows","default":0,"example":1498},"trades_returned":{"type":"integer","title":"Trades Returned","default":0,"example":656},"skipped_rows":{"type":"integer","title":"Skipped Rows","default":0,"example":427},"skip_breakdown":{"$ref":"#/components/schemas/EMLSkipBreakdown"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","example":"public/Monthly Statement (6).eml"}},"type":"object","required":["instrument"],"title":"EMLIngestMetadata"},"EMLIngestResponse":{"properties":{"trades":{"items":{"$ref":"#/components/schemas/EMLIngestTradeInput"},"type":"array","title":"Trades"},"metadata":{"$ref":"#/components/schemas/EMLIngestMetadata"},"data_warnings":{"items":{"type":"string"},"type":"array","title":"Data Warnings"}},"type":"object","required":["metadata"],"title":"EMLIngestResponse"},"EMLIngestTradeInput":{"properties":{"instrument":{"type":"string","title":"Instrument","example":"XAUUSD"},"direction":{"type":"string","enum":["LONG","SHORT"],"title":"Direction"},"entry_time":{"type":"string","format":"date-time","title":"Entry Time"},"exit_time":{"type":"string","format":"date-time","title":"Exit Time"},"entry_price":{"type":"number","title":"Entry Price"},"exit_price":{"type":"number","title":"Exit Price"},"stop_loss_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stop Loss Price","description":"Actual stop loss price set at entry"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume","description":"Position size / lot size"},"source_trade_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Trade Id","example":"3404562675"},"ticket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ticket","example":"321133293"},"close_ticket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Ticket","example":"321133611"},"position_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Id","example":"3404562675"},"profit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Profit","example":42.7},"commission":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Commission","example":-0.7},"swap":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Swap","example":0.0}},"type":"object","required":["instrument","direction","entry_time","exit_time","entry_price","exit_price"],"title":"EMLIngestTradeInput"},"EMLSkipBreakdown":{"properties":{"instrument_filtered_rows":{"type":"integer","title":"Instrument Filtered Rows","default":0,"example":12},"unmatched_exit_rows":{"type":"integer","title":"Unmatched Exit Rows","default":0,"example":3},"partially_unmatched_exit_rows":{"type":"integer","title":"Partially Unmatched Exit Rows","default":0,"example":1},"unclosed_entry_rows":{"type":"integer","title":"Unclosed Entry Rows","default":0,"example":2},"total_problem_rows":{"type":"integer","title":"Total Problem Rows","default":0,"example":6},"total_skipped_rows":{"type":"integer","title":"Total Skipped Rows","default":0,"example":18}},"type":"object","title":"EMLSkipBreakdown"},"EvidenceCard":{"properties":{"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"},"trade_ids":{"items":{"type":"string"},"type":"array","title":"Trade Ids"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"},"related_pattern_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related Pattern Id"},"related_candidate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related Candidate Id"}},"type":"object","required":["title","body"],"title":"EvidenceCard","description":"One unit of evidence the user can click.\n\nShape mirrors the existing RevealPayload proof_card shape so the same\nUI component renders both. `trade_ids` MUST reference real trade_ids\nthat exist in trade_evidence."},"EvidenceExecutionPhysics":{"properties":{"mae":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mae"},"mfe":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mfe"},"mfe_capture_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mfe Capture Ratio"},"heat_time_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Heat Time Pct"},"duration_candles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Candles"},"duration_minutes":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Minutes"},"data_warnings":{"items":{"type":"string"},"type":"array","title":"Data Warnings"}},"additionalProperties":true,"type":"object","title":"EvidenceExecutionPhysics"},"EvidenceFragment":{"properties":{"fragment_ref":{"type":"string","title":"Fragment Ref","example":"fragment_post_loss_gap_v1"},"family":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Family","example":"statement_sequence"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","example":"Post-loss re-entry gap"},"required_fields_present":{"type":"boolean","title":"Required Fields Present","default":true,"example":true},"evidence_mode":{"type":"string","enum":["statement_only","candle_confirmed","mixed","unknown"],"title":"Evidence Mode","default":"unknown"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","example":0.91},"cost_type":{"type":"string","enum":["realized","missed_continuation","hypothetical_filter","none"],"title":"Cost Type","default":"none"},"safe_copy_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Safe Copy Key","example":"post_loss_gap_safe_v1"},"receipts":{"items":{"$ref":"#/components/schemas/EvidenceReceipt"},"type":"array","title":"Receipts"}},"additionalProperties":true,"type":"object","required":["fragment_ref"],"title":"EvidenceFragment"},"EvidencePostExitProof":{"properties":{"available":{"type":"boolean","title":"Available","default":false,"example":true},"measured_window_candles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Measured Window Candles","example":50},"max_forward_excursion":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Forward Excursion","example":15.2},"estimated_missed_continuation":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Estimated Missed Continuation","example":12.0},"continuation_strength":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Continuation Strength","example":"MODERATE"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"additionalProperties":true,"type":"object","title":"EvidencePostExitProof"},"EvidenceReceipt":{"properties":{"trade_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trade Ref"},"ticket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ticket"},"entry_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entry Time"},"exit_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exit Time"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"net_result":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Result"}},"additionalProperties":true,"type":"object","title":"EvidenceReceipt"},"EvidenceReconstructionStatus":{"properties":{"chart_proof_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Chart Proof Available","example":true},"coverage_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Coverage Pct","example":1.0},"timezone_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timezone Confidence","example":1.0},"symbol_mapping_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Symbol Mapping Confidence","example":1.0},"timeframe":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timeframe","example":"1m"},"execution_candles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Execution Candles","example":12},"post_exit_candles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Post Exit Candles","example":50},"post_exit_window_candles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Post Exit Window Candles","example":50},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"additionalProperties":true,"type":"object","title":"EvidenceReconstructionStatus"},"EvidenceSummary":{"properties":{"uploaded_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Uploaded Trade Count","example":224},"parsed_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parsed Trade Count","example":224},"unsupported_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unsupported Trade Count","example":0},"candle_reviewed_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Candle Reviewed Trade Count","example":120},"candle_review_skipped_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Candle Review Skipped Trade Count","example":104},"chart_proof_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chart Proof Trade Count","example":113},"candle_confirmed_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Candle Confirmed Trade Count","example":113},"statement_only_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Statement Only Trade Count","example":7},"reviewed_statement_only_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reviewed Statement Only Trade Count","example":7},"news_context_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"News Context Trade Count","example":224},"news_matched_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"News Matched Trade Count","example":18},"high_impact_news_window_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"High Impact News Window Trade Count","example":6},"news_data_sufficiency":{"additionalProperties":true,"type":"object","title":"News Data Sufficiency"},"candle_backed_run":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Candle Backed Run","example":true},"candle_analysis_capped":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Candle Analysis Capped","example":true},"review_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Review Limit","example":120},"coverage_notice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coverage Notice"},"timeframes_used":{"items":{"type":"string"},"type":"array","title":"Timeframes Used","example":["1m"]},"warning_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Warning Counts"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"diagnostics":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Diagnostics"}},"additionalProperties":true,"type":"object","title":"EvidenceSummary"},"FocusCandidate":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","example":"cand_overtrading_after_first_loss"},"pattern_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern Type","example":"overtrading_after_first_loss"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","example":"Trading continues after the first loss"},"mode":{"anyOf":[{"type":"string","enum":["statement_only","candle_confirmed"]},{"type":"null"}],"title":"Mode","example":"statement_only"},"priority":{"anyOf":[{"type":"string","enum":["critical","watchlist"]},{"type":"null"}],"title":"Priority","example":"critical"},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size","example":224},"affected_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Affected Trade Count","example":42},"affected_share":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Share","example":0.188},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","example":0.78},"critical_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Critical Score","example":0.553},"affected_net_result":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Net Result","example":-52.67},"realized_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Realized Loss","example":-83.75},"loss_share":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Loss Share","example":0.229},"proof_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Proof Available","example":true},"rule_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Rule Available","example":true},"cost_v1":{"anyOf":[{"$ref":"#/components/schemas/CandidateCostV1"},{"type":"null"}]},"affected_trade_ids":{"items":{"type":"string"},"type":"array","title":"Affected Trade Ids"},"counterexample_trade_ids":{"items":{"type":"string"},"type":"array","title":"Counterexample Trade Ids"},"eligibility_reasons":{"items":{"type":"string"},"type":"array","title":"Eligibility Reasons","example":[]},"data_warnings":{"items":{"type":"string"},"type":"array","title":"Data Warnings"},"evidence":{"items":{},"type":"array","title":"Evidence"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"},"episode_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Episode Id","example":"epi_XAUUSD_short_20250701_080531"},"episode_summary":{"additionalProperties":true,"type":"object","title":"Episode Summary"},"entry_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entry Events"},"flagged_decision":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Flagged Decision"},"episode_cost_v1":{"anyOf":[{"$ref":"#/components/schemas/CandidateCostV1"},{"type":"null"}]},"why_this_decision_not_first_entry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Why This Decision Not First Entry","example":"The first entry opened the idea; the flagged decision added size after price had already moved against it."},"rule_default":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rule Default"},"safe_variants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Safe Variants"},"rapid_fire_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rapid Fire Events"},"sequences":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sequences"},"day_summaries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Day Summaries"},"temporal_scope":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Temporal Scope"},"pre_entry_context_summary":{"additionalProperties":true,"type":"object","title":"Pre Entry Context Summary"},"trade_metadata":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trade Metadata"},"priority_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Priority Score","example":0.96},"priority_engine":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Priority Engine"},"problem_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Problem Id","example":"P01"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier","example":"mvp_focus_pattern"},"root_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Type","example":"behavioral"},"user_facing_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Facing Label","example":"Fast re-entry after a loss"},"proof_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proof Type","example":"timeline"},"action_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Type","example":"guardrail"},"detector_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detector Version","example":"v4.0"},"strategy_warnings":{"items":{"type":"string"},"type":"array","title":"Strategy Warnings"}},"additionalProperties":true,"type":"object","title":"FocusCandidate"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LatestProgress":{"properties":{"rule_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Ref","example":"rule_abc123"},"checked_trade_count":{"type":"integer","title":"Checked Trade Count","default":0,"example":44},"qualified_event_count":{"type":"integer","title":"Qualified Event Count","default":0,"example":9},"followed_count":{"type":"integer","title":"Followed Count","default":0,"example":7},"broken_count":{"type":"integer","title":"Broken Count","default":0,"example":2},"comparison":{"additionalProperties":true,"type":"object","title":"Comparison"},"evidence_available":{"type":"boolean","title":"Evidence Available","default":false,"example":true},"receipt_refs":{"items":{"type":"string"},"type":"array","title":"Receipt Refs"}},"additionalProperties":true,"type":"object","title":"LatestProgress"},"LatestRevealResponse":{"properties":{"status":{"type":"string","enum":["ok","no_data"],"title":"Status","example":"ok"},"reveal":{"anyOf":[{"$ref":"#/components/schemas/RevealPayload"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["status"],"title":"LatestRevealResponse"},"MemoryEvent":{"properties":{"memory_ref":{"type":"string","title":"Memory Ref","example":"mem_abc123"},"account_ref":{"type":"string","title":"Account Ref","example":"demo"},"event_type":{"type":"string","enum":["truth_shown","rule_offered","rule_accepted","progress_checked","milestone_shown","truth_suppressed"],"title":"Event Type","example":"truth_shown"},"run_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Ref","example":"run_abc123"},"upload_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Ref","example":"upl_abc123"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Occurred At"},"pattern_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern Type","example":"post_loss_fast_reentry"},"truth_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Truth Ref","example":"cand_abc123"},"decision_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Type","example":"critical_discovery"},"discovery_angle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discovery Angle","example":"main_cost_driver"},"cost_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Type","example":"realized"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size"},"affected_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Affected Count"},"rule_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Ref"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"should_persist":{"type":"boolean","title":"Should Persist","default":true}},"additionalProperties":true,"type":"object","required":["memory_ref","account_ref","event_type"],"title":"MemoryEvent"},"MinimalTradeInput":{"properties":{"instrument":{"type":"string","title":"Instrument","example":"XAUUSD"},"direction":{"type":"string","enum":["LONG","SHORT"],"title":"Direction"},"entry_time":{"type":"string","format":"date-time","title":"Entry Time"},"exit_time":{"type":"string","format":"date-time","title":"Exit Time"},"entry_price":{"type":"number","title":"Entry Price"},"exit_price":{"type":"number","title":"Exit Price"},"stop_loss_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stop Loss Price","description":"Actual stop loss price set at entry"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume","description":"Position size / lot size"}},"type":"object","required":["instrument","direction","entry_time","exit_time","entry_price","exit_price"],"title":"MinimalTradeInput","description":"The absolute minimal data required to process a trade."},"PriorityCandidateSummary":{"properties":{"pattern_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern Type","example":"overtrading_after_first_loss"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","example":"Trading volume expands after the first loss of the day"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority","example":"critical"},"critical_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Critical Score","example":0.74},"priority_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Priority Score","example":0.96},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","example":0.95},"affected_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Affected Trade Count","example":236},"event_affected_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Event Affected Count","example":142},"event_affected_share":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Event Affected Share","example":0.46},"cluster_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cluster Ratio","example":1.19},"suppressed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Suppressed","example":false},"suppression_reasons":{"items":{"type":"string"},"type":"array","title":"Suppression Reasons"},"scores":{"additionalProperties":true,"type":"object","title":"Scores"}},"additionalProperties":true,"type":"object","title":"PriorityCandidateSummary"},"PriorityDecisionPayload":{"properties":{"selected_pattern_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Pattern Id","example":"cand_overtrading_after_first_loss"},"selected_candidate":{"anyOf":[{"$ref":"#/components/schemas/FocusCandidate"},{"type":"null"}]},"priority_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority Reason","example":"Chosen because it is a direct repeated behavior with strong proof and a clearer first rule."},"ranked_candidates":{"items":{"$ref":"#/components/schemas/PriorityCandidateSummary"},"type":"array","title":"Ranked Candidates"},"suppressed_candidates":{"items":{"$ref":"#/components/schemas/PriorityCandidateSummary"},"type":"array","title":"Suppressed Candidates"},"top_alternative":{"anyOf":[{"$ref":"#/components/schemas/PriorityCandidateSummary"},{"type":"null"}]},"decision_context":{"additionalProperties":true,"type":"object","title":"Decision Context"}},"additionalProperties":true,"type":"object","title":"PriorityDecisionPayload"},"ReportResponse":{"properties":{"report_id":{"type":"string","title":"Report Id"},"slug":{"type":"string","title":"Slug"},"priority":{"type":"integer","title":"Priority"},"name":{"type":"string","title":"Name"},"support_tier":{"$ref":"#/components/schemas/ReportTier"},"status":{"$ref":"#/components/schemas/ReportStatus"},"core_question":{"type":"string","title":"Core Question"},"verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verdict"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"},"evidence_cards":{"items":{"$ref":"#/components/schemas/EvidenceCard"},"type":"array","title":"Evidence Cards"},"related_patterns":{"items":{"type":"string"},"type":"array","title":"Related Patterns"},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size"},"missing_data":{"items":{"type":"string"},"type":"array","title":"Missing Data"},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"},"required_data":{"items":{"type":"string"},"type":"array","title":"Required Data"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["report_id","slug","priority","name","support_tier","status","core_question"],"title":"ReportResponse"},"ReportStatus":{"type":"string","enum":["supported","partial","insufficient_data","unavailable"],"title":"ReportStatus"},"ReportTier":{"type":"string","enum":["A","B","C","D","E"],"title":"ReportTier"},"RevealPayload":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","example":"critical_found"},"analysis_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Run Id","example":"run_abc123"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","example":"demo"},"selected_pattern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Pattern","example":"overtrading_after_first_loss"},"selected_pattern_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Pattern Id","example":"cand_overtrading_after_first_loss"},"pattern_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern Type","example":"overtrading_after_first_loss"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","example":"Trading volume expands after the first loss of the day"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode","example":"statement_only"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority","example":"critical"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","example":0.95},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size","example":523},"affected_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Affected Trade Count","example":236},"temporal_scope":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Temporal Scope","example":{"share":0.62,"timeframe":"Thursday afternoons"}},"data_warnings":{"items":{"type":"string"},"type":"array","title":"Data Warnings"},"evidence":{"items":{},"type":"array","title":"Evidence"},"evidence_bundle":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Evidence Bundle"},"main_proof":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Main Proof"},"proof_cards":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Proof Cards"},"rule":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rule"},"rule_reason":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rule Reason","example":"This is the most repeated, action-ready behavior in the uploaded trades."},"counterexamples":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Counterexamples"},"cost_breakdown":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cost Breakdown"},"rule_filter_estimate_evidence":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rule Filter Estimate Evidence"},"episode_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Episode Id","example":"episode_1"},"episode_summary":{"additionalProperties":true,"type":"object","title":"Episode Summary"},"entry_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entry Events"},"flagged_decision":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Flagged Decision"},"episode_cost_v1":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Episode Cost V1"},"why_this_decision_not_first_entry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Why This Decision Not First Entry"},"rule_default":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rule Default"},"safe_variants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Safe Variants"},"priority_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority Reason"},"top_alternative":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Top Alternative"},"suppressed_candidate_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Suppressed Candidate Count","example":4},"decision_context":{"additionalProperties":true,"type":"object","title":"Decision Context"},"selection_reasoning":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Selection Reasoning"},"chart_decision_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Chart Decision Context"},"diagnostics":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Diagnostics"},"next_points":{"items":{},"type":"array","title":"Next Points"},"next_pattern_being_verified":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Next Pattern Being Verified"},"other_detected_patterns":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Other Detected Patterns","description":"Compact ranked follow-up patterns detected but not assigned as the current one-rule focus."},"progress_target":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Progress Target"},"latest_progress":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Latest Progress"},"problem_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Problem Id","example":"P01"},"root_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Type","example":"behavioral"},"action":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Action","description":"Optional action matched to the root condition — action_type, machine_checkable, and rule."},"personalization":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Personalization","description":"Persona-framing hints used in the reveal — style, confidence, used_for. Neutral if confidence < 0.70."},"next_upload_compare":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Next Upload Compare","description":"Comparison promise for the next upload — comparison_status, rate_delta, cost_delta from behavior memory."}},"additionalProperties":true,"type":"object","title":"RevealPayload"},"RuleAcceptResponse":{"properties":{"status":{"type":"string","const":"accepted","title":"Status","default":"accepted","example":"accepted"},"assigned_rule":{"additionalProperties":true,"type":"object","title":"Assigned Rule"}},"additionalProperties":true,"type":"object","title":"RuleAcceptResponse"},"RuleProgressResponse":{"properties":{"status":{"type":"string","title":"Status","example":"ok"},"rule":{"additionalProperties":true,"type":"object","title":"Rule"},"progress":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Progress"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","example":"Upload the next statement/history file to check this rule."}},"additionalProperties":true,"type":"object","required":["status"],"title":"RuleProgressResponse"},"Stage0DataQualityResponse":{"properties":{"stage":{"type":"string","title":"Stage","default":"data_quality_audit","example":"data_quality_audit"},"upload_id":{"type":"string","title":"Upload Id","example":"upl_abc123"},"trade_count":{"type":"integer","title":"Trade Count","example":224},"evidence_summary":{"$ref":"#/components/schemas/EvidenceSummary"},"data_quality":{"$ref":"#/components/schemas/DataQualityAudit"}},"additionalProperties":true,"type":"object","required":["upload_id","trade_count"],"title":"Stage0DataQualityResponse"},"Stage1Derived":{"properties":{"mfe_capture_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mfe Capture Ratio"},"entry_efficiency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Entry Efficiency"},"exit_efficiency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exit Efficiency"},"heat_time_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Heat Time Pct"},"drawdown_to_profit_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Drawdown To Profit Ratio"}},"type":"object","title":"Stage1Derived","description":"Derived execution ratios."},"Stage1Facts":{"properties":{"duration_minutes":{"type":"number","title":"Duration Minutes","description":"Time held in actual minutes"},"duration_candles":{"type":"integer","title":"Duration Candles","description":"Time held in candle units"},"mae":{"type":"number","title":"Mae","description":"Maximum Adverse Excursion (Max Heat/Drawdown)"},"mfe":{"type":"number","title":"Mfe","description":"Maximum Favorable Excursion (Max Profit)"},"realized_profit":{"type":"number","title":"Realized Profit","description":"Trade profit in price units"}},"type":"object","required":["duration_minutes","duration_candles","mae","mfe","realized_profit"],"title":"Stage1Facts","description":"Deterministic execution facts."},"Stage1NormalizeResponse":{"properties":{"stage":{"type":"string","title":"Stage","default":"upload_trade_normalization","example":"upload_trade_normalization"},"upload_id":{"type":"string","title":"Upload Id","example":"upl_abc123"},"parse_status":{"type":"string","title":"Parse Status","example":"ok"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"parse_warnings":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Parse Warnings"},"trades":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trades"}},"additionalProperties":true,"type":"object","required":["upload_id","parse_status"],"title":"Stage1NormalizeResponse"},"Stage1PhysicsOutput":{"properties":{"facts":{"$ref":"#/components/schemas/Stage1Facts"},"derived":{"$ref":"#/components/schemas/Stage1Derived"},"data_warnings":{"items":{"type":"string"},"type":"array","title":"Data Warnings","default":[]},"insight_signals":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Insight Signals","default":[]}},"type":"object","required":["facts","derived"],"title":"Stage1PhysicsOutput","description":"The objective physics of what happened during the trade."},"Stage2ContextOutput":{"properties":{"metadata":{"$ref":"#/components/schemas/Stage2Metadata"},"m1_pre":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"M1 Pre"},"m15_pre":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"M15 Pre"},"h1_pre":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"H1 Pre"},"h4_pre":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"H4 Pre"},"execution_window":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Execution Window"},"post_window":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Post Window"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"data_warnings":{"items":{"type":"string"},"type":"array","title":"Data Warnings","default":[]},"insight_signals":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Insight Signals","default":[]},"candles":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Candles","default":[]},"candle_count":{"type":"integer","title":"Candle Count","default":0}},"type":"object","required":["metadata","m1_pre","m15_pre","h1_pre","h4_pre","execution_window","post_window","counts"],"title":"Stage2ContextOutput","description":"Structured multi-timeframe candle context for a trade."},"Stage2EvidenceResponse":{"properties":{"stage":{"type":"string","title":"Stage","default":"trade_evidence_engine","example":"trade_evidence_engine"},"upload_id":{"type":"string","title":"Upload Id","example":"upl_abc123"},"trade_count":{"type":"integer","title":"Trade Count","example":224},"data_quality":{"anyOf":[{"$ref":"#/components/schemas/DataQualityAudit"},{"type":"null"}]},"evidence_summary":{"$ref":"#/components/schemas/EvidenceSummary"},"evidence":{"items":{"$ref":"#/components/schemas/TradeEvidencePackage"},"type":"array","title":"Evidence"}},"additionalProperties":true,"type":"object","required":["upload_id","trade_count"],"title":"Stage2EvidenceResponse"},"Stage2Metadata":{"properties":{"instrument":{"type":"string","title":"Instrument"},"timezone":{"type":"string","title":"Timezone","default":"UTC"},"available_timeframes":{"items":{"type":"string"},"type":"array","title":"Available Timeframes","default":[]},"resampled_timeframes":{"items":{"type":"string"},"type":"array","title":"Resampled Timeframes","default":[]}},"type":"object","required":["instrument"],"title":"Stage2Metadata"},"Stage3CandidatesResponse":{"properties":{"stage":{"type":"string","title":"Stage","default":"focus_pattern_candidate_engine","example":"focus_pattern_candidate_engine"},"upload_id":{"type":"string","title":"Upload Id","example":"upl_abc123"},"sample_size":{"type":"integer","title":"Sample Size","example":224},"data_quality":{"anyOf":[{"$ref":"#/components/schemas/DataQualityAudit"},{"type":"null"}]},"evidence_summary":{"$ref":"#/components/schemas/EvidenceSummary"},"candidates":{"items":{"$ref":"#/components/schemas/FocusCandidate"},"type":"array","title":"Candidates"}},"additionalProperties":true,"type":"object","required":["upload_id","sample_size"],"title":"Stage3CandidatesResponse"},"Stage3ClassificationOutput":{"properties":{"trade_type":{"type":"string","title":"Trade Type"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["trade_type","confidence"],"title":"Stage3ClassificationOutput"},"Stage3ContextOutput":{"properties":{"macro_context":{"additionalProperties":true,"type":"object","title":"Macro Context"},"structure":{"additionalProperties":true,"type":"object","title":"Structure"},"support_resistance":{"additionalProperties":true,"type":"object","title":"Support Resistance"},"entry_context":{"additionalProperties":true,"type":"object","title":"Entry Context"},"volatility":{"additionalProperties":true,"type":"object","title":"Volatility"},"session_context":{"additionalProperties":true,"type":"object","title":"Session Context"},"mtf_alignment":{"additionalProperties":true,"type":"object","title":"Mtf Alignment"},"data_warnings":{"items":{"type":"string"},"type":"array","title":"Data Warnings","default":[]},"insight_signals":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Insight Signals","default":[]},"trend_regime":{"type":"string","title":"Trend Regime"},"volatility_state":{"type":"string","title":"Volatility State"},"volatility_ratio":{"type":"number","title":"Volatility Ratio"},"nearest_resistance":{"type":"number","title":"Nearest Resistance"},"nearest_support":{"type":"number","title":"Nearest Support"},"distance_to_resistance_pips":{"type":"number","title":"Distance To Resistance Pips"},"distance_to_support_pips":{"type":"number","title":"Distance To Support Pips"},"entry_position_in_range":{"type":"number","title":"Entry Position In Range"},"candlestick_patterns":{"items":{"type":"string"},"type":"array","title":"Candlestick Patterns"},"trend_structure":{"type":"string","title":"Trend Structure"},"break_of_structure":{"type":"boolean","title":"Break Of Structure"},"break_retest_present":{"type":"boolean","title":"Break Retest Present"},"fomo_trigger_present":{"type":"boolean","title":"Fomo Trigger Present"},"exhaustion_entry":{"type":"boolean","title":"Exhaustion Entry"},"momentum_alignment":{"type":"string","title":"Momentum Alignment"},"session":{"type":"string","title":"Session"},"day_of_week":{"type":"string","title":"Day Of Week"},"mtf_conflict":{"type":"boolean","title":"Mtf Conflict"},"news_shock_present":{"type":"boolean","title":"News Shock Present"},"raw_metrics":{"additionalProperties":true,"type":"object","title":"Raw Metrics"}},"type":"object","required":["macro_context","structure","support_resistance","entry_context","volatility","session_context","mtf_alignment","trend_regime","volatility_state","volatility_ratio","nearest_resistance","nearest_support","distance_to_resistance_pips","distance_to_support_pips","entry_position_in_range","candlestick_patterns","trend_structure","break_of_structure","break_retest_present","fomo_trigger_present","exhaustion_entry","momentum_alignment","session","day_of_week","mtf_conflict","news_shock_present","raw_metrics"],"title":"Stage3ContextOutput","description":"The structural market context of the trade."},"Stage4PriorityResponse":{"properties":{"stage":{"type":"string","title":"Stage","default":"priority_decision_engine","example":"priority_decision_engine"},"upload_id":{"type":"string","title":"Upload Id","example":"upl_abc123"},"trade_count":{"type":"integer","title":"Trade Count","example":224},"evidence_summary":{"$ref":"#/components/schemas/EvidenceSummary"},"data_quality":{"anyOf":[{"$ref":"#/components/schemas/DataQualityAudit"},{"type":"null"}]},"priority_decision":{"$ref":"#/components/schemas/PriorityDecisionPayload"}},"additionalProperties":true,"type":"object","required":["upload_id","trade_count"],"title":"Stage4PriorityResponse"},"Stage4RevealResponse":{"properties":{"stage":{"type":"string","title":"Stage","default":"critical_reveal_builder","example":"critical_reveal_builder"},"data_quality":{"anyOf":[{"$ref":"#/components/schemas/DataQualityAudit"},{"type":"null"}]},"evidence_summary":{"$ref":"#/components/schemas/EvidenceSummary"},"priority_decision":{"anyOf":[{"$ref":"#/components/schemas/PriorityDecisionPayload"},{"type":"null"}]},"reveal":{"$ref":"#/components/schemas/RevealPayload"}},"additionalProperties":true,"type":"object","title":"Stage4RevealResponse"},"Stage5ProgressResponse":{"properties":{"stage":{"type":"string","title":"Stage","default":"rule_progress_engine","example":"rule_progress_engine"},"upload_id":{"type":"string","title":"Upload Id","example":"upl_abc123"},"progress":{"additionalProperties":true,"type":"object","title":"Progress"}},"additionalProperties":true,"type":"object","required":["upload_id"],"title":"Stage5ProgressResponse"},"TiebreakRequest":{"properties":{"answer":{"type":"string","title":"Answer"}},"type":"object","required":["answer"],"title":"TiebreakRequest"},"TradeEvidencePackage":{"properties":{"trade_id":{"type":"string","title":"Trade Id","example":"trd_abc123"},"source_trade_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Trade Id","example":"123456"},"mode":{"type":"string","enum":["statement_only","candle_confirmed"],"title":"Mode","default":"statement_only","example":"candle_confirmed"},"candle_review_status":{"anyOf":[{"type":"string","enum":["reviewed","capped_statement_only","missing_candles","statement_only_unclassified"]},{"type":"null"}],"title":"Candle Review Status","description":"Persisted trade_evidence review status. May be absent from raw Stage 2 preview packages.","example":"statement_only_unclassified"},"execution_physics":{"$ref":"#/components/schemas/EvidenceExecutionPhysics"},"reconstruction_status":{"$ref":"#/components/schemas/EvidenceReconstructionStatus"},"post_exit_proof":{"$ref":"#/components/schemas/EvidencePostExitProof"},"pre_entry_context":{"additionalProperties":true,"type":"object","title":"Pre Entry Context"},"rule_derived_context":{"additionalProperties":true,"type":"object","title":"Rule Derived Context"},"price_action_context":{"additionalProperties":true,"type":"object","title":"Price Action Context"},"news_context":{"additionalProperties":true,"type":"object","title":"News Context"},"loader_diagnostics":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Loader Diagnostics"},"stop_loss_present":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stop Loss Present","description":"R context field from persisted trade_evidence."},"initial_risk_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Initial Risk Price"},"initial_risk_pips":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Initial Risk Pips"},"realized_r":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Realized R"},"mae_r":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mae R"},"mfe_r":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mfe R"},"r_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"R Available"},"r_unavailable_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"R Unavailable Reason"}},"additionalProperties":true,"type":"object","required":["trade_id"],"title":"TradeEvidencePackage"},"TruthAccount":{"properties":{"account_ref":{"type":"string","title":"Account Ref","default":"unknown","example":"demo"},"broker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broker","example":"ic_markets"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage","example":"evaluation"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone","example":"Asia/Qatar"}},"additionalProperties":true,"type":"object","title":"TruthAccount"},"TruthConstraints":{"properties":{"one_focus_only":{"type":"boolean","title":"One Focus Only","default":true},"allow_identity":{"type":"boolean","title":"Allow Identity","default":true},"allow_milestones":{"type":"boolean","title":"Allow Milestones","default":true},"allow_progress_first":{"type":"boolean","title":"Allow Progress First","default":true},"allow_recent_repeat":{"type":"boolean","title":"Allow Recent Repeat","default":false},"safe_language":{"type":"boolean","title":"Safe Language","default":true}},"additionalProperties":true,"type":"object","title":"TruthConstraints"},"TruthCostHypotheticalFilter":{"properties":{"net_estimate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Estimate"},"blocked_trades":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Blocked Trades"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"}},"additionalProperties":true,"type":"object","title":"TruthCostHypotheticalFilter"},"TruthCostMissedContinuation":{"properties":{"estimated_total":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Estimated Total"},"trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trade Count"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"}},"additionalProperties":true,"type":"object","title":"TruthCostMissedContinuation"},"TruthCostRealized":{"properties":{"affected_net_result":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Net Result","example":-421.5},"affected_loss_sum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Loss Sum"},"affected_win_sum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Affected Win Sum"}},"additionalProperties":true,"type":"object","title":"TruthCostRealized"},"TruthDataQuality":{"properties":{"grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grade","example":"strong"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","example":0.91},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"additionalProperties":true,"type":"object","title":"TruthDataQuality"},"TruthDecision":{"properties":{"decision_version":{"type":"string","title":"Decision Version","default":"truth_decision_v1"},"decision_ref":{"type":"string","title":"Decision Ref","example":"td_abc123"},"account_ref":{"type":"string","title":"Account Ref","example":"demo"},"run_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Ref","example":"run_abc123"},"upload_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Ref","example":"upl_abc123"},"decision_type":{"type":"string","enum":["progress_first","critical_discovery","same_truth_update","next_priority_truth","watchlist_only","no_undeniable_truth","waiting_for_progress","expected_issue_not_proven"],"title":"Decision Type"},"selected_truth_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Truth Ref"},"selected_pattern_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Pattern Type"},"discovery_angle":{"type":"string","title":"Discovery Angle","default":"main_cost_driver"},"display":{"$ref":"#/components/schemas/TruthDisplay"},"proof":{"$ref":"#/components/schemas/TruthProof"},"rule_offer":{"$ref":"#/components/schemas/TruthRuleOffer"},"memory_event":{"$ref":"#/components/schemas/MemoryEvent"},"audit":{"$ref":"#/components/schemas/TruthDecisionAudit"}},"additionalProperties":true,"type":"object","required":["decision_ref","account_ref","decision_type","display","memory_event"],"title":"TruthDecision"},"TruthDecisionAudit":{"properties":{"kernel_version":{"type":"string","title":"Kernel Version","default":"truth_kernel_v1"},"policies_applied":{"items":{"type":"string"},"type":"array","title":"Policies Applied"},"candidate_count":{"type":"integer","title":"Candidate Count","default":0},"eligible_count":{"type":"integer","title":"Eligible Count","default":0},"memory_used":{"type":"boolean","title":"Memory Used","default":false},"safe_language_checked":{"type":"boolean","title":"Safe Language Checked","default":true},"suppressed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Suppressed"}},"additionalProperties":true,"type":"object","title":"TruthDecisionAudit"},"TruthDiscoverySidecarPayload":{"properties":{"status":{"type":"string","title":"Status","default":"ok","example":"ok"},"persisted_memory":{"type":"boolean","title":"Persisted Memory","default":false,"example":true},"memory_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Ref","example":"mem_abc123"},"decision":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Decision"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","example":"truth_discovery_sidecar_failed"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"additionalProperties":true,"type":"object","title":"TruthDiscoverySidecarPayload"},"TruthDisplay":{"properties":{"headline":{"type":"string","title":"Headline"},"safe_summary":{"type":"string","title":"Safe Summary"},"status_label":{"$ref":"#/components/schemas/TruthStatusLabel"},"identity":{"anyOf":[{"$ref":"#/components/schemas/TruthIdentity"},{"type":"null"}]},"milestone":{"anyOf":[{"$ref":"#/components/schemas/TruthMilestone"},{"type":"null"}]},"next_reveal_hint":{"anyOf":[{"$ref":"#/components/schemas/TruthNextRevealHint"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["headline","safe_summary","status_label"],"title":"TruthDisplay"},"TruthEvaluateResponse":{"properties":{"status":{"type":"string","enum":["ok","error"],"title":"Status","default":"ok"},"decision":{"anyOf":[{"$ref":"#/components/schemas/TruthDecision"},{"type":"null"}]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"additionalProperties":true,"type":"object","title":"TruthEvaluateResponse"},"TruthEvidenceSummary":{"properties":{"statement_only_available":{"type":"boolean","title":"Statement Only Available","default":true,"example":true},"candle_confirmed_available":{"type":"boolean","title":"Candle Confirmed Available","default":false,"example":true},"timeframes_used":{"items":{"type":"string"},"type":"array","title":"Timeframes Used","example":["1m","15m","1h","4h"]},"coverage_warnings":{"items":{"type":"string"},"type":"array","title":"Coverage Warnings"}},"additionalProperties":true,"type":"object","title":"TruthEvidenceSummary"},"TruthIdentity":{"properties":{"label":{"type":"string","title":"Label"},"status":{"type":"string","title":"Status","default":"current_evidence_profile"},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size"},"affected_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Affected Trade Count"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"additionalProperties":true,"type":"object","required":["label"],"title":"TruthIdentity"},"TruthInputBundle":{"properties":{"bundle_version":{"type":"string","title":"Bundle Version","default":"truth_input_v1","example":"truth_input_v1"},"account":{"$ref":"#/components/schemas/TruthAccount"},"run":{"$ref":"#/components/schemas/TruthRun"},"trade_summary":{"$ref":"#/components/schemas/TruthTradeSummary"},"data_quality":{"$ref":"#/components/schemas/TruthDataQuality"},"evidence_summary":{"$ref":"#/components/schemas/TruthEvidenceSummary"},"candidate_truths":{"items":{"$ref":"#/components/schemas/CandidateTruth"},"type":"array","title":"Candidate Truths"},"evidence_fragments":{"items":{"$ref":"#/components/schemas/EvidenceFragment"},"type":"array","title":"Evidence Fragments"},"active_rule":{"anyOf":[{"$ref":"#/components/schemas/ActiveRule"},{"type":"null"}]},"latest_progress":{"anyOf":[{"$ref":"#/components/schemas/LatestProgress"},{"type":"null"}]},"memory_hint":{"$ref":"#/components/schemas/TruthMemoryHint"},"user_context":{"$ref":"#/components/schemas/TruthUserContext"},"constraints":{"$ref":"#/components/schemas/TruthConstraints"}},"additionalProperties":true,"type":"object","title":"TruthInputBundle"},"TruthMemoryAppendResponse":{"properties":{"status":{"type":"string","const":"accepted","title":"Status","default":"accepted"},"memory_ref":{"type":"string","title":"Memory Ref"}},"additionalProperties":true,"type":"object","required":["memory_ref"],"title":"TruthMemoryAppendResponse"},"TruthMemoryHint":{"properties":{"previously_shown":{"items":{},"type":"array","title":"Previously Shown"}},"additionalProperties":true,"type":"object","title":"TruthMemoryHint"},"TruthMemoryResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","default":"ok"},"account_ref":{"type":"string","title":"Account Ref"},"count":{"type":"integer","title":"Count","default":0},"memory":{"items":{"$ref":"#/components/schemas/MemoryEvent"},"type":"array","title":"Memory"}},"additionalProperties":true,"type":"object","required":["account_ref"],"title":"TruthMemoryResponse"},"TruthMilestone":{"properties":{"type":{"type":"string","title":"Type"},"label":{"type":"string","title":"Label"},"qualified":{"type":"boolean","title":"Qualified","default":false},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"additionalProperties":true,"type":"object","required":["type","label"],"title":"TruthMilestone"},"TruthNextRevealHint":{"properties":{"status":{"type":"string","title":"Status","example":"being_verified"},"message":{"type":"string","title":"Message"}},"additionalProperties":true,"type":"object","required":["status","message"],"title":"TruthNextRevealHint"},"TruthProof":{"properties":{"cost_type":{"type":"string","enum":["realized","missed_continuation","hypothetical_filter","none"],"title":"Cost Type","default":"none"},"sample_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Size"},"affected_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Affected Count"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"receipt_refs":{"items":{"type":"string"},"type":"array","title":"Receipt Refs"},"evidence_fragment_refs":{"items":{"type":"string"},"type":"array","title":"Evidence Fragment Refs"}},"additionalProperties":true,"type":"object","title":"TruthProof"},"TruthRuleOffer":{"properties":{"available":{"type":"boolean","title":"Available","default":false},"rule_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Ref"},"machine_checkable":{"type":"boolean","title":"Machine Checkable","default":false}},"additionalProperties":true,"type":"object","title":"TruthRuleOffer"},"TruthRun":{"properties":{"run_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Ref","example":"run_abc123"},"upload_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Ref","example":"upl_abc123"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","example":"v3_upload"},"review_window":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Window","example":"January 2026"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"additionalProperties":true,"type":"object","title":"TruthRun"},"TruthStateResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","default":"ok"},"account_ref":{"type":"string","title":"Account Ref"},"latest_truth":{"anyOf":[{"$ref":"#/components/schemas/MemoryEvent"},{"type":"null"}]},"active_rule":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Active Rule"},"latest_progress":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Latest Progress"},"next_expected_action":{"additionalProperties":true,"type":"object","title":"Next Expected Action"}},"additionalProperties":true,"type":"object","required":["account_ref"],"title":"TruthStateResponse"},"TruthStatusLabel":{"properties":{"label":{"type":"string","title":"Label","example":"Critical Pattern Active"},"severity":{"type":"string","enum":["critical","watchlist","progress","info","none"],"title":"Severity","default":"info"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"additionalProperties":true,"type":"object","required":["label"],"title":"TruthStatusLabel"},"TruthTradeSummary":{"properties":{"trade_count":{"type":"integer","title":"Trade Count","default":0,"example":224},"symbol_scope":{"items":{"type":"string"},"type":"array","title":"Symbol Scope","example":["XAUUSD"]},"eligible_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eligible Trade Count","example":224},"unsupported_trade_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unsupported Trade Count","example":0}},"additionalProperties":true,"type":"object","title":"TruthTradeSummary"},"TruthUserContext":{"properties":{"focus_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Focus Hint","example":"risk"},"expected_issue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Issue","example":"price_action"},"requested_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Mode","example":"product"}},"additionalProperties":true,"type":"object","title":"TruthUserContext"},"UploadPayload":{"properties":{"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","example":"demo"},"broker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broker","example":"exness"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol","example":"XAUUSD"},"review_window":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Window","example":"January 2026"},"symbol_scope":{"items":{"type":"string"},"type":"array","title":"Symbol Scope","example":["XAUUSD"]},"symbols":{"items":{"type":"string"},"type":"array","title":"Symbols","example":["XAUUSD"]},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type","example":"json"},"original_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Filename","example":"Monthly Statement (3).eml"},"account_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Stage","example":"evaluation"},"user_focus_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Focus Hint","example":"Find the first destruction pattern"},"truth_discovery":{"additionalProperties":true,"type":"object","title":"Truth Discovery","example":{"enabled":true,"expected_issue":"price_action","persist_memory":true}},"trades":{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array","title":"Trades"},"history":{"items":{"$ref":"#/components/schemas/UploadTradeRow"},"type":"array","title":"History"}},"additionalProperties":true,"type":"object","title":"UploadPayload","example":{"account_id":"demo","broker":"exness","source_type":"json","symbol":"XAUUSD","trades":[{"direction":"LONG","entry_price":2645.2,"entry_time":"2026-01-01T08:00:00Z","exit_price":2641.8,"exit_time":"2026-01-01T08:03:00Z","instrument":"XAUUSD","profit":-34.0,"volume":0.1}]}},"UploadTradeRow":{"properties":{"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol","example":"XAUUSD"},"instrument":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instrument","example":"XAUUSD"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction","example":"LONG"},"side":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Side","example":"BUY"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","example":"BUY"},"open_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Open Time","example":"2026-01-01T08:00:00Z"},"entry_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entry Time","example":"2026-01-01T08:00:00Z"},"close_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Time","example":"2026-01-01T08:03:00Z"},"exit_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exit Time","example":"2026-01-01T08:03:00Z"},"open_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Open Price","example":2645.2},"entry_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Entry Price","example":2645.2},"close_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Close Price","example":2641.8},"exit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exit Price","example":2641.8},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume","example":0.1},"lots":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lots","example":0.1},"size":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Size","example":0.1},"stop_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stop Loss","example":2649.0},"stop_loss_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stop Loss Price","example":2649.0},"sl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sl","example":2649.0},"take_profit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Take Profit","example":2638.5},"tp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tp","example":2638.5},"net_result":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Result","example":-34.0},"pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pnl","example":-34.0},"profit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Profit","example":-34.0},"commission":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Commission","example":-0.7},"swap":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Swap","example":0.0},"taxes":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Taxes","example":0.0},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","example":"demo"},"broker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broker","example":"exness"}},"additionalProperties":true,"type":"object","title":"UploadTradeRow","example":{"commission":-0.7,"direction":"LONG","entry_price":2645.2,"entry_time":"2026-01-01T08:00:00Z","exit_price":2641.8,"exit_time":"2026-01-01T08:03:00Z","instrument":"XAUUSD","profit":-34.0,"volume":0.1}},"V3CandidatesResponse":{"properties":{"status":{"type":"string","enum":["ok","no_data"],"title":"Status","default":"ok","example":"ok"},"analysis_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Run Id","example":"run_abc123"},"selected_pattern_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Pattern Id","example":"cand_overtrading_after_first_loss"},"candidate_count":{"type":"integer","title":"Candidate Count","default":0,"example":7},"candidates":{"items":{"$ref":"#/components/schemas/FocusCandidate"},"type":"array","title":"Candidates"}},"additionalProperties":true,"type":"object","title":"V3CandidatesResponse"},"V3CompatibilityResponse":{"properties":{"supported_now":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Supported Now"},"supported_symbols_first":{"items":{"type":"string"},"type":"array","title":"Supported Symbols First","example":["XAUUSD","XAUUSDm","XAUUSD.raw","GOLD"]},"not_supported_yet":{"items":{"type":"string"},"type":"array","title":"Not Supported Yet"},"statement_only_patterns":{"items":{"type":"string"},"type":"array","title":"Statement Only Patterns"},"candle_confirmed_patterns":{"items":{"type":"string"},"type":"array","title":"Candle Confirmed Patterns"},"privacy_note":{"type":"string","title":"Privacy Note","example":"Upload-only works; broker API credentials are not required."}},"additionalProperties":true,"type":"object","required":["privacy_note"],"title":"V3CompatibilityResponse"},"V3ResetResponse":{"properties":{"status":{"type":"string","title":"Status","default":"ok","example":"ok"},"message":{"type":"string","title":"Message"},"market_data_cache_cleared":{"type":"boolean","title":"Market Data Cache Cleared","default":true,"example":true}},"additionalProperties":true,"type":"object","required":["message"],"title":"V3ResetResponse"},"V3UploadAnalysisResponse":{"properties":{"upload_id":{"type":"string","title":"Upload Id","example":"upl_abc123"},"analysis_run_id":{"type":"string","title":"Analysis Run Id","example":"run_abc123"},"parse_status":{"type":"string","title":"Parse Status","example":"ok"},"trades_parsed":{"type":"integer","title":"Trades Parsed","example":224},"trades_eligible":{"type":"integer","title":"Trades Eligible","example":224},"unsupported_trades":{"type":"integer","title":"Unsupported Trades","default":0,"example":0},"selected_reveal_url":{"type":"string","title":"Selected Reveal Url","example":"/api/v1/v3/reveals/run_abc123"},"candidate_count":{"type":"integer","title":"Candidate Count","example":7},"critical_found":{"type":"boolean","title":"Critical Found","example":true},"data_quality":{"anyOf":[{"$ref":"#/components/schemas/DataQualityAudit"},{"type":"null"}]},"evidence_summary":{"$ref":"#/components/schemas/EvidenceSummary"},"evidence_packages":{"items":{"$ref":"#/components/schemas/TradeEvidencePackage"},"type":"array","title":"Evidence Packages"},"reveal":{"$ref":"#/components/schemas/RevealPayload"},"truth_discovery":{"anyOf":[{"$ref":"#/components/schemas/TruthDiscoverySidecarPayload"},{"type":"null"}],"description":"Optional sidecar returned only when upload payload includes truth_discovery.enabled=true."}},"additionalProperties":true,"type":"object","required":["upload_id","analysis_run_id","parse_status","trades_parsed","trades_eligible","selected_reveal_url","candidate_count","critical_found"],"title":"V3UploadAnalysisResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}