stock-bot/docs/development/backlog/tasks/R07.md

6.8 KiB

R07 — Deliver sweep configuration and comparable-result views

Parent epic: E6. Priority/severity: P1 / High. Relative complexity: M. Recommended specialization: Full-stack research product.

Scheduling source of truth: manifest entry R07. No task is authorized until the plan is approved. Dependencies and decision references below describe the design; the manifest controls current readiness.

Evidence and root cause

Intended behavior and implementation scope

Deliver experiment preview/progress/comparison directly on R06 APIs. Accept an existing frozen dataset ID and show its manifest; R11's picker is optional convenience, not a prerequisite. A project/workspace link is optional; users need not build project metadata before comparing a sweep. Reuse current charts/metrics and R06 summary projection.

Exclusions

No general workflow framework, browser IDE, multi-tenant identity platform or second simulator.

Likely files and ownership

  • apps/stock/web-app/src/features/experiments/ (new)
  • apps/stock/web-app/src/features/backtest/components/
  • apps/stock/web-app/src/components/ui/DataTable/

Write locks: web-experiments. One agent owns this change. Lock names do not override actual overlapping files.

Dependencies and blockers

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.

Feature activation/release gates: W04. These do not block implementing or integrating this component against its own tests.

Parallel eligibility: only with disjoint actual files and reserved write locks; read FIRST-WAVE.md for the initial exact ownership boundaries.

Acceptance criteria

  • User previews bounded trial count, submits, sees all statuses, cancels and opens exact candidate runs.
  • Default comparison requires matching data, execution/metrics policy, costs and evaluation windows; mismatches remain visible, not silently ranked.
  • No full detail blobs on summary list; failed/incomplete counts and null metrics are explicit.

Mandatory tests

  • sweep_to_compare_browser, mixed_policy_warning, partial_failure_visibility, reopen_experiment.
  • Large result table rendering measurement and metric-null tests.

Apply the relevant quality gates; submit exact commands, outcomes and skipped checks. Named cases above are required regression scenarios, not claims that those tests already exist.

Regression risks and rollback

Schema/API backward compatibility, historical provenance and UI state regression. Keep migrations additive and previous results readable. Do not add a switch that restores a correctness defect. Versioned cutover/migration is required only when persisted contracts or active engines change; never silently fall back to old economics.

Web/API contract and user states

  • API: R06 experiment/trial listing; summary metrics projection from result contracts; pagination where needed.
  • Backend/data dependencies: Experiments and canonical provenance; full trade arrays are fetched only on run detail.
  • Loading/error/empty behavior: Preview loading; invalid grid errors; empty not-yet-submitted; per-trial failed/cancelled; retryable aggregate errors.
  • User-facing completion is demonstrated by the acceptance criteria and interaction tests above; a backend-only implementation is insufficient where a UI is in scope.

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.