fix(research): preserve strategy work before backtest handoff (RP09)

This commit is contained in:
Boki 2026-10-27 13:37:24 -04:00
parent c24410e5dd
commit 49da701aa7
5 changed files with 258 additions and 7 deletions

View file

@ -11,3 +11,5 @@ Ownership: strategy agent owns `StrategyDetailPage.tsx` and focused existing str
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.
Accepted October 27, 2026. The baseline custody defect was reproduced before the change. Independent review passed 29 focused tests / 199 assertions and also closed the reverse-order competing-write path by disabling publication while a clone form is open. Root full repository check passed, including 1,334 integration and 150 Rust tests. Actual Chromium clone recovery passed with 50 assertions after correcting a fixture count to account for default publication lineage; same body/key/version and exactly one additional child version are proven. [Combined evidence](../../real-data-research.md) records all 21 browser scenarios and the initial fixture failure. Application and authored types, lint, formatting and builds passed; no child contract, backend or financial semantics changed.

View file

@ -89,6 +89,15 @@ For a first change, follow one parameter from [the built-in selection schemas](.
## From source code to a saved candidate
The strategy page keeps one publication or clone workflow at a time. **Use in backtest**
waits until that work is finished or cleared; opening a clone also disables candidate
publication, and a loaded candidate package blocks starting a clone. Clear an unpublished
package or explicitly discard the clone form to return to ordinary parameter handoff.
If a write response was lost, use **Retry same publication** or **Retry clone** to recover
the original request and key. These controls preserve the local retry information; they
do not cancel work already accepted by the backend. Ordinary validated parameters still
transfer directly to backtest setup.
Source, package, catalog version, execution, and promotion are separate steps:
1. **Author and test.** The factory returns the selected owner, strategy identity, version, and seed unchanged. Retained candidate factories currently use target mode. Start from the [sandbox test's small source factory and metadata fixture](../../test/integration/candidate-sandbox.test.ts); inspect the [package contract](../../libs/core/types/src/strategy-version.ts) and [candidate declarations](../../apps/stock/config/src/contracts/candidate-execution.ts) for exact fields.