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

4.3 KiB

R04 — Deliver research workspace and save-findings flow

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

Scheduling source of truth: manifest entry R04. 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

Add project overview, hypothesis notes, linked strategies/runs and Save finding from result view. Reuse DataTable/Card/Dialog and current navigation. Keep human conclusions separate from AI suggestions and measured evidence.

Measurable benefit: Provides the primary research workspace before advanced optimization.

Exclusions

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

Likely files and ownership

  • apps/stock/web-app/src/features/research/ (new)
  • apps/stock/web-app/src/app/App.tsx
  • apps/stock/web-app/src/lib/constants/navigation.ts
  • apps/stock/web-app/src/features/backtest/BacktestDetailPageV2.tsx

Write locks: web-research, web-backtest-detail. One agent owns this change. Lock names do not override actual overlapping files.

Dependencies and blockers

Implementation requires R03, W02 integrated.

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

  • Project -> strategy -> configure/run -> inspect -> save cited finding -> reopen project is navigable.
  • Finding links open exact run/version; incomplete/legacy evidence displays limitations.
  • Notes can be saved without claiming strategy validation.

Mandatory tests

  • research_project_to_finding_browser, missing_evidence_error, ai_authorship_badge, archived_project_read.
  • Loading/error/empty state component 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: R03 project/hypothesis/artifact APIs and existing saved runs.
  • Backend/data dependencies: R03 entities, existing run provenance, no requirement for full Rust cutover.
  • Loading/error/empty behavior: Empty project guidance; saving/retry states preserve draft; stale evidence error; archived read-only state.
  • 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.