feat(research): run retained strategies through durable canonical engine
This commit is contained in:
parent
d929db707a
commit
618fb9e33c
58 changed files with 6596 additions and 779 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue