83 lines
8.3 KiB
Markdown
83 lines
8.3 KiB
Markdown
# R09 — Expose validation, cost and regime evidence in the workbench
|
|
|
|
Parent epic: E6. Priority/severity: P1 / High. Relative complexity: M. Recommended specialization: Full-stack research product.
|
|
|
|
Scheduling source of truth: [manifest entry R09](../manifest.json). 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
|
|
|
|
- **RES-01 — Verified:** Experimental Python feature preprocessing uses full-sample medians/quantiles; shuffled returns preserve ordinary Sharpe. These routines must not silently become validation evidence. [apps/stock/analytics/src/ml/feature_engineering.py:386](../../../../apps/stock/analytics/src/ml/feature_engineering.py#L386); [apps/stock/analytics/src/analysis/statistical_validation.py:168](../../../../apps/stock/analytics/src/analysis/statistical_validation.py#L168).
|
|
- **WEB-01 — Verified:** The real backtest list/detail/API/SQL flow already exists. Strategy/project/experiment work should extend it; App strategy/analytics views are placeholders. [apps/stock/web-app/src/app/App.tsx:24](../../../../apps/stock/web-app/src/app/App.tsx#L24); [apps/stock/web-api/src/services/backtest-v2.service.ts:211](../../../../apps/stock/web-api/src/services/backtest-v2.service.ts#L211).
|
|
|
|
## Intended behavior and implementation scope
|
|
|
|
Expose stored chronological/cost validation evidence from R08. Regime panels render only when valid as-of regime annotations exist; otherwise show unavailable, not fake classification. The basic validation UI need not wait for S05; enabling that example's regime comparison requires its artifact contract.
|
|
|
|
## 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/
|
|
- apps/stock/web-app/src/features/research/
|
|
- apps/stock/web-app/src/features/backtest/components/
|
|
|
|
Write locks: web-experiments. One agent owns this change. Lock names do not override actual overlapping files.
|
|
|
|
## Dependencies and blockers
|
|
|
|
Implementation requires the accepted functional component of [R07](R07.md) and [R08](R08.md) integrated. R07's explicitly paused table measurement is not a citation prerequisite; the manifest records its accepted component commit.
|
|
|
|
Architecture decisions: ADR-006. Agents may not independently amend their policies.
|
|
|
|
Conditional activation: regime comparison requires [S05](S05.md); saving/linking a research finding requires [R03](R03.md). Neither blocks basic validation display.
|
|
|
|
Parallel eligibility: only with disjoint actual files and reserved write locks; read FIRST-WAVE.md for the initial exact ownership boundaries.
|
|
|
|
## Acceptance criteria
|
|
|
|
- User can validate and inspect each OOS segment with reset/warmup/cost assumptions visible.
|
|
- Regime data missing => explicit unavailable panel; present => sample counts/unclassified bucket and window coverage displayed.
|
|
- Validation display works without R03. Enable save/link-finding only when R03 exists; link the exact experiment/report identity and contributing run/metric references through its existing evidence API. Otherwise show the action unavailable.
|
|
- No client-side accounting or continuous-equity claim for reset segments.
|
|
|
|
## Mandatory tests
|
|
|
|
- walk_forward_browser, train_test_badges, insufficient_sample_warning, regime_slice_reconciliation.
|
|
- Loading/empty/failure states for incomplete validation; validation_without_findings_api; save_finding_requires_R03.
|
|
|
|
Apply the relevant [quality gates](../../QUALITY-GATES.md); 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: R08 experiment-owned immutable recipes/reports. R03 evidence-linked findings only for the conditionally enabled save action.
|
|
- Backend/data dependencies: Canonical returns, as-of regime annotations and sample counts; no client-side financial recomputation.
|
|
- Loading/error/empty behavior: Loading each segment; unclassified regime bucket; invalid partition feedback; explicit partial validation.
|
|
- 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 source-citation continuation — 2026-10-24
|
|
|
|
R07 functional comparison is accepted as `46a4f13`; its paused measurement does not gate this task. R03/R08 are committed. Existing phase/reset/warmup/cost/sample displays are retained. Add one optional exact experiment/chronological-report/walk-forward-report source to each immutable artifact revision and preserve existing run/metric evidence. All cited runs must belong to that source; sealed reports are verified against full retained native evidence through the same read-only client. Historical source resolution ignores current admission/archive/cancellation gates. Existing create/revise locks and narrative-unvalidated status remain.
|
|
|
|
Use additive SQL27 and existing findings endpoints/form, not a new store or scheduler. An omitted source on revision preserves the prior source; explicit null detaches only the new revision. Generic experiment details expose a server-derived standalone flag so phase pages cannot masquerade as standalone findings. Save actions lazily load research destinations; report viewing remains independent of R03 availability. Preserve ambiguous-create behavior and original single-run findings.
|
|
|
|
No persisted as-of regime annotation contract exists: S05's internal volatility flag and current analytics endpoint do not qualify. Show regime counts/coverage unavailable, never zero or inferred classifications. Positive regime reconciliation remains conditional future capability, not a test claimed by this slice. Required gates include exact sources/metrics, forged-report rejection, raw SQL/upgrade preservation, snapshot/pool1/concurrent revisions, archival historical reads, source-preserving edits and actual native browser save/reopen. Performance remains paused.
|
|
|
|
## Validated handoff — 2026-10-24
|
|
|
|
Supported scope is independently reviewed and validated on `46a4f13`; status is `review`, new changes uncommitted. Existing OOS/reset/cost displays are retained. All three exact source kinds save through the existing finding API/form, retain canonical contributing run/metric references, survive revision/history and reopen the exact source. SQL27 and historical read verification reject source/metric/report tampering while preserving old findings and archived evidence. Actual native Chromium workflows cover cost, chronological and walk-forward citations without admitting extra runs.
|
|
|
|
Validation: full repository check passed 1024 integration /150 Rust, plus 93 tooling /43 utility /44 calculation tests; final PostgreSQL/Redis 235/2099 and Chromium 16/569. Strict test types, source/test lint, formatting, diff/source hash/DAG checks passed. The real SQL24 upgrade regression confirms missing role metadata fails closed before migration and ordinary experiments qualify afterward. Four preexisting Rust cases remain ignored. Both temporary test containers were removed.
|
|
|
|
Positive `regime_slice_reconciliation` remains conditional and unrun because no retained as-of annotation contract exists. The unavailable-state UI is tested; S05 alone does not enable classification. No performance work, financial changes or trading/AI activation. Exact hashes, logs, independent review and limits: [wave34 manifest evidence](../manifest.json), [roadmap handoff](../../ROADMAP.md#thirty-fourth-wave-handoff--2026-10-24).
|
|
|
|
Accepted by owner continuation and committed as `06039d1` on 2026-10-24. Supported R09 is done; conditional regime-annotation limitations remain unchanged.
|