diff --git a/docs/development/backlog/README.md b/docs/development/backlog/README.md index 6a9dcf30..7cc34d80 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: 80 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/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. 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. @@ -164,3 +164,6 @@ 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. diff --git a/docs/development/backlog/dependencies.mmd b/docs/development/backlog/dependencies.mmd index d2765c70..a44ab416 100644 --- a/docs/development/backlog/dependencies.mmd +++ b/docs/development/backlog/dependencies.mmd @@ -285,3 +285,7 @@ flowchart TD RP01 --> RP03 D01 --> RP03 RP02 --> RP04 + + RP03 --> RP05 + R11 --> RP05 + RP03 --> RP06 diff --git a/docs/development/backlog/manifest.json b/docs/development/backlog/manifest.json index 02e9ec8c..fd0954c1 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.90", + "plan_revision": "2026-10-27.91", "repository_base": "b7aeca4", - "plan_status": "research_preparation_followup_complete", + "plan_status": "dataset_reuse_and_settings_custody_in_progress", "execution_authorized": true, "execution_scope": { "authorized_by": "Owner: commit and continue with the rest of the tasks till 100%", @@ -3192,6 +3192,58 @@ "/root/review_cleanup_backend" ], "review_notes": "Independent review and combined repository, PostgreSQL and Chromium gates passed. RP03 includes read-only actual source validation; no new real research execution." + }, + { + "id": "RP05", + "title": "Reuse retained datasets beyond the first catalog page", + "epic": "E12", + "priority": "P1", + "severity": "High", + "status": "in_progress", + "dependencies": [ + "RP03", + "R11" + ], + "decision_dependencies": [], + "task_file": "backlog/tasks/RP05.md", + "complexity": "M", + "assignment": "/root/implement_source_inspection", + "branch": "research/dataset-reuse", + "write_locks": [ + "canonical-dataset-picker", + "canonical-catalog-transport" + ], + "completed_commit": null, + "blocker": null, + "integration_state": "implementing", + "integration_base": "7f7c07e3", + "completion_evidence": "real-data-research.md", + "release_gates": [] + }, + { + "id": "RP06", + "title": "Preserve settings and captured preparation across backtest tabs", + "epic": "E12", + "priority": "P1", + "severity": "High", + "status": "in_progress", + "dependencies": [ + "RP03" + ], + "decision_dependencies": [], + "task_file": "backlog/tasks/RP06.md", + "complexity": "M", + "assignment": "/root/review_cleanup_frontend", + "branch": "research/settings-custody", + "write_locks": [ + "backtest-page-settings-lifecycle" + ], + "completed_commit": null, + "blocker": null, + "integration_state": "implementing", + "integration_base": "7f7c07e3", + "completion_evidence": "real-data-research.md", + "release_gates": [] } ], "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/backlog/tasks/RP05.md b/docs/development/backlog/tasks/RP05.md new file mode 100644 index 00000000..1dcd4fc0 --- /dev/null +++ b/docs/development/backlog/tasks/RP05.md @@ -0,0 +1,13 @@ +# RP05 — Reuse retained datasets beyond the first catalog page + +Parent E12. Priority P1 / High workflow defect. Complexity M. Dependencies RP03 and R11. Owner's "commit and continue" authorizes this narrow research follow-up; conditional performance work remains deferred. + +Evidence: `backtestApiV2.listCanonicalDatasets` hardcodes `limit=50&offset=0`; `CanonicalSetup` provides only that selector. A fresh template cannot select an older retained dataset or an agent-supplied known hash. The backend already supports pagination and validated exact-hash lookup. Legacy `HistoricalDataSelection` demonstrates the existing load-more interaction. The two canonical transport methods also return unchecked successful JSON, which can crash rendering instead of presenting a recoverable error. + +Scope: parameterize the existing canonical catalog request; add explicit load-more and known-hash selection in canonical setup. Preserve loaded pages and the selection on a failed next page; retry that same page, deduplicate overlapping hashes, and reset/fence stale page responses on refresh/retention. The exact-hash action uses the existing detail endpoint and must validate identity/eligibility before saving. A known selected hash remains visible outside the current page. Validate list/detail response envelopes and manifest shape at these existing transport boundaries; preserve valid unavailable entries and v2 manifests with non-null parentDatasetHash (the preparation-only schema currently forbids those). No new backend endpoint, database, generic picker, search service, automatic all-history load or financial changes. + +Acceptance: choose and save a dataset beyond the first 50; choose an exact known hash even when absent from the list; malformed hashes do not fetch or submit; missing, unavailable, mismatched or malformed responses show errors and cannot authorize save; a later stale lookup/page cannot replace current state. Loading/empty/error states distinguish no loaded entries from lookup failure; loaded entries survive paging failures; loading controls cannot skip a failed page. Inspecting or typing a hash never submits the enclosing form. Saving uses the verified chosen hash and its exact bounds; no run starts automatically. Refresh after retention includes the new dataset without duplicating rows or losing current selection. + +Files/locks: `CanonicalSetup.tsx`, `backtestApiV2.ts`, focused `test/integration/canonical-workbench.test.tsx` (add a focused transport test file if necessary). Root owns the shared browser test and all planning state. Parallel with RP06, which owns only the parent page and its lifecycle tests. Frontend implementation agent; independent transport/UI review. + +Required tests: >50 entries and exact hash; appended page failure/retry and overlapping responses; stale refresh/lookup; unavailable/corrupt/malformed entries including valid converted v2 parent hash; final saved input and no unintended submission. Extend real authenticated browser/database workflow. Run focused tests, application/authored-test types, strict lint, production build; root combined repository and browser gates. Risk: stale data changing selection or falsely accepting malformed metadata; existing server admission remains authoritative. diff --git a/docs/development/backlog/tasks/RP06.md b/docs/development/backlog/tasks/RP06.md new file mode 100644 index 00000000..e03182cf --- /dev/null +++ b/docs/development/backlog/tasks/RP06.md @@ -0,0 +1,13 @@ +# RP06 — Preserve settings and captured preparation across backtest tabs + +Parent E12. Priority P1 / High custody defect. Complexity M. Dependency RP03. Owner continuation authorizes this correction; ADR-006 and financial semantics stay unchanged. + +Evidence: `BacktestDetailPageV2.renderTabContent` mounts canonical setup only in the settings case. Any other tab unmounts it and `DatasetPreparation`, destroying a preview or ambiguous retention retry. `useUnsavedWarning` protects browser unload only, so an ordinary same-page tab click silently loses the exact captured input. The page also clears the configure flag on every run-ID change, although the edited template still belongs to the same backtest. + +Scope: keep settings lazily mounted after the first visit for the current backtest; hide them accessibly while other tabs render. Preserve policy/strategy drafts, loaded source metadata, captured preview and unconfirmed retention retry across tabs and same-backtest run selections. Scope ownership to the backtest ID; changing it disposes/fences the previous editor and never renders old inputs for the new owner. Explicit close/discard and authoritative saved-definition updates keep their existing semantics. Do not start settings/catalog requests before first visit, duplicate the editor or trigger hidden saves/runs. No persistent browser draft store, global router blocker, framework or financial change. Leaving this backtest/reloading remains outside the in-memory preservation guarantee. + +Files/locks: `apps/stock/web-app/src/features/backtest/BacktestDetailPageV2.tsx`, existing `test/integration/backtest-run-controls.test.tsx` and narrowly scoped lifecycle tests. Do not edit CanonicalSetup or its transport (RP05 ownership). Root owns shared browser tests and planning state. React lifecycle implementation agent; independent review. + +Acceptance/tests: demonstrate the original loss before changing code; ordinary name/policy changes survive Settings → Runs → Settings; capture and ambiguous-retention retry retain exactly the same input/hash without another source read; late completion while hidden stays owned by the same template; same-backtest run navigation preserves the draft. Other tabs cannot expose/focus hidden settings, and entering a backtest does not eagerly fetch the catalog. Changing backtest ID clears the old editor and fences late completion; explicit discard/save still work. Verify zero unintended template/run writes during navigation, with a real browser retention retry scenario. Existing polling, cancellation, archived and legacy-history behavior must pass. + +Gates: focused page/lifecycle tests, application/authored-test types, strict lint, production build; root full repository and Chromium suite. Parallel with RP05 because the parent owns mounting while the child owns dataset choice. No broad navigation refactor; the main regression risks are stale ownership, hidden focusable inputs and newly eager requests.