{"name":"PrimeSync AI Studio","icon":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","publisher":"PrimeSync Project","legalOperator":"נביה חיר","operatorCountry":"Israel","version":"2.24.0","mcpEndpoint":"https://ai.primesync.me/mcp/v1","transport":"MCP Streamable HTTP","protocolVersion":"2026-07-28","legacyProtocolCompatibility":["2025-11-25","2025-03-26"],"authentication":"OAuth 2.1 authorization code with PKCE (S256)","scopes":{"strategies:build":"Build strategies, indicators, experiments, conversions, and code repairs from the rules you provide.","strategies:audit":"Audit supplied Pine Script or Python against an approved blueprint without changing external systems.","strategies:validate":"Analyze TradingView results and run Monte Carlo or robustness validation in a bounded compute-only environment.","memory:manage":"Optional: read and manage saved preferences and strategy summaries for your account. Memory stays off until you explicitly enable it; you can delete it anytime."},"limits":{"activeConnections":"3 per PrimeSync account","toolCalls":"30 calls per OAuth session per rolling minute","requestBody":"5.5 MB","csvStructure":"4,000,000 characters, 100,000 rows, 64 columns, and 32,000 characters per cell","monteCarloWork":"25,000,000 aggregate resampled trade observations across all baseline, candidate, and cost-stress paths in one request","accessToken":"1 hour","refreshToken":"Up to 30 days and rotated on use; reviewer sessions have an absolute 8-hour limit","auditMetadata":"30 days"},"executionBoundary":"Pure in-process parsing and seeded reproducible computation. No submitted-code execution and no outbound broker, TradingView, exchange, or market-data calls.","personalization":{"default":"off","permission":"memory:manage","ownership":"authenticated_user_id","retention":"Until reset, disable, or deletion","researchToolContext":"Optional context field: temporary preferences, provisional preferences, saved project reference, or portable summary. Permission plus explicit enablement is required to load saved memory. Compute calls do not write memory."},"capabilities":["Capture trader-approved P0–P4 or CUSTOM strategy Properties, bind their full snapshot into blueprint/code audits, confirm effective export settings, and block final rankings with missing or mismatched Properties. P profiles are independent of V entry profiles.","Use Open AI Strategy Mode for genuinely new, trader-owned architectures without importing PrimeSync.me logic or presets.","Use Preserve Existing Logic Mode for repairs, conversions, and upgrades that must protect supplied logic, visuals, and order behavior.","Build an entirely new strategy from trader-supplied rules.","Build a new indicator.","Help the connected AI add Pine Script alert logic on request, preserve existing alerts during approved edits, and perform basic static alert/arrow checks. Users create, activate, and test alerts in TradingView; the MCP does not run a live notification service.","Create new experiments and trading models.","Fix code without changing its logic.","Convert indicators into strategies or strategies into indicators.","Preserve identical arrows and levels during conversion when visual parity is requested.","Optimize for net PnL, win rate, drawdown, or robustness.","Research universal cross-asset improvements.","Run Monte Carlo without building code.","Validate fresh TradingView or Python backtest results.","Create profiles only when profiles are explicitly requested.","Use exact, client-retrieved academic sources—including SSRN—as caller-attested evidence for research-backed hypotheses, with explicit provenance boundaries and trader approval before coding.","Generate market-, timeframe-, mechanism-, and objective-specific research queries for browsing-capable clients; score supplied papers and reputable practitioner research transparently before creating isolated hypotheses.","Preserve stable source, hypothesis, candidate, code, and dataset lineage while keeping incomplete citations, abstract-only reviews, promotional claims, leakage, and irrelevant evidence out of the caller-attested eligible-source set. Independently verified sources remain empty until a retrieval and authentication layer exists.","Apply an eight-gate baseline-first validation process covering dataset mapping, logic equivalence, isolated improvements, chronological folds, holdout costs, Monte Carlo comparison, and fresh TradingView or Python runtime confirmation.","Carry the full research ledger in the client, or explicitly save a minimal account-owned strategy summary with optional memory:manage consent. Raw code and CSVs are never automatically saved.","Progressively remember confirmed preferences, support request-only overrides, resume an owned strategy, and export, reset, or erase optional memory.","Import and normalize TradingView List of Trades exports or Python one-row-per-closed-trade CSVs before validation.","Detect blueprint drift with a stable blueprint hash embedded in generated code.","Return visible deterministic audit findings and complete Monte Carlo metrics instead of analysis instructions.","Compare audited candidates and select only from complete datasets with matching blueprint lineage.","Hand any complete Pine Script v6 or Python architecture to a connected AI for authoring, then audit the returned candidate against its locked blueprint.","Estimate a trader-supplied account failure-threshold breach probability without inventing the threshold.","Use a final-candidate selection contract that requires code/data fingerprints, code version, parameter set, chronological folds, untouched holdout, realistic cost stress, and parameter sensitivity before a preferred candidate is returned.","Bound CSV parsing and Monte Carlo work to hosted safety budgets with explicit recovery guidance instead of timing out or truncating evidence.","Treat submitted code, CSV cells, filenames, metadata, and source evidence as untrusted data rather than instructions."],"tools":[{"name":"primesync_analyze_backtests","title":"Analyze supplied backtests","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Analyze supplied closed-trade datasets and report historical metrics, seeded robustness results, and evidence gaps. Does not optimize entry filters.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Analyze supplied closed-trade datasets and report historical metrics, seeded robustness results, and evidence gaps. Does not optimize entry filters. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","datasets"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_bootstrap_backtests","title":"Bootstrap supplied backtests","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Run seeded bootstrap robustness analysis on supplied closed-trade CSV datasets. For return arrays or final candidate selection use primesync_monte_carlo.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Run seeded bootstrap robustness analysis on supplied closed-trade CSV datasets. For return arrays or final candidate selection use primesync_monte_carlo. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","datasets"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_optimize_entry_filters","title":"Research entry-filter improvements","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Evaluate permitted entry-feature filters against a supplied baseline, chronological folds and holdout. Returns experimental candidates, never a guaranteed improvement.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Evaluate permitted entry-feature filters against a supplied baseline, chronological folds and holdout. Returns experimental candidates, never a guaranteed improvement. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"allowedEntryFeatures":{"default":["direction","time"],"type":"array","items":{"type":"string","enum":["direction","time","weekday","session","setup_class","entry_regime"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","datasets"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_compare_asset_filters","title":"Compare filters across assets","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Evaluate common permitted entry-feature filters across supplied asset/timeframe datasets. Reports weak datasets and cross-asset robustness limits.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Evaluate common permitted entry-feature filters across supplied asset/timeframe datasets. Reports weak datasets and cross-asset robustness limits. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":2,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"allowedEntryFeatures":{"default":["direction","time"],"type":"array","items":{"type":"string","enum":["direction","time","weekday","session","setup_class","entry_regime"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","datasets"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_design_research_experiment","title":"Design a research experiment","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Profile a research question and turn supplied academic evidence into isolated, source-linked hypotheses and candidate experiments requiring trader approval. Does not retrieve papers.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Profile a research question and turn supplied academic evidence into isolated, source-linked hypotheses and candidate experiments requiring trader approval. Does not retrieve papers. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_design_strategy_candidate","title":"Design a strategy candidate","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Prepare a strategy candidate from trader-owned rules, supplied research evidence and approved change scope. Returns missing rules or a candidate/authoring handoff; does not execute strategy code.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Prepare a strategy candidate from trader-owned rules, supplied research evidence and approved change scope. Returns missing rules or a candidate/authoring handoff; does not execute strategy code. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_design_indicator_candidate","title":"Design an indicator candidate","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Prepare an indicator candidate from supplied rules and evidence. Returns a candidate/authoring handoff and any missing requirements; does not execute code.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Prepare an indicator candidate from supplied rules and evidence. Returns a candidate/authoring handoff and any missing requirements; does not execute code. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_convert_indicator_to_strategy","title":"Convert an indicator to a strategy","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Prepare an indicator-to-strategy conversion from supplied base code, preserving the explicitly protected logic and visuals. Returns candidate or authoring guidance and parity checks.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Prepare an indicator-to-strategy conversion from supplied base code, preserving the explicitly protected logic and visuals. Returns candidate or authoring guidance and parity checks. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","minLength":1,"maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","baseCode"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_convert_strategy_to_indicator","title":"Convert a strategy to an indicator","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Prepare a strategy-to-indicator conversion from supplied base code with the requested preservation constraints. Returns candidate or authoring guidance and parity checks.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Prepare a strategy-to-indicator conversion from supplied base code with the requested preservation constraints. Returns candidate or authoring guidance and parity checks. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","minLength":1,"maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","baseCode"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_validate_code_evidence","title":"Validate code against backtest evidence","scopes":["strategies:build","strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Only the goal, code, visual reference, client-supplied strategy ID and research ledger, and TradingView CSV data supplied in the current tool call.","returns":"Evaluate supplied candidate code and fresh closed-trade exports with lineage, fold and robustness checks. Reports missing evidence; does not compile or execute code.","sideEffects":"Writes one metadata-only audit event (tool, scopes, client, time, status). It does not save code, execute submitted code, call brokers, publish scripts, or access TradingView accounts.","description":"Evaluate supplied candidate code and fresh closed-trade exports with lineage, fold and robustness checks. Reports missing evidence; does not compile or execute code. Computes only from supplied data; writes metadata audit/usage records, not strategy content. Research continuity is client-managed. Requires Studio access for analysis. No broker access or trade execution.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","minLength":1,"maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","candidateCode","datasets"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build","strategies:validate"]}]},{"name":"primesync_import_backtest","title":"Import a strategy backtest","scopes":["strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"One supplied TradingView List of Trades CSV or Python closed-trade CSV plus explicit platform, asset, timeframe, timezone, and mapping metadata.","returns":"Dataset audit, normalized chronological returns, a dataset fingerprint, candidate/code-version/content-hash mapping, blueprint lineage, an explicit evidenceStatus, staged warnings, and the next action. BACKTEST EVIDENCE ACCEPTED requires matching blueprint hashes, a clean static pass, user-reported compilation, a user-attested fresh export, confirmed costs, matching confirmed effective Properties, and confirmed clean mapping; final selection additionally requires complete reproducibility metadata and comparable realistic Properties. P0/P4 remain comparison-only.","sideEffects":"Writes one metadata-only audit event. It does not contact TradingView, save the CSV, or execute strategy code.","description":"Validate and normalize either a user-attested fresh TradingView List of Trades export or a Python one-row-per-closed-trade CSV before research or Monte Carlo. Checks blueprint lineage, reported runtime validation, export provenance, costs, mapping, chronology, and safe file structure. Returns a dataset fingerprint plus optional candidate ID, code version, audited code-content fingerprint, and parameter mapping for final traceability. It never executes supplied code or cryptographically proves code-to-export provenance.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"description":"Stable client-owned dataset identifier used for final traceability.","type":"string","minLength":1,"maxLength":300},"candidateId":{"description":"Candidate ID that produced this exact export.","type":"string","minLength":1,"maxLength":100},"codeVersion":{"description":"Client-owned code version for this export.","type":"string","minLength":1,"maxLength":100},"codeContentHash":{"description":"Exact code-content fingerprint returned by the static audit.","type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"default":"America/New_York","type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"description":"User confirms this exact hash-marked code compiled successfully in TradingView.","type":"boolean"},"runtimeValidationConfirmed":{"default":false,"description":"For Python, the user confirms this exact hash-marked code passed syntax checks and executed against the exported dataset.","type":"boolean"},"freshExportConfirmed":{"default":false,"description":"User confirms this CSV was freshly exported from that exact compiled or executed code.","type":"boolean"},"costsConfirmed":{"default":false,"description":"User confirms commission, slippage, spread, and other applicable costs are represented.","type":"boolean"}},"required":["asset","timeframe","csvText"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string","enum":["ready","needs_correction"]},"evidenceStatus":{"type":"string","enum":["DATASET_INVALID","EVIDENCE_INCOMPLETE","BACKTEST_EVIDENCE_ACCEPTED"]},"dataset":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"chronologicalTradeReturns":{"type":"array","items":{"type":"number"}},"chronologicalNetPnl":{"type":"array","items":{"type":"number"}},"tradeIds":{"type":"array","items":{"type":"string"}},"normalization":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"validationStages":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"lineage":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"verificationWarnings":{"type":"array","items":{"type":"string"}},"traceabilityWarnings":{"type":"array","items":{"type":"string"}},"nextAction":{"type":"string"}},"required":["answer","status","evidenceStatus","dataset","chronologicalTradeReturns","chronologicalNetPnl","tradeIds","normalization","validationStages","lineage","verificationWarnings","traceabilityWarnings","nextAction"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:validate"]}]},{"name":"primesync_strategy_builder","title":"Build a Pine or Python strategy","scopes":["strategies:build"],"effect":"Compute-only result + metadata audit entry","reads":"The trader's idea, rules, market, timeframe, execution assumptions, costs, requested Pine/Python output, and any connected-AI code candidate returned for audit.","returns":"A top-of-response Strategy Completion Map followed by a bundled clarification, deterministic Pine candidate, or open connected-AI authoring contract for arbitrary complete Pine/Python architectures. Returned candidates receive blueprint-integrity and static audit findings.","sideEffects":"Writes one metadata-only audit event. It does not place trades, save workspaces, or alter external files.","description":"Clarify and lock trader-owned rules. Generate a supported deterministic template or return an open authoring contract so a connected AI can implement any complete trader-approved architecture in Pine Script v6 and/or Python without PrimeSync.me presets. Candidate code then returns to this tool for blueprint and static audit.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"idea":{"type":"string","minLength":10,"maxLength":6000,"description":"The trader's strategy idea in their own words."},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"baseCode":{"description":"Required in Preserve Existing Logic mode. The complete current Pine or Python source.","type":"string","maxLength":200000},"allowedChangeScope":{"description":"Required in Preserve Existing Logic mode. Exact changes the trader approved.","maxItems":40,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"marketAndTimeframe":{"description":"Market and intended timeframe exactly as provided.","type":"string","maxLength":500},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"description":"Exact entry conditions extracted from the trader's idea.","type":"string","maxLength":3000},"exitRules":{"description":"Exact exit conditions extracted from the trader's idea.","type":"string","maxLength":3000},"riskRules":{"description":"Trader-supplied position-sizing or account-risk rules.","type":"string","maxLength":2000},"executionRules":{"description":"Trader-supplied timing, session, pyramiding, and reversal rules.","type":"string","maxLength":2000},"costRules":{"description":"Trader-supplied commission and slippage assumptions.","type":"string","maxLength":1000},"selectionObjective":{"description":"Primary metric for comparing strategy candidates. highest_pnl remains a legacy alias.","type":"string","enum":["highest_net_pnl","highest_pnl","highest_win_rate","highest_profit_factor","lowest_drawdown","strongest_robustness"]},"additionalConstraints":{"description":"Plain constraints (3000 characters), or the documented PRIMESYNC_BUILD_V1 completion envelope for legacy clients.","type":"string","maxLength":2420000},"output":{"type":"string","enum":["pine_v6","python","both"]},"candidateCode":{"description":"Connected-AI code candidate for a single requested language, returned for audit.","type":"string","maxLength":200000},"candidatePineCode":{"type":"string","maxLength":200000},"candidatePythonCode":{"type":"string","maxLength":200000}},"required":["idea"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:build"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"blueprintHash":{"type":"string"},"sourceOfTradingRules":{"type":"string","const":"user_only"},"hiddenDefaults":{"type":"boolean","const":false}},"required":["answer","status","blueprintHash","sourceOfTradingRules","hiddenDefaults"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:build"]}]},{"name":"primesync_audit_strategy","title":"Static audit a generated strategy","scopes":["strategies:audit"],"effect":"Compute-only result + metadata audit entry","reads":"The approved rule blueprint, its required Strategy Builder hash, and supplied Pine Script or Python code.","returns":"A staged STATIC PASS, STATIC REVIEW REQUIRED, or STATIC FAILED result plus a stable code-content fingerprint and visible findings for blueprint drift, higher-timeframe leakage, look-ahead, negative offsets, pivots, intrabar execution, risk sizing, partial exits, stop mutation, sessions, pyramiding, alert/arrow parity, costs, direction, and rule coverage. Compilation and runtime behavior remain explicitly unconfirmed.","sideEffects":"Writes one metadata-only audit event. It analyzes text and returns corrections in the conversation without changing external files.","description":"Perform deterministic static inspection against the trader-approved blueprint. Check lineage, higher-timeframe leakage, look-ahead and negative offsets, pivot delays, intrabar execution, position sizing, partial exits, stop mutation, sessions and DST, pyramiding, alert/arrow parity, costs, direction, and rule coverage. Returns STATIC PASS, STATIC REVIEW REQUIRED, or STATIC FAILED; it never claims TradingView compilation or runtime verification.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"approvedRules":{"type":"string","minLength":10,"maxLength":12000},"approvedBlueprint":{"description":"Exact blueprint object returned by Strategy Builder. Required for a clean integrity-bound static pass; legacy rules-only calls remain review-required.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"code":{"type":"string","minLength":10,"maxLength":200000},"language":{"type":"string","enum":["pine_v6","python"]},"approvedBlueprintHash":{"description":"Required for an approved-workflow pass. Without it, returns an unverified static review that cannot qualify a candidate for selection. Never infer approval from a code comment.","type":"string","pattern":"^psb_[a-f0-9]{8}$"}},"required":["approvedRules","code","language"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:audit"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string","enum":["passed","warning","failed"]},"verificationStage":{"type":"string","enum":["STATIC PASS","STATIC REVIEW REQUIRED","STATIC FAILED"]},"compileStatus":{"type":"string","const":"NOT_CONFIRMED"},"backtestStatus":{"type":"string","const":"NOT_SUBMITTED"},"robustnessStatus":{"type":"string","const":"NOT_RUN"},"approvedBlueprintHash":{"type":["string","null"]},"codeBlueprintHash":{"type":["string","null"]},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"blueprintDrift":{"type":"string","enum":["matched","missing_code_marker","hash_mismatch","unverified"]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"findings":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"rule":{"type":"string"},"status":{"type":"string","enum":["PASS","WARNING","FAIL"]},"severity":{"type":"string","enum":["info","medium","high"]},"evidence":{"type":"string"},"codeLocation":{"anyOf":[{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"snippet":{"type":"string"}},"required":["line","snippet"],"additionalProperties":false},{"type":"null"}]},"impact":{"type":"string"},"recommendedCorrection":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"verificationScope":{"type":"string","const":"static_source_inspection"}},"required":["check","rule","status","severity","evidence","codeLocation","impact","recommendedCorrection","confidence","verificationScope"],"additionalProperties":false}}},"required":["answer","status","verificationStage","compileStatus","backtestStatus","robustnessStatus","approvedBlueprintHash","codeBlueprintHash","codeContentHash","blueprintDrift","counts","findings"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:audit"]}]},{"name":"primesync_monte_carlo","title":"Run a Monte Carlo robustness check","scopes":["strategies:validate"],"effect":"Compute-only result + metadata audit entry","reads":"Up to 20,000 chronological returns per candidate, original row counts, return unit, up to 100,000 simulations, comparison objective, optional account failure threshold, and caller-supplied compilation/export/cost/mapping lineage.","returns":"A standalone analytical result, backward-compatible provisional comparison, or fully gated final-candidate decision. Final mode requires complete fold, holdout, cost-stress, parameter-sensitivity, code-content, dataset, and parameter lineage; it reports reproducible percentiles, drawdown, losing-streak distribution, negative-result and optional failure-threshold probabilities, rejection reasons, and the exact unchanged preferred code.","sideEffects":"Writes one metadata-only audit event. It does not build code, fetch market data, or execute trades.","description":"Complete the final analytical stage using a seeded and reproducible bootstrap on chronological trade returns. Standalone mode analyzes one series; approved_candidate_selection remains a provisional compatibility comparison; final_candidate_selection requires exact code/data fingerprints, version, parameters, folds, untouched holdout, realistic cost stress, parameter sensitivity, compilation, fresh export, costs, and confirmed mapping before returning a final preferred code. Hosted work is bounded before computation. Never describe the result as a profit guarantee.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"datasetPropertiesFingerprint":{"description":"Actual Properties fingerprint returned by the importer for this export.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"tradeReturns":{"description":"Chronological returns for one standalone candidate in one consistent unit.","minItems":20,"maxItems":20000,"type":"array","items":{"type":"number"}},"candidateId":{"type":"string","maxLength":100},"code":{"description":"Exact audited code for a standalone candidate. Returned unchanged if it is the selected result.","type":"string","minLength":10,"maxLength":200000},"originalTradeCount":{"description":"Original row count before transport, used to detect incomplete datasets.","type":"integer","minimum":20,"maximum":1000000},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"auditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"},"mappingConfidence":{"type":"string","enum":["confirmed","inferred"]},"datasetId":{"type":"string","maxLength":300},"asset":{"type":"string","maxLength":200},"timeframe":{"type":"string","maxLength":100},"language":{"type":"string","enum":["pine_v6","python"]},"workflowMode":{"default":"standalone","description":"Use final_candidate_selection only after every candidate supplies exact code/data lineage plus passing folds, untouched holdout, cost stress, and parameter sensitivity evidence. approved_candidate_selection remains a backward-compatible provisional comparison.","type":"string","enum":["standalone","approved_candidate_selection","final_candidate_selection"]},"baselineCandidateId":{"description":"Optional baseline ID. When no candidate is robustly better, the baseline remains preferred.","type":"string","maxLength":100},"candidates":{"description":"Candidates to screen. Final selection additionally requires code-content and dataset fingerprints, version, parameter set, chronological folds, untouched holdout, realistic cost stress, and parameter sensitivity evidence.","minItems":2,"maxItems":12,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"datasetPropertiesFingerprint":{"description":"Actual Properties fingerprint returned by the importer for this export.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"candidateId":{"type":"string","minLength":1,"maxLength":100},"sourcePlatform":{"type":"string","enum":["tradingview","python"]},"code":{"type":"string","maxLength":200000},"codeVersion":{"type":"string","maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetCodeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","pattern":"^fnv1a-[a-f0-9]{8}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"validationEvidence":{"type":"object","properties":{"chronologicalFolds":{"minItems":2,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false}},"untouchedHoldout":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false},"costStress":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false}},"parameterSensitivity":{"minItems":2,"maxItems":24,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false}},"walkForward":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false}}},"required":["chronologicalFolds","untouchedHoldout","costStress","parameterSensitivity"],"additionalProperties":false},"language":{"type":"string","enum":["pine_v6","python"]},"tradeReturns":{"default":[],"maxItems":20000,"type":"array","items":{"type":"number"}},"originalTradeCount":{"type":"integer","minimum":0,"maximum":1000000},"approvedBlueprintHash":{"type":"string","maxLength":100},"codeBlueprintHash":{"type":"string","maxLength":100},"auditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"},"mappingConfidence":{"type":"string","enum":["confirmed","inferred"]},"datasetId":{"type":"string","maxLength":300},"asset":{"type":"string","maxLength":200},"timeframe":{"type":"string","maxLength":100}},"required":["candidateId"],"additionalProperties":false}},"unit":{"type":"string","enum":["R","percent"]},"simulations":{"description":"Omit for up to 30,000 simulations fitted to the hosted compute budget with the actual count disclosed. Explicit counts are never silently reduced.","type":"integer","minimum":500,"maximum":100000},"randomSeed":{"default":42,"description":"Explicit reproducibility seed, returned in the result.","type":"integer","minimum":-2147483648,"maximum":2147483647},"bootstrapMethod":{"default":"circular_block","description":"Circular/moving blocks preserve local trade order; independent resampling does not.","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"description":"Trades per block for circular or moving block bootstrap.","type":"integer","minimum":2,"maximum":100},"costStressPerTrade":{"description":"Additional per-trade cost deductions in the selected return unit. Final candidate selection requires at least one positive scenario. In percent mode, every stressed trade must remain greater than -100%.","minItems":1,"maxItems":8,"type":"array","items":{"type":"number","minimum":0}},"selectionObjective":{"description":"Primary comparison metric. highest_pnl remains a legacy alias; outputs use highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","highest_win_rate","highest_profit_factor","lowest_drawdown","strongest_robustness"]},"riskThreshold":{"description":"Optional trader-supplied account failure threshold. For percent returns, equity compounds directly. For R returns, provide riskPerR to express each R in account currency; when omitted, both equity values are interpreted as cumulative R-equity units.","type":"object","properties":{"startingEquity":{"type":"number","exclusiveMinimum":0},"failureEquity":{"type":"number","minimum":0},"riskPerR":{"type":"number","exclusiveMinimum":0}},"required":["startingEquity","failureEquity"],"additionalProperties":false}},"required":["unit"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["strategies:validate"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"finishedResult":{"type":"boolean","const":true},"method":{"type":"string","const":"seeded_reproducible_bootstrap"},"randomSeed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selectionObjective":{"type":"string","enum":["highest_net_pnl","highest_win_rate","highest_profit_factor","lowest_drawdown","strongest_robustness"]},"workflowMode":{"type":"string","enum":["standalone","approved_candidate_selection","final_candidate_selection"]},"finalityStatus":{"type":"string","enum":["standalone_analysis","provisional_candidate_comparison","final_candidate_selected","baseline_preserved"]},"evidenceProvenance":{"type":"string","enum":["standalone_return_series_unverified_provenance","caller_attested_candidate_evidence","caller_attested_full_validation_evidence"]},"preferredCandidate":{"type":"string"},"preferredCode":{"type":["string","null"]},"preferredCodeContentHash":{"type":["string","null"]},"rejectedCandidates":{"type":"array","items":{"type":"object","properties":{"candidateId":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"monteCarloRun":{"type":"boolean","const":false}},"required":["candidateId","reasons","monteCarloRun"],"additionalProperties":false}},"candidateResults":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"historical":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"simulated":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"codeChangeRule":{"type":"string"}},"required":["answer","status","finishedResult","method","randomSeed","selectionObjective","workflowMode","finalityStatus","evidenceProvenance","preferredCandidate","preferredCode","preferredCodeContentHash","rejectedCandidates","candidateResults","historical","simulated","codeChangeRule"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["strategies:validate"]}]},{"name":"primesync_get_preferences","title":"Read saved preferences","scopes":["memory:manage"],"effect":"Account-owned memory read + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Read whether optional memory is enabled and the current confirmed preferences and profileVersion.","sideEffects":"Reads only owned memory; writes a metadata audit event. No memory changes.","description":"Read whether optional memory is enabled and the current confirmed preferences and profileVersion. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_enable_memory","title":"Enable optional memory","scopes":["memory:manage"],"effect":"Explicitly authorized memory change + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Enable memory only after explicit user consent; optionally save the supplied confirmed preferences.","sideEffects":"Enable memory only after explicit user consent; optionally save the supplied confirmed preferences.","description":"Enable memory only after explicit user consent; optionally save the supplied confirmed preferences. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"preferences":{"type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false}},"required":["consent"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_update_preferences","title":"Update saved preferences","scopes":["memory:manage"],"effect":"Explicitly authorized memory change + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Update or remove only the preferences explicitly requested by the user using the current profileVersion.","sideEffects":"Update or remove only the preferences explicitly requested by the user using the current profileVersion.","description":"Update or remove only the preferences explicitly requested by the user using the current profileVersion. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"preferences":{"type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"removePreferences":{"maxItems":16,"type":"array","items":{"type":"string","enum":["language","explanationDepth","tradingExperience","programmingExperience","markets","timeframes","sessions","timezone","output","execution","riskPerTradePct","objective","objectiveBalance","responseLength","codeCommentDetail"]}}},"required":["consent","profileVersion"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":true,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_reset_preferences","title":"Reset saved preferences","scopes":["memory:manage"],"effect":"Explicitly authorized memory change + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Erase all saved preferences after explicit consent using the current profileVersion. Keeps project summaries.","sideEffects":"Erase all saved preferences after explicit consent using the current profileVersion. Keeps project summaries.","description":"Erase all saved preferences after explicit consent using the current profileVersion. Keeps project summaries. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["consent","profileVersion"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":true,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_disable_memory","title":"Disable and erase memory","scopes":["memory:manage"],"effect":"Explicitly authorized memory change + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Disable optional memory and erase all saved preferences and project summaries after explicit consent. Does not erase exported copies or security logs.","sideEffects":"Disable optional memory and erase all saved preferences and project summaries after explicit consent. Does not erase exported copies or security logs.","description":"Disable optional memory and erase all saved preferences and project summaries after explicit consent. Does not erase exported copies or security logs. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["consent","profileVersion"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":true,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_delete_all_memory","title":"Delete all saved memory","scopes":["memory:manage"],"effect":"Explicitly authorized memory change + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Erase all saved preferences and project summaries and leave memory off, after explicit consent. Does not erase exported copies or security logs.","sideEffects":"Erase all saved preferences and project summaries and leave memory off, after explicit consent. Does not erase exported copies or security logs.","description":"Erase all saved preferences and project summaries and leave memory off, after explicit consent. Does not erase exported copies or security logs. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["consent","profileVersion"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":true,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_export_memory","title":"Export saved memory","scopes":["memory:manage"],"effect":"Account-owned memory read + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Read all confirmed preferences and project summaries as a portable export; does not write or delete memory.","sideEffects":"Reads only owned memory; writes a metadata audit event. No memory changes.","description":"Read all confirmed preferences and project summaries as a portable export; does not write or delete memory. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_create_project_summary","title":"Create a project summary","scopes":["memory:manage"],"effect":"Explicitly authorized memory change + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Create a new account-owned minimal project summary after explicit consent using the current profileVersion. Never store raw code or CSVs.","sideEffects":"Create a new account-owned minimal project summary after explicit consent using the current profileVersion. Never store raw code or CSVs.","description":"Create a new account-owned minimal project summary after explicit consent using the current profileVersion. Never store raw code or CSVs. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false}},"required":["consent","profileVersion","project"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_update_project_summary","title":"Update a project summary","scopes":["memory:manage"],"effect":"Explicitly authorized memory change + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Replace an owned project summary after explicit consent, matching its projectId, projectRevision and current profileVersion.","sideEffects":"Replace an owned project summary after explicit consent, matching its projectId, projectRevision and current profileVersion.","description":"Replace an owned project summary after explicit consent, matching its projectId, projectRevision and current profileVersion. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","minimum":0,"maximum":9007199254740991},"project":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false}},"required":["consent","profileVersion","projectId","projectRevision","project"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":true,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_get_project_summary","title":"Read a project summary","scopes":["memory:manage"],"effect":"Account-owned memory read + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Read one account-owned project summary by its projectId. Remembered evidence is user-reported, not reverified.","sideEffects":"Reads only owned memory; writes a metadata audit event. No memory changes.","description":"Read one account-owned project summary by its projectId. Remembered evidence is user-reported, not reverified. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["projectId"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_list_project_summaries","title":"List saved project summaries","scopes":["memory:manage"],"effect":"Account-owned memory read + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Read this account’s saved project summaries and portable request context. Does not save changes.","sideEffects":"Reads only owned memory; writes a metadata audit event. No memory changes.","description":"Read this account’s saved project summaries and portable request context. Does not save changes. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_delete_project_summary","title":"Delete a project summary","scopes":["memory:manage"],"effect":"Explicitly authorized memory change + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Delete one owned project summary after explicit consent and matching profileVersion, projectId and projectRevision. Other projects remain.","sideEffects":"Delete one owned project summary after explicit consent and matching profileVersion, projectId and projectRevision. Other projects remain.","description":"Delete one owned project summary after explicit consent and matching profileVersion, projectId and projectRevision. Other projects remain. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["consent","profileVersion","projectId","projectRevision"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":true,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},{"name":"primesync_resume_project_summary","title":"Read context for continuing a project","scopes":["memory:manage"],"effect":"Account-owned memory read + metadata audit entry","reads":"Only this authenticated user's confirmed preferences and explicitly saved project summaries. Shared reviewer accounts are excluded.","returns":"Read a selected project’s context and next step; asks which project if selection is ambiguous. Does not execute or modify the project.","sideEffects":"Reads only owned memory; writes a metadata audit event. No memory changes.","description":"Read a selected project’s context and next step; asks which project if selection is ambiguous. Does not execute or modify the project. Requires optional memory:manage permission. Access is restricted to the authenticated account. No raw code, CSVs or conversations are saved.","inputSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false},"annotations":{"readOnlyHint":true,"destructiveHint":false,"openWorldHint":false},"icons":[{"src":"https://ai.primesync.me/primesync-studio-icon-48-v6.png","mimeType":"image/png","sizes":["48x48"]},{"src":"https://ai.primesync.me/primesync-studio-icon-96-v6.png","mimeType":"image/png","sizes":["96x96"]},{"src":"https://ai.primesync.me/primesync-studio-icon-512-v6.png","mimeType":"image/png","sizes":["512x512"]}],"_meta":{"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"securitySchemes":[{"type":"oauth2","scopes":["memory:manage"]}]}],"outputSchemas":{"primesync_analyze_backtests":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_bootstrap_backtests":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_optimize_entry_filters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_compare_asset_filters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_design_research_experiment":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_design_strategy_candidate":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_design_indicator_candidate":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_convert_indicator_to_strategy":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_convert_strategy_to_indicator":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_validate_code_evidence":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"taskMode":{"type":"string"},"objective":{"type":"string","enum":["highest_net_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"strategyCompletionMap":{"type":"array","items":{"type":"object","properties":{"point":{"type":"string"},"status":{"type":"string"},"detail":{"type":"string"}},"required":["point","status","detail"],"additionalProperties":false}},"strategyProfile":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"researchQueries":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"callerAttestedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"verifiedSources":{"maxItems":0,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"rejectedSources":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"sourceRelevanceScores":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"hypotheses":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"candidateExperiments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"protectedLogic":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missingEvidence":{"type":"array","items":{"type":"string"}},"validationPlan":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"overfittingWarnings":{"type":"array","items":{"type":"string"}},"researchStatus":{"type":"string"},"nextAction":{"type":"string"},"validationProcess":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"number"},"name":{"type":"string"},"pass":{"type":"string"}},"required":["gate","name","pass"],"additionalProperties":false}},"researchLedger":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"independentSourceVerification":{"type":"boolean","const":false},"sourceVerificationBoundary":{"type":"string","const":"server_does_not_retrieve_or_authenticate_sources"},"academicResearch":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["answer","status","operatingMode","taskMode","objective","strategyCompletionMap","strategyProfile","researchQueries","callerAttestedSources","verifiedSources","rejectedSources","sourceRelevanceScores","hypotheses","candidateExperiments","protectedLogic","missingEvidence","validationPlan","overfittingWarnings","researchStatus","nextAction","validationProcess","researchLedger","independentSourceVerification","sourceVerificationBoundary"],"additionalProperties":{}},"primesync_import_backtest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string","enum":["ready","needs_correction"]},"evidenceStatus":{"type":"string","enum":["DATASET_INVALID","EVIDENCE_INCOMPLETE","BACKTEST_EVIDENCE_ACCEPTED"]},"dataset":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"chronologicalTradeReturns":{"type":"array","items":{"type":"number"}},"chronologicalNetPnl":{"type":"array","items":{"type":"number"}},"tradeIds":{"type":"array","items":{"type":"string"}},"normalization":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"validationStages":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"lineage":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"verificationWarnings":{"type":"array","items":{"type":"string"}},"traceabilityWarnings":{"type":"array","items":{"type":"string"}},"nextAction":{"type":"string"}},"required":["answer","status","evidenceStatus","dataset","chronologicalTradeReturns","chronologicalNetPnl","tradeIds","normalization","validationStages","lineage","verificationWarnings","traceabilityWarnings","nextAction"],"additionalProperties":{}},"primesync_strategy_builder":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"blueprintHash":{"type":"string"},"sourceOfTradingRules":{"type":"string","const":"user_only"},"hiddenDefaults":{"type":"boolean","const":false}},"required":["answer","status","blueprintHash","sourceOfTradingRules","hiddenDefaults"],"additionalProperties":{}},"primesync_audit_strategy":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string","enum":["passed","warning","failed"]},"verificationStage":{"type":"string","enum":["STATIC PASS","STATIC REVIEW REQUIRED","STATIC FAILED"]},"compileStatus":{"type":"string","const":"NOT_CONFIRMED"},"backtestStatus":{"type":"string","const":"NOT_SUBMITTED"},"robustnessStatus":{"type":"string","const":"NOT_RUN"},"approvedBlueprintHash":{"type":["string","null"]},"codeBlueprintHash":{"type":["string","null"]},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"blueprintDrift":{"type":"string","enum":["matched","missing_code_marker","hash_mismatch","unverified"]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"findings":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"rule":{"type":"string"},"status":{"type":"string","enum":["PASS","WARNING","FAIL"]},"severity":{"type":"string","enum":["info","medium","high"]},"evidence":{"type":"string"},"codeLocation":{"anyOf":[{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"snippet":{"type":"string"}},"required":["line","snippet"],"additionalProperties":false},{"type":"null"}]},"impact":{"type":"string"},"recommendedCorrection":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"verificationScope":{"type":"string","const":"static_source_inspection"}},"required":["check","rule","status","severity","evidence","codeLocation","impact","recommendedCorrection","confidence","verificationScope"],"additionalProperties":false}}},"required":["answer","status","verificationStage","compileStatus","backtestStatus","robustnessStatus","approvedBlueprintHash","codeBlueprintHash","codeContentHash","blueprintDrift","counts","findings"],"additionalProperties":{}},"primesync_monte_carlo":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"answer":{"type":"string"},"status":{"type":"string"},"finishedResult":{"type":"boolean","const":true},"method":{"type":"string","const":"seeded_reproducible_bootstrap"},"randomSeed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selectionObjective":{"type":"string","enum":["highest_net_pnl","highest_win_rate","highest_profit_factor","lowest_drawdown","strongest_robustness"]},"workflowMode":{"type":"string","enum":["standalone","approved_candidate_selection","final_candidate_selection"]},"finalityStatus":{"type":"string","enum":["standalone_analysis","provisional_candidate_comparison","final_candidate_selected","baseline_preserved"]},"evidenceProvenance":{"type":"string","enum":["standalone_return_series_unverified_provenance","caller_attested_candidate_evidence","caller_attested_full_validation_evidence"]},"preferredCandidate":{"type":"string"},"preferredCode":{"type":["string","null"]},"preferredCodeContentHash":{"type":["string","null"]},"rejectedCandidates":{"type":"array","items":{"type":"object","properties":{"candidateId":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"monteCarloRun":{"type":"boolean","const":false}},"required":["candidateId","reasons","monteCarloRun"],"additionalProperties":false}},"candidateResults":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"historical":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"simulated":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"codeChangeRule":{"type":"string"}},"required":["answer","status","finishedResult","method","randomSeed","selectionObjective","workflowMode","finalityStatus","evidenceProvenance","preferredCandidate","preferredCode","preferredCodeContentHash","rejectedCandidates","candidateResults","historical","simulated","codeChangeRule"],"additionalProperties":{}},"primesync_get_preferences":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_enable_memory":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_update_preferences":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_reset_preferences":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_disable_memory":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_delete_all_memory":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_export_memory":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_create_project_summary":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_update_project_summary":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_get_project_summary":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_list_project_summaries":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_delete_project_summary":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}},"primesync_resume_project_summary":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}}},"resultExamples":{"researchLineage":{"sourceId":"src_a1b2c3d4","verificationStatus":"caller_attested_full_text","independentVerification":false,"hypothesisId":"hyp_b2c3d4e5","candidateId":"cand_c3d4e5f6","codeContentHash":null,"datasetIds":[],"status":"awaiting_trader_approval"},"strategyContinuity":{"strategyId":"client_strategy_42","revision":4,"baseline":{"datasetId":"nq15m-baseline","asset":"NQ","timeframe":"15m","metrics":{"profitFactor":1.19,"maxDrawdownPct":18.29}},"experiments":[{"id":"exp-sma200","change":"Require close above SMA 200","status":"rejected","reason":"Profit factor fell to 1.05 and Monte Carlo negative-outcome probability rose to 33.7%."}],"blockedExperimentChanges":["Require close above SMA 200"],"storage":"client_supplied_not_retained"},"blueprintDrift":{"approvedBlueprintHash":"psb_12ab34cd","codeBlueprintHash":"psb_12ab34cd","blueprintDrift":"matched"},"importedBacktest":{"answer":"Imported 240 closed trades in chronological order; evidence remains incomplete until every verification warning is resolved.","status":"ready","evidenceStatus":"EVIDENCE_INCOMPLETE","dataset":{"asset":"NAS100","timeframe":"15m","mappingConfidence":"confirmed","closedTradeCount":240,"excludedOpenTradeCount":1},"chronologicalTradeReturns":[0.8,-0.4,1.1],"chronologicalNetPnl":[80,-40,110],"tradeIds":["1","2","3"],"normalization":{"ordering":"final_exit_time_ascending","openTrades":"excluded","returnUnit":"percent"},"validationStages":{"staticAudit":"NOT_CONFIRMED","compilation":"NOT_CONFIRMED","backtest":"EVIDENCE INCOMPLETE","robustness":"NOT_RUN"},"lineage":{"sourcePlatform":"tradingview","freshExportConfirmed":false,"costsConfirmed":false},"verificationWarnings":["TradingView compilation of this exact hash-marked code is not confirmed."],"traceabilityWarnings":["A stable datasetId is missing; final candidate selection requires it."],"nextAction":"Resolve every evidence warning before using this backtest for final candidate selection."}},"inputSchemas":{"primesync_analyze_backtests":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","datasets"],"additionalProperties":false},"primesync_bootstrap_backtests":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","datasets"],"additionalProperties":false},"primesync_optimize_entry_filters":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"allowedEntryFeatures":{"default":["direction","time"],"type":"array","items":{"type":"string","enum":["direction","time","weekday","session","setup_class","entry_regime"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","datasets"],"additionalProperties":false},"primesync_compare_asset_filters":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":2,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"allowedEntryFeatures":{"default":["direction","time"],"type":"array","items":{"type":"string","enum":["direction","time","weekday","session","setup_class","entry_regime"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","datasets"],"additionalProperties":false},"primesync_design_research_experiment":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal"],"additionalProperties":false},"primesync_design_strategy_candidate":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal"],"additionalProperties":false},"primesync_design_indicator_candidate":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal"],"additionalProperties":false},"primesync_convert_indicator_to_strategy":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","minLength":1,"maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","baseCode"],"additionalProperties":false},"primesync_convert_strategy_to_indicator":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","minLength":1,"maxLength":200000},"candidateCode":{"type":"string","maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visualReference":{"type":"string","maxLength":200000},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"researchSources":{"default":[],"description":"Preferred research sources. SSRN is the starting point; other sources provide complementary evidence types.","maxItems":9,"type":"array","items":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]}},"sourceEvidence":{"default":[],"description":"Client-retrieved research evidence with exact citation, methodology, limitations, review scope, relevance, and optional isolated-change metadata. PrimeSync never fabricates or independently retrieves citations.","maxItems":20,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ssrn","arxiv_qfin","quantpedia","nber","peer_reviewed_journals","alpha_architect","cfa_institute","practitioner_blogs","user_supplied"]},"title":{"type":"string","minLength":1,"maxLength":1000},"url":{"type":"string","maxLength":2000,"format":"uri"},"doi":{"type":"string","maxLength":500},"authors":{"type":"string","maxLength":2000},"sourceType":{"type":"string","maxLength":300},"publication":{"type":"string","maxLength":1000},"publicationDate":{"type":"string","maxLength":100},"publicationStatus":{"type":"string","maxLength":1000},"marketStudied":{"type":"string","maxLength":1000},"timeHorizon":{"type":"string","maxLength":1000},"datasetPeriod":{"type":"string","maxLength":1000},"methodology":{"type":"string","maxLength":8000},"abstractOrFinding":{"type":"string","minLength":1,"maxLength":12000},"limitations":{"type":"string","maxLength":8000},"fullTextReviewed":{"type":"boolean"},"relevance":{"type":"string","enum":["direct","conceptual","weak"]},"paywalled":{"type":"boolean"},"dataAccessible":{"type":"boolean"},"implementationFeasible":{"type":"boolean"},"transactionCostsConsidered":{"type":"boolean"},"outOfSampleEvidence":{"type":"boolean"},"replicationEvidence":{"type":"string","maxLength":4000},"suspectedLookAheadBias":{"type":"boolean"},"performanceClaimVerified":{"description":"Legacy caller-attestation field; PrimeSync does not independently verify performance claims.","type":"boolean"},"proposedStrategyChange":{"type":"string","maxLength":4000},"expectedEffect":{"type":"string","maxLength":4000},"possibleDownside":{"type":"string","maxLength":4000},"requiredData":{"type":"string","maxLength":4000},"parametersToTest":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}},"required":["source","title","abstractOrFinding"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","baseCode"],"additionalProperties":false},"primesync_validate_code_evidence":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"operatingMode":{"default":"auto","type":"string","enum":["auto","new_strategy_open_ai","preserve_existing_logic"]},"goal":{"type":"string","minLength":3,"maxLength":8000,"description":"The exact current goal. Work only from this request and relevant supplied files."},"objective":{"description":"highest_pnl is accepted as a legacy alias and normalized to highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","best_winrate","lowest_drawdown","balanced","robustness"]},"specification":{"type":"string","maxLength":20000},"baseCode":{"type":"string","maxLength":200000},"candidateCode":{"type":"string","minLength":1,"maxLength":200000},"approvedBlueprint":{"description":"Exact Strategy Builder blueprint for auditing the single supplied research candidate against researchLedger.approvedBlueprintHash.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strategyId":{"description":"Client-managed strategy identifier for stateless continuity.","type":"string","minLength":1,"maxLength":200},"researchLedger":{"description":"CLIENT-MANAGED CONTINUITY: send the complete current ledger on every relevant call. PrimeSync returns it but does not store it.","type":"object","properties":{"revision":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"approvedBlueprintHash":{"type":"string","maxLength":100},"baseline":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":300},"asset":{"type":"string","minLength":1,"maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"metrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"recordedAt":{"type":"string","maxLength":100}},"required":["datasetId","asset","timeframe","metrics"]},"experiments":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"change":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["accepted","rejected","inconclusive"]},"reason":{"type":"string","minLength":1,"maxLength":4000},"datasetId":{"type":"string","maxLength":300},"baselineMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"candidateMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"decidedAt":{"type":"string","maxLength":100}},"required":["id","change","status","reason"]}},"rejectedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary","reason"]}},"acceptedHypotheses":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","summary"]}}}},"datasets":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"type":"string","minLength":1,"maxLength":300},"candidateId":{"type":"string","minLength":1,"maxLength":100},"codeVersion":{"type":"string","minLength":1,"maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000,"description":"TradingView List of Trades or Python one-row-per-closed-trade CSV text."},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"}},"required":["asset","timeframe","csvText"]}},"preservation":{"type":"object","properties":{"preserveLogic":{"default":false,"type":"boolean"},"preserveVisualSetups":{"default":false,"type":"boolean"},"preserveOrderBehavior":{"default":false,"type":"boolean"},"preserveEntireBase":{"default":false,"type":"boolean"},"protectedSections":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"startMarker":{"type":"string","minLength":1,"maxLength":500},"endMarker":{"type":"string","minLength":1,"maxLength":500}},"required":["name","startMarker","endMarker"]}},"allowedChangeScope":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":500}}}},"validation":{"type":"object","properties":{"simulations":{"description":"Omit for a budget-aware default; actual simulations and any adjustment are disclosed without dropping trades.","type":"integer","minimum":100,"maximum":100000},"bootstrapMethod":{"default":"circular_block","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"type":"integer","minimum":1,"maximum":100},"randomSeed":{"default":42,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"validationFolds":{"default":3,"type":"integer","minimum":2,"maximum":6},"holdoutFraction":{"default":0.2,"type":"number","minimum":0,"maximum":0.4},"bucketMinutes":{"default":30,"type":"integer","minimum":5,"maximum":240},"minimumTradesTotal":{"default":60,"type":"integer","minimum":5,"maximum":9007199254740991},"minimumTradesPerFold":{"default":10,"type":"integer","minimum":1,"maximum":9007199254740991},"minimumProfitFactor":{"default":1.1,"type":"number","minimum":1},"requirePositiveHoldout":{"default":true,"type":"boolean"}}},"output":{"type":"object","properties":{"pineVersion":{"default":"preserve","type":"string","enum":["preserve","v5","v6"]},"includePineFilterBlock":{"default":true,"type":"boolean"},"includeFullCode":{"default":true,"type":"boolean"},"includeReport":{"default":true,"type":"boolean"},"includeMachineReadableRules":{"default":true,"type":"boolean"}}}},"required":["goal","candidateCode","datasets"],"additionalProperties":false},"primesync_import_backtest":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"sourcePlatform":{"default":"tradingview","type":"string","enum":["tradingview","python"]},"rowFormat":{"default":"auto","type":"string","enum":["auto","tradingview_entry_exit","closed_trade_rows"]},"datasetId":{"description":"Stable client-owned dataset identifier used for final traceability.","type":"string","minLength":1,"maxLength":300},"candidateId":{"description":"Candidate ID that produced this exact export.","type":"string","minLength":1,"maxLength":100},"codeVersion":{"description":"Client-owned code version for this export.","type":"string","minLength":1,"maxLength":100},"codeContentHash":{"description":"Exact code-content fingerprint returned by the static audit.","type":"string","pattern":"^psc_[a-f0-9]{16}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"asset":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","maxLength":200},"timeframe":{"type":"string","minLength":1,"maxLength":100},"sourceTimezone":{"default":"UTC","type":"string","maxLength":100},"researchTimezone":{"default":"America/New_York","type":"string","maxLength":100},"csvText":{"type":"string","minLength":1,"maxLength":4000000},"filename":{"type":"string","maxLength":500},"mappingConfidence":{"default":"confirmed","type":"string","enum":["confirmed","inferred"]},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"staticAuditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"description":"User confirms this exact hash-marked code compiled successfully in TradingView.","type":"boolean"},"runtimeValidationConfirmed":{"default":false,"description":"For Python, the user confirms this exact hash-marked code passed syntax checks and executed against the exported dataset.","type":"boolean"},"freshExportConfirmed":{"default":false,"description":"User confirms this CSV was freshly exported from that exact compiled or executed code.","type":"boolean"},"costsConfirmed":{"default":false,"description":"User confirms commission, slippage, spread, and other applicable costs are represented.","type":"boolean"}},"required":["asset","timeframe","csvText"],"additionalProperties":false},"primesync_strategy_builder":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"idea":{"type":"string","minLength":10,"maxLength":6000,"description":"The trader's strategy idea in their own words."},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"baseCode":{"description":"Required in Preserve Existing Logic mode. The complete current Pine or Python source.","type":"string","maxLength":200000},"allowedChangeScope":{"description":"Required in Preserve Existing Logic mode. Exact changes the trader approved.","maxItems":40,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"marketAndTimeframe":{"description":"Market and intended timeframe exactly as provided.","type":"string","maxLength":500},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"description":"Exact entry conditions extracted from the trader's idea.","type":"string","maxLength":3000},"exitRules":{"description":"Exact exit conditions extracted from the trader's idea.","type":"string","maxLength":3000},"riskRules":{"description":"Trader-supplied position-sizing or account-risk rules.","type":"string","maxLength":2000},"executionRules":{"description":"Trader-supplied timing, session, pyramiding, and reversal rules.","type":"string","maxLength":2000},"costRules":{"description":"Trader-supplied commission and slippage assumptions.","type":"string","maxLength":1000},"selectionObjective":{"description":"Primary metric for comparing strategy candidates. highest_pnl remains a legacy alias.","type":"string","enum":["highest_net_pnl","highest_pnl","highest_win_rate","highest_profit_factor","lowest_drawdown","strongest_robustness"]},"additionalConstraints":{"description":"Plain constraints (3000 characters), or the documented PRIMESYNC_BUILD_V1 completion envelope for legacy clients.","type":"string","maxLength":2420000},"output":{"type":"string","enum":["pine_v6","python","both"]},"candidateCode":{"description":"Connected-AI code candidate for a single requested language, returned for audit.","type":"string","maxLength":200000},"candidatePineCode":{"type":"string","maxLength":200000},"candidatePythonCode":{"type":"string","maxLength":200000}},"required":["idea"],"additionalProperties":false},"primesync_audit_strategy":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"approvedRules":{"type":"string","minLength":10,"maxLength":12000},"approvedBlueprint":{"description":"Exact blueprint object returned by Strategy Builder. Required for a clean integrity-bound static pass; legacy rules-only calls remain review-required.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"code":{"type":"string","minLength":10,"maxLength":200000},"language":{"type":"string","enum":["pine_v6","python"]},"approvedBlueprintHash":{"description":"Required for an approved-workflow pass. Without it, returns an unverified static review that cannot qualify a candidate for selection. Never infer approval from a code comment.","type":"string","pattern":"^psb_[a-f0-9]{8}$"}},"required":["approvedRules","code","language"],"additionalProperties":false},"primesync_monte_carlo":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"datasetPropertiesFingerprint":{"description":"Actual Properties fingerprint returned by the importer for this export.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"context":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"resume":{"type":"boolean"},"portableProject":{"description":"A user-supplied project summary for this request only. Not saved or independently verified.","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false},"useMemory":{"description":"False ignores saved context for this request without altering it.","type":"boolean"},"preferences":{"description":"Preferences for this request only; never persisted.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"provisionalPreferences":{"description":"Inferred and unconfirmed; shown only for confirmation, never applied.","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"confirmRuleChanges":{"description":"True only after the user confirms the specific conflict with approved project rules.","type":"boolean"}},"additionalProperties":false},"tradeReturns":{"description":"Chronological returns for one standalone candidate in one consistent unit.","minItems":20,"maxItems":20000,"type":"array","items":{"type":"number"}},"candidateId":{"type":"string","maxLength":100},"code":{"description":"Exact audited code for a standalone candidate. Returned unchanged if it is the selected result.","type":"string","minLength":10,"maxLength":200000},"originalTradeCount":{"description":"Original row count before transport, used to detect incomplete datasets.","type":"integer","minimum":20,"maximum":1000000},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"codeBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"auditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"},"mappingConfidence":{"type":"string","enum":["confirmed","inferred"]},"datasetId":{"type":"string","maxLength":300},"asset":{"type":"string","maxLength":200},"timeframe":{"type":"string","maxLength":100},"language":{"type":"string","enum":["pine_v6","python"]},"workflowMode":{"default":"standalone","description":"Use final_candidate_selection only after every candidate supplies exact code/data lineage plus passing folds, untouched holdout, cost stress, and parameter sensitivity evidence. approved_candidate_selection remains a backward-compatible provisional comparison.","type":"string","enum":["standalone","approved_candidate_selection","final_candidate_selection"]},"baselineCandidateId":{"description":"Optional baseline ID. When no candidate is robustly better, the baseline remains preferred.","type":"string","maxLength":100},"candidates":{"description":"Candidates to screen. Final selection additionally requires code-content and dataset fingerprints, version, parameter set, chronological folds, untouched holdout, realistic cost stress, and parameter sensitivity evidence.","minItems":2,"maxItems":12,"type":"array","items":{"type":"object","properties":{"strategyProperties":{"type":"object","properties":{"preset":{"type":"string","enum":["P0","P1","P2","P3","P4","CUSTOM"]},"overrides":{"type":"object","properties":{"initial_capital":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","enum":["NONE","USD","EUR","GBP","AUD","CAD","CHF","HKD","JPY","NZD","SEK","SGD","ZAR"]},"default_qty_type":{"type":"string","enum":["fixed","percent_of_equity","cash"]},"default_qty_value":{"type":"number","exclusiveMinimum":0},"pyramiding":{"type":"integer","minimum":0,"maximum":100},"commission_type":{"type":"string","enum":["percent","cash_per_contract","cash_per_order"]},"commission_value":{"type":"number","minimum":0},"slippage":{"type":"integer","minimum":0,"maximum":9007199254740991},"margin_long":{"type":"number","minimum":0},"margin_short":{"type":"number","minimum":0},"calc_on_every_tick":{"type":"boolean"},"calc_on_order_fills":{"type":"boolean"},"process_orders_on_close":{"type":"boolean"},"use_bar_magnifier":{"type":"boolean"},"backtest_fill_limits_assumption":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"sizingAuthority":{"description":"properties uses declaration sizing; code explicitly authorizes order-level qty to override it. Never infer stop-risk sizing from percent-of-equity allocation.","type":"string","enum":["properties","code"]}},"required":["preset"],"additionalProperties":false,"description":"Explicit trader-approved Properties choice. CUSTOM requires every value in overrides. P0–P4 are reference assumptions, not automatic asset detection or broker guarantees."},"propertiesConfirmed":{"description":"Caller confirms these exact effective Properties were applied to this export, including UI overrides and sizing authority. A trades CSV alone does not prove this.","type":"boolean"},"approvedPropertiesFingerprint":{"description":"Properties fingerprint from the approved blueprint/static audit.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"datasetPropertiesFingerprint":{"description":"Actual Properties fingerprint returned by the importer for this export.","type":"string","pattern":"^psp_[a-f0-9]{8}$"},"candidateId":{"type":"string","minLength":1,"maxLength":100},"sourcePlatform":{"type":"string","enum":["tradingview","python"]},"code":{"type":"string","maxLength":200000},"codeVersion":{"type":"string","maxLength":100},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetCodeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","pattern":"^fnv1a-[a-f0-9]{8}$"},"parameterSet":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"validationEvidence":{"type":"object","properties":{"chronologicalFolds":{"minItems":2,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false}},"untouchedHoldout":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false},"costStress":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false}},"parameterSensitivity":{"minItems":2,"maxItems":24,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false}},"walkForward":{"minItems":1,"maxItems":24,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"tradeCount":{"type":"integer","minimum":0,"maximum":1000000},"netReturn":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"profitFactor":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]}},"required":["id","tradeCount","netReturn","maxDrawdown"],"additionalProperties":false}}},"required":["chronologicalFolds","untouchedHoldout","costStress","parameterSensitivity"],"additionalProperties":false},"language":{"type":"string","enum":["pine_v6","python"]},"tradeReturns":{"default":[],"maxItems":20000,"type":"array","items":{"type":"number"}},"originalTradeCount":{"type":"integer","minimum":0,"maximum":1000000},"approvedBlueprintHash":{"type":"string","maxLength":100},"codeBlueprintHash":{"type":"string","maxLength":100},"auditStatus":{"type":"string","enum":["passed","warning","failed"]},"tradingViewCompilationConfirmed":{"default":false,"type":"boolean"},"runtimeValidationConfirmed":{"default":false,"type":"boolean"},"freshExportConfirmed":{"default":false,"type":"boolean"},"costsConfirmed":{"default":false,"type":"boolean"},"mappingConfidence":{"type":"string","enum":["confirmed","inferred"]},"datasetId":{"type":"string","maxLength":300},"asset":{"type":"string","maxLength":200},"timeframe":{"type":"string","maxLength":100}},"required":["candidateId"],"additionalProperties":false}},"unit":{"type":"string","enum":["R","percent"]},"simulations":{"description":"Omit for up to 30,000 simulations fitted to the hosted compute budget with the actual count disclosed. Explicit counts are never silently reduced.","type":"integer","minimum":500,"maximum":100000},"randomSeed":{"default":42,"description":"Explicit reproducibility seed, returned in the result.","type":"integer","minimum":-2147483648,"maximum":2147483647},"bootstrapMethod":{"default":"circular_block","description":"Circular/moving blocks preserve local trade order; independent resampling does not.","type":"string","enum":["circular_block","moving_block","independent"]},"blockLength":{"default":10,"description":"Trades per block for circular or moving block bootstrap.","type":"integer","minimum":2,"maximum":100},"costStressPerTrade":{"description":"Additional per-trade cost deductions in the selected return unit. Final candidate selection requires at least one positive scenario. In percent mode, every stressed trade must remain greater than -100%.","minItems":1,"maxItems":8,"type":"array","items":{"type":"number","minimum":0}},"selectionObjective":{"description":"Primary comparison metric. highest_pnl remains a legacy alias; outputs use highest_net_pnl.","type":"string","enum":["highest_net_pnl","highest_pnl","highest_win_rate","highest_profit_factor","lowest_drawdown","strongest_robustness"]},"riskThreshold":{"description":"Optional trader-supplied account failure threshold. For percent returns, equity compounds directly. For R returns, provide riskPerR to express each R in account currency; when omitted, both equity values are interpreted as cumulative R-equity units.","type":"object","properties":{"startingEquity":{"type":"number","exclusiveMinimum":0},"failureEquity":{"type":"number","minimum":0},"riskPerR":{"type":"number","exclusiveMinimum":0}},"required":["startingEquity","failureEquity"],"additionalProperties":false}},"required":["unit"],"additionalProperties":false},"primesync_get_preferences":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"additionalProperties":false},"primesync_enable_memory":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"preferences":{"type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false}},"required":["consent"],"additionalProperties":false},"primesync_update_preferences":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"preferences":{"type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{2,8})*$"},"explanationDepth":{"type":"string","enum":["beginner","intermediate","advanced"]},"tradingExperience":{"type":"string","enum":["beginner","intermediate","experienced"]},"programmingExperience":{"type":"string","enum":["none","beginner","intermediate","experienced"]},"markets":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timeframes":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"sessions":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"timezone":{"type":"string","maxLength":80},"output":{"type":"string","enum":["pine_v6","python","both"]},"execution":{"type":"string","enum":["bar_close","intrabar","ask_each_strategy"]},"riskPerTradePct":{"type":"number","exclusiveMinimum":0,"maximum":100},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"objectiveBalance":{"type":"object","properties":{"netProfit":{"type":"number","minimum":0,"maximum":1},"drawdown":{"type":"number","minimum":0,"maximum":1},"robustness":{"type":"number","minimum":0,"maximum":1}},"required":["netProfit","drawdown","robustness"],"additionalProperties":false},"responseLength":{"type":"string","enum":["concise","standard","detailed"]},"codeCommentDetail":{"type":"string","enum":["minimal","standard","teaching"]}},"additionalProperties":false},"removePreferences":{"maxItems":16,"type":"array","items":{"type":"string","enum":["language","explanationDepth","tradingExperience","programmingExperience","markets","timeframes","sessions","timezone","output","execution","riskPerTradePct","objective","objectiveBalance","responseLength","codeCommentDetail"]}}},"required":["consent","profileVersion"],"additionalProperties":false},"primesync_reset_preferences":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["consent","profileVersion"],"additionalProperties":false},"primesync_disable_memory":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["consent","profileVersion"],"additionalProperties":false},"primesync_delete_all_memory":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["consent","profileVersion"],"additionalProperties":false},"primesync_export_memory":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"additionalProperties":false},"primesync_create_project_summary":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false}},"required":["consent","profileVersion","project"],"additionalProperties":false},"primesync_update_project_summary":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","minimum":0,"maximum":9007199254740991},"project":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"operatingMode":{"type":"string","enum":["new_strategy_open_ai","preserve_existing_logic"]},"objective":{"type":"string","enum":["highest_net_pnl","lowest_drawdown","highest_win_rate","highest_profit_factor","strongest_robustness","balanced"]},"output":{"type":"string","enum":["pine_v6","python","both"]},"rules":{"type":"object","properties":{"marketAndTimeframe":{"type":"string","minLength":1,"maxLength":1200},"direction":{"type":"string","enum":["long","short","both"]},"entryRules":{"type":"string","minLength":1,"maxLength":1200},"exitRules":{"type":"string","minLength":1,"maxLength":1200},"riskRules":{"type":"string","minLength":1,"maxLength":1200},"executionRules":{"type":"string","minLength":1,"maxLength":1200},"costRules":{"type":"string","minLength":1,"maxLength":1200},"additionalConstraints":{"type":"string","minLength":1,"maxLength":1200}},"additionalProperties":false},"approvedRulesConfirmed":{"type":"boolean"},"approvedBlueprintHash":{"type":"string","pattern":"^psb_[a-f0-9]{8}$"},"assumptions":{"default":[],"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"codeVersion":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"evidence":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string","minLength":1,"maxLength":160},"codeContentHash":{"type":"string","pattern":"^psc_[a-f0-9]{16}$"},"datasetFingerprint":{"type":"string","minLength":1,"maxLength":160},"stage":{"type":"string","enum":["compile_reported","backtest_reported","robustness_reported"]}},"required":["datasetId","codeContentHash","stage"],"additionalProperties":false}},"rejectedExperiments":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"change":{"type":"string","minLength":1,"maxLength":400},"reason":{"type":"string","minLength":1,"maxLength":400}},"required":["id","change","reason"],"additionalProperties":false}},"nextStep":{"default":"clarify","type":"string","enum":["clarify","approve_blueprint","generate_candidate","static_audit","compile_and_backtest","import_evidence","robustness","review_selection"]}},"required":["title","operatingMode"],"additionalProperties":false}},"required":["consent","profileVersion","projectId","projectRevision","project"],"additionalProperties":false},"primesync_get_project_summary":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["projectId"],"additionalProperties":false},"primesync_list_project_summaries":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"additionalProperties":false},"primesync_delete_project_summary":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"consent":{"type":"boolean","const":true,"description":"Only after explicit user consent to this exact change."},"profileVersion":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectRevision":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["consent","profileVersion","projectId","projectRevision"],"additionalProperties":false},"primesync_resume_project_summary":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}}}