Gate3 Research Loop with Context
Objective
Gate3 extends research flow to consume:
- Knowledge Base evidence.
- Data Module market context.
Runtime Sequence
- Client calls
POST /v2/research/market-scan. - Platform computes baseline strategy ideas.
- Platform queries Knowledge Base for relevant evidence.
- Platform requests contextual market summary from data module adapter.
- Platform returns enriched response with:
strategyIdeasknowledgeEvidencedataContextSummary
Feedback Loop
After backtest completion, runtime feedback is ingested into KB as LessonLearned records.
Gate3 Non-goals
- Full conversation UX rollout.
- OpenClaw expansion.
- Full ML decision loop rollout.
Gate5 Extension (ML Safety + Cache Freshness)
Gate5 extends this flow with optional-safe ML enrichment while preserving deterministic behavior:
- Market context may include
mlSignals(prediction,sentiment,volatility,anomaly,regime). - Runtime normalizes top-level
sentimentcontext fields into canonicalmlSignals.sentimentbefore validation/scoring. - Research scoring validates signal shapes and confidence before use.
- Missing/invalid model output falls back to deterministic baseline scoring (no opaque execution side effects).
- Market context retrieval is cache-backed with explicit TTL and order-insensitive asset keying.
- Research responses expose fallback state in
dataContextSummaryfor auditability. - Provider-backed market-scan symbol retrieval is guarded by deterministic budget policy (
maxTotalCostUsd,maxPerRequestCostUsd,estimatedMarketScanCostUsd,spentCostUsd). - Budget breach or invalid policy fails closed before adapter side effects; typed adapter failures release reserved budget and return deterministic fallback responses.
- Unexpected adapter exceptions release reserved budget and fail closed with an explicit error code.
- Budget decision events are recorded for auditability.
- Research loop persists validated anomaly/regime snapshots for downstream risk gating (
__market__key fallback-safe). - Risk pretrade gates apply deterministic regime sizing reduction (
risk_off+ confidence>=0.55) and fail closed on anomaly breach (isAnomaly=true,score>=0.8,confidence>=0.7).
Detailed Gate5 ML contracts, fallback matrix, and auditability coverage:
/docs/portal/platform/gate5-ml-signal-integration.md