feat(research): download validated retained datasets (RP07)

This commit is contained in:
Boki 2026-10-27 10:59:19 -04:00
parent 43ea2cc9b6
commit b959779ada
14 changed files with 1076 additions and 11 deletions

View file

@ -15,3 +15,5 @@ Ownership: backend agent owns `canonical-research.service.ts`, `datasets.routes.
Acceptance/tests: full downloaded JSON validates with identical manifest and every bar; converted parent, delayed availableAt, source ordinals and null VWAP survive. Invalid hashes avoid storage; missing/corrupt/mismatched/unsupported data never attach; internal errors are sanitized; cancellation fences delivery. Existing role access and research-token denial hold. Actual PostgreSQL export followed by the existing CLI import is idempotent, with unchanged unrelated tables. Real browser downloads from a selected dataset and an original run whose editable template now points elsewhere; file identity must match each source. Malformed/HTML/mismatched responses and delayed selection changes cannot create a download. No run/template/source writes from export.
Gates: focused API/UI/read tests, app/authored-test types, strict lint and production build; root full repository check, relevant disposable PostgreSQL tests and Chromium workbench. Document JSON inspection and existing CLI reimport; the file is a retained v2 snapshot, distinct from the source-input preparation uploader. Risk: exporting a mutable template's new dataset instead of original run input, or presenting a transport error as a data file. No broad research framework is needed.
Accepted October 27, 2026. Independent review accepted API, UI and root fixture changes; 66 focused tests / 591 assertions plus 25 independent probes passed. Root full repository check passed, including 1,316 integration and 150 Rust tests. Disposable PostgreSQL passed 14 tests / 183 assertions, including actual export-to-CLI repeated import with unchanged custody. Chromium passed all 21 scenarios / 721 assertions, downloading real files from selected data and original run provenance after the template changes. [Combined evidence](../../real-data-research.md) records exact checks and limitations; [usage](../../../backtest-datasets.md#downloading-a-retained-snapshot-for-local-exploration) covers local inspection and reimport. No financial semantics, access grants or deferred optimization changed.