stock-bot/docs/development/backlog/tasks/CL15.md

4.2 KiB
Raw Blame History

CL15 — Retire abandoned Rust architecture scaffolding

Parent epic: E11. Priority/severity: P1 / High. Complexity: M. Specialist: Rust module graph and compatibility.

Scheduling and commit evidence: manifest. Scope baseline: 700ee09c. Owner authorized planning, implementation and one commit per completed task on 2026-10-26; CL21 remains conditional. Follow quality gates and agent instructions.

Outcome and evidence

lib.rs:5 compiles adapters; adapters/mod.rs:32 fabricates price-100 fills without calling its wrapped handler, :80 reports arbitrary orders Filled. Repository references are confined to scaffold and stale MIGRATION.md. Cargo/lib.rs and module declarations do not include the alternate architecture files.

The concrete benefit is a smaller supported execution surface with unchanged financial behavior. Findings are verified at the baseline; recheck caller/module evidence before edits. This does not imply active financial corruption.

Scope

  • Recheck module graph and repository callers; record a concise deletion/preservation inventory.
  • Remove unused placeholder adapter framework and truly obsolete duplicate architecture entrypoints/backups.
  • Inspect uncompiled metrics/results/framework for unique useful algorithms; preserve any such code in an explicitly retained location with honest status rather than silently deleting capability.
  • Replace misleading migration guidance with current canonical versus retained-compatibility map. Keep compiled legacy constructors, indicators, analytics and meaningful regression tests.

Likely files/modules:

  • apps/stock/engine/src/lib.rs
  • apps/stock/engine/src/adapters/
  • apps/stock/engine/src/lib_new.rs
  • apps/stock/engine/src/lib_simplified.rs
  • apps/stock/engine/src/test_lib.rs
  • apps/stock/engine/src/api_new/
  • apps/stock/engine/src/domain.bak/
  • apps/stock/engine/src/events.bak/
  • apps/stock/engine/src/modes.bak/
  • apps/stock/engine/src/backtest/results.rs
  • apps/stock/engine/src/backtest/metrics_calculator.rs
  • apps/stock/engine/src/strategies/framework/
  • apps/stock/engine/MIGRATION.md

Exclusions

No blanket legacy API deletion, rewriting algorithms, adding a new framework, loader/provenance changes or financial-core edits. Preserve retained strategy packages/datasets/results, useful algorithms, reviewed calculations, durable recovery and the existing .env files. No pushes, PRs or paper/live activation.

Dependencies and ownership

Prerequisites: None; inspect existing integrated baseline rather than reopening earlier cleanup tasks.

Write locks: native-module-graph.

Parallelism: Independent of TS contract/lifecycle work. Serialize Rust module and native build output with CL18.

Acceptance criteria

  1. No compiled adapter can manufacture placeholder fills; no repository consumers lose supported APIs.
  2. Every removed file is classified by module/caller evidence; unique useful calculations remain discoverable.
  3. Native ESM/CJS constructors and canonical reports retain existing behavior; current docs no longer recommend abandoned scaffolding.

Mandatory verification

  • cargo test -p engine --lib --offline
  • Build native addon from this checkout; bun test scripts/test/native-bindings.test.ts test/integration/native-terminal-equity.test.ts test/integration/native-market-data.test.ts
  • bun test scripts/test/architecture.test.ts

Use isolated worktrees/build outputs and disposable safety databases/Redis only. Never rebaseline financial fixtures to hide changed behavior. Integrator runs repository checks on the combined source. Performance work remains deferred; no speed claims are part of acceptance.

Risks and definition of done

Mistaking retained algorithms/public compatibility APIs for dead scaffolding; native rebuild/provenance required.

Done requires scoped tests, independent reviewer acceptance, integration verification, and a focused commit. The manifest owns status and evidence; implementers do not edit it. Root records each completed commit in the next bookkeeping update; the task completion commit includes its tests/reviewer evidence, avoiding self-referential hashes. Unrelated prior CL01–CL13 review status remains unchanged.