3.9 KiB
CL21 — Extract private deterministic replay preparation when needed
Parent epic: E11. Priority/severity: P3 / Low. Complexity: M. Specialist: Rust deterministic replay.
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
financial/replay.rs:262-641 combines canonicalization, validation and schedule creation with stateful advance/submit/restore at :642 onward.
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
- Only activate when an upcoming calendar/timeframe change benefits from this split and the owner resumes it.
- Extract private preparation/schedule functions; keep existing public types and one Replay state owner.
- Preserve exact event order, input binding, barriers, financial trace and checkpoint bytes.
Likely files/modules:
apps/stock/engine/src/financial/replay.rsapps/stock/engine/src/financial/replay_tests.rs
Exclusions
No immediate implementation, new traits/managers, event framework, algorithm changes or performance work. 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-replay.
Parallelism: Deferred; sole replay owner when activated.
Acceptance criteria
- Private extraction leaves all public contracts/economic traces/checkpoints unchanged.
- Future-suffix, equal-time permutation and restore-before/after-every-event regressions pass.
- No additional mutable financial handle or module dependency cycle.
Mandatory verification
- cargo test -p engine --lib --offline
- Build native addon; bun test test/integration/native-replay.test.ts test/integration/native-replay-report.test.ts
- Exact event-order/checkpoint equality fixtures
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. This extraction is not performance work; no speed claims are part of its acceptance.
Risks and definition of done
Changing economic event ordering during a cosmetic move; intentionally deferred until there is practical need.
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.
Conditional review — October 28, 2026
No-go for now: no concrete calendar/timeframe change needs a replay-preparation split. Cosmetic movement of validated financial replay adds regression exposure without delivering a current capability. Reopen alongside a concrete replay preparation change that benefits from a private extraction. Status remains deferred, not implemented or silently cancelled. The owner authorized judgment on all remaining conditions and explicitly resumed performance work. Current review. Earlier audit findings above are historical evidence: F02–F07/S06 already resolved competing financial cores and the old insertion queue; they are not reasons to implement this extension now.