feat(research): run retained strategies through durable canonical engine

This commit is contained in:
Boki 2026-10-23 21:59:09 -04:00
parent d929db707a
commit 618fb9e33c
58 changed files with 6596 additions and 779 deletions

View file

@ -522,3 +522,18 @@ R10 is accepted and committed as `8cca0ee`, superseding its uncommitted handoff
The browser gate exposed intermittent Chromium control-pipe loss across serial launches, not a financial assertion failure. Isolated workflows passed. The fixture now shares one suite-owned Chromium process while giving each workflow a fresh context/server/schema/queue; the complete suite passed without retries. Production workers are unchanged. The release addon matches the prior wave and checkout library; no Rust financial semantics changed. Both exact disposable containers were stopped; development services were untouched.
No new R02 commit, push, PR, performance work or trading/default activation. **Next after acceptance/commit: R05**, connecting verified retained executable identity and canonical reports to durable runs. Start with a trusted-built-in single-asset vertical slice; do not certify a retained hash while executing an unrelated current built-in. Candidate execution remains gated by A02 and multi-asset default by the explicit mark-policy decision. R03 research metadata is also ready for disjoint work, but does not unlock catalog execution.
## Twenty-third-wave handoff — 2026-10-23
R02 is accepted and committed as `d929db7`. The initial R05 vertical slice is independently reviewed and `partial_validated_uncommitted`; R05 remains **in_progress**. Fifty-four implementation/contract/migration/test files connect approved retained built-ins, eligible single-series v2 datasets and explicit financial/reporting settings to the existing durable Rust runner. Isolated worker, durable and frontend worktrees plus evidence remain under `/tmp/stock-bot-wave23.D3gFzn/`.
- **Executable provenance:** Admission freezes exact retained package/lock bytes, version/review, parameters, dataset hash, seed, financial/time/reporting policies and worker/native/runtime build identities. The child verifies and imports the retained bundle; it never substitutes a current built-in by name. Approval/archive changes serialize with admission; accepted receipts and snapshots remain usable afterward.
- **Durability:** One queue/runner/repository lifecycle handles leases, heartbeats, fencing, cancellation/reaping and atomic results. Corrupt data, wrong builds or a non-native runner fail without provider/legacy fallback. Migration 19 preserves retention and adds versioned canonical results without rewriting old rows.
- **Workbench:** Review built-ins, save exact canonical settings against a retained dataset, submit, inspect canonical Rust balances/owners/fills/metrics/provenance, and reopen results. Exact UTC/DST warmup boundaries survive save/admission. Zeros and unavailable reasons are preserved; fills do not become invented round trips. Cross-parent results and late navigation replies are rejected; canonical positive drawdowns use correct severity colours.
- **Validation:** All relevant gates passed across the recorded commands: build/source/contracts/secrets; 93 tooling, 43 utility, 44 calculation, **576 final integration** and **150 Rust** tests (4 manual ignored); full PostgreSQL/Redis **150 tests / 1154 assertions**, plus **13 final release-admission/durability tests / 106 assertions**; Chromium **9 workflows / 164 assertions**. The canonical browser fixture proves two expected fills, `9969.30000000` equity, exact saved provenance and zero provider reads. Final strict new-test/script checks, application lint, modern test lint, formatting and diff checks passed.
The initial aggregate check exposed stale pure-contract allowlists and lint issues; those were corrected and affected gates rerun. Optional lint over all touched old fixtures still reports eight existing curly-rule errors in two files changed only to apply migration 19; no suppressions or unrelated cleanup. Full commands, review dispositions and exact source hashes are in `manifest.json` → `twenty_third_wave_validation`. The release addon equals the prior wave/checkout release hash; Rust financial code is unchanged. Both exact disposable fixture containers were stopped; no development/production state was seeded or migrated.
Deployment requires the existing native research runner (`useRustEngine: true`) and matching immutable build files. Capability is input/artifact validation, not worker health. An incompatible deployment fails an accepted run; historical build restoration belongs to R12. [R05](backlog/tasks/R05.md#first-vertical-slice--2026-10-23) documents the explicit offline v2 import and remaining source-preparation contract. No candidate/multi-asset/default activation, benchmark or performance work, new-wave commit, push or PR.
**Next after acceptance/commit: R03 research projects, hypotheses and evidence-linked findings APIs.** It is independently ready and adds useful research workflow without pretending full R05 is finished. R05's source-to-v2 preparation and broader cutover remain tracked; R06/S06 dependencies are not released by this partial milestone.

View file

@ -1,6 +1,6 @@
# Canonical development backlog
**First twenty-one waves committed; R02 is validated and awaiting acceptance/commit.** R10 is accepted as `8cca0ee`. R02 adds catalog/version browsing and validated saved backtest setups; catalog execution remains gated by R05. Performance work remains paused. See [current handoff](../ROADMAP.md#twenty-second-wave-handoff--2026-10-23) and manifest execution scope.
**First twenty-two waves committed; the initial R05 vertical slice is validated and uncommitted.** R02 is accepted as `d929db7`. Reviewed built-ins can now run against one eligible retained v2 dataset through the durable Rust engine and reopen canonical results in the web workbench. Full R05 remains in progress. Performance work remains paused. See [current handoff](../ROADMAP.md#twenty-third-wave-handoff--2026-10-23) and manifest execution scope.
## One source of truth
@ -73,10 +73,10 @@ Relative size: S narrow correction, M coherent boundary, L sensitive owner-contr
| Task | Priority / status | Implementation prerequisites | Release gate | Specialist / size |
| --- | --- | --- | --- | --- |
| [R01 Persist immutable strategy versions and parameter schemas](tasks/R01.md) | P1 / done | O01, ADR-006 | — | Full-stack research product / M |
| [R02 Deliver strategy catalog and version-aware backtest setup](tasks/R02.md) | P1 / review | R01, W03, ADR-006 | W04 | Full-stack research product / M |
| [R02 Deliver strategy catalog and version-aware backtest setup](tasks/R02.md) | P1 / done | R01, W03, ADR-006 | W04 | Full-stack research product / M |
| [R03 Add projects, hypotheses and evidence-linked findings APIs](tasks/R03.md) | P1 / ready | R01, R10, ADR-006 | — | Full-stack research product / M |
| [R04 Deliver research workspace and save-findings flow](tasks/R04.md) | P1 / blocked | R03, W02, ADR-006 | W04 | Full-stack research product / M |
| [R05 Freeze complete provenance and cut over durable canonical runs](tasks/R05.md) | P0 / ready | F08, S02, R01, R10, D01, W03, C06, ADR-006 | Multi-asset default mark-policy disposition | Full-stack research product / M |
| [R05 Freeze complete provenance and cut over durable canonical runs](tasks/R05.md) | P0 / in_progress | F08, S02, R01, R10, D01, W03, C06, ADR-006 | Multi-asset default mark-policy disposition | Full-stack research product / M |
| [R06 Create immutable experiments and bounded sweep expansion](tasks/R06.md) | P1 / blocked | R05, ADR-006 | — | Full-stack research product / M |
| [R07 Deliver sweep configuration and comparable-result views](tasks/R07.md) | P1 / blocked | R06, ADR-006 | W04 | Full-stack research product / M |
| [R08 Add bounded chronological and reset-segment validation](tasks/R08.md) | P1 / blocked | R06, ADR-006 | — | Quantitative research integrity / M |

View file

@ -1,16 +1,16 @@
{
"schema_version": 1,
"plan_revision": "2026-10-23.48",
"plan_revision": "2026-10-23.50",
"repository_base": "b7aeca4",
"plan_status": "twenty_second_wave_review",
"plan_status": "twenty_third_wave_partial_validated",
"execution_authorized": true,
"execution_scope": {
"authorized_by": "User: commit and continue after validated R10 handoff named R02 next. R10 committed 8cca0ee588b55cf904f46199ccb65942de70ee99.",
"authorized_by": "User: commit and continue after validated R02 handoff; R02 committed d929db707a4894096b8b31ebd25c5e39d15289c1.",
"tasks": [
"R02"
"R05"
],
"permissions": [
"R02 isolated implementation, correctness tests, independent review and planning updates; prior R10 commit authorized and completed"
"R05 trusted-built-in single-asset retained-v2 vertical slice, isolated implementation, correctness tests, cross-agent review and planning updates"
],
"excluded": [
"performance_profiling_or_optimization",
@ -20,11 +20,15 @@
"pull_requests",
"live_or_paper_operations",
"default_engine_cutover",
"candidate_execution",
"provider_to_v2_inference",
"multi_asset_activation",
"other_backlog_tasks"
],
"pending_policy_decisions": [
"ADR-007",
"ADR-008"
"ADR-008",
"Simultaneous multi-asset mark/risk policy before default activation"
]
},
"canonical_metadata": "This manifest alone owns task status, dependency edges, approvals, assignments and write locks. Task Markdown owns scope and acceptance criteria. Index/roadmap are derived views.",
@ -1442,7 +1446,7 @@
"epic": "E6",
"priority": "P1",
"severity": "High",
"status": "review",
"status": "done",
"dependencies": [
"R01",
"W03"
@ -1465,12 +1469,12 @@
"assignment": "/root",
"branch": null,
"pull_request": null,
"completed_commit": null,
"completed_commit": "d929db707a4894096b8b31ebd25c5e39d15289c1",
"blocker": null,
"release_gates": [
"W04"
],
"integration_state": "validated_uncommitted",
"integration_state": "validated_committed",
"integration_base": "8cca0ee588b55cf904f46199ccb65942de70ee99",
"worktree": "/home/boki/repos/stock-bot",
"implementation_slices": [
@ -1565,7 +1569,7 @@
"epic": "E6",
"priority": "P0",
"severity": "Critical",
"status": "ready",
"status": "in_progress",
"dependencies": [
"F08",
"S02",
@ -1592,14 +1596,45 @@
"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": [
"Explicit owner disposition of the simultaneous multi-asset mark/risk policy before canonical default activation"
]
],
"integration_state": "partial_validated_uncommitted",
"integration_base": "d929db707a4894096b8b31ebd25c5e39d15289c1",
"worktree": "/home/boki/repos/stock-bot",
"implementation_slices": [
{
"owner": "/root",
"scope": "Shared pure contracts, admission/API, migration19, offline dataset import, browser/fixture integration and planning"
},
{
"owner": "/root/s04_controls_audit",
"worktree": "/tmp/stock-bot-wave23.D3gFzn/durable",
"scope": "One durable runner/repository/adapter lifecycle and focused recovery tests"
},
{
"owner": "/root/s03_review",
"worktree": "/tmp/stock-bot-wave23.D3gFzn/worker",
"scope": "Retained executable bytes and exact worker/native build verification with child tests"
},
{
"owner": "/root/s04_feed_audit",
"worktree": "/tmp/stock-bot-wave23.D3gFzn/frontend",
"scope": "Explicit canonical setup/capability and canonical result UI; focused DOM tests"
}
],
"reviewed_by": [
"/root/s03_review",
"/root/s04_controls_audit",
"/root/s04_feed_audit"
],
"verification_reference": "ROADMAP.md#twenty-third-wave-handoff--2026-10-23",
"review_notes": "Reviewed retained-builtin/single-asset vertical slice only. Full R05 remains in progress; provider-to-v2 preparation and broader cutover are not claimed. Corrected warmup clock, series/rate/decimal admission mismatches, concurrent approval proof, UI parent identity and drawdown severity."
},
{
"id": "R06",
@ -7007,5 +7042,173 @@
"ea7d33b519a35b14ca493e460734a70d98937507a29406765edff53688f12b9a"
],
"next": "After acceptance/commit, R05: integrate verified retained executable identity, frozen provenance and existing canonical reports with the durable runner. Begin with a trusted-built-in single-asset slice, without claiming all R05 complete or enabling candidates/multi-asset default. R03 is independently ready. Performance remains deferred."
},
"twenty_third_wave": [
"R05"
],
"twenty_third_wave_base": "d929db707a4894096b8b31ebd25c5e39d15289c1",
"twenty_third_wave_notes": [
"Initial R05 vertical slice only: approved server-seeded built-in, exact retained bundle, eligible retained v2 dataset, one execution asset/series/owner, explicit financial and analytics policy.",
"Reuses existing queue/runner/recovery/Rust semantics. No automatic v1 conversion or provider calendar inference; add explicit offline validated dataset import.",
"Canonical request/result discriminants bypass legacy input and financial metric conversion; raw retained payload and full installed build identity frozen. Later review/archive affects new admissions only; accepted frozen requests remain replayable under matching installed build.",
"R05 remains incomplete until remaining provider preparation/default-cutover gates are explicitly resolved. No candidate/multi-asset/default activation or performance work."
],
"twenty_third_wave_validation": {
"state": "partial_validated_uncommitted",
"log_directory": "/tmp/stock-bot-wave23.D3gFzn",
"integration_base": "d929db707a4894096b8b31ebd25c5e39d15289c1",
"source_archive": "/tmp/stock-bot-wave23.D3gFzn/r05-integrated-source.tar",
"source_archive_sha256": "8d1102108d92e91c98333d1886400bd1f9c6351889f28455826394b265eacc5a",
"source_file_count": 54,
"source_sha256": {
"apps/stock/config/package.json": "7c6229de79360036584d332459d301811fcc6ea246c099ac9f5ce97e73251973",
"apps/stock/config/src/contracts/backtest.ts": "29981152d55a21b0526f8df2f4a609e4e26df830bb6679acf5414484e185864e",
"apps/stock/config/src/contracts/canonical-replay.ts": "61089f847e079b0166cb6ba6f53c50c8fa050fbf9f795ffe0e0a763c80d0033c",
"apps/stock/config/src/contracts/canonical-research.ts": "a724a679a3fbd1e5e1ec50ec9cf648d75ec4adf060a11518b7044aaacc107607",
"apps/stock/orchestrator/src/backtest/BacktestRunner.ts": "9a3fb70f4624fa661eb74b253398363c96999a15f033e3e9f51927e49870d1cf",
"apps/stock/orchestrator/src/backtest/NativeBacktestWorker.ts": "9dd451a232c9e76792f1302184827c678d45746f6fb538e816bc36afd865077a",
"apps/stock/orchestrator/src/backtest/PostgresBacktestRunRepository.ts": "8c1addf002fc5663b88c5f8ec9d8db6f12740c57083246fad1b04beee68f3648",
"apps/stock/orchestrator/src/backtest/RustBacktestAdapter.ts": "307f1575d9e728eee1d6895b976d878f9d873e764ef2525ae4d78e94aa302f90",
"apps/stock/orchestrator/src/backtest/canonical-build.ts": "a3024df5208fc3a9564a90744971a5e9f8e1c957060cdb97675b2b687fc2a56b",
"apps/stock/orchestrator/src/backtest/execution-engine.ts": "dadf54be396473ca12acf24fc7837622008e043b5ef37f145151f315bc947c92",
"apps/stock/orchestrator/src/backtest/native-worker-protocol.ts": "d0c31a6a75a1fa81a9f2e82560b9f83d28344ad8a93aaa252eebdf506dba45a3",
"apps/stock/orchestrator/src/backtest/native-worker.ts": "14f68b63f1f6893e9521f9671784962874ff7ddf52905ce1493bd781180f4a25",
"apps/stock/orchestrator/src/backtest/run-repository.ts": "f7069873b7b929b03dea847efd1ee09738640cc7351c978698b29b2aa9dcd6b4",
"apps/stock/orchestrator/src/contracts/native-replay.ts": "08a774154ded32580a8d31d5e09ccfb9700d00405f7838aa1f9e98643cf1adc1",
"apps/stock/web-api/src/migrations/migration-runner.ts": "a4ee363ca81ef9981a37f171c5784b519e593d03e0ce806e844e766587a3afb6",
"apps/stock/web-api/src/routes/backtests-v2.routes.ts": "b1fc489f4f355f4aee7a898e796dbbbbe0a576660f366bdd4ad70d87e07ebb13",
"apps/stock/web-api/src/routes/datasets.routes.ts": "9cfcee18ec39d085f23b23291c26ab56d41609fc21d9b1b3b4ccb1ace3f0884a",
"apps/stock/web-api/src/services/backtest-v2.service.ts": "94ff256df957939e018936323aa33507210ea2c081fd3e93cd697df1fb32eaf5",
"apps/stock/web-api/src/services/canonical-research.service.ts": "4efd29de567eeb0d7513e00d3c770dd0e1cf076ed2227eb73144484cfab32748",
"apps/stock/web-api/src/services/strategy-catalog.service.ts": "10453640baa5d84ec09b0d1dd70c8037d04d08443b274a6bb2773e09459479e4",
"apps/stock/web-app/src/features/backtest/BacktestDetailPageV2.tsx": "850d6a9f64bc11c8140a725f4cb5f899270eb9bb33e7b380c53d087b6cb13f2d",
"apps/stock/web-app/src/features/backtest/components/CanonicalResults.tsx": "820457a455bbe7791676319dc82bbf73e68d9da57e260f6e35ce723f029ceff9",
"apps/stock/web-app/src/features/backtest/components/CanonicalSetup.tsx": "a778105db06ded3645019f528e0ce2436aa5621ede1032fc69a1ccfe5fd81c11",
"apps/stock/web-app/src/features/backtest/components/RunsListWithMetrics.tsx": "f844eeb08fb3dd974c2a2f855b4c01e3252f778ff5252be94f7b8bf0174bb653",
"apps/stock/web-app/src/features/backtest/hooks/useBacktestV2.ts": "a035f631f107260d4a069e24b6153e6533b5890a27211731c4a0d0392e2ccc22",
"apps/stock/web-app/src/features/backtest/services/backtestApiV2.ts": "1fe7c23e8a12d9ff4e952b1be3c8c743cc806d6a56c966a9320d36091e3acf28",
"apps/stock/web-app/src/features/strategies/StrategyDetailPage.tsx": "e3854ab84b6ef1daed69dab0c0f0369fee19dd3457e10313cbe886f2c0c332bd",
"apps/stock/web-app/src/features/strategies/StrategyListPage.tsx": "f87b82af088a389d47b9ad2c28496e0adb3f730c4085e3d15173f8bf5bcdf080",
"apps/stock/web-app/src/features/strategies/components/BuiltinReview.tsx": "7af2c7de0aabd032e37dca37129ae3bb62d641b903773a72b98a5cafa081b647",
"apps/stock/web-app/src/features/strategies/components/StrategyParameterForm.tsx": "895a793f592b7351ed9581746199605b6ef0d845aac9e619c2165056fba28735",
"apps/stock/web-app/src/features/strategies/components/StrategySelection.tsx": "5ea0a513195a1b78ffc81e7fa70202c0aaef3b54da96728732aa2612b9dd85b3",
"apps/stock/web-app/src/features/strategies/services/strategyApi.ts": "1bb46b0406bc96817e0565118972ca6334bfc201c5ededb077c8f3635c5b510c",
"database/postgres/init/19-canonical-research.sql": "be6d7ab04523017d8bb6769b18aa706288286ffbda5e187a052872ab27218dc9",
"libs/core/types/src/financial-engine.ts": "f03f22774c8ad1ae17cdb381c7c30f20c8de7b28a77ef57de5064f134009bdff",
"libs/core/types/src/index.ts": "3f8d8a1bd2e460b6c5520df27ea9eb42228e40958e19eae18419e1e447abe162",
"scripts/import-research-dataset.ts": "8f5074b971cc9c3cc3cd4508cbd1da6272f83e31f5c2694ea935963054707321",
"scripts/package-builtin-strategies.ts": "e35988c768966986718808fc700886f65bd1b1c3754cd3f7993319bf1e5c4f77",
"scripts/test/architecture.test.ts": "0534a42d6921fc7cd9e3a816014affe9947dd64c1017aeaadcf071b5d5fb7bc8",
"test/e2e/fixture.ts": "f19cc8945ad489e175626df1b813527a6dd07c5fdceb09ccf94eef143fdd0adb",
"test/e2e/workbench.test.ts": "36c540a8fa074cc92f87c827728ceea1cc88dde4d3ec1e31fffbfb8a39cdabcf",
"test/fixtures/canonical-research.ts": "204c3a2565cc84aaea4ee3ad844381fdb506043e9e50fc7df0ea03fe86ce3f95",
"test/integration/canonical-durable-runner.test.ts": "ab7051dd578f39a08aeca2d1ab596b9324a32cc5cb4af10f73d265e89bf3a1cb",
"test/integration/canonical-workbench.test.tsx": "6cdb55719f72b8406ab4c300e1abf121daae1cee840e8c274f2de6bb2bfe5a71",
"test/integration/retained-strategy-worker.test.ts": "08cae3e8fa0d077c8750affe592a2f289b251dca6713e78d1c88e89596dc089f",
"test/integration/strategy-workbench.test.tsx": "511ff13931331ad2c242a74b69657faf670c31b469042c7828283e3702038327",
"test/postgres/canonical-durable-backtest.test.ts": "c034854d83af39daa3366ad845c49ee3653557be5469bc80b9747f3d16de2e08",
"test/postgres/canonical-research.test.ts": "2e27c9dcccd958c5b0fc3c29d50cb02a4751b1ad99865718929f45ab7a4966bf",
"test/postgres/catalog-backtest-drafts.test.ts": "5c19b8be2ded6b6d4db934763f8f2a09782adf3074895116440e9f131f75a9d3",
"test/postgres/dataset-catalog.test.ts": "fcea7827851481f146c7d81bd67052ccc8d38f15807d30b508cce51af46daa81",
"test/postgres/durable-backtest.test.ts": "462cc1ccd27f1e5e0561fd2acba6d451f654da010b84b37b0ebaa6b02162851f",
"test/postgres/migration-runner.test.ts": "026a74d85779d740e6f7372bf25c3f509131e5f262a0bb56d7b1701e28c86624",
"test/postgres/research-retention.test.ts": "4724d498d2fbd5c6fc52825cff545c5d0064e99c650aa27764f4ecd8530c3d28",
"test/postgres/research-runtime-isolation.test.ts": "b94f7ad1a4a5b272fbe1f15fca48b3b3e30918c3261846dcd95be8f779d4bda9",
"test/postgres/strategy-catalog.test.ts": "2edb7d920b63a40cfd6fc3cbe612032ac8888a21048004a7e28c5722609d0e15"
},
"checks": [
{
"command": "CARGO_BUILD_JOBS=2 bun run check",
"log": "/tmp/stock-bot-wave23.D3gFzn/check.log",
"outcome": "Build, source types, contracts, secrets, 43 utility, 44 calculation, 565 integration and 150 Rust tests passed (4 manual Rust tests ignored). Initial pure-contract allowlist and lint failures were fixed and rerun below; the aggregate command itself initially exited nonzero."
},
{
"command": "bun run test:tooling",
"log": "/tmp/stock-bot-wave23.D3gFzn/tooling-final.log",
"outcome": "93 tests / 12167 assertions passed after extending the guarded pure contract graph. No service/native/browser boundary exemptions."
},
{
"command": "bun run lint:check",
"log": "/tmp/stock-bot-wave23.D3gFzn/lint-final.log",
"outcome": "Passed on final application/library source."
},
{
"command": "bun run typecheck",
"log": "/tmp/stock-bot-wave23.D3gFzn/source-types-final.log",
"outcome": "Passed. Final strict changed-test gate also covers the subsequent shared rate and UI refinements."
},
{
"command": "PIPELINE_TEST_DATABASE_URL=<disposable PG> BACKTEST_TEST_REDIS_URL=<dedicated Redis /15> bun run test:postgres",
"log": "/tmp/stock-bot-wave23.D3gFzn/postgres.log",
"outcome": "150 tests / 1154 assertions passed, including retained execution, legacy durability, recovery, order execution, migrations and isolation."
},
{
"command": "PIPELINE_TEST_DATABASE_URL=<disposable PG> BACKTEST_TEST_REDIS_URL=<dedicated Redis /15> bun test test/postgres/canonical-research.test.ts test/postgres/canonical-durable-backtest.test.ts",
"log": "/tmp/stock-bot-wave23.D3gFzn/canonical-postgres-final.log",
"outcome": "Final release-addon admission/durability regressions passed: 13 tests / 106 assertions. Includes rate boundaries, genuine approval race in both lock orderings, exact UTC/DST warmup clock, direct SQL guards, frozen evidence and result reopening."
},
{
"command": "CARGO_BUILD_JOBS=2 bun run --cwd apps/stock/engine build:release",
"log": "/tmp/stock-bot-wave23.D3gFzn/native-release.log",
"outcome": "Restored release addon; SHA256 ef00eed556f5c32332d36a9a00ef710682e90deb00b54552e4b5c8bfdfbe8103 equals checkout release library and prior wave. No Rust financial source changes."
},
{
"command": "bun test test/integration/retained-strategy-worker.test.ts test/integration/canonical-durable-runner.test.ts test/integration/typescript-strategy-runtime.test.ts",
"log": "/tmp/stock-bot-wave23.D3gFzn/release-native-final.log",
"outcome": "16 tests / 83 assertions passed in the two existing requested files. Third named path does not exist; full integration run below includes the actual strategy-runtime.test.ts. No additional coverage claimed for the nonexistent path."
},
{
"command": "bun run test:integration",
"log": "/tmp/stock-bot-wave23.D3gFzn/integration-final.log",
"outcome": "576 tests / 4907 assertions passed against final release addon, including new unsupported-runner and browser identity/severity regressions."
},
{
"command": "PIPELINE_TEST_DATABASE_URL=<disposable PG> BACKTEST_TEST_REDIS_URL=<dedicated Redis /15> bun run test:e2e",
"log": "/tmp/stock-bot-wave23.D3gFzn/e2e.log",
"outcome": "9 workflows / 164 assertions passed, including actual approval -> retained canonical setup -> durable dispatch -> exact Rust fills/equity/provenance -> reload. Existing legacy, archive, cancellation and dataset workflows passed. Zero provider fallback in canonical fixture."
},
{
"command": "node_modules/.bin/tsc --project /tmp/stock-bot-wave23.D3gFzn/tests-tsconfig.json --noEmit",
"log": "/tmp/stock-bot-wave23.D3gFzn/strict-tests-final.log",
"outcome": "Passed for new and modern changed tests, shared/source dependencies, offline importer and browser fixture."
},
{
"command": "node_modules/.bin/eslint <new/modern changed test files> --max-warnings 0",
"log": "/tmp/stock-bot-wave23.D3gFzn/scoped-modern-test-lint.log",
"outcome": "Passed. Optional lint over all touched fixtures also reports 8 pre-existing curly-rule errors in two legacy files whose only edits add migration19; see scoped-test-lint.log."
},
{
"command": "node_modules/.bin/prettier --check <changed non-script TypeScript/JSON files>; git diff --check",
"log": "/tmp/stock-bot-wave23.D3gFzn/scoped-format-final.log",
"outcome": "Passed. New offline script was separately formatted; existing scripts retain their repository formatting convention."
}
],
"reviews": [
{
"reviewer": "/root/s03_review",
"scope": "Root contracts/API/SQL/import plus native prerequisite and approval-race assertions",
"outcome": "No remaining production must-fix; strengthened concurrency evidence and added missing native-capability failure regression."
},
{
"reviewer": "/root/s04_controls_audit",
"scope": "Retained worker and integrated UI/runner contract interactions",
"outcome": "Exact retained bytes/build and worker lifecycle accepted. Parent identity and canonical drawdown blockers fixed with focused regressions."
},
{
"reviewer": "/root/s04_feed_audit",
"scope": "Durable runner/repository, final API/rate boundaries, independent final UI guard review",
"outcome": "No remaining blockers after adverse-price-rate alignment; no legacy fallback or alternate simulator."
}
],
"limitations": [
"Partial R05 only: approved server-seeded built-ins; exactly one eligible retained v2 dataset series/asset/owner. Candidates, source-to-v2 inference, multi-asset/default activation and paper/live operations remain excluded.",
"Eligibility is an input/artifact preflight, not a remote-worker health check. Deploy native research runner/useRustEngine:true with matching immutable worker/addon/runtime/lock; mismatches fail durably.",
"Historical executable-build retention/restoration and exact reproduction workflow remain R12. Statistical policy v1 must retain its meaning; changed analytics require versioned readers.",
"Initial capital fits the existing two-decimal USD template column; exact engine financial fields remain eight-place strings. Fills are not reported as completed round trips; unsupported metrics remain null with reasons.",
"No production/development datasets, strategy catalog or schema were mutated. Offline import/seeding are explicit operator actions.",
"Performance work and benchmarks remain paused. No new-wave commit, push, PR, trading activation or default cutover."
],
"cleanup": "Both exact --rm disposable PostgreSQL/Redis containers stopped; development services untouched. Worktrees and evidence logs retained.",
"next": "After acceptance/commit, R03 research projects, hypotheses and evidence-linked findings APIs is independently ready. Keep R05 in progress until explicit source-v2 preparation and broader cutover scope are completed; R06/S06 remain blocked."
}
}

View file

@ -74,3 +74,34 @@ Keep migrations additive and previous results readable. Do not add a switch that
## 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.
## First vertical slice — 2026-10-23
The additive slice connects the approved, server-seeded catalog built-ins to the existing durable runner and canonical Rust session. It supports one eligible retained v2 dataset, one series/asset/owner, explicit USD cash-funded long-only execution and reporting settings. HTTP-published or cloned candidates remain excluded even if reviewed. R05 is **not complete**: source-request preparation into eligible v2 data and broader cutover remain outstanding. No multi-asset/default activation is implied.
The pinned request is `canonical-research/v1` in `apps/stock/config/src/contracts/canonical-research.ts`. It retains the full checksummed executable package and dependency lock, normalized parameters, review receipt, dataset hash, seed, complete replay/financial/reporting policies and installed worker/native/runtime build identity. Admission and review/archive serialize on the strategy-family row; accepted receipt replay precedes current eligibility checks. Later edits or review revocation affect new submissions only. Account risk boundaries use actual retained calendar opens, including warmup and DST; daily bounds remain exact UTC instants.
The child imports the retained ESM bytes through a temporary Blob URL, verifies the package/build before strategy factory execution, and runs the existing deterministic TypeScript callback loop against Rust. The current built-in constructor is not a fallback. Durable claiming, heartbeat, cancellation/reaping, lease fencing and atomic result persistence are shared with legacy work. A build mismatch, corrupt dataset or runner without canonical capability fails with a durable diagnostic and no legacy/provider fallback.
Migration 19 adds `canonical_result` to existing results and strengthens admission/result identity guards; it preserves retention triggers. `canonical-result/v1` bypasses legacy percentage conversion and placeholder metrics. Existing required legacy JSON columns contain JSON null for canonical results. F08 remains the statistical evaluator; exact Rust financial facts, zeros, unavailable reasons, owner books and fills survive reopening. Reporting policy version 1 must keep its existing meaning; changed statistics require a new version and compatible retained readers.
### Operator workflow and deployment prerequisite
Use the R01 offline packaging/seeding workflow for repository built-ins, review a retained version in the web catalog, save a backtest, then open Settings → Configure canonical research. An explicitly prepared v2 dataset can be retained with:
```sh
RESEARCH_DATASET_DATABASE_URL=<database> bun run scripts/import-research-dataset.ts --file <v2-dataset.json>
```
The importer validates content/hash before connecting, never infers calendars/actions, does not migrate tables and never overwrites retained bytes. Normal startup migrations own the schema. The canonical picker validates retained content and shows unsupported entries as unavailable. All capital, cost, risk and statistical settings are explicit; legacy settings are not silently translated. Initial capital must fit the existing USD-cent template column, while engine quantities/notionals retain checked eight-place decimals.
Deploy the existing **native research runner (`useRustEngine: true`)**, bundled `orchestrator/dist/native-worker.js`, engine wrapper/addon and lockfile from the same build. Keep executable files immutable while jobs launch/run. Eligibility is an input/artifact preflight, not a worker health check. Accepted runs fail closed after an incompatible deployment; retaining/restoring historical executable builds and an exact reproduction workflow remain R12. No production database was seeded or migrated by this development wave.
### Remaining work and release gates
- Add explicit provider/source preparation only when it can supply v2 availability, calendar, action coverage and universe evidence; do not relabel v1 data eligible or infer missing facts. Freeze the immutable preparation request and bind the first verified dataset atomically before decisions.
- Preserve the current single-asset restriction until the simultaneous-mark policy is resolved. Candidate execution still requires A02 isolation; paper/live operation and default simulator retirement remain separately gated.
- R03 research projects/hypotheses/findings is independently ready and can deliver useful product work without opening these execution gates. R06 remains dependent on completed R05 scope; do not mark it ready from this partial milestone alone.
- No profiling, performance optimization, benchmark runs, DSL, second job engine, simulator or deployment framework was added.
Final validation and source identity are recorded in `manifest.json` → `twenty_third_wave_validation` and the roadmap handoff.