stock-bot/docs/development/ROADMAP.md

9.4 KiB
Raw Blame History

Revised development roadmap

Baseline b7aeca4 · reviewed 2026-10-22 · First wave completed and committed; see manifest execution_scope

Authorization update: the owner requested a planning commit and implementation start, then authorized all pending commits. C01/C03/C04/W01 are completed, reviewed, validated and committed. Later tasks and economic/timing/trust-model decisions remain gated. Historical review statements describe the planning phase, not current authorization. No push, PR or trading operation is authorized.

Strategy and review outcome

Use TypeScript for strategies, research and the web product; one Rust kernel owns money, risk, matching and replay. Preserve durable decisions/checkpoints, transactional execution, frozen datasets, reviewed calculations and failure-oriented tests.

The skeptical review consolidates 52 separate task definitions into 43 scheduled tasks plus 5 conditional tasks. Four old IDs remain merged redirects, not extra work. This is a smaller delivery plan, not a smaller correctness standard. See review findings and dispositions, complete index and canonical manifest.

The existing web workbench improves during engine migration. Legacy results remain labelled; fixing controls or terminal valuation does not make same-bar economics trustworthy. C06 blocks shared-runtime legacy research rather than building another soon-to-be-retired simulator runtime.

Decisions to approve

Decision Direction Approval
ADR-001 TS product/strategy code; Rust financial authority; retain monolith and workers User-mandated
ADR-002 Maintained checked decimal; 8-place half-up postings; authoritative remaining cost; owner books from day one; initial cash-funded long-only account Explicit economic approval
ADR-003 Availability/event phases; open-only next-interval matching; explicit zero-latency convention; mark-open terminal policy; account risk-session clock Explicit execution/data approval
ADR-004 NAPI pull sessions in existing workers; tagged decision barriers; IPC for untrusted code; no embedded JS Plan approval
ADR-005 One Rust transition kernel; resident research state; private staged paper state under existing SQL transactions Plan approval
ADR-006 Existing API/queue/database; immutable versions, provenance and evidence retention; no laboratory framework Plan approval
ADR-007 Isolated untrusted code, research-only permissions/budgets; human-only paper promotion; live disabled Explicit trust-model approval
ADR-008 Measure actual paths; cursor replay and bounded trials; caching/DSL only when measured Plan approval; later optimization go/no-go

Long-only is a proposed first canonical model, not deletion of short history or a silent change to current paper accounts. If first-release shorts are required, approve borrowing/margin policy and fixtures before F01. C01/C03/C04/W01 do not depend on those unresolved economic choices.

Milestones

Milestone Tasks Exit criterion
M0: safe interim behavior C01/C02/C03/C04/C06; O01; P01 Scoped terminal/funding/input fixes; failed init cleans up; shared-runtime research rejected; migration lock and honest baseline measurements
M1: usable current workbench W01–W04 Save, submit, cancel, inspect and reopen tested in browser; unsupported controls hidden; legacy economic limitations visible
M2: canonical Rust/TS research F01/F02/F04–F08, D01, S01/S02; R01/R10/W03/C06 then R05 Owner-aware finance, deterministic replay, one TS strategy and retained input provenance work through durable runs
M3: useful research product R02/R03/R04/R11/R12 Catalog/workspace/dataset selection and original reproduction; metadata/UI proceed alongside engine work
M4: batch research and validation R06–R09, P04; S05 when ready Bounded sweeps, summary comparisons, OOS/reset-segment walk-forward and measured worker scaling; regime panels only with S05
M5: paper parity and AI research S03/S04, A01–A04 Recovery parity, operator readiness, isolated bounded AI experiments and evidence-linked human paper promotion
M6: remove duplicates / optional speed S06; conditional D04/P03/P05/P06/O02 Retire duplicate economics only after cutover proof; optional work requires demonstrated need

Rows are outcomes, not a sequential waterfall. S03 does not wait for research UI or statistical reporting; basic experiments do not wait for regime models or feature caches.

Critical path and parallel lanes

flowchart LR
  F01[Contract + economic fixtures] --> F02[Owned ledger] --> F04[Risk + reservations] --> F05[Matcher]
  F05 --> F06[Deterministic cursor replay]
  D01[Availability-aware eligible datasets] --> F06
  P01[Existing-path measurements] --> F06
  F06 --> F07[Bounded NAPI sessions] --> S01[TS decisions] --> S02[One SMA]
  C02[Boundary integrity] --> F07
  F06 --> F08[Canonical projections + reviewed TS statistics]
  S02 --> R05[Durable canonical runs]
  F08 --> R05
  PRODUCT[Versions / retained artifacts / safe submission] --> R05
  C06[Runtime containment] --> R05
  R05 --> R06[Bounded experiments] --> P04[Measured parallel trials]
  R06 --> R08[Chronological validation]
  R06 --> A01[Research authorization] --> A02[Untrusted code isolation]
  R08 --> A03[AI evidence loop]
  A02 --> A03
  S01 --> S03[Durable Rust paper adapter]

The full dependency graph includes all code and decision gates. Solid task edges are implementation prerequisites. Dotted task edges are release/conditional gates, not blockers to integrating component work.

After approval, run one financial-core owner alongside one web/product owner and one data/benchmark/metadata owner. Serialize shared DTOs, migration registry, worker protocol and actual overlapping files. Core tasks F01/F02/F04/F05 must not be split among agents simultaneously.

First wave: four independent assignments

Completed wave; the table records its original rationale. Exact prompts, paths, commands, commit references and verification results: FIRST-WAVE.md.

Task Why now Ownership / unlock
C01 Final native equity currently omits liquidation costs Legacy Rust engine/results only; preserves a known arithmetic fixture for migration
C03 Existing gross-capital guard ignores fee liability TS execution model only; safer interim paper behavior without a new financing model
C04 Partially initialized runtime can retain resources ModeManager lifecycle only; unlocks C06 containment
W01 Current user-facing cancellation/status can mislead Frontend controls/hooks only; unlocks W02 and the tested workbench

Recommend 3 simultaneous implementers, reserving one slot for coordination/independent review. Start C01 + C03 + W01; rotate C04 into the first freed slot, or start C04 first if runtime containment is the immediate operational need. These four have no mutual code dependencies and disjoint writable files. Four concurrent implementers are technically possible but not recommended without separate review capacity.

Next-ready work: C02, C06, W02, P01 and O01; execution still requires owner approval. F01/D01 require their ADR approvals as well. W02 follows W01 because they edit the same detail page, not because it requires the new engine.

Deferred and rejected

Conditional: shared feature cache D04; cross-trial resident datasets P03; large-detail pagination/storage P05; tiny DSL P06; expanded cross-service monitoring O02. Each has a measured/real-need trigger and is not a prerequisite for scheduled work.

Deferred economics: short/margin/borrow, multicurrency, full corporate actions, intrabar stops/OCO, detailed market impact and live brokers. Reject unsupported datasets/orders explicitly. The model is not generalized by pretending unsupported behavior exists.

Later product/research: embedded IDE, advanced optimizers, generalized ML training, Monte Carlo significance tooling. Basic immutable versions, chronological validation and evidence links are not deferred.

Rejected: competing TS/web simulators, wholesale Rust rewrite, hand-written decimal engine, new service/message bus/workflow framework, generic signal DSL, compatibility switches that re-enable defects, deleting reviewed calculations because they are currently unused. Keep existing local environment-file policy; no WCAG or cosmetic-dashboard scope here.

Execution governance

Only manifest.json owns status/assignment/dependencies. Task files own scope/acceptance. Read the reusable implementation, review, integration, planning briefs and quality gates.

Approval of planning artifacts is not permission to commit, push or create PRs. No application changes, runtime benchmarks or application-test pass claims are made by this revision.