16 KiB
Revalidated audit findings
Baseline: b7aeca4, inspected 2026-10-22. No standalone structured audit/backlog was found in existing docs; this matrix reconciles the supplied audit concerns against current code. Existing informal docs remain historical context, not a second task tracker.
Verified means the cited implementation establishes the behavior or gap. Likely would mean an inference not yet reproduced; none is promoted to a confirmed defect here. Needs Investigation marks runtime/coverage questions that source alone cannot certify. No full application test suite or new performance benchmark was run during this planning-only task. Numeric acceptance examples are new test requirements, not fabricated passing tests.
FIN-01 — Critical / Verified
Both execution paths can act on a completed bar and fill against its current close; this is not a defensible default bar-close policy.
Evidence: apps/stock/engine/src/backtest/engine.rs:249; apps/stock/orchestrator/src/services/ExecutionService.ts:224.
Disposition: F01, F05, F06, W02.
FIN-02 — Critical / Verified
Native forced liquidation occurs after the last equity mark; reported final value reads that earlier mark, omitting terminal costs.
Evidence: apps/stock/engine/src/backtest/engine.rs:135; apps/stock/engine/src/backtest/simple_results.rs:308.
FIN-03 — Critical / Verified
Native order risk lacks a cash/fee reservation check. TypeScript compares gross exposure with pre-fee equity, so a fully funded buy can leave negative cash.
Evidence: apps/stock/engine/src/risk/mod.rs:89; apps/stock/orchestrator/src/execution/model.ts:234.
Disposition: C03, F01, F02, F04.
FIN-04 — Critical / Verified
Native fills notify every strategy. TypeScript realized P&L uses aggregate symbol cost basis, not per-strategy cost basis.
Evidence: apps/stock/engine/src/backtest/engine.rs:489; apps/stock/orchestrator/src/execution/model.ts:108.
Disposition: F01, F02, S02, S05.
FIN-05 — Critical / Verified
Rust and TypeScript separately implement fill/accounting behavior; the exposed native TypeScript callback method explicitly rejects callbacks.
Evidence: apps/stock/engine/src/api/backtest.rs:63; apps/stock/orchestrator/src/execution/SimulationExecution.ts:114.
Disposition: F01, F02, F05, F07, S01, S03, S06, R05, P01, P06.
FIN-06 — High / Verified
Native simulation fills complete requested quantities at the latest price without bar-volume participation; current risk must be enforced at acceptance and fill, including pending exposure.
Evidence: apps/stock/engine/src/backtest/engine.rs:374; apps/stock/engine/src/backtest/engine.rs:414.
Disposition: F01, F04, F05, S04.
FIN-07 — High / Verified
Daily return grouping, Sharpe/Sortino conventions and placeholder exposure/VaR produce incomparable or misleading native metrics.
Evidence: apps/stock/engine/src/backtest/simple_results.rs:374; apps/stock/engine/src/backtest/simple_results.rs:542.
Disposition: F08, W02, R07, R08.
DAT-01 — Critical / Verified
Dataset v1 has one bar timestamp and interval in the manifest, without explicit bar-end/availability semantics. Session dates cannot safely be treated as observation times.
Evidence: libs/core/types/src/historical-data.ts:90; apps/stock/orchestrator/src/services/StorageService.ts:177.
Disposition: F06, D01, R08, R11.
DAT-02 — High / Verified
Native input parsing silently discards malformed rows and truncates timestamps to seconds.
Evidence: apps/stock/engine/src/api/backtest.rs:217; apps/stock/engine/src/api/backtest.rs:290.
Disposition: C02.
DAT-03 — High / Verified
Missing VWAP is replaced with typical price; reported volume and provider-adjusted prices are not a complete corporate-action execution model.
Evidence: apps/stock/orchestrator/src/data/historical-dataset.ts:230; libs/core/types/src/historical-data.ts:98.
Disposition: D01.
DAT-04 — High / Verified
Historical storage selects QuestDB or daily MongoDB; the Mongo path explicitly rejects intraday requests. Ingestion-to-research routing requires an executable provider/interval capability check.
Evidence: apps/stock/orchestrator/src/services/StorageService.ts:287; apps/stock/orchestrator/src/services/StorageService.ts:299.
Disposition: D02.
RUN-01 — Critical / Verified
TypeScript research preparation calls the shared mode manager, which shuts down the current mode, so a research job can interfere with paper runtime.
Evidence: apps/stock/orchestrator/src/container.ts:101; apps/stock/orchestrator/src/core/ModeManager.ts:47.
Disposition: C06.
RUN-02 — High / Verified
Partial initialization can allocate services before isInitialized becomes true; shutdown exits early on that failure path.
Evidence: apps/stock/orchestrator/src/core/ModeManager.ts:55; apps/stock/orchestrator/src/core/ModeManager.ts:157.
Disposition: C04.
KEEP-01 — High / Verified
Preserve transaction-scoped account locking, idempotent fills/event fingerprints, durable decisions and recovery checkpoints; these are real behavior, not interfaces alone.
Evidence: apps/stock/orchestrator/src/execution/PostgresExecutionRepository.ts:46; apps/stock/orchestrator/src/execution/StrategyRecovery.ts:151.
Disposition: F01, C06, F02, F05, S01, S03, S06, A04.
KEEP-02 — High / Verified
Preserve frozen/hash-verified historical snapshots and fenced durable runner attempts; extend them instead of creating a second job engine.
Evidence: apps/stock/orchestrator/src/data/historical-dataset.ts:98; apps/stock/orchestrator/src/backtest/BacktestRunner.ts:190.
Disposition: F07, D01, D04, W04, R05, R06, R11, R12, P01, P03, P04, O02.
STR-01 — High / Verified
Registry is a useful small boundary, but its factories receive mode/execution services; BaseStrategy mixes author decisions, order submission and hidden signal filtering.
Evidence: apps/stock/orchestrator/src/strategies/StrategyRegistry.ts:7; apps/stock/orchestrator/src/strategies/BaseStrategy.ts:315.
Disposition: F02, D04, S01, S02, S05, S06, R01, R02, A02.
WEB-01 — High / Verified
The real backtest list/detail/API/SQL flow already exists. Strategy/project/experiment work should extend it; App strategy/analytics views are placeholders.
Evidence: apps/stock/web-app/src/app/App.tsx:24; apps/stock/web-api/src/services/backtest-v2.service.ts:211.
Disposition: W01, W03, W04, R01, R02, R03, R04, R06, R07, R09, P05, A01.
WEB-02 — High / Verified
Detail exposes native-unsupported pause/resume controls, omits cancel wiring, and overlapping polling/selection can apply stale responses.
Evidence: apps/stock/web-app/src/features/backtest/BacktestDetailPageV2.tsx:379; apps/stock/orchestrator/src/backtest/RustBacktestAdapter.ts:160.
WEB-03 — High / Verified
Definition creation auto-starts by default and catches submission failure; run creation has no client submission key. Re-run uses current definition rather than immutable original input.
Evidence: apps/stock/web-api/src/services/backtest-v2.service.ts:105; apps/stock/web-app/src/features/backtest/BacktestDetailPageV2.tsx:173.
WEB-04 — High / Verified
Existing results snapshot configuration and datasets but do not capture an immutable strategy artifact/engine build/model/seed bundle. Legacy projection can fall back to mutable definition fields.
Evidence: libs/core/types/src/backtest-run.ts:4; apps/stock/web-api/src/services/backtest-result.ts:107.
Disposition: F08, W02, R01, R03, R04, R05, R06, R07, R10, R11, R12, A03.
WEB-05 — High / Verified
SQL deletion cascades from definitions to runs/results; evidence retention must be defined before research findings reference those results.
Evidence: database/postgres/init/08-create-runs-table.sql:13; database/postgres/init/06-create-backtest-tables.sql:25.
OPS-01 — High / Verified
Migration runner uses an explicit safe allowlist; adding SQL alone will not run it. Concurrent migration admission lacks an advisory lock.
Evidence: apps/stock/web-api/src/migrations/migration-runner.ts:42; apps/stock/web-api/src/migrations/migration-runner.ts:57.
Disposition: O01.
PER-01 — Medium / Verified
EventQueue insertion scans prior events; native run is synchronous/one-shot and returns full JSON. Actual end-to-end bottleneck distribution still needs controlled measurements.
Evidence: apps/stock/engine/src/backtest/mod.rs:138; apps/stock/engine/src/api/backtest.rs:194.
Disposition: F06, F07, P01, P03, P04, P05, P06.
AI-01 — High / Verified
Existing small operator auth has read/admin/service roles, not a research-only principal or arbitrary-code isolation boundary.
Evidence: libs/core/di/src/http/security.ts:4; libs/core/di/src/http/security.ts:144.
Disposition: A01, A02, A03, A04.
RES-01 — High / Verified
Experimental Python feature preprocessing uses full-sample medians/quantiles; shuffled returns preserve ordinary Sharpe. These routines must not silently become validation evidence.
Evidence: apps/stock/analytics/src/ml/feature_engineering.py:386; apps/stock/analytics/src/analysis/statistical_validation.py:168.
Disposition: D04, S05, R08, R09, A03.
OPS-02 — High / Needs Investigation
Paper/live operational readiness is not demonstrated end-to-end. Live is deliberately disabled; preserve that gate until feed, reconciliation and broker-specific recovery are verified.
Evidence: apps/stock/orchestrator/src/core/ModeManager.ts:33; apps/stock/orchestrator/src/container.ts:152.
Corrections to over-broad audit conclusions
- The first web workflow is not missing: real list/detail/routes, transactional dispatch and committed-state websocket updates exist. W01–W04 repair and verify it.
- Durable recovery and frozen data are implemented, not planned placeholders. Preserve them through S03; do not replace them for language uniformity.
- Native callback support is explicitly unavailable; NAPI types alone do not imply TS strategies already run in Rust replay.
- Future/native/experimental strategy files and Python research routines are not project-gated runtime capabilities. Do not enable them simply because names appear in a dropdown.
- Provider-adjusted data is not automatically executable corporate-action accounting. Hashing a dataset does not establish point-in-time correctness.
- No runtime evidence here establishes real broker reliability. Live-disabled guards remain intact.
- Exact hardware throughput, storage hot spots, memory limits and sandbox availability require P01/A02 measurements, not architectural confidence.
- Preservation rules in cleanup audit remain: reviewed calculations, restored helpers and useful research prototypes are not disposable dead code.