feat(research): prepare stored EOD datasets before canonical admission

This commit is contained in:
Boki 2026-10-24 15:26:38 -04:00
parent 366bee810b
commit 0c6aec4dc6
16 changed files with 1897 additions and 61 deletions

View file

@ -59,7 +59,7 @@ Keep `/api/v2` and current operator sessions. New APIs follow the task-specific
- Results distinguish financial engine, strategy execution mode, metrics/economics policy versions and provenance completeness. Maintain compatibility fields for old clients.
- Reproduce-original pins original inputs; rerun-current creates a new request. Missing original code/dataset/model is a clear failure, not a fallback.
- Comparison must surface mismatched costs, datasets, windows, engines and failed candidates; default ranking uses comparable completed project-gated runs.
- Batch submission requires a resolved frozen dataset hash shared by its candidates. A single run may first prepare a new source request; individual sweep trials must not independently reload provider history.
- Canonical single and batch submissions require a resolved retained dataset hash. Prepare sources before admission; individual sweep trials must not independently reload provider history.
- Retention is archive-first. Referenced runs/versions/datasets/artifacts cannot disappear through an existing cascade.
- UI/API do not calculate competing equity, fees or fills. Display-only formatting/downsampling never changes financial results.
@ -75,7 +75,7 @@ Keep `/api/v2` and current operator sessions. New APIs follow the task-specific
Do not delay M1/M2 for the entire Rust migration. Conversely, delivering those screens does not make old financial results trustworthy. M1 release requires C06 runtime isolation; exploratory labels never excuse interference with paper state.
Dataset selection R11 lists retained manifests without loading bar payloads. A selected existing hash is recorded in the immutable submission and is bound by the runner after retained-content validation. A new source request freezes query parameters then prepares asynchronously through the existing runner; only after a fenced atomic dataset binding is it reproducible input. No strategy execution occurs before that binding. Retries reuse the pinned dataset, not a fresh provider query. The UI must distinguish these phases.
Canonical source preparation is explicit and precedes run admission. Preview returns materialized source bytes and their normalized identity; retention captures those exact bytes through the existing immutable store. A subsequent source read may differ and must be requested explicitly. Canonical admission validates the retained content and atomically freezes its hash with the executable and policies; the worker verifies the binding before decisions. Retention retries reuse the captured input, and run retries reuse the retained dataset. This 2026-10-24 refinement supersedes the original asynchronous source-preparation-inside-run proposal, avoiding another run lifecycle without weakening frozen-input guarantees. Legacy v1 source preparation/readers retain their existing behavior.
## Example: bounded AI-assisted multi-strategy research
@ -96,7 +96,7 @@ Reuse current Card/Dialog/DataTable/layout/chart/metric components and responsiv
Existing [analytics-ui tests](../../../test/integration/analytics-ui.test.tsx#L1) use server rendering. W04 now supplies the shared [Playwright workflow harness](../../../test/e2e/workbench.test.ts), real authenticated Hono routes, disposable SQL/Redis, durable dispatch and native smoke coverage. Extend it for research-product flows instead of creating a second harness.
R11 exposes retained v1 metadata and exact hash selection in both backtest forms. Catalog coverage is unknown and full content integrity is not verified by metadata inspection; the runner validates retained bytes before binding/execution. The current web runner remains legacy/v1, so v2 entries are visibly unsupported until R05. Source requests remain unpinned until prepared asynchronously. These product capabilities do not remove the existing economics qualifications.
R11 exposes retained v1 metadata and exact hash selection in both backtest forms. Catalog coverage is unknown and full content integrity is not verified by metadata inspection; the runner validates retained bytes before binding/execution. That R11 milestone was legacy/v1 only. R05 subsequently added a separate fully validated v2 canonical picker and retained-input runner. Legacy source requests retain their original asynchronous behavior and economics qualifications; new canonical source preparation follows the before-admission sequence above.
## Review clarifications