docs(research): plan strategy custody and template recovery fixes

This commit is contained in:
Boki 2026-10-27 12:46:40 -04:00
parent ba0dea32cb
commit c24410e5dd
5 changed files with 85 additions and 3 deletions

View file

@ -0,0 +1,13 @@
# RP09 — Preserve strategy work before backtest handoff
Parent E12. Priority P1 / High custody defect. Complexity S. Dependencies R02 and A02. Owner continuation authorizes this correction; no authorization or financial policy changes.
Verified baseline: `StrategyDetailPage` enables **Use in backtest** after parameter validation and guards navigation only with `metadataDirty`. Pending and lost-response clone reproductions navigate away with no confirmation, destroying the local retry receipt. `useStrategyClone` owns the frozen body/key for that route; `CandidatePublication` has the same local ownership. **Clone version** also remains enabled while candidate publication owns work, permitting competing operations. Baseline probe: `/tmp/stock-bot-navigation-audit/probe.log`.
Scope: reuse existing publication/clone state and clear/discard/retry controls. Disable and handler-guard **Use in backtest** while a candidate package/publication or clone form/receipt is outstanding; show a concise explanation of how to finish or clear that work. Disable and guard **Clone version** while candidate publication owns work. Normal validated parameter handoff stays unchanged, including the existing metadata-discard confirmation; parameter edits transferred to the backtest are not discarded. No router blocker, persistent receipt store, new state framework or backend API. Other deliberate navigation keeps its current behavior.
Ownership: strategy agent owns `StrategyDetailPage.tsx` and focused existing strategy/publication UI tests; touch a child only if a reproduced ownership gap requires it. Root owns shared Chromium tests/docs/manifest/commits. Independent review required.
Acceptance/tests: pending and ambiguous clones/publications cannot disappear through backtest handoff; retry uses the original exact body/key. Competing clone admission is blocked while publication owns work. Clearing an unpublished package or explicitly discarding a clone restores ordinary handoff. Validated parameters transfer unchanged without a new unnecessary prompt. Late replies after deliberate navigation remain fenced; no extra mutations on blocked actions. Reuse existing fixtures and prove the baseline failure before the fix.
Gates: focused strategy/publication tests, application/authored types, strict lint/build, root full repository check and browser regression through actual catalog/clone routes. No performance, paper/live work or global navigation redesign.

View file

@ -0,0 +1,13 @@
# RP10 — Recover experiment setup from a missing linked template
Parent E12. Priority P2 / Medium recovery defect. Complexity S. Dependency R07. Owner continuation authorizes this correction.
Verified baseline: `useExperimentTemplates` publishes a successful catalog only after awaiting an optional initial-template lookup. A deleted or failing linked backtest therefore hides every valid catalog choice. A HappyDOM probe of the actual hook and `ExperimentEditor` shows an enabled chooser containing only the missing selection and empty option, despite a valid catalog row. Probe: `/tmp/stock-bot-next-experiments-probe.ts`.
Scope: preserve successful catalog choices independently of optional selected-template lookup failure. Keep an explicit lookup error and the existing retry action; preserve the unavailable selection and never automatically switch templates. A valid recovered selected template may join the choices without replacing the user's current selection or draft name/grid. Genuine list failure remains visible. Retain current cancellation/generation ownership and canonical eligibility filtering. No backend, transport-wide error refactor, new cache or auto-submission.
Ownership: experiment agent owns `useExperimentTemplates.ts`, a small `ExperimentEditor.tsx` presentation adjustment only if needed, and focused existing experiment UI tests. Root owns shared Chromium tests/docs/manifest/commits. Independent review required. Parallel with RP09: disjoint application and focused-test files.
Acceptance/tests: 404/transport failure of the linked lookup leaves valid catalog options selectable and missing selection explicitly unavailable. Choosing a valid option preserves name/grid and enables normal preview; no save or submission occurs merely by selecting. Retry can recover the linked option without changing the current choice. List errors, empty catalogs, pagination and unavailable/noncanonical selections retain honest states. Late lookup/list replies after parent change, reload or unmount cannot replace current choices. Use existing test fixtures.
Gates: focused experiment/cost/validation tests, application/authored types, strict lint/build, root full repository check and browser recovery from a missing query-string backtest ID. No financial, execution, statistical or conditional optimization changes.