feat(research): add durable walk-forward validation workflows

This commit is contained in:
Boki 2026-10-24 12:34:39 -04:00
parent abd1c5b83d
commit 3ed7b98f7c
45 changed files with 5188 additions and 199 deletions

View file

@ -1,14 +1,14 @@
{
"schema_version": 1,
"plan_revision": "2026-10-24.64",
"plan_revision": "2026-10-24.66",
"repository_base": "b7aeca4",
"plan_status": "thirtieth_wave_validated_awaiting_commit",
"plan_status": "thirty_first_wave_validated_awaiting_commit",
"execution_authorized": true,
"execution_scope": {
"authorized_by": "User: commit and continue; accepted chronological preflight committed 67ab30cb7a578591262cb0218fa9f6a135924c7f",
"authorized_by": "User: commit and continue; accepted durable chronological workflow committed abd1c5b83d55ad49b562408cb3a87a1c7b7f952e",
"tasks": ["R08"],
"permissions": [
"R08 durable single chronological recipe: immutable source and phase datasets, ordinary training experiment and fixed-winner holdout children, write-once selection/report, explicit web workflow and full regression gates"
"R08 bounded walk-forward series: freeze all ordered recipes/common inputs, atomically admit existing training windows, reuse per-window actions and save an immutable reset-segment report with integrated web workflow"
],
"excluded": [
"performance_profiling_or_optimization",
@ -24,8 +24,8 @@
"AI_execution_or_credentials",
"historical_binary_provisioning",
"cross_experiment_ranking",
"multi_window_walk_forward_and_cost_sensitivity_execution",
"strategy_performance_conclusions"
"strategy_performance_conclusions",
"cost_sensitivity_execution"
],
"pending_policy_decisions": [
"ADR-007",
@ -1444,34 +1444,33 @@
"blocker": null,
"release_gates": [],
"integration_state": "component_validated_uncommitted",
"integration_base": "67ab30cb7a578591262cb0218fa9f6a135924c7f",
"integration_base": "abd1c5b83d55ad49b562408cb3a87a1c7b7f952e",
"worktree": "/home/boki/repos/stock-bot",
"execution_component": "Durable single train/fixed-winner validation/test recipe with immutable report",
"execution_component": "Bounded repeated walk-forward windows and immutable independent reset-segment reports",
"component_exclusions": [
"multi-window walk-forward/reset-series aggregation",
"cost-sensitivity execution",
"bounded cost-sensitivity execution",
"findings/regime evidence integration"
],
"reviewed_by": "/root/r04_review",
"verification_reference": "ROADMAP.md#thirtieth-wave-handoff--2026-10-24",
"review_notes": "Single durable chronological recipe independently accepted and all integrated gates passed. Full R08 stays in progress for multi-window walk-forward/reset-series aggregation and cost sensitivity; R09 remains blocked.",
"verification_reference": "ROADMAP.md#thirty-first-wave-handoff--2026-10-24",
"review_notes": "Independent backend/frontend/root integration reviews accepted exact snapshots. Native all-window admission, immutable reports, no future suffix leakage, cancellation and receipt races, existing flow preservation and complete browser lifecycle pass. Full R08 remains partial for bounded cost sensitivity.",
"implementation_slices": [
{
"owner": "/root/r12_backend",
"worktree": "/tmp/stock-bot-wave30.K6IDyj/backend",
"scope": "SQL24, validation service/routes, ordinary experiment compatibility, new pure/API/PostgreSQL regressions"
"worktree": "/tmp/stock-bot-wave31.QqUT6Z/backend",
"scope": "SQL25 header/membership guards, walk-forward service/preparation/routes, narrow transaction-scoped chronological admission/report reuse, new pure/API/PostgreSQL tests"
},
{
"owner": "/root/r12_frontend",
"worktree": "/tmp/stock-bot-wave30.K6IDyj/frontend",
"scope": "Explicit training/selection/report UI, saved validations and focused interaction tests; symmetric submission ownership"
"worktree": "/tmp/stock-bot-wave31.QqUT6Z/frontend",
"scope": "Explicit window editor with shared submission ownership, series detail/list/report UI and focused regressions"
},
{
"owner": "/root",
"scope": "Shared DTO, migration registry and old fixture chains, web route composition, native/browser workflow, full gates and planning"
"scope": "Shared DTO/export and fixture, migration registry/old fixture chains, App/index composition, actual native browser lifecycle, final gates and planning"
}
],
"partial_commit": "67ab30cb7a578591262cb0218fa9f6a135924c7f"
"partial_commit": "abd1c5b83d55ad49b562408cb3a87a1c7b7f952e"
},
{
"id": "R09",
@ -3340,7 +3339,7 @@
"files": 1153,
"scope": "Tracked and nonignored untracked file paths/content, including dirty changes; generated ignored artifacts excluded."
},
"workload": "1k/10k total bars;1asset/1owner or10assets/2owners;2fresh processes \u00d72fresh native sessions, second reverses callback evaluation. Alternating unit targets,1% fee,initialcapital1000000,600bars/session with retained gaps. No randomness, storage, queue, indicators or parallel simulation.",
"workload": "1k/10k total bars;1asset/1owner or10assets/2owners;2fresh processes ×2fresh native sessions, second reverses callback evaluation. Alternating unit targets,1% fee,initialcapital1000000,600bars/session with retained gaps. No randomness, storage, queue, indicators or parallel simulation.",
"equality": "Exact complete normalized result hashes match every repeat and debug/release profile. Independent integer-cent cash/equity/remaining basis/owner fees/fill count oracle passes. Economically different results invalidate measurement.",
"timing": "Report separates imports, detached D01 verify, once-per-child prepared-JS mapping, fresh native load, actual advance/submit/decision/finalize and validation/hash. Native call timers include JS encoding/schema/immutable projection plus Rust work/serialization, not pure crossing cost. Trial wall includes load+replay+finalization+oracle/hash, excludes one-time preparation/import and parent aggregation. No explicit warmup or OS-cache flush; means only, not latency distributions. Shared host; release focused checks briefly overlapped initial measurement, so not an isolated performance SLA.",
"workloads": [
@ -5227,7 +5226,7 @@
"Two separate processes per mode, two fresh timed sessions each, counterbalanced mode order. Second SMA session reverses owner callback order and must preserve financial and diagnostic hashes. This checks fresh whole-attempt recomputation, not native checkpoint resume.",
"Shared host, no timing assertion, confidence interval, cold-start SLA, or cross-artifact performance attribution. Root must freeze source and use the matching release addon before execution."
],
"interpretation": "Verified aggregate host/strategy/state overhead, not per-function attribution. Long-window decision phase is about51\u201362%of total owner-dense wall. Profiles in P08 must distinguish schema parsing, copying/freezing, trailing calculations and allocation before optimization. No cross-shape scaling or S02 speedup claim."
"interpretation": "Verified aggregate host/strategy/state overhead, not per-function attribution. Long-window decision phase is about51–62%of total owner-dense wall. Profiles in P08 must distinguish schema parsing, copying/freezing, trailing calculations and allocation before optimization. No cross-shape scaling or S02 speedup claim."
},
"cleanup": {
"stopped_exact_containers": [
@ -6901,7 +6900,7 @@
"R08 remains partial for multiple walk-forward windows and cost sensitivity. R09 and performance/default/trading/AI gates unchanged."
],
"thirtieth_wave_validation": {
"state": "component_validated_uncommitted",
"state": "component_committed",
"scope": "R08 durable single train/fixed-winner validation/test recipe and immutable report; full R08 remains in_progress and R09 blocked",
"integration_base": "67ab30cb7a578591262cb0218fa9f6a135924c7f",
"log_directory": "/tmp/stock-bot-wave30.K6IDyj",
@ -7017,6 +7016,132 @@
"An initial manually built browser fixture used the local VITE API override; its network guard rejected login. Rebuilding with explicit same-origin VITE_API_BASE_URL fixed the setup; both focused and final complete browser suites passed. No application change or test retry hid a source failure."
],
"cleanup": "Both exact disposable PostgreSQL/Redis containers stopped successfully after all suites completed. 38 source/test files archived and hashed; worktrees/logs retained. Development/production services and data untouched.",
"next": "Accept/commit this durable single-recipe component, then finish R08 with explicit repeated nonoverlapping walk-forward windows and bounded cost sensitivity through the existing recipe/experiment paths. Preserve immutable per-window winners and separate reset-account reports; avoid a general workflow scheduler. Keep performance, candidate/AI execution and default/trading activation gated."
"next": "Accept/commit this durable single-recipe component, then finish R08 with explicit repeated nonoverlapping walk-forward windows and bounded cost sensitivity through the existing recipe/experiment paths. Preserve immutable per-window winners and separate reset-account reports; avoid a general workflow scheduler. Keep performance, candidate/AI execution and default/trading activation gated.",
"completed_commit": "abd1c5b83d55ad49b562408cb3a87a1c7b7f952e"
},
"thirty_first_wave": ["R08"],
"thirty_first_wave_base": "abd1c5b83d55ad49b562408cb3a87a1c7b7f952e",
"thirty_first_wave_notes": [
"Walk-forward only: cost scenarios change financial-policy admission and stay a separate next slice. No template mutation or cost-as-strategy-parameter workaround.",
"Focused research_walk_forwards header plus train-root membership columns; every member remains an existing standalone chronological validation. Avoid overloading first-window cancellation.",
"Freeze 2–10 recipes/common source/grid/build/policies before any execution; total promised training plus future holdouts<=100. Nondecreasing training starts, strictly increasing train cutoffs and previous test.end<=next validation.start.",
"Atomic all-training admission with exact deferred membership/run/outbox guards. Existing member select/finalize/retry paths reused; no scheduler or automatic advancement.",
"Historical series finalization verifies full canonical evidence and every sealed member report, copying ordered validation/test reset segments without compounding or new analytics. Accepted receipts replay before current eligibility.",
"Whole-series cancellation propagates downward to every member; local member cancellation remains local and blocks series completion. SQL22–24 files remain unchanged.",
"Performance remains paused. Full R08 stays partial for cost sensitivity; R09 and candidate/AI/multi-asset/default/trading activation gates unchanged."
],
"thirty_first_wave_validation": {
"state": "component_validated_uncommitted",
"scope": "R08 bounded repeated walk-forward windows and immutable independent reset-segment reports; full R08 remains in_progress for cost sensitivity and R09 blocked",
"integration_base": "abd1c5b83d55ad49b562408cb3a87a1c7b7f952e",
"log_directory": "/tmp/stock-bot-wave31.QqUT6Z",
"source_archive": "/tmp/stock-bot-wave31.QqUT6Z/validated-source.tar.gz",
"source_archive_sha256": "ff10c4fe33033d5a4e33c68cfb1d8f6633ce885ccc7d95bf5a4e2ff408c55818",
"source_files": {
"apps/stock/config/package.json": "802bc6005690386786d536758c3d49f9a5929e193bb14760dd2b7e0880f25bea",
"apps/stock/config/src/contracts/walk-forward.ts": "823632db7935aaa729a8b9aba925e74db117553b1ca9eaea027a0637ab96fe92",
"apps/stock/web-api/src/migrations/migration-runner.ts": "819e13509f052ff81ea8021ab0eb2e975bd699fd87b42efba9ecc5c2eabe0879",
"apps/stock/web-api/src/routes/experiments.routes.ts": "d959a1dbedf158c6dbb1eb39e28354fe8d31bc13bbceaaafc0c474deff60a2ad",
"apps/stock/web-api/src/services/chronological-validation.service.ts": "51ac51167351d496c67fd9154c696ce7eb33be4b4af14c7fdce429a5224db349",
"apps/stock/web-api/src/services/walk-forward-input.ts": "7f4dc96c449bb09d075b027b5c4e2f26f38b6bc0a1498a8338d830d96647bdde",
"apps/stock/web-api/src/services/walk-forward.service.ts": "357a2a3e29f9e78329003186835669d74096c5f3f5ae93a859af4570b5b77596",
"apps/stock/web-app/src/app/App.tsx": "0a882a55c98f53d0fe2f246f1f3536b27990c9ad3bd35a2bdcbca4e8463f187d",
"apps/stock/web-app/src/features/experiments/ExperimentListPage.tsx": "8afe33d1fd4836e4209ebd62bbb05e168c938cd7cc89bc8da9fb43d3b2f2d03a",
"apps/stock/web-app/src/features/experiments/WalkForwardDetailPage.tsx": "671dd0aff2d42f83cc776bc101b65fcf2dccfb3be44d24e6a6eea530127a34d2",
"apps/stock/web-app/src/features/experiments/components/ChronologicalValidationPreflight.tsx": "8f135323ddac45fc38294a488afd0cf8216aae4c3df59dd2c38ce0aaf97cdaff",
"apps/stock/web-app/src/features/experiments/components/ExperimentEditor.tsx": "77a4586120a60550d58e331227fca0b85a7801dda5f76bd7c9eedc6c8b7586d2",
"apps/stock/web-app/src/features/experiments/components/SavedWalkForwards.tsx": "10ee1ff4340c2c24a31b09f3653ae4b314b03353be19f1b3ab7345b1d24e3015",
"apps/stock/web-app/src/features/experiments/components/ValidationWindowFields.tsx": "a7bf21462f58e277ae3939355cd1a56cdb6eefd3cced654b1182dd159887400c",
"apps/stock/web-app/src/features/experiments/components/WalkForwardPreflight.tsx": "7550d4027b8df56c24568de74b56b71f3814c8bc4a837ffce145acf91d8ac729",
"apps/stock/web-app/src/features/experiments/index.ts": "65cec87cea6e4b5b30df231bfbcc4b52caccd340d5dd9a68b72e0d1596411308",
"apps/stock/web-app/src/features/experiments/services/chronologicalValidationDurableApi.ts": "ed90d1c5211fec8850507984ada72216c83c17be4077196a37ad436a3980463a",
"apps/stock/web-app/src/features/experiments/services/walkForwardApi.ts": "2fe8c8e23e7e108fd117db3eb4cc35fe9ebd3d0c9a76733b685156bb4f65495d",
"database/postgres/init/25-walk-forward.sql": "bc30037f303c67cd431e904fd251671fa88210b888dcee75799b0cc4a55e64df",
"test/e2e/fixture.ts": "10b19b3723a8c24a08af1d9dbacf9a639e1e733a119f02a09017dba2d071e3a6",
"test/e2e/workbench.test.ts": "24253213d7efdb4c7750990338fc7be1b3468dc40655f44b4c542ad03c17c8f6",
"test/fixtures/walk-forward.ts": "e0ec22545c3aa74c703808fcc4785f475feb13395ac3904323f52dd16072963f",
"test/integration/chronological-validation-ui.test.tsx": "f59c5cf66a1e46c8ddd0a5c3ebc623a57c7d7b111e99988c59580dc452fcebdf",
"test/integration/walk-forward-api.test.ts": "bd6fc7fe02e6c89150b467191912d9a6251660cd16582a5ae3fd55d8538b89d1",
"test/integration/walk-forward-ui.test.tsx": "eaaa96110baae8bf6065222da1acb8cc89d9ea416692cdcd71e1d7834242f08d",
"test/integration/walk-forward.test.ts": "f4864edb4bd69944407eff49ece4ba1e1c554872caacc33d15c8c221d475dafb",
"test/postgres/canonical-durable-backtest.test.ts": "252e30fea1e3e86b1278c6b0f60b0f632714407a6fa141915b16c70774648a8f",
"test/postgres/canonical-research.test.ts": "d03b7b8a2876f3662d85c009ddea0e5a9812c2b6a11b3475185fd6d3606c9325",
"test/postgres/catalog-backtest-drafts.test.ts": "a8af8e65f1899303513e0e0efb817e59a192ffb92bab8d925d09b390cdff5be6",
"test/postgres/chronological-validation-durable.test.ts": "13976744faaca453a8e151777a12d36321b235a4978384f2220083375c25c855",
"test/postgres/chronological-validation.test.ts": "1a181f21bc399f3aae924d2a62f61f1e6e1b166c498445ee8e6711fe3153610f",
"test/postgres/dataset-catalog.test.ts": "003666a7fe9ba460c5c6b9869d353a43a9356529e880a4c255d73c10fe4f6ec1",
"test/postgres/durable-backtest.test.ts": "b7afc78dc689349c9d832c0bb348fb0c7ff9fe9e7f0278e6f8bf71e673e3fb7c",
"test/postgres/experiment-retries.test.ts": "f6a73e6a6d409bd52ba5abcc937052b4bb090be73323f9857bf3d4c531197405",
"test/postgres/experiments.test.ts": "1f3fbfda8f164dcda1832d6cff7d3909fad8c0e63de7414fd431a74f3b66d2d1",
"test/postgres/migration-runner.test.ts": "c2865ad88c2def8d19f6fd2e4cbb8893657311813d19d0887bb09c4dbc455d7a",
"test/postgres/research-retention.test.ts": "98ec033a93ddf4129160654dc3fa85687c34a912d47d54c17e6ce0c8d3df49a2",
"test/postgres/research-runtime-isolation.test.ts": "359a887febbbab359ce2a04f1cb67ea4ae5b82eeabf8f35e76126c6e465e109a",
"test/postgres/research-workspace.test.ts": "8cc154401e69a7b3d8c0e4c303644a350ad79d08cf166dac024c4730713a69e5",
"test/postgres/run-reproduction.test.ts": "d3a76cbcd072e3e1edda11f9b8e468afc953f8195a307873aa61434e5a9235ea",
"test/postgres/walk-forward.test.ts": "cd11f3f5d64301a4ac64b536a07ee5af7e4b72c8dad9002e61b6342bd2695676"
},
"checks": [
{
"command": "CARGO_BUILD_JOBS=2 bun run check",
"log": "integration-check-final.log",
"exit_code": 1,
"result": "Secret audit, build, types, contracts, 93 tooling, 43 utility, 44 calculation, 882 integration and 150 Rust tests passed; only one remaining route curly lint error failed. Corrected with braces only; final repository lint and source types passed separately below. Four existing Rust cases remain ignored."
},
{
"command": "bun run lint:check; bun run typecheck",
"logs": ["integration-lint-final.log", "integration-types-final.log"],
"result": "Both passed after final reviewed brace/format fixes; no application behavior changed."
},
{
"command": "bun test test/integration/walk-forward.test.ts test/integration/walk-forward-api.test.ts",
"log": "integration-backend-focused-final.log",
"result": "7 passed, 83 assertions; final brace-only test overlay also passed owner rerun backend-focused-final.log."
},
{
"command": "bun run test:postgres",
"log": "integration-postgres-final.log",
"result": "215 passed, 1881 assertions, zero failures; disposable PostgreSQL and Redis DB15."
},
{
"command": "bun run test:e2e",
"log": "integration-browser-final.log",
"result": "14 passed, 412 assertions, zero failures; same-origin production rebuild and real Chromium/native runner."
},
{
"command": "Strict authored test TypeScript; explicit authored test ESLint",
"logs": ["root-tests-types-final.log", "authored-tests-lint-final.log"],
"result": "Passed. Broad lint of all touched old test fixtures found eight preexisting curly violations in durable-backtest.test.ts and research-runtime-isolation.test.ts; only their migration lists changed. New authored tests are clean."
},
{
"command": "Prettier changed TS/TSX/JSON; git diff --check; task references/dependency DAG",
"result": "Passed; 55 unique IDs, valid references and acyclic implementation dependencies."
}
],
"review": {
"independent_reviewer": "/root/r04_review",
"backend": "Accepted final eight-file v2 snapshot; only three tests changed for braces after initial acceptance, no semantics changed. Own pure/API 7/83 and reviewed PG 10/108.",
"backend_archive": "/tmp/stock-bot-wave31.QqUT6Z/backend-final-v2.tar",
"backend_archive_sha256": "f8ed5599fc27be0c8cbe660a41e623803f31e2fc9ca15eca12e216cac21499dc",
"frontend": "Accepted final 11-file snapshot; independent focused UI 50/154 and owner combined UI 285/1305.",
"frontend_archive": "/tmp/stock-bot-wave31.QqUT6Z/frontend-final.tar.gz",
"frontend_archive_sha256": "8bfd0d8d9296f3903697906683a481a7727cbbc675a0c9b0ee8f58e88336f45b",
"root_composition": "Read-only independent reviews of shared DTO/fixture, App/index, old migration chains and real native browser flow accepted."
},
"engine": {
"debug_sha256": "75e33ffdd1e2738537879e62243a9d8f63665864835a58c46087bb4b78f274ff",
"release_sha256": "ef00eed556f5c32332d36a9a00ef710682e90deb00b54552e4b5c8bfdfbe8103",
"note": "Unchanged financial engine. Release restored before final PostgreSQL and browser suites."
},
"limits": [
"2–10 explicit windows; at most 100 planned runs including both future holdouts per window.",
"Deterministic registered built-ins and zero label horizon only; no trained models, candidate execution or AI authorization.",
"Training may overlap earlier historical holdouts; frozen recipes and own-training-only selection do not certify globally unseen data.",
"Separate reset-account validation/test segments, not compounded equity or averaged Sharpe/CAGR; execution completeness is not statistical adequacy.",
"Per-window existing actions remain explicit; no scheduler or automatic advancement. Ambiguous browser intent remains component-lifetime state.",
"Bounded cost sensitivity remains the next R08 slice; no cost-as-strategy-parameter workaround or template mutation.",
"Performance work, R09 evidence integration and candidate/AI/multi-asset/default/paper/live activation gates remain unchanged."
],
"fixture_cleanup": "Removed both exact disposable PostgreSQL/Redis containers after all final gates; development services untouched. Worktrees and local evidence retained.",
"commits": "Previous wave committed as abd1c5b. This validated component remains uncommitted; no push or PR."
}
}