feat(research): reproduce retained canonical runs with economic comparison

This commit is contained in:
Boki 2026-10-24 10:02:21 -04:00
parent e3bd708838
commit 30accfcf43
31 changed files with 2969 additions and 28 deletions

View file

@ -1,14 +1,14 @@
{
"schema_version": 1,
"plan_revision": "2026-10-24.54",
"plan_revision": "2026-10-24.56",
"repository_base": "b7aeca4",
"plan_status": "twenty_fifth_wave_validated_uncommitted",
"plan_status": "twenty_sixth_wave_validated_uncommitted",
"execution_authorized": true,
"execution_scope": {
"authorized_by": "User: commit and continue after validated R03 handoff naming R04; R03 committed ee4525750741a314cbaaaf9f316b114c10dfd846.",
"tasks": ["R04"],
"authorized_by": "User: how far are we in the backlog, also commit and continue after R04 handoff naming original reproduction; R04 committed e3bd708838ce17a4da0bc2b4d6be701b72625dd8",
"tasks": ["R12"],
"permissions": [
"R04 research workspace, saved-result finding UI, browser/interaction tests, isolated implementation and independent review"
"Scoped same-installed-build retained canonical single-asset reproduction; independent implementation/review, fixtures and validation"
],
"excluded": [
"performance_profiling_or_optimization",
@ -23,7 +23,7 @@
"multi_asset_activation",
"other_backlog_tasks",
"AI_execution_or_credentials",
"R03_backend_or_financial_contract_changes_without_demonstrated_need"
"historical_binary_provisioning"
],
"pending_policy_decisions": [
"ADR-007",
@ -1238,7 +1238,7 @@
"epic": "E6",
"priority": "P1",
"severity": "High",
"status": "review",
"status": "done",
"dependencies": ["R03", "W02"],
"decision_dependencies": ["ADR-006"],
"task_file": "backlog/tasks/R04.md",
@ -1250,10 +1250,10 @@
"assignment": "/root",
"branch": null,
"pull_request": null,
"completed_commit": null,
"completed_commit": "e3bd708838ce17a4da0bc2b4d6be701b72625dd8",
"blocker": null,
"release_gates": ["W04"],
"integration_state": "validated_uncommitted",
"integration_state": "validated_committed",
"integration_base": "ee4525750741a314cbaaaf9f316b114c10dfd846",
"worktree": "/home/boki/repos/stock-bot",
"implementation_slices": [
@ -1514,8 +1514,8 @@
"epic": "E6",
"priority": "P1",
"severity": "High",
"status": "blocked",
"dependencies": ["R05", "W04"],
"status": "review",
"dependencies": ["W04", "R01", "R10", "F08", "S02", "D01", "W03", "C06"],
"decision_dependencies": ["ADR-006"],
"task_file": "backlog/tasks/R12.md",
"findings": ["WEB-03", "WEB-04", "KEEP-02"],
@ -1523,12 +1523,41 @@
"specialization": "Full-stack reproducible research",
"write_locks": ["web-backtest-service", "web-backtest-detail"],
"parallel_policy": "Allowed only with satisfied dependencies/approvals and disjoint write locks AND actual files; see agents/integration.md.",
"assignment": null,
"assignment": "/root",
"branch": null,
"pull_request": null,
"completed_commit": null,
"blocker": null,
"release_gates": []
"release_gates": [],
"integration_state": "validated_uncommitted",
"integration_base": "e3bd708838ce17a4da0bc2b4d6be701b72625dd8",
"worktree": "/home/boki/repos/stock-bot",
"satisfied_component_dependencies": [
{
"task": "R05",
"scope": "Accepted retained-input single-asset canonical durable runner/provenance slice only; source preparation/default cutover not required",
"commit": "618fb9e33cebc1fde4869eb1f975a12c55bd9b94"
}
],
"implementation_slices": [
{
"owner": "/root",
"scope": "Shared DTO/comparison projection, migration fixture integration, browser and planning"
},
{
"owner": "/root/r12_backend",
"worktree": "/tmp/stock-bot-wave26.38tu9A/backend",
"scope": "Admission/API/migration21 and focused SQL/HTTP tests"
},
{
"owner": "/root/r12_frontend",
"worktree": "/tmp/stock-bot-wave26.38tu9A/frontend",
"scope": "Reproduction preview/retry/lineage/comparison UI and DOM tests"
}
],
"reviewed_by": "/root/r04_review",
"review_notes": "Independent backend/SQL/hash and frontend review accepted. Root full repository, PostgreSQL and Chromium gates passed. Original retained inputs remain independent of mutable template settings; current approval, immutable lineage and repeat-safe receipts remain enforced.",
"verification_reference": "ROADMAP.md#twenty-sixth-wave-handoff--2026-10-24"
},
{
"id": "P01",
@ -6330,7 +6359,7 @@
"R05 remains partial, R06/S06 remain gated; performance and AI/trading activation remain excluded."
],
"twenty_fifth_wave_validation": {
"state": "validated_uncommitted",
"state": "validated_committed",
"log_directory": "/tmp/stock-bot-wave25.X7zzoe",
"integration_base": "ee4525750741a314cbaaaf9f316b114c10dfd846",
"source_archive": "/tmp/stock-bot-wave25.X7zzoe/r04-integrated-source.tar",
@ -6403,6 +6432,98 @@
"Chromium only; existing build bundle-size/Rust warnings remain."
],
"cleanup": "Both exact --rm PostgreSQL/Redis fixture containers stopped successfully. All 17 authored source/test hashes reverified; worktrees and logs retained. Development/production services and data untouched.",
"next": "Recommend a scoped R12 same-installed-build original-run reproduction slice after explicitly recording dependence on the accepted R05 retained-input component and pinning guarded reproduction admission/approval. R12 remains blocked in the manifest until that planning step; keep full R05 in progress and R06/S06 gated."
"next": "Recommend a scoped R12 same-installed-build original-run reproduction slice after explicitly recording dependence on the accepted R05 retained-input component and pinning guarded reproduction admission/approval. R12 remains blocked in the manifest until that planning step; keep full R05 in progress and R06/S06 gated.",
"completed_commit": "e3bd708838ce17a4da0bc2b4d6be701b72625dd8"
},
"twenty_sixth_wave": ["R12"],
"twenty_sixth_wave_base": "e3bd708838ce17a4da0bc2b4d6be701b72625dd8",
"twenty_sixth_wave_notes": [
"Root narrowed R12 to accepted R05 retained-input component after independent code review; R05 remains partial and R06/S06 blocked.",
"Reproduction preserves frozen economic inputs, current original-version approval and repeat-safe receipts. No current-template dependency or historical executable manager."
],
"twenty_sixth_wave_validation": {
"state": "validated_uncommitted",
"log_directory": "/tmp/stock-bot-wave26.38tu9A",
"integration_base": "e3bd708838ce17a4da0bc2b4d6be701b72625dd8",
"source_archive": "/tmp/stock-bot-wave26.38tu9A/r12-integrated-source.tar",
"source_archive_sha256": "61ceb44bf8aa10a93e160f0ad7c8964748ae548c06a07b6954e5018688e0927a",
"source_file_count": 26,
"source_sha256": {
"apps/stock/config/src/contracts/canonical-research.ts": "d18421e275cd90d98cf05f352f7f6858580cb7cdc26124b535bfc45518521714",
"apps/stock/web-api/src/migrations/migration-runner.ts": "c4105e10b612ad1fa186f66714bb31318d4c70fab5a50229a66f7f96432b3853",
"apps/stock/web-api/src/routes/backtests-v2.routes.ts": "499a6b53c2dffedb341cbcb9b51339ab9e113584f074eb2ea92dadf2833f09a4",
"apps/stock/web-api/src/services/backtest-v2.service.ts": "76f02ff5dd60cd4b70718a2cf3703092b4f2cccb579b65c851524f4030706532",
"apps/stock/web-api/src/services/reproduction-comparison.ts": "5bde63cb6922f396ae53d5c4817c651f0a20d014deed1d9ea6d7a082c426537b",
"apps/stock/web-api/src/services/run-reproduction.ts": "02690bf2e001a6495413700aa1fcfc2accac7d12aee4369aedd5b25c10fe6ce5",
"apps/stock/web-app/src/features/backtest/BacktestDetailPageV2.tsx": "96f4bcbc3024d9713dc9585b8afccc058c69bcee6f715fa486ac2911b0bbb92d",
"apps/stock/web-app/src/features/backtest/components/RunReproduction.tsx": "b23f235049f9c80a317b8ca38202cd1857ea460bc9b5e009d6926e1de21bdef1",
"apps/stock/web-app/src/features/backtest/services/backtestApiV2.ts": "23d8a64fac4fcc3254166f1457a3b9f1c20d81d7b379c469b5171f51efabeea9",
"database/postgres/init/21-run-reproduction.sql": "25d6f8f6bc23666d01f104be0e1c625822450c0c08b1c2ffaa31915d2b88c6cb",
"test/e2e/fixture.ts": "7ce1d95bc95a583cd937e036d9f584149af938515d1c588dbbd952a1b5a6f295",
"test/e2e/workbench.test.ts": "d19fa08c6a8a01e3fc9e66065a1e108816bae79c3c70a11d6457321f6b3e5a7c",
"test/integration/backtest-run-controls.test.tsx": "ca9e33508bd825821fd8ade631dec8a622ed019ad20eb6ec13b6c9957d4f37e8",
"test/integration/reproduction-comparison.test.ts": "e3a61f53c2a79f553f4be234e0b07e761543354b7c617351a1e75fa6ee7cb4fd",
"test/integration/run-reproduction-api.test.ts": "108f72299cdce927694d476a98797f3039bda4c0ee5b34b76cf94023a23b7a65",
"test/integration/run-reproduction-ui.test.tsx": "c72e7a07b823f44f583cf30d9e393027293991619f336b1e6fba99bde17a3c58",
"test/postgres/canonical-durable-backtest.test.ts": "774f394ac61d32cef241b9ef7f2267b66bcb8feb072b2545da23f37f23e3c192",
"test/postgres/canonical-research.test.ts": "c87bf4453f53daf9872d70cb2475060d39b53dbd59f0c32c615eb6795d40b697",
"test/postgres/catalog-backtest-drafts.test.ts": "d47dd06f9a43dd36b15fe3f3649408cbcf89ca8a7e62c644dc32479d11098bd0",
"test/postgres/dataset-catalog.test.ts": "51c976c966ae0dc92f8b1395521c058a89eb0543f5efe5a6930109a4e3c9652a",
"test/postgres/durable-backtest.test.ts": "e42912c8c2f366abec9ac3104c3f2eb2a083dc03595374455c1d755a537e48fe",
"test/postgres/migration-runner.test.ts": "093eb76e2e718b3930dc4efb805cc97ce33cf262d590eb73a99fb3920d83286b",
"test/postgres/research-retention.test.ts": "805a7403e07bee0c3dff5bf4d8eefa61fcbea8daaa31f45d2bbbd7e61d10ec98",
"test/postgres/research-runtime-isolation.test.ts": "c58d461555ae07b47f599f9f99187a4ba36c22ed7ff05bb1b403dab317a4197a",
"test/postgres/research-workspace.test.ts": "620836176bddf0dc927a812217087372baa279890b754cfe297236037374a93c",
"test/postgres/run-reproduction.test.ts": "f357a08fa4333f4beacb6aef1b6169cdbe6278229d2eab9f54d460af207dec32"
},
"checks": [
{
"command": "CARGO_BUILD_JOBS=2 bun run check",
"log": "/tmp/stock-bot-wave26.38tu9A/check.log",
"outcome": "All repository checks passed: build/source/contracts/secrets/lint; 93 tooling, 43 utility, 44 calculation, 662 integration and 150 Rust tests (4 manual Rust ignored)."
},
{
"command": "PIPELINE_TEST_DATABASE_URL=<disposable PG> BACKTEST_TEST_REDIS_URL=<dedicated Redis /15> bun run test:postgres",
"log": "/tmp/stock-bot-wave26.38tu9A/postgres.log",
"outcome": "169 tests / 1376 assertions passed across 19 files. Focused R12 PostgreSQL gate separately passed 10 tests / 97 assertions, including real native parity, concurrency, admission guards, migration upgrade and corruption/mismatch diagnostics."
},
{
"command": "PIPELINE_TEST_DATABASE_URL=<disposable PG> BACKTEST_TEST_REDIS_URL=<dedicated Redis /15> bun run test:e2e",
"log": "/tmp/stock-bot-wave26.38tu9A/e2e.log",
"outcome": "9 Chromium workflows / 215 assertions passed. Real retained execution, template mutation, original-input preview/reproduction, duplicate receipt replay, economic hash match, reload/source lineage and separate current-settings execution; original results unchanged."
},
{
"command": "bunx tsc --project /tmp/stock-bot-wave26.38tu9A/tests-tsconfig.json --noEmit",
"log": "/tmp/stock-bot-wave26.38tu9A/integrated-types-final.log",
"outcome": "Strict changed/new tests and dependent sources passed after final browser assertions."
},
{
"command": "bunx eslint <new/changed scoped tests and comparison helper> --max-warnings 0; bunx prettier --check <changed TS/TSX>; git diff --check",
"log": "/tmp/stock-bot-wave26.38tu9A/scoped-lint-final.log",
"outcome": "Scoped lint, formatting and diff checks passed. Existing controls test received only its ResizeObserver harness ownership fix; unrelated existing test-file curly findings were not expanded into cleanup."
},
{
"command": "CARGO_BUILD_JOBS=2 bun run --cwd apps/stock/engine build:release",
"log": "/tmp/stock-bot-wave26.38tu9A/native-release.log",
"outcome": "Release addon restored after repository checks. SHA256 ef00eed556f5c32332d36a9a00ef710682e90deb00b54552e4b5c8bfdfbe8103 matches checkout release library and previous wave; no Rust changes."
}
],
"reviews": [
{
"reviewer": "/root/r04_review",
"scope": "Backend admission, SQL21 lineage/retained identity guards, complete economic hash projection, frontend intent/retry/late-response behavior and focused tests",
"outcome": "Accepted verified implementation hashes; independently ran combined 106 UI tests / 555 assertions and 10 HTTP/hash tests / 96 assertions. Root owns final integrated database/browser gates.",
"next_wave_note": "Independent reviewer confirms retained-dataset experiments do not technically require provider-to-v2 preparation. Existing R06/R07 dependencies remain blocked until the planning owner records a narrow component scope. Full R05 completion must not require A02 candidate execution, which would introduce a cycle through A01/R06."
}
],
"limitations": [
"Completed canonical retained single-asset trusted built-ins on the exact installed build only. Legacy, incomplete, missing/corrupt retained inputs and unavailable historical builds cannot be reproduced; existing results remain readable.",
"New reproduction requires active parent/original strategy family and latest approval of the original version. Accepted receipt retries return the same run even after eligibility changes. No execution permission is derived from old approval alone.",
"Hash equality is versioned deterministic economic-output comparison, not statistical validation or proof of strategy merit. Only admission identities are normalized; actual financial policies, market session IDs, ownership, ordered fills and null analytics are retained.",
"Full R05 remains incomplete; R06/S06 stay blocked. No source preparation, candidate execution, multi-asset/default activation, paper/live operation, historical binary manager, AI execution, performance work or benchmark runs.",
"Chromium only; existing build bundle-size/Rust warnings remain. No new-wave commit, push or PR."
],
"cleanup": "Both exact --rm PostgreSQL/Redis fixture containers stopped successfully. All 26 source/test hashes frozen; source archive, worktrees and logs retained. Development/production services and data untouched.",
"next": "Recommend an R06 retained-input experiment component using one immutable strategy version, eligible single-asset dataset, installed build and bounded parameter grid; a focused R07 UI component may follow pinned APIs. Before execution, explicitly record component prerequisites rather than treating full R05/R06 as complete. Reuse durable runs/outbox with guarded experiment admission; do not mutate templates per trial or misuse reproduction lineage. Keep provider preparation, candidate isolation, multi-asset/default cutover and performance work separately gated."
}
}