stock-bot/docs/development/backlog/tasks/D02.md

3.2 KiB

D02 — Connect supported intraday storage to research datasets

Parent epic: E3. Priority/severity: P1 / High. Relative complexity: M. Recommended specialization: TypeScript trading infrastructure.

Scheduling source of truth: manifest entry D02. No task is authorized until the plan is approved. Dependencies and decision references below describe the design; the manifest controls current readiness.

Evidence and root cause

Intended behavior and implementation scope

Trace the actual intraday collection/schema, add the smallest provider adapter or correct routing, and expose an explicit provider/interval coverage capability. Keep a single normalized dataset admission path; do not migrate all storage systems.

Measurable benefit: Makes supported intraday requests usable and honest.

Exclusions

No unrelated refactor, new service or broker activation.

Likely files and ownership

  • apps/stock/orchestrator/src/services/StorageService.ts
  • apps/stock/data-ingestion/src/
  • test/integration/ingestion-backtest.test.ts

Write locks: storage-adapters. One agent owns this change. Lock names do not override actual overlapping files.

Dependencies and blockers

Implementation requires D01 integrated.

No additional economic-policy approval is needed for this narrowly scoped task.

Parallel eligibility: only with disjoint actual files and reserved write locks; read FIRST-WAVE.md for the initial exact ownership boundaries.

Acceptance criteria

  • A disposable ingested 5m fixture is retrieved through the research path with unchanged timestamps/OHLC/count.
  • Unavailable ranges/providers return typed errors, never daily data or synthetic fallbacks.
  • Record the verified ingestion collection/adapter in the task evidence before changing code.

Mandatory tests

  • ingest_5m_freeze_replay, unsupported_interval, missing_range, provider_priority.
  • Hash the ingested normalized fixture and compare retrieval.

Apply the relevant quality gates; submit exact commands, outcomes and skipped checks. Named cases above are required regression scenarios, not claims that those tests already exist.

Regression risks and rollback

Compatibility or lifecycle regression; preserve frozen inputs, old results and existing failure tests. Keep migrations additive and previous results readable. Do not add a switch that restores a correctness defect. Versioned cutover/migration is required only when persisted contracts or active engines change; never silently fall back to old economics.

Handoff

Report scope changes (if any), fixture expectations, API/schema changes, measurements, remaining limitations and commit/PR references once authorized. Request independent review; only the integration/planning owner may mark the manifest done.