docs(development): defer performance work and begin durable execution
This commit is contained in:
parent
ca5abdde0e
commit
5e9655de0b
6 changed files with 88 additions and 30 deletions
|
|
@ -4,7 +4,7 @@ Parent epic: E7. Priority/severity: P1 / High. Complexity: M. Specialist: TypeSc
|
|||
|
||||
Story: As a researcher, I can run realistic window-based TypeScript strategies without repeatedly paying avoidable state-validation or copying costs.
|
||||
|
||||
Scheduling source of truth: [manifest P08](../manifest.json). This story is planned, not authorized for implementation in S02's wave.
|
||||
Scheduling source of truth: [manifest P08](../manifest.json). **Deferred at the owner's request, 2026-10-23:** stop performance work for now and continue the remaining backlog. Initial inspection produced no application changes, profiling or benchmark runs. Resume only when requested.
|
||||
|
||||
## Evidence and root cause
|
||||
|
||||
|
|
|
|||
|
|
@ -57,3 +57,23 @@ Keep migrations additive and previous results readable. Do not add a switch that
|
|||
## Handoff
|
||||
|
||||
Report scope changes (if any), fixture expectations, API/schema changes, measurements, remaining limitations and commit/PR references once authorized. Request independent review; only the integration/planning owner may mark the manifest done.
|
||||
|
||||
## Execution contract — 2026-10-23
|
||||
|
||||
The owner stopped performance work and requested the remaining backlog after S02 was committed as `ca5abdd`. S03 is authorized under ADR-005; P08 is deferred. No profiling, throughput optimization or performance measurements belong to this wave.
|
||||
|
||||
**Native staging:** expose one stateless JSON `stageFinancialTransaction` boundary with initialize/apply variants, explicit version/session/account identity, canonical matching config or checkpoint, and one matching command. Rehydrate a private `MatchingAccount`, use its existing `apply`, and return the new checkpoint, native view, outcome and ordered per-effect views. No operator-reset or broker capability. Research retains its existing resident loop.
|
||||
|
||||
At the paper boundary, intermediate views may be reconstructed by restoring the pre-command private Rust `RiskAccount` and applying the exact retained effect commands through the same reducer, plus native managed-order updates. Compare every reconstructed outcome and final risk checkpoint/order state with the authoritative matcher. No TS accounting or final-view substitution. A replayed outcome emits no new effect rows; persist any native alias receipt without replaying historical effects into current state. Intermediate views are recovery facts, not decision-barrier tokens.
|
||||
|
||||
**Durable custody:** retain the existing SQL account row lock and transaction mechanism. New explicitly canonical account IDs use a versioned outer envelope containing the opaque native checkpoint plus TS cursors/pending work. Reuse generic JSON journal/checkpoint/input storage where compatible; add only the all-owner batch-intent storage actually needed. Native order snapshots and ordered fill journal facts are authoritative persisted records; do not introduce UUID remapping or redundant financial projections. Legacy repository reads/initialization explicitly refuse canonical envelopes, and canonical initialization refuses legacy state or changed configuration. No implicit account conversion.
|
||||
|
||||
**Actual strategy recovery:** a canonical paper runner accepts trusted normalized input commands/observations and optional decision scheduling metadata. S04 supplies the real feed/calendar/scheduler; the caller cannot supply a portfolio or revision. Capture the committed native view for a decision. Restore program JSON state, RNG state/draws, decision cursors and pending observation prefixes for every owner before evaluating all due owners against that same view. Functionally extract/reuse S01 staging logic; preserve its public research diagnostics and complete-retry behavior. Never invent a historical dataset hash for paper.
|
||||
|
||||
Atomically save all next checkpoints and one complete decision-batch intent. Dispatch that batch in a subsequent locked transaction and persist actual admission feedback with its financial snapshot/effects. Drain pending batch, then pending decision, then next input; do not admit later financial input while recovery is pending. Reject caller-supplied Submit commands on the paper input path. Per-owner pending observations must survive mixed-cadence restarts. Trusted program definitions are bound by declared metadata/version/seed/mode/initial state; immutable code artifact retention remains R01/R05.
|
||||
|
||||
**Failures:** SQL failure discards all private staged changes. Native validation/restore errors with no returned transition roll back. A returned native `Failed` outcome can contain a committed financial prefix: save its failed snapshot and exact ordered effects atomically, mark the account/batch terminal, then surface failure after commit. Never report successful execution or keep a running retry state. Publication occurs after commit and cannot roll back finance; stable readable journal IDs recover notification gaps without claiming exactly-once delivery.
|
||||
|
||||
Port existing failure/recovery scenarios to approved canonical economics. Legacy immediate cached-quote fills, UTC implicit resets, shorts and mutable policy reloads are not canonical compatibility promises. Preserve DAY/GTC/IOC/FOK under next-eligible-event timing and explicit venue/risk sessions, and retain legacy tests unchanged. Required added cases include old-command/alias retries after later fills, failed-prefix custody, shared-revision owner batches, mixed-cadence restart, pending-input recovery, SQL decision/intent/effect failures, lost commit acknowledgement and competing producers.
|
||||
|
||||
Native and TypeScript owners work in separate worktrees with an accepted wire-schema overlay. The native owner controls the new API/schema and minimal existing-schema exports; the durable owner controls custody, shared strategy staging and canonical recovery. Root controls integration/migrations acceptance; independent review checks invariants. No default/service/feed activation or paper trading operation is authorized by this task.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue