From d465e27084a7074b4e0d8f771c9fe4e280248899 Mon Sep 17 00:00:00 2001 From: Boki Date: Tue, 27 Oct 2026 09:35:27 -0400 Subject: [PATCH] docs(research): close dataset reuse and settings custody stories --- docs/backtest-datasets.md | 20 +++++++++++++++++ docs/development/ROADMAP.md | 2 +- docs/development/backlog/README.md | 6 +++--- docs/development/backlog/manifest.json | 30 +++++++++++++++----------- docs/development/real-data-research.md | 20 +++++++++++++++++ 5 files changed, 62 insertions(+), 16 deletions(-) diff --git a/docs/backtest-datasets.md b/docs/backtest-datasets.md index 2146c9fd..5da58c2a 100644 --- a/docs/backtest-datasets.md +++ b/docs/backtest-datasets.md @@ -90,6 +90,26 @@ corporate-action coverage and source timing remain explicit operator declaration successful preparation does not certify them or establish gap-free data. The source inspector diagnoses its own selected range independently of these capture windows. +## Reusing a retained dataset in the web workbench + +In **Settings → Canonical research setup**, use **Load more canonical datasets** to +browse beyond the newest 50 entries. A failed page can be retried without losing the +loaded choices or advancing past that page. **Refresh canonical datasets** reloads +the list and verifies the selected hash again. + +If an AI workflow or earlier result gives you an exact hash, paste it into **Retained +dataset hash** and choose **Use dataset hash**. The existing catalog endpoint checks +the retained content and compatibility. A missing, unavailable or malformed hash lookup +cannot enable saving; a selected dataset outside the loaded page remains visible. +**Save canonical setup** saves the verified choice and its bounds without starting a run. + +Settings are loaded on the first visit and stay in memory while switching tabs or +selecting another run of the same backtest. That includes source previews and an +unconfirmed retention retry's exact input/hash. Other tabs use the saved definition; +an unsaved settings draft does not change a run. Explicit discard, leaving this +backtest and reloading do not provide persistent draft recovery. Save settings and +resolve retention before leaving if you need to keep the work. + ## Verification `bun run check` includes complete-range reads without row caps, acceptance beyond the diff --git a/docs/development/ROADMAP.md b/docs/development/ROADMAP.md index eb50b854..3aa6d541 100644 --- a/docs/development/ROADMAP.md +++ b/docs/development/ROADMAP.md @@ -1,6 +1,6 @@ # Revised development roadmap -Current follow-up: [real-data research workflow](real-data-research.md), complete. CL01–CL20 are independently accepted. RP01 adds scoped stored-source inspection; RP02 completed nine retained real-data runs after explicit strategy approval, exact reproduction and an evidence-linked finding reopened in the web app. RP03 adds explicit declared-session preparation with read-only two-session source verification; RP04 explains the retained evaluation horizon beside CAGR. All 69 scheduled tasks across the original backlog and extensions are accepted; 7 conditional tasks and 4 merged redirects remain. CL21 and performance extensions remain deferred. Historical milestones below remain evidence, not a new activation request. +Current follow-up: [real-data research workflow](real-data-research.md), complete. CL01–CL20 are independently accepted. RP01 adds scoped stored-source inspection; RP02 completed nine retained real-data runs after explicit strategy approval, exact reproduction and an evidence-linked finding reopened in the web app. RP03 adds explicit declared-session preparation with read-only two-session source verification; RP04 explains the retained evaluation horizon beside CAGR. RP05 enables older-page and known-hash dataset reuse; RP06 preserves settings and captured retention retries across same-backtest tabs/run URLs. All 71 scheduled tasks across the original backlog and extensions are accepted; 7 conditional tasks and 4 merged redirects remain. CL21 and performance extensions remain deferred. Historical milestones below remain evidence, not a new activation request. ## Cleanup implementation — October 26, 2026 diff --git a/docs/development/backlog/README.md b/docs/development/backlog/README.md index 7cc34d80..ffdd37d2 100644 --- a/docs/development/backlog/README.md +++ b/docs/development/backlog/README.md @@ -8,7 +8,7 @@ [manifest.json](manifest.json) owns scheduling metadata: status, priorities, dependencies, ADR approvals, assignments and write locks. Task Markdown owns implementation scope/evidence/acceptance. This index and the [graph](dependencies.mmd) are derived views. Only the planning/integration owner updates scheduling state. -**Current total: 82 retained IDs.** RP01/RP02 add the authorized real-data workflow. The earlier 68 IDs retain their state. E11 adds seven authorized cleanup tasks and one conditional replay extraction; see the manifest for current scheduling. The original backlog accounted for 55 IDs. F09/P07 added projection/profiling work; the owner deferred P08's TypeScript optimization. Merged records preserve traceability; never execute them separately. Deferred work requires its stated trigger and explicit activation. +**Current total: 82 retained IDs.** RP01–RP06 add the authorized real-data workflow and its dataset reuse/custody follow-ups. The earlier 68 IDs retain their state. E11 adds seven authorized cleanup tasks and one conditional replay extraction; see the manifest for current scheduling. The original backlog accounted for 55 IDs. F09/P07 added projection/profiling work; the owner deferred P08's TypeScript optimization. Merged records preserve traceability; never execute them separately. Deferred work requires its stated trigger and explicit activation. States: ready, claimed, in_progress, review, done, blocked, deferred, merged. “Ready” means no code/ADR prerequisite, not execution authority. Implementation dependencies require accepted integration. `release_gates` govern enabling an end-to-end feature, not component coding or integration; conditional gates apply only to the named capability. F05 may integrate before F06, but its replay behavior is not released until F06 proves it. @@ -165,5 +165,5 @@ Owner authorized planning and per-task implementation commits. [Execution plan a - [RP03: Declared-session source preparation](tasks/RP03.md) — done, `d2b78eac`; explicit session capture preserves strict validation and captured-input retention. - [RP04: Evaluation horizon and CAGR presentation](tasks/RP04.md) — done, `302ba60e`; retained UTC bounds and calendar duration make short-sample annualization explicit. -- [RP05: Retained dataset reuse](tasks/RP05.md) — in progress; load older catalog pages or select a known hash. -- [RP06: Settings and preparation custody](tasks/RP06.md) — in progress; preserve the current backtest draft across tabs. +- [RP05: Retained dataset reuse](tasks/RP05.md) — done, `6d549542`; load older catalog pages or select and verify a known hash. +- [RP06: Settings and preparation custody](tasks/RP06.md) — done, `c838e3d0`; preserve the current backtest draft and captured retry across tabs/run URLs. diff --git a/docs/development/backlog/manifest.json b/docs/development/backlog/manifest.json index fd0954c1..f91699a4 100644 --- a/docs/development/backlog/manifest.json +++ b/docs/development/backlog/manifest.json @@ -1,8 +1,8 @@ { "schema_version": 1, - "plan_revision": "2026-10-27.91", + "plan_revision": "2026-10-27.92", "repository_base": "b7aeca4", - "plan_status": "dataset_reuse_and_settings_custody_in_progress", + "plan_status": "dataset_reuse_and_settings_custody_complete", "execution_authorized": true, "execution_scope": { "authorized_by": "Owner: commit and continue with the rest of the tasks till 100%", @@ -3199,7 +3199,7 @@ "epic": "E12", "priority": "P1", "severity": "High", - "status": "in_progress", + "status": "done", "dependencies": [ "RP03", "R11" @@ -3213,12 +3213,15 @@ "canonical-dataset-picker", "canonical-catalog-transport" ], - "completed_commit": null, + "completed_commit": "6d549542a98b52f8e1283f5d02285034aa25242c", "blocker": null, - "integration_state": "implementing", - "integration_base": "7f7c07e3", + "integration_state": "accepted", + "integration_base": "5319bd1bb21f3a1d9a5c1f4f26f6cd3d9dde4343", "completion_evidence": "real-data-research.md", - "release_gates": [] + "release_gates": [], + "review_status": "accepted", + "reviewer": "/root/review_cleanup_backend", + "review_notes": "Independent review accepted. Combined full repository check passed; all 21 browser scenarios covered by 20 successful full-suite scenarios and the corrected RP05 focused rerun. No application code changed after full browser run." }, { "id": "RP06", @@ -3226,7 +3229,7 @@ "epic": "E12", "priority": "P1", "severity": "High", - "status": "in_progress", + "status": "done", "dependencies": [ "RP03" ], @@ -3238,12 +3241,15 @@ "write_locks": [ "backtest-page-settings-lifecycle" ], - "completed_commit": null, + "completed_commit": "c838e3d05a10410fa80fc5a279867cae64d78a41", "blocker": null, - "integration_state": "implementing", - "integration_base": "7f7c07e3", + "integration_state": "accepted", + "integration_base": "5319bd1bb21f3a1d9a5c1f4f26f6cd3d9dde4343", "completion_evidence": "real-data-research.md", - "release_gates": [] + "release_gates": [], + "review_status": "accepted", + "reviewer": "/root/review_cleanup_backend", + "review_notes": "Independent review accepted. Combined full repository check passed; all 21 browser scenarios covered by 20 successful full-suite scenarios and the corrected RP05 focused rerun. No application code changed after full browser run." } ], "review_note": "Independent skeptical revision: four superseded tasks retain stable IDs; deferred work is not a dependency of scheduled tasks. Release gates are distinct from implementation prerequisites.", diff --git a/docs/development/real-data-research.md b/docs/development/real-data-research.md index 1de82d70..6d2b1041 100644 --- a/docs/development/real-data-research.md +++ b/docs/development/real-data-research.md @@ -113,3 +113,23 @@ Combined checkout gates: The initial sandbox checks could not reach fixture ports/launch Chromium or complete native workers. Authorized reruns passed. One browser attempt also overlapped the general frontend build and picked up the wrong API target; it was stopped, then the complete browser suite passed after serializing builds. Those interrupted attempts are not counted as successful validation. Logs: `/tmp/stock-bot-rp03-root-check-escalated.log`, `stock-bot-rp03-postgres.log`, `stock-bot-rp03-browser-final.log`, `stock-bot-rp03-root-test-types.log` and independent `stock-bot-rp03-*-review*.log` / `stock-bot-rp04-independent-review.log`. Both stories are accepted. All 69 scheduled tasks are complete; seven conditional tasks and four merged redirects remain in the 80-ID manifest. Performance work, CL21 and paper/live activation remain deferred. + +## RP05 / RP06 — Retained dataset reuse and settings custody + +Owner continuation authorized two independently verified workflow corrections, recorded in planning commit `5319bd1b`. RP05 (`6d549542`) fixes the canonical picker's first-page-only limitation; RP06 (`c838e3d0`) fixes loss of settings and preparation on same-backtest tab changes. The backend, database schema and Rust financial behavior are unchanged. [Workbench usage](../backtest-datasets.md#reusing-a-retained-dataset-in-the-web-workbench). + +RP05 uses existing paginated catalog and exact-hash endpoints. Load-more preserves prior choices and retries a failed page at the same offset; refresh and retention fence stale requests. The deliberate hash action verifies identity/availability before saving. Catalog/detail parsing now rejects malformed successful responses while preserving valid unavailable entries and converted v2 manifests with parent hashes. Browsing and typing a lookup do not save a template or submit a run. + +RP06 first reproduced the baseline defect: an edited name reverted after Settings → Runs → Settings. Settings now mount only after the first visit and stay hidden across tabs and index/run routes for that backtest. Captured source input and ambiguous-retention retry remain owned by the editor; changing backtest ID disposes it and fences old completions. Explicit discard and saved-definition replacement retain their behavior. Hidden controls are excluded from accessible role queries. This is in-memory same-backtest preservation, not persistent draft recovery or a general navigation guard. + +Independent reviewer `/root/review_cleanup_backend` accepted both changes: RP05 29 workbench tests / 245 assertions plus eight independent transport probes; RP06 45 lifecycle tests / 279 assertions. Implementer focused suites passed 119 / 570 and 198 / 967 respectively. Reviewer `/root/review_cleanup_frontend` independently checked root's browser fixtures and usage documentation. That review caught a fixture timestamp UPDATE forbidden by the evidence-immutability trigger; the fixture now sets ordering on initial INSERT and verifies custody through the normal retention helper, without altering the trigger. + +Combined validation: + +- `CARGO_BUILD_JOBS=2 bun run check`: passed — 134 tooling, 43 utility, 44 calculation, 1,279 integration and 150 Rust tests; existing 14 conditional integration skips / 4 ignored Rust measurements remain. Build, types, contract checks, strict lint and secret audit passed. +- Chromium full workbench run: 20 scenarios passed. The new dataset-reuse scenario correctly remained unable to save because its test omitted the existing explicit strategy-parameter validation step. After adding that step to the test, its focused rerun passed with 13 assertions. Together these cover all 21 scenarios; no application change followed the full browser run. The initial full invocation is not reported as an all-pass run. +- The new browser scenario inserts 52 distinct valid older snapshots in its disposable schema, selects a hash absent from the first page, loads the older page, saves the verified dataset and reopens it. It asserts zero runs and dispatch records. +- The retention browser scenario commits through the actual HTTP/database route, deliberately loses the response, changes tabs and retries the identical input/hash after removing the fixture source rows. Exactly two original session reads remain; the saved template and run/dispatch counts do not change. The actual-native smoke preserves an unsaved name across index-to-run navigation while the persisted definition remains unchanged. +- Application and authored-test types, focused lint, formatting/diff checks and production frontend build passed. The browser used isolated PostgreSQL/Redis fixtures, removed after validation. No development dataset, research execution or paper/live state was changed. + +Logs: `/tmp/stock-bot-rp05-root-check.log`, `/tmp/stock-bot-rp05-browser.log`, `/tmp/stock-bot-rp05-browser-focused.log`, `/tmp/stock-bot-rp05-root-test-types.log`, and `/tmp/stock-bot-rp06-baseline-regression.log`. Current manifest: 71 accepted scheduled tasks, seven deferred conditional tasks and four merged redirects, 82 IDs total. No conditional performance or monitoring work was activated.