feat(research): add strategy catalog and versioned backtest setup

This commit is contained in:
Boki 2026-10-23 21:11:59 -04:00
parent 8cca0ee588
commit d929db707a
44 changed files with 4198 additions and 209 deletions

View file

@ -1,8 +1,8 @@
# Revised development roadmap
Baseline `b7aeca4` · execution 2026-10-23 · **R01 committed; R10 validated, uncommitted**
Baseline `b7aeca4` · execution 2026-10-23 · **R10 committed; R02 catalog/setup validated and awaiting acceptance/commit**
Authorization update: the owner requested “commit and continue with backlog”. R01 is committed as `4a2e5ad`; R10 is authorized under ADR-006. Performance work remains paused. New R10 implementation commits, pushes, PRs and trading/default-engine operations remain outside this continuation’s scope.
Authorization update: the owner requested “commit and continue”. R10 is committed as `8cca0ee`; R02 is authorized under ADR-006. Performance work remains paused. New R02 commits, pushes, PRs and trading/default-engine operations remain outside this continuation’s scope.
## Strategy and review outcome
@ -21,7 +21,7 @@ The existing web workbench improves during engine migration. Legacy results rema
| [ADR-003](architecture/decisions/003-time-and-datasets.md) | Availability/event phases; open-only next-interval matching; explicit zero-latency convention; mark-open terminal policy; account risk-session clock | Approved by owner, 2026-10-22 |
| [ADR-004](architecture/decisions/004-strategy-boundary.md) | NAPI pull sessions in existing workers; tagged decision barriers; IPC for untrusted code; no embedded JS | Approved by owner, 2026-10-22 |
| [ADR-005](architecture/decisions/005-durable-cutover.md) | One Rust transition kernel; resident research state; private staged paper state under existing SQL transactions | Approved by owner continuation, 2026-10-23; paper activation separately gated |
| [ADR-006](architecture/decisions/006-research-product.md) | Existing API/queue/database; immutable versions, provenance and evidence retention; no laboratory framework | Plan approval |
| [ADR-006](architecture/decisions/006-research-product.md) | Existing API/queue/database; immutable versions, provenance and evidence retention; no laboratory framework | Approved by owner continuation, 2026-10-23 |
| [ADR-007](architecture/decisions/007-ai-boundary.md) | Isolated untrusted code, research-only permissions/budgets; human-only paper promotion; live disabled | Explicit trust-model approval |
| [ADR-008](architecture/decisions/008-performance.md) | Measure actual paths; cursor replay and bounded trials; caching/DSL only when measured | Plan approval; later optimization go/no-go |
@ -508,3 +508,17 @@ R01 accepted and committed as `4a2e5ad`. R10 is independently reviewed and `vali
The initial sandbox run could not support native worker IPC or fixture network access; full checks were rerun successfully outside it. Optional broad strict legacy harness checks retain pre-existing errors, recorded in the manifest. Release addon is restored and matches the prior wave hash; Rust code and financial semantics were unchanged. Disposable fixture containers were removed; development services were untouched. No performance work, new R10 commit, push, PR or trading/default activation.
Legacy economic/provenance limitations remain explicit; retaining evidence does not certify its economics or create missing version history. Next: R02 strategy catalog UI and version-aware setup. R05 still owns retained-artifact execution and canonical durable cutover.
## Twenty-second-wave handoff — 2026-10-23
R10 is accepted and committed as `8cca0ee`, superseding its uncommitted handoff above. R02 is `review` / `validated_uncommitted`. Thirty-nine implementation/shared-contract/migration/test files were integrated from isolated backend/frontend owners and root browser/fixture integration, with independent review. Worktrees/logs remain under `/tmp/stock-bot-wave22.fPRkAC/`.
- **Catalog and versions:** Browse/create/edit/archive strategy families; select immutable versions; clone with frozen retry identity; compare retained bundled JavaScript/schema/identities as escaped text. Parameter forms preserve omission, explicit empty strings, false, zero, typed enums and decimal strings, and require exact server validation. Version-linked execution/deployment history remains explicitly unavailable.
- **Saved backtest setups:** Migration 18 retains exact version IDs and normalized parameters separately from execution settings. Create, save, reopen and edit catalog setups in the existing workbench. Archive/restore resets visible parameter state and validation together. Legacy pacing stays out of strict catalog settings. Existing supported legacy strategies retain their qualified independent workflow.
- **Admission boundary:** Every catalog version remains non-runnable, including approved built-ins. API, direct repository and SQL gates reject before run/outbox creation; accepted legacy receipts still replay first. No legacy alias fallback, catalog/legacy mode conversion, browser code execution or fabricated provenance.
- **Validation:** Full checks passed: 93 tooling, 43 utility, 44 calculation, **541 integration** and **150 Rust** tests (4 manual ignored), plus build/source/contracts/lint/secrets. Full disposable PostgreSQL/Redis: **137 tests / 1052 assertions**. Final unfiltered Chromium suite: **8 workflows / 117 assertions**, including catalog selection/save/reopen/edit/archive/clone and existing native/frozen-dataset workflows. Strict new/modern changed tests and scoped lint/format/diff checks pass. Exact commands, source hashes and limitations are in `manifest.json` → `twenty_second_wave_validation`.
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.