feat(research): add retained-input parameter sweep workbench

This commit is contained in:
Boki 2026-10-24 10:33:05 -04:00
parent 30accfcf43
commit 6f64ef62ba
41 changed files with 4469 additions and 34 deletions

View file

@ -31,7 +31,7 @@ Write locks: sql-migrations, experiment-api. One agent owns this change. Lock na
## Dependencies and blockers
Implementation requires [R05](R05.md) integrated.
The retained-input component requires the accepted R05 durable-run/provenance slice plus R01/R10/F08/S02/D01/W03/C06/R12. The manifest records that narrower prerequisite; provider preparation and broader default cutover remain outside it. Full R06 still requires the failed-retry acceptance below.
Architecture decisions: ADR-006. Agents may not independently amend their policies.
@ -66,3 +66,19 @@ Keep migrations additive and previous results readable. Do not add a switch that
## Handoff
Report scope changes (if any), fixture expectations, API/schema changes, measurements, remaining limitations and commit/PR references once authorized. Request independent review; only the integration/planning owner may mark the manifest done.
## Authorized component — 2026-10-24
Retained-input single-asset experiments depend on the accepted R05 runner/provenance component (`618fb9e`), not provider preparation or default cutover. One atomic bounded grid uses a current approved retained built-in, one eligible dataset and installed build, and fixed financial/reporting policy. Preview commits to exact inputs; submission receipts survive current eligibility changes. Existing runs/outbox/worker own execution. Failed retry is excluded from this component; full R06 remains incomplete until retry diagnostics/fencing acceptance is met.
### Pinned experiment contract
`@stock-bot/stock-config/experiments` owns shared request/result DTOs. POST `/api/v2/experiments/preview` validates a saved canonical template plus bounded parameter grid; POST `/api/v2/experiments` requires its exact preview hash and an idempotency key. GET collection/detail exposes every frozen candidate and scalar result evidence; POST `/:id/cancel` is idempotent. Existing authenticated reads and credential mutations apply. Preview includes retained dataset manifest, current approved built-in package, complete financial/reporting policies and installed build. A template/review/build change before submission invalidates the preview. An accepted receipt is replayed before rechecking eligibility.
All children and outbox rows commit with the immutable experiment in one transaction. The initial bound is 100 trials; it bounds atomic admission and does not introduce a parallel scheduler. Only parameters and new run/account/session identities vary. `experiment_id`/`trial_key`/`trial_index` are immutable and mutually exclusive with new-run reproduction lineage. Child submission receipts are null; the experiment owns the unique principal/key receipt. SQL reconstructs exact trial requests from the manifest and preserves ordinary/reproduction admission guards. No template cloning/edit loop or separate financial engine.
Cancellation latches once, cancels pending children and requests worker acknowledgement for active children, preserving terminal outcomes. Counts are derived from actual children; the frozen candidate count exposes missing rows. Compact summaries validate retained provenance and statistical conventions, preserve null reasons and list inconsistent results as incomparable. No detail-array loading or financial recalculation is needed. Failed-run retry remains absent until history/fencing tests are implemented.
### Validated component handoff
The retained-input component is implemented and independently reviewed. Full repository, PostgreSQL and Chromium gates passed; exact source hashes and logs are in `manifest.json` → `twenty_seventh_wave_validation`. See the twenty-seventh-wave roadmap handoff. This component is uncommitted and does not complete the full task or release its downstream dependencies.

View file

@ -28,7 +28,7 @@ Write locks: web-experiments. One agent owns this change. Lock names do not over
## Dependencies and blockers
Implementation requires [R06](R06.md) integrated.
Component implementation may proceed against root-pinned R06 DTOs; activation requires integrated retained-input R06 admission/results. Full R06 failed-retry work is independent of this component and no retry action is exposed.
Architecture decisions: ADR-006. Agents may not independently amend their policies.
@ -64,3 +64,17 @@ Keep migrations additive and previous results readable. Do not add a switch that
## Handoff
Report scope changes (if any), fixture expectations, API/schema changes, measurements, remaining limitations and commit/PR references once authorized. Request independent review; only the integration/planning owner may mark the manifest done.
## Authorized component — 2026-10-24
Implement same-experiment preview, submission, progress, cancellation, scalar comparison and exact run reopening against the pinned R06 component API. Component coding may proceed in parallel; release requires integrated R06 component. Cross-experiment comparison and table performance measurements remain outstanding, with all performance work paused. Full R07 remains incomplete.
### Pinned web workflow
`/experiments` selects a saved canonical backtest, names a sweep and previews a small parameter grid before submission. `/experiments/:experimentId` shows the frozen inputs, all trial outcomes, comparable scalar metrics with units/null reasons, cancellation state and exact saved-run links. An optional backtest query parameter starts from its detail page. The API is shared with other authorized clients; the browser does not calculate economics or rank incompatible runs.
Ambiguous submission preserves its exact body/key, and only an explicit new intent may replace it. Form edits invalidate previews; route changes and late reads/mutations cannot replace another experiment. Loading, empty, failed, missing and incomparable outcomes remain distinct. Refresh/reopen must retain immutable evidence and cancelled/partial outcomes. The browser acceptance executes real retained native trials, mutates the template after admission, replays the submission receipt, opens results and cancels a separate pending batch.
### Validated component handoff
The retained-input component is implemented and independently reviewed. Full repository, PostgreSQL and Chromium gates passed; exact source hashes and logs are in `manifest.json` → `twenty_seventh_wave_validation`. See the twenty-seventh-wave roadmap handoff. This component is uncommitted and does not complete the full task or release its downstream dependencies.