40 lines
4.8 KiB
Markdown
40 lines
4.8 KiB
Markdown
# Orchestrator and engine cleanup
|
||
|
||
Baseline: `700ee09c`, inspected 2026-10-26. Owner authorized backlog creation, a planning commit, implementation, and one focused commit per completed task. The [manifest](backlog/manifest.json) is the sole scheduling source; [CL14–CL21 task files](backlog/README.md#e11--orchestrator-and-engine-cleanup) define scope and acceptance.
|
||
|
||
## Direction
|
||
|
||
Keep Rust authoritative for finance and replay, TypeScript for strategies and supervision, existing durable custody, and reviewed algorithms. Simplify supported interfaces and remove abandoned scaffolding. Do not reopen performance work, change economic policies, activate paper/live accounts, or replace existing services. Earlier CL01–CL13 independent-review status remains unchanged.
|
||
|
||
## Sequence and ownership
|
||
|
||
1. CL14 narrows canonical runner contracts and removes unused constructor requirements. CL15 independently removes verified unused Rust scaffolding after a calculation/caller inventory.
|
||
2. CL16 gives application startup/shutdown an explicit resource owner. Serialize its container.ts edits after CL14; no financial contract changes.
|
||
3. CL17 historical readers and CL20 typed worker results follow CL14. CL18 shared native parser/view follows CL15. CL19 pure strategy bookkeeping may proceed independently with exclusive paper/helper ownership.
|
||
4. CL21 private replay preparation extraction is deferred until an actual scheduler/calendar edit warrants it and the owner activates it. It is not required to finish this cleanup wave.
|
||
|
||
Use isolated worktrees with local workspace links/build outputs. Start at most two implementation agents and reserve a slot for independent review. Root owns manifest integration and commits; each agent supplies a scoped patch and exact check evidence. A task commit contains its acceptance evidence; its SHA is recorded in the next bookkeeping update rather than embedded in itself. No commits/pushes/PRs by agents unless specifically delegated.
|
||
|
||
## Gates
|
||
|
||
Run scoped tests and typechecks per story; native changes rebuild this checkout's addon and preserve existing economic fixtures. Use disposable PostgreSQL/Redis for custody boundaries. Independent review precedes completion and each task commit. Root runs combined `bun run check`; no benchmark or browser gate is needed for unchanged performance/UI behavior. Missing/skipped checks are explicit, never reported as passing.
|
||
|
||
Read-only audit baseline passed 17 architecture tests, 29 focused integration tests and 150 Rust tests (4 ignored). These are baseline evidence, not acceptance of future changes.
|
||
|
||
## Execution evidence
|
||
|
||
Implementation records will be appended here as tasks pass review and validation.
|
||
|
||
### CL15 — accepted
|
||
|
||
Removed 24 unused adapter/alternate-architecture files; moved two uncompiled reporting prototypes byte-for-byte into `engine/reference/legacy-reporting/` with explicit limitations. `MIGRATION.md` records every removal/preservation and current boundaries. Only compiled-code change removes the unused adapter module; canonical finance, legacy algorithms and native exports are unchanged.
|
||
|
||
Implemented by `/root/implement_cl15`; independently reviewed/integrated by `/root`. Both preserved files were compared against baseline bytes. Root rebuilt the addon and ran `bun test scripts/test/native-bindings.test.ts test/integration/native-terminal-equity.test.ts test/integration/native-market-data.test.ts scripts/test/architecture.test.ts`: 75 passed. `cargo test -p engine --lib --offline`: 150 passed, 4 ignored. `git diff --check` passed. The sandbox initially prevented NAPI from spawning `/bin/sh`; the authorized rebuild succeeded. No performance claim or stored-artifact migration.
|
||
|
||
### CL14 — accepted
|
||
|
||
The durable runner now requires canonical engine/repository capabilities. Legacy playback uses an explicit separate interface; concrete compatibility methods and historical formats remain. Removed unused adapter storage and runner engineName. Existing pause/resume/speed routes keep their production rejection behavior without SQL control writes. Negative type fixtures reject missing canonical capabilities.
|
||
|
||
Implemented by `/root/implement_cl14`; independently reviewed/integrated by `/root`. Root rebuilt the orchestrator and passed application typecheck/contract tests. Focused runner/workflow/worker/pool/isolation/architecture suite: 91 passed, 6,888 assertions. Disposable PostgreSQL canonical and retained durable-run suites: 33 passed, 181 assertions. No SQL/native/economic policy changes. Worker tests required execution outside the sandbox; two transient worktree Bun dependency-reading failures passed on separate reruns and root integration. Legacy-only provider-spy assertions were removed with the unused injection, not replaced with fabricated coverage. Full combined repository gate follows CL16 integration.
|
||
|
||
CL15 implementation commit: `bc2b8a89`.
|