diff --git a/docs/development/ROADMAP.md b/docs/development/ROADMAP.md index 3d99ee77..e049a989 100644 --- a/docs/development/ROADMAP.md +++ b/docs/development/ROADMAP.md @@ -1,8 +1,8 @@ # Revised development roadmap -Baseline `b7aeca4` · reviewed 2026-10-22 · **Third wave committed; W03 continuation authorized; see manifest execution_scope** +Baseline `b7aeca4` · reviewed 2026-10-22 · **First four waves committed; W04 authorized; see manifest execution_scope** -Authorization update: the first three waves are independently reviewed, validated and committed. The owner's “commit and start the next wave” authorizes the O01/P01 closeout and continuation with next-ready W03. Other tasks and economic/timing/trust-model decisions remain gated. Fourth-wave implementation commits, pushes, PRs and trading operations are not authorized. +Authorization update: the first four waves are independently reviewed, validated and committed. The owner's “commit and continue” authorizes the W03 closeout and continuation with next-ready W04. Other tasks and economic/timing/trust-model decisions remain gated. Fifth-wave implementation commits, pushes, PRs and trading operations require further approval. ## Strategy and review outcome @@ -81,7 +81,7 @@ Completed wave; the table records its original rationale. Exact prompts, paths, Recommend **3 simultaneous implementers**, reserving one slot for coordination/independent review. Start C01 + C03 + W01; rotate C04 into the first freed slot, or start C04 first if runtime containment is the immediate operational need. These four have no mutual code dependencies and disjoint writable files. Four concurrent implementers are technically possible but not recommended without separate review capacity. -O01/P01 are committed. W03 is the authorized next workbench task; it separates saving definitions from repeat-safe run submission. F01/D01 still require their ADR approvals. W04 remains blocked on W03; subsequent work is not included in this execution scope. +O01/P01 and W03 are committed. W04 now adds real-browser end-to-end verification of the existing workbench. F01/D01 still require their ADR approvals; subsequent tasks are not included in this execution scope. ## Second-wave handoff — 2026-10-22 @@ -127,6 +127,26 @@ These are single-host synthetic baseline measurements, not a speedup claim or fi No DSL, cache, scheduler or new service is justified by this wave. Same-bar execution and canonical ownership/funding remain gated future work. O01/P01 were committed with owner approval; no pushes, PRs or trading operations occurred. +## Fourth-wave handoff — 2026-10-22 + +W03 is independently reviewed and `validated_committed` as `9b9403e` following owner approval. Backend and frontend contributors used separate worktrees under `/tmp/stock-bot-wave4.iEBUTZ/` with a pinned API contract. All 18 implementation/test files match their reviewed versions. + +- **Save / Save and run:** Web saves explicitly send `autoStart:false`. Save and run keeps the saved definition and original submission body/key through rejection or a lost response; retry does not save another definition. Immediate ref guards prevent duplicate clicks. Close waits for an unresolved definition write; closing after saving refreshes the list. Detail submissions have separate errors, explicit retry controls and late-navigation guards. +- **Durable admission:** `Idempotency-Key` is scoped to the existing verified operator or service principal, not a caller-supplied identity or browser-session nonce. A normalized intent fingerprint distinguishes retries from conflicts. Parent-row locking, immutable request snapshots and dispatch insertion remain in one transaction; the unique principal/key constraint also covers concurrent submissions across different definitions. Matching retries return the original run; changed intent returns 409 with existing 202/Location success behavior. +- **Migration / compatibility:** New additive `14-backtest-submission.sql` is admitted by O01's serialized startup runner. Legacy NULL-key rows remain readable. Omitted `autoStart` retains legacy auto-start, and keyless clients retain non-idempotent behavior. New web paths opt into explicit save and keyed submission. No financial simulation or paper-state behavior changed. + +Combined validation: + +- `CARGO_BUILD_JOBS=2 bun run check`: all gates passed; 60 tooling, 43 utility, 35 calculation, 310 integration and 37 Rust tests; zero failures. The 36 DOM interaction cases and 12 security cases are included in these totals, not additional suites. +- `bun run test:postgres`: 58 tests, 345 assertions, zero failures against disposable PostgreSQL/Redis, including a final rerun after the combined build. A database barrier proves both cross-definition contenders reach INSERT before release; tests verify one run/outbox, rollback/retry, numbering, principal separation, cookie renewal, frozen snapshots and preserved legacy rows. +- Explicit frontend typecheck, application-source lint, production build and `git diff --check` passed. Existing Rust/frontend warnings and the unchanged 12 curly findings in the old DOM test harness remain; the repository lint gate passes. + +Independent review caught and corrected premature list refresh while saving and a submission error hidden after changing selected runs; dedicated real-component/route regressions cover both. Local logs and hashes are recorded in the manifest. Disposable test containers and their recreatable fixture data were removed; development services were untouched. Worktrees are retained. + +Limits: UI retry identities are component-lifetime state, not recovery across reload/navigation. Definition POST response loss is not covered by run-submission idempotency. Operator/service scopes are the existing single-operator security model, not new user accounts or AI authorization. DOM tests do not prove browser layout, virtualized rows or full browser/API execution; that is W04. Existing native economic limitations remain visible and unchanged. + +W03 was committed with owner approval; no push, PR or trading operation occurred. W04 is authorized next; canonical Rust finance still requires ADR-002/003/004 approval. + ## Deferred and rejected Conditional: shared feature cache D04; cross-trial resident datasets P03; large-detail pagination/storage P05; tiny DSL P06; expanded cross-service monitoring O02. Each has a measured/real-need trigger and is not a prerequisite for scheduled work. diff --git a/docs/development/backlog/README.md b/docs/development/backlog/README.md index fabff5d0..d483670d 100644 --- a/docs/development/backlog/README.md +++ b/docs/development/backlog/README.md @@ -1,6 +1,6 @@ # Canonical development backlog -**First three waves committed; W03 continuation authorized.** Consult manifest execution_scope, [ROADMAP](../ROADMAP.md), [skeptical review](../REVIEW.md) and [first-wave handoff](../FIRST-WAVE.md). Other tasks and unresolved policies remain gated. +**First four waves committed; W04 browser verification authorized.** Consult manifest execution_scope, [ROADMAP](../ROADMAP.md), [skeptical review](../REVIEW.md) and [first-wave handoff](../FIRST-WAVE.md). Other tasks and unresolved policies remain gated. ## One source of truth @@ -64,8 +64,8 @@ Relative size: S narrow correction, M coherent boundary, L sensitive owner-contr | --- | --- | --- | --- | --- | | [W01 Make existing run controls and selection truthful](tasks/W01.md) | P1 / done | None | — | Full-stack React/API / M | | [W02 Expose result provenance and legacy correctness limitations](tasks/W02.md) | P1 / done | W01 | — | Full-stack research UX / M | -| [W03 Separate save, submit and repeat-safe run creation](tasks/W03.md) | P1 / ready | O01 | — | Full-stack durable workflow / M | -| [W04 Verify the first research vertical slice in a browser](tasks/W04.md) | P1 / blocked | W01, W02, W03, C06 | — | Full-stack test engineering / M | +| [W03 Separate save, submit and repeat-safe run creation](tasks/W03.md) | P1 / done | O01 | — | Full-stack durable workflow / M | +| [W04 Verify the first research vertical slice in a browser](tasks/W04.md) | P1 / claimed | W01, W02, W03, C06 | — | Full-stack test engineering / M | ### E6 — Research product, provenance and validation diff --git a/docs/development/backlog/manifest.json b/docs/development/backlog/manifest.json index c7d017b6..99f1787a 100644 --- a/docs/development/backlog/manifest.json +++ b/docs/development/backlog/manifest.json @@ -1,13 +1,13 @@ { "schema_version": 1, - "plan_revision": "2026-10-22.9", + "plan_revision": "2026-10-22.12", "repository_base": "b7aeca4", - "plan_status": "fourth_wave_authorized", + "plan_status": "fifth_wave_authorized", "execution_authorized": true, "execution_scope": { - "authorized_by": "User: commit and start the next wave (2026-10-22); next-ready W03", + "authorized_by": "User: commit and continue (2026-10-22); commit validated W03 and continue next-ready W04", "tasks": [ - "W03" + "W04" ], "permissions": [ "isolated_implementation", @@ -16,7 +16,7 @@ "planning_progress_updates" ], "excluded": [ - "fourth_wave_commits_without_further_approval", + "fifth_wave_commits_without_further_approval", "push", "pull_requests", "live_or_paper_operations", @@ -950,7 +950,7 @@ "epic": "E5", "priority": "P1", "severity": "High", - "status": "ready", + "status": "done", "dependencies": [ "O01" ], @@ -968,12 +968,36 @@ "sql-migrations" ], "parallel_policy": "Allowed only with satisfied dependencies/approvals and disjoint write locks AND actual files; see agents/integration.md.", - "assignment": null, - "branch": null, + "assignment": "/root/wave4_w03", + "branch": "wave4/w03-safe-submission", "pull_request": null, - "completed_commit": null, + "completed_commit": "9b9403e36be2c6ffbdd939331450d70b0e2a8f0e", "blocker": null, - "release_gates": [] + "release_gates": [], + "worktree": "/tmp/stock-bot-wave4.iEBUTZ/w03", + "integration_base": "5eb0985057c11d899b155d2dd154416e6ec93f0b", + "contract_notes": "Preserve omitted legacy autoStart; new web explicitly saves autoStart:false then submits keyed run. Stable operator/service principals from existing verified auth, not caller headers. Fingerprint normalized submitted intent, not mutable definition. Same key returns original frozen run; changed intent conflicts. No original-run reproduction (R12) or financial changes.", + "reserved_migration": "14-backtest-submission.sql", + "contributors": [ + { + "agent": "/root/wave4_w03", + "scope": "Backend, verified principal, additive migration and backend/security/PostgreSQL tests", + "worktree": "/tmp/stock-bot-wave4.iEBUTZ/w03" + }, + { + "agent": "/root/wave4_web", + "scope": "Disjoint frontend save/submit/retry flow and existing DOM interaction tests; pinned API contract", + "branch": "wave4/w03-web-submission", + "worktree": "/tmp/stock-bot-wave4.iEBUTZ/web" + } + ], + "integration_state": "validated_committed", + "reviewed_by": [ + "/root/wave4_contract_review", + "/root/wave4_product_review" + ], + "review_notes": "Independent backend/frontend reviews approved frozen changes; close/save race and hidden submission error after run selection were corrected with DOM regressions. Combined repository and PostgreSQL gates passed. Committed following owner approval.", + "verification_reference": "ROADMAP.md#fourth-wave-handoff--2026-10-22" }, { "id": "W04", @@ -981,7 +1005,7 @@ "epic": "E5", "priority": "P1", "severity": "High", - "status": "blocked", + "status": "claimed", "dependencies": [ "W01", "W02", @@ -1001,12 +1025,15 @@ "browser-harness" ], "parallel_policy": "Allowed only with satisfied dependencies/approvals and disjoint write locks AND actual files; see agents/integration.md.", - "assignment": null, - "branch": null, + "assignment": "/root/wave5_w04", + "branch": "wave5/w04-browser-workbench", "pull_request": null, "completed_commit": null, "blocker": null, - "release_gates": [] + "release_gates": [], + "worktree": "/tmp/stock-bot-wave5.t2GVG7/w04", + "integration_base": "9b9403e36be2c6ffbdd939331450d70b0e2a8f0e", + "contract_notes": "Real browser against existing API/dispatcher and isolated PostgreSQL/Redis; deterministic fixture worker plus native smoke. No financial policy, broker activation, new business endpoint or other task scope. One implementation owner for browser harness." }, { "id": "R01", @@ -1830,7 +1857,7 @@ } ], "review_note": "Independent skeptical revision: four superseded tasks retain stable IDs; deferred work is not a dependency of scheduled tasks. Release gates are distinct from implementation prerequisites.", - "integration_base": "c5b93eb8fdc70622fee3befc82def85c8da45b0f", + "integration_base": "9b9403e36be2c6ffbdd939331450d70b0e2a8f0e", "validation": { "date": "2026-10-22", "integration_base": "1148673", @@ -2385,5 +2412,89 @@ }, "fourth_wave": [ "W03" + ], + "fourth_wave_validation": { + "date": "2026-10-22", + "integration_base": "5eb0985057c11d899b155d2dd154416e6ec93f0b", + "application_commit": null, + "repository_check": { + "command": "CARGO_BUILD_JOBS=2 bun run check", + "status": "passed", + "tooling": 60, + "utils": 43, + "calculations": 35, + "integration": 310, + "native": 37, + "failed": 0 + }, + "postgres_recovery_tests": { + "command": "bun run test:postgres", + "passed": 58, + "failed": 0, + "assertions": 345, + "environment": "Disposable stock_bot_safety PostgreSQL and dedicated Redis DB15; final combined build rerun passed; exact fixture containers removed afterward; development services untouched" + }, + "ui_interactions": { + "command": "bun test test/integration/backtest-run-controls.test.tsx", + "passed": 36, + "failed": 0, + "assertions": 176, + "included_in_integration": true, + "scope": "Happy DOM with actual React components/routes and controlled transport; real-browser layout/end-to-end proof remains W04" + }, + "security": { + "command": "bun test scripts/test/security.test.ts", + "passed": 12, + "failed": 0, + "assertions": 83, + "included_in_tooling": true + }, + "reviewed_files": { + "apps/stock/web-api/src/migrations/migration-runner.ts": "bd34ceb1af371ca0699cdf61f09b11768b3cdab13ef3e376e2f1dcec44391839", + "apps/stock/web-api/src/routes/backtests-v2.routes.ts": "613dcd140f5f41f20cea0fd5d7a147a7c6515558084de8f3457305941752e466", + "apps/stock/web-api/src/routes/create-routes.ts": "6a981b832ed053c4efb8571e0117bfb59038bb53431f04140d3d163f2320db5b", + "apps/stock/web-api/src/services/backtest-v2.service.ts": "cbc49a2eb8d3812c0dc81924d4b5451b23d49111b7d5b324e9f03bb5534895aa", + "libs/core/di/src/http/security.ts": "5e650684a69eb7e0215246d08f4876addf409fa26cc4c0d20810f74f14f7a77d", + "libs/core/di/src/index.ts": "38ac79020bde00a095232dc8e16afda15d36a385ca047efb186b1d71aed9c421", + "scripts/test/security.test.ts": "97581aad0f64332adcf1b7a3bd412da9431e52f6aed59e1985c242bd696274bf", + "test/integration/backtest-workflow.test.ts": "62295c903515a7a744f876716bb5a1d487defac2e2139bdb90b5560149ef077e", + "test/postgres/durable-backtest.test.ts": "f4923e789d32ff0a248a4a0c33f4e8ce75b15e8c0e312de3866916e70cf5c97c", + "test/postgres/migration-runner.test.ts": "21db25c4a55a470896b6f70f9b0f86e736f76f7d37f7d35866264b63e1132345", + "database/postgres/init/14-backtest-submission.sql": "77da77706fc28f15d7554ea03085cd192dd3cc12f4a4921080e6bf5272ff5cef", + "apps/stock/web-app/src/features/backtest/BacktestDetailPageV2.tsx": "89599635bb0b2620d7f4b3ec7c578dfa2628f72ab3382e8ca2e5bd7b318ac114", + "apps/stock/web-app/src/features/backtest/BacktestListPageV2.tsx": "4c6c072a6b281b2a5f0cbf866785b896c9827160bdae2cd3c8e8896eee290205", + "apps/stock/web-app/src/features/backtest/components/CreateBacktestDialog.tsx": "6be841c543bd19537383cdcc6481bd0c8aa74e228d0159cdad24e6baf4149d2b", + "apps/stock/web-app/src/features/backtest/components/RunControlsCompact.tsx": "54cc880ba75efcc983c6239c888e87a8a2d12d6a2239bc4131b0fbd89a48b89b", + "apps/stock/web-app/src/features/backtest/hooks/useBacktestV2.ts": "a53164a82fa02518515e92d30fec887757f0ac7d76e10285ace00b71763fff8c", + "apps/stock/web-app/src/features/backtest/services/backtestApiV2.ts": "c99c28b12dfa84840da755074bb4977c0304ed3d2e6a550fb563a690c51674c1", + "test/integration/backtest-run-controls.test.tsx": "c7dfe0dfcdd330ecf8004000c1675a4e552827da56e50106594725cde7b27493" + }, + "native_addon": { + "path": "apps/stock/engine/dist/engine.node", + "sha256": "833332fbfefcc65e91671d5b42bb714f6e257a7689c18c79acbd740efcc2a791", + "build": "debug; rebuilt by combined check; native source and financial semantics unchanged" + }, + "logs": { + "repository_check": "/tmp/stock-bot-wave4.iEBUTZ/check.log", + "postgres": "/tmp/stock-bot-wave4.iEBUTZ/postgres.log" + }, + "compatibility": { + "migration": "14-backtest-submission.sql is additive and admitted by the serialized startup runner; legacy NULL-key rows preserved", + "principal": "Existing verified operator and service identities only, stable across operator bearer/cookie renewal; not a multi-user or AI authorization model", + "legacy": "Omitted autoStart retains legacy auto-start. Keyless submissions remain non-idempotent. New web saves always send autoStart:false and submit runs with keys.", + "retry_lifetime": "UI key/body retained within the mounted definition/dialog; no cross-reload/navigation recovery claim. Run keys persist server-side with retained run rows. Definition creation itself is not idempotent." + }, + "notes": [ + "All 18 authored implementation/test files match independently reviewed worktrees.", + "Distinct-parent submission race uses an observed PostgreSQL advisory barrier before releasing both INSERTs; one run/outbox commits.", + "Retries return original frozen snapshots after definition edits; conflicting submitted intent returns409; outbox failure rolls back the run/key claim.", + "Frontend Save and run retains the saved definition on submit failure, gates immediate duplicate clicks, distinguishes submission/polling errors and suppresses late navigation.", + "Explicit frontend typecheck/source lint/build and diff checks passed. Existing 12 curly findings in the old DOM test harness remain; repository lint gate passes.", + "Existing Rust/frontend build warnings remain. No financial-engine change, browser E2E claim, AI permission expansion or paper/live operation.", + "No fourth-wave commit, push or PR. After acceptance/commit, W04 is the next dependency-ready task; F01 still requires ADR-002/003/004 approval." + ] + }, + "fifth_wave": [ + "W04" ] }