feat(research): download original canonical run results (RP08)
This commit is contained in:
parent
8e9d0cf619
commit
e8a6b70968
8 changed files with 245 additions and 13 deletions
|
|
@ -11,3 +11,5 @@ Ownership: one frontend agent owns the result action, minimal shared download he
|
|||
Acceptance/tests: a downloaded file deep-equals the displayed canonical API result, including decimal amounts, null reasons and full original provenance. Distinct run IDs produce the corresponding filenames and contents; failed Blob/click work creates no success and releases resources. Downloading does not fetch, save settings, create runs or mutate the result. Preserve RP07 cancellation/raw-text semantics. Chromium reopens an original native run after changing its editable template, downloads the result and compares the complete JSON with that original API response; run/dispatch counts remain unchanged. Existing run-selection tests remain the identity gate; do not add a competing result validator or async loader.
|
||||
|
||||
Gates: focused result/download UI tests, authored-test/application types, strict lint, production build, root full repository check and Chromium workbench. Document that the JSON is analysis evidence, not a standalone replay archive: dataset bars and engine binaries are separate, and retained strategy JavaScript is data, not automatically executed. No candidate approval, research execution, paper/live activation or performance work.
|
||||
|
||||
Accepted October 27, 2026. Independent review and implementer checks passed 64 focused tests / 457 assertions. Root full repository check passed, including 1,320 integration and 150 Rust tests. Final Chromium suite passed all 21 scenarios / 726 assertions, comparing the actual downloaded result with its original API response after template changes and checking no extra API requests/writes. The repeated archive-fixture shutdown failure was addressed by returning its WebSocket upgrade synchronously; HTTP handling and teardown checks remain unchanged, with authored types and full browser suite passing. [Evidence](../../real-data-research.md) records the initial failure and final gates; [usage](../../../guide/backtest-walkthrough.md#take-the-result-into-a-notebook-or-local-ai-workflow) covers local inspection and replay limitations.
|
||||
|
|
|
|||
|
|
@ -154,3 +154,21 @@ Root validation:
|
|||
- Chromium: all 21 workbench scenarios passed with 721 assertions. Actual downloaded files from a verified selection and a reopened native result validate in full. The latter's template is deliberately changed to a distinct retained dataset first; export still delivers the original run dataset and leaves the replacement settings, one run and one dispatch unchanged. The fills-only view exposes no download action.
|
||||
|
||||
Logs: `/tmp/stock-bot-rp07-root-check.log`, `/tmp/stock-bot-rp07-postgres.log`, `/tmp/stock-bot-rp07-browser.log`, `/tmp/stock-bot-rp07-root-test-types.log`, `/tmp/stock-bot-rp07-api-independent.log` and `/tmp/stock-bot-rp07-ui-independent.log`. Tests use disposable PostgreSQL/Redis fixtures; no development research runs or paper/live operations were performed. Export retains the existing eligible single-asset/single-series gate. Performance, monitoring and conditional replay extraction remain deferred.
|
||||
|
||||
## RP08 — Original run result download
|
||||
|
||||
Owner continuation authorized a small companion to the dataset download; planning commit `dd1545b9` records the scope. The full canonical result view now offers **Download run result**, saving its already loaded `CanonicalRunResult` as `run-<runId>.json`. It serializes the entire original object, preserving decimal strings, null metric reasons, financial views, analytics and admitted request/build provenance. There is no new API, request on click, financial calculation or upload format.
|
||||
|
||||
The existing results service validates stored financial content and request/analytics identity; the existing monitoring hook binds it to the selected run/backtest. The new action reuses that ownership instead of introducing another loader or validator. A private per-run component owns local error/retry state. A 15-line JSON-text download helper is shared with RP07, preserving its raw text, cancellation and resource cleanup behavior. Legacy and fills-only views remain unchanged.
|
||||
|
||||
Independent reviewer `/root/find_research_followup` accepted the implementation and root browser test: 64 focused UI tests / 457 assertions passed independently and in the implementer worktree. The existing canonical report fixture verifies complete JSON equality, unchanged input, distinct run filenames/contents, zero extra requests, error reset and URL/click failure retry with cleanup. No duplicate financial fixture or download framework was added. Review corrected two guide details: orders are under `financial.view`, and the button says **Retry run result download**. [Usage](../guide/backtest-walkthrough.md#take-the-result-into-a-notebook-or-local-ai-workflow) explains local inspection and the separate dataset/runtime requirements for replay.
|
||||
|
||||
Root validation:
|
||||
|
||||
- `CARGO_BUILD_JOBS=2 bun run check`: passed — 134 tooling, 43 utility, 44 calculation, 1,320 integration and 150 Rust tests. Existing 14 conditional integration skips / 4 ignored Rust measurements remain. Build, types, contracts, strict lint and secret audit passed.
|
||||
- Authored Chromium-test typecheck and formatting/diff checks passed. Implementer application/authored-test types, focused strict lint and production build also passed.
|
||||
- Final Chromium suite: all 21 scenarios passed with 726 assertions. An actual result file deep-equals the original API response after the editable template changes dataset. Downloading issues zero additional API requests and leaves the replacement settings, run and dispatch counts unchanged. The existing dataset download also passes through the shared helper.
|
||||
|
||||
The first full browser invocation passed 20 scenarios but failed the archive scenario during fixture shutdown (`pendingWebSockets=1`, no tracked sockets). All archive application assertions completed; the shutdown failure repeated in isolation. The fixture now returns WebSocket upgrades synchronously while keeping ordinary HTTP handling asynchronous. The focused archive test and then the complete suite passed; original cleanup deadlines/errors remain enforced. No timing probes or timeout increases were retained, and the production server wrapper was not changed. This is observed fixture validation, not a claim that a Bun internals defect has been proven or a production reliability issue fixed.
|
||||
|
||||
Logs: `/tmp/stock-bot-rp08-root-check.log`, `/tmp/stock-bot-rp08-root-test-types-final.log`, `/tmp/stock-bot-rp08-browser.log` (initial failure), `/tmp/stock-bot-rp08-browser-archive-sync.log`, `/tmp/stock-bot-rp08-browser-final.log` and `/tmp/stock-bot-rp08-independent.log`. Browser tests use disposable PostgreSQL/Redis fixtures. No development research runs, paper/live operations or deferred optimization were activated.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue