docs(development): accept S01 and pin trusted SMA worker scope
This commit is contained in:
parent
2bcadbd117
commit
4f6e44a853
4 changed files with 103 additions and 34 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Canonical development backlog
|
||||
|
||||
**First thirteen waves committed; S01 validated and awaiting acceptance.** F08 is accepted as `3838295`; `0870b55` records completion and the next execution contract. S01 adds stateful TypeScript decisions over Rust sessions with per-owner cursors and staged state. Consult manifest execution_scope and [current wave](../ROADMAP.md#fourteenth-wave-execution--2026-10-23). ADR-002/003/004/005 are approved; other policies/default cutovers remain gated.
|
||||
**First fourteen waves committed; S02 is in progress.** S01 is accepted as `2bcadbd`. S02 adds one explicit long-only SMA version and trusted selection through the existing native worker. Consult manifest execution_scope and [current wave](../ROADMAP.md#fifteenth-wave-execution--2026-10-23). ADR-002/003/004/005 are approved; other policies/default cutovers remain gated.
|
||||
|
||||
## One source of truth
|
||||
|
||||
|
|
@ -52,9 +52,9 @@ Relative size: S narrow correction, M coherent boundary, L sensitive owner-contr
|
|||
|
||||
| Task | Priority / status | Implementation prerequisites | Release gate | Specialist / size |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| [S01 Run deterministic TypeScript decisions on Rust sessions](tasks/S01.md) | P0 / review | F07, ADR-004, ADR-005 | — | TypeScript trading infrastructure / M |
|
||||
| [S02 Adapt one SMA strategy for the first canonical path](tasks/S02.md) | P1 / blocked | S01 | — | TypeScript strategy/quant engineering / M |
|
||||
| [S03 Adapt durable paper transactions to Rust financial reducers](tasks/S03.md) | P0 / blocked | S01, C06, ADR-005 | — | Durable execution/Rust integration / L |
|
||||
| [S01 Run deterministic TypeScript decisions on Rust sessions](tasks/S01.md) | P0 / done | F07, ADR-004, ADR-005 | — | TypeScript trading infrastructure / M |
|
||||
| [S02 Adapt one SMA strategy for the first canonical path](tasks/S02.md) | P1 / in_progress | S01 | — | TypeScript strategy/quant engineering / M |
|
||||
| [S03 Adapt durable paper transactions to Rust financial reducers](tasks/S03.md) | P0 / ready | S01, C06, ADR-005 | — | Durable execution/Rust integration / L |
|
||||
| [S04 Establish a verified paper feed and operator safety gate](tasks/S04.md) | P1 / blocked | S02, S03 | — | TypeScript trading infrastructure / M |
|
||||
| [S05 Add a small composable multi-signal regime example](tasks/S05.md) | P2 / blocked | S02, F08 | R08 | Quant strategy research / M |
|
||||
| [S06 Retire duplicate simulator paths after cutover proof](tasks/S06.md) | P2 / blocked | S03, S04, R05 | — | TypeScript trading infrastructure / M |
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"schema_version": 1,
|
||||
"plan_revision": "2026-10-23.32",
|
||||
"plan_revision": "2026-10-23.33",
|
||||
"repository_base": "b7aeca4",
|
||||
"plan_status": "fourteenth_wave_in_review",
|
||||
"plan_status": "fifteenth_wave_in_progress",
|
||||
"execution_authorized": true,
|
||||
"execution_scope": {
|
||||
"authorized_by": "User: commit all of it and continue (2026-10-23), after handoff explicitly named S01 and linked pending ADR-005. F08 accepted and committed as 3838295; continue with S01 under ADR-004/005. No paper/default cutover or unrelated ADR approval.",
|
||||
"authorized_by": "User: commit and continue (2026-10-23), after S01 validated handoff named S02. S01 accepted and committed as 2bcadbd. Continue only S02 under approved ADR-002/003/004/005.",
|
||||
"tasks": [
|
||||
"S01"
|
||||
"S02"
|
||||
],
|
||||
"permissions": [
|
||||
"accepted_wave13_commits",
|
||||
"accepted_wave14_commits",
|
||||
"isolated_implementation",
|
||||
"local_tests",
|
||||
"local_integration_review",
|
||||
|
|
@ -641,7 +641,11 @@
|
|||
"apps/stock/engine/src/financial/replay_tests.rs (accessor regression only)"
|
||||
],
|
||||
"review_notes": "Independent boundary and data/quant reviewers accepted frozen production code. Boundary reviewer implemented disjoint benchmark files; root independently reviewed those. Root integrated 22 matching files, validated final tests/build, disposable durability suites and debug/release measured workloads. Native module ordering and three test-only type corrections were revalidated. No active runner cutover, S01 state framework, F08 metrics or SQL changes.",
|
||||
"reviewed_by": ["/root/wave11_boundary_review", "/root/wave11_data_review", "/root"],
|
||||
"reviewed_by": [
|
||||
"/root/wave11_boundary_review",
|
||||
"/root/wave11_data_review",
|
||||
"/root"
|
||||
],
|
||||
"verification_reference": "ROADMAP.md#eleventh-wave-handoff--2026-10-23",
|
||||
"accepted_by": "Owner: commit everything (2026-10-23). Performance assessment requested; no optimization implementation authorized."
|
||||
},
|
||||
|
|
@ -699,7 +703,10 @@
|
|||
}
|
||||
],
|
||||
"review_notes": "Independent reviews accepted native/reporting and analytics slices. 22 owner files integrated with exact hashes plus root native/worker/analytics composition tests. Repository gates, disposable recovery and release comparisons pass; shared-host drift checked against unchanged release control. Financial event IDs/checkpoints/trace/projection and legacy paths retained. See thirteenth_wave_validation; R05 owns persisted/public-result cutover.",
|
||||
"reviewed_by": ["/root/wave12_review", "/root"],
|
||||
"reviewed_by": [
|
||||
"/root/wave12_review",
|
||||
"/root"
|
||||
],
|
||||
"verification_reference": "ROADMAP.md#thirteenth-wave-execution--2026-10-23",
|
||||
"accepted_by": "Owner: commit all of it and continue (2026-10-23). Accepted source hashes reverified before commit 3838295."
|
||||
},
|
||||
|
|
@ -904,7 +911,7 @@
|
|||
"epic": "E4",
|
||||
"priority": "P0",
|
||||
"severity": "Critical",
|
||||
"status": "review",
|
||||
"status": "done",
|
||||
"dependencies": [
|
||||
"F07"
|
||||
],
|
||||
|
|
@ -929,18 +936,31 @@
|
|||
"assignment": "/root/s01_contract",
|
||||
"branch": "wave14/s01-runtime",
|
||||
"pull_request": null,
|
||||
"completed_commit": null,
|
||||
"completed_commit": "2bcadbd117c288577a26615e6d132cf49ea074e4",
|
||||
"blocker": null,
|
||||
"release_gates": [],
|
||||
"worktree": "/tmp/stock-bot-wave14.JYfazy/s01",
|
||||
"integration_base": "3838295eec8e84a46115462ca6c5d5c8c7fab66b",
|
||||
"integration_state": "validated_uncommitted",
|
||||
"integration_state": "validated_committed",
|
||||
"implementation_slices": [
|
||||
{ "owner": "/root/s01_contract", "scope": "Typed strategy contract, shared pull driver, staged per-owner runtime, native admission-feedback parser and focused tests", "worktree": "/tmp/stock-bot-wave14.JYfazy/s01", "branch": "wave14/s01-runtime" },
|
||||
{ "owner": "/root/s01_test_review", "scope": "Disjoint real-native multi-owner failure/retry/integrity tests and measured strategy fixture after pinned API handoff", "worktree": "/tmp/stock-bot-wave14.JYfazy/verification", "branch": "wave14/s01-verification" }
|
||||
{
|
||||
"owner": "/root/s01_contract",
|
||||
"scope": "Typed strategy contract, shared pull driver, staged per-owner runtime, native admission-feedback parser and focused tests",
|
||||
"worktree": "/tmp/stock-bot-wave14.JYfazy/s01",
|
||||
"branch": "wave14/s01-runtime"
|
||||
},
|
||||
{
|
||||
"owner": "/root/s01_test_review",
|
||||
"scope": "Disjoint real-native multi-owner failure/retry/integrity tests and measured strategy fixture after pinned API handoff",
|
||||
"worktree": "/tmp/stock-bot-wave14.JYfazy/verification",
|
||||
"branch": "wave14/s01-verification"
|
||||
}
|
||||
],
|
||||
"review_notes": "Exact eight-file integration independently reviewed; root added permanent author type gate. Full repository, disposable recovery and release checks passed. Whole-attempt retry, mixed cadence, staged owner state/RNG and native admission feedback verified. Rejected Promise cleanup and missing envelope tags fixed before acceptance. Paired 48-session measurement preserves exact economic identities; see fourteenth_wave_validation. Trusted direct programs only; S02/S03/R05 own later worker/paper/default integration. Owner accepted and authorized commit on 2026-10-23.",
|
||||
"reviewed_by": [
|
||||
"/root/s01_final_review",
|
||||
"/root"
|
||||
],
|
||||
"review_notes": "Exact eight-file integration independently reviewed; root added permanent author type gate. Full repository, disposable recovery and release checks passed. Whole-attempt retry, mixed cadence, staged owner state/RNG and native admission feedback verified. Rejected Promise cleanup and missing envelope tags fixed before acceptance. Paired 48-session measurement preserves exact economic identities; see fourteenth_wave_validation. Trusted direct programs only; S02/S03/R05 own later worker/paper/default integration.",
|
||||
"reviewed_by": ["/root/s01_final_review", "/root"],
|
||||
"verification_reference": "ROADMAP.md#fourteenth-wave-execution--2026-10-23"
|
||||
},
|
||||
{
|
||||
|
|
@ -949,7 +969,7 @@
|
|||
"epic": "E4",
|
||||
"priority": "P1",
|
||||
"severity": "High",
|
||||
"status": "blocked",
|
||||
"status": "in_progress",
|
||||
"dependencies": [
|
||||
"S01"
|
||||
],
|
||||
|
|
@ -962,15 +982,33 @@
|
|||
"complexity": "M",
|
||||
"specialization": "TypeScript strategy/quant engineering",
|
||||
"write_locks": [
|
||||
"strategy-builtins"
|
||||
"strategy-builtins",
|
||||
"worker-protocol"
|
||||
],
|
||||
"parallel_policy": "Allowed only with satisfied dependencies/approvals and disjoint write locks AND actual files; see agents/integration.md.",
|
||||
"assignment": null,
|
||||
"branch": null,
|
||||
"parallel_policy": "Disjoint strategy/schema and worker owners; worker consumes root-accepted selection overlay. Root owns planning/integration; independent review controls acceptance.",
|
||||
"assignment": "/root/s02_strategy",
|
||||
"branch": "wave15/s02-strategy",
|
||||
"pull_request": null,
|
||||
"completed_commit": null,
|
||||
"blocker": null,
|
||||
"release_gates": []
|
||||
"release_gates": [],
|
||||
"worktree": "/tmp/stock-bot-wave15.zi3GmP/strategy",
|
||||
"integration_base": "2bcadbd117c288577a26615e6d132cf49ea074e4",
|
||||
"integration_state": "isolated_implementation",
|
||||
"implementation_slices": [
|
||||
{
|
||||
"owner": "/root/s02_strategy",
|
||||
"scope": "Strict trusted selection and versioned long-only SMA with dedicated tests",
|
||||
"worktree": "/tmp/stock-bot-wave15.zi3GmP/strategy",
|
||||
"branch": "wave15/s02-strategy"
|
||||
},
|
||||
{
|
||||
"owner": "/root/s02_worker",
|
||||
"scope": "Additive trusted worker request/result supervision with dedicated tests",
|
||||
"worktree": "/tmp/stock-bot-wave15.zi3GmP/worker",
|
||||
"branch": "wave15/s02-worker"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "S03",
|
||||
|
|
@ -978,7 +1016,7 @@
|
|||
"epic": "E4",
|
||||
"priority": "P0",
|
||||
"severity": "Critical",
|
||||
"status": "blocked",
|
||||
"status": "ready",
|
||||
"dependencies": [
|
||||
"S01",
|
||||
"C06"
|
||||
|
|
@ -3654,7 +3692,7 @@
|
|||
"files": 1153,
|
||||
"scope": "Tracked and nonignored untracked file paths/content, including dirty changes; generated ignored artifacts excluded."
|
||||
},
|
||||
"workload": "1k/10k total bars;1asset/1owner or10assets/2owners;2fresh processes ×2fresh native sessions, second reverses callback evaluation. Alternating unit targets,1% fee,initialcapital1000000,600bars/session with retained gaps. No randomness, storage, queue, indicators or parallel simulation.",
|
||||
"workload": "1k/10k total bars;1asset/1owner or10assets/2owners;2fresh processes \u00d72fresh native sessions, second reverses callback evaluation. Alternating unit targets,1% fee,initialcapital1000000,600bars/session with retained gaps. No randomness, storage, queue, indicators or parallel simulation.",
|
||||
"equality": "Exact complete normalized result hashes match every repeat and debug/release profile. Independent integer-cent cash/equity/remaining basis/owner fees/fill count oracle passes. Economically different results invalidate measurement.",
|
||||
"timing": "Report separates imports, detached D01 verify, once-per-child prepared-JS mapping, fresh native load, actual advance/submit/decision/finalize and validation/hash. Native call timers include JS encoding/schema/immutable projection plus Rust work/serialization, not pure crossing cost. Trial wall includes load+replay+finalization+oracle/hash, excludes one-time preparation/import and parent aggregation. No explicit warmup or OS-cache flush; means only, not latency distributions. Shared host; release focused checks briefly overlapped initial measurement, so not an isolated performance SLA.",
|
||||
"workloads": [
|
||||
|
|
@ -5217,7 +5255,9 @@
|
|||
"cleanup": "Stopped only exact --rm fixture containers a4edf7d7b61f944d9b42f93fe2fb77c9be565efabfa9292aeb8d34de3d1c8c85 and 604c940db286ab408bd60963116355428f0efa216725ca2e269639e1572fc1dd. Development services untouched; isolated worktrees/logs retained.",
|
||||
"next": "At handoff S01 required ADR-005; the next owner instruction accepted F08 and continued the explicitly named S01/ADR-005 direction. See fourteenth_wave_notes. R01/R11 remain gated by ADR-006."
|
||||
},
|
||||
"fourteenth_wave": ["S01"],
|
||||
"fourteenth_wave": [
|
||||
"S01"
|
||||
],
|
||||
"fourteenth_wave_base": "3838295eec8e84a46115462ca6c5d5c8c7fab66b",
|
||||
"fourteenth_wave_notes": [
|
||||
"Owner: commit all of it and continue, after the handoff named S01 and linked pending ADR-005. F08 committed after exact accepted-source hash verification; S01 is now authorized under ADR-004/005.",
|
||||
|
|
@ -5432,5 +5472,15 @@
|
|||
],
|
||||
"cleanup": "Stopped only disposable --rm fixtures 0547b8ad5629caea34a7191d44c09beba2f58770dcc2d57e938526a39118864f and a6b5721f9cce058e341abbba8f33234bda1cef318ae3d438fa4e95181f4feeac. Development services untouched; worktrees/logs/archives retained.",
|
||||
"next": "After acceptance: S02 one SMA program and explicit trusted worker composition; no additional economic-policy approval needed for its scoped task. R01/R11 await ADR-006; S03/R05 retain paper/default activation gates."
|
||||
}
|
||||
},
|
||||
"fifteenth_wave": [
|
||||
"S02"
|
||||
],
|
||||
"fifteenth_wave_base": "2bcadbd117c288577a26615e6d132cf49ea074e4",
|
||||
"fifteenth_wave_notes": [
|
||||
"S01 accepted after frozen-hash and diff verification. No new-wave implementation commit yet.",
|
||||
"Pinned S02 explicit long-only version, reviewed crossover arithmetic, exact owner-budget whole-share sizing, monotonic available observations and native Fresh gating; legacy semantics unchanged.",
|
||||
"Minimal trusted worker selection/result envelope binds exact strategy provenance and native identity/policy/format. No callback/source/path or checkpoint transport.",
|
||||
"S03 is code/ADR-ready but not authorized in this wave. R05 owns durable/default/public result cutover; ADR-006/007/008 remain pending."
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,11 @@ No unrelated refactor, new service or broker activation.
|
|||
|
||||
## Likely files and ownership
|
||||
|
||||
- apps/stock/orchestrator/src/strategies/StrategyRegistry.ts
|
||||
- apps/stock/orchestrator/src/strategies/BaseStrategy.ts
|
||||
- apps/stock/orchestrator/src/strategies/builtin/SmaCrossoverStrategy.ts
|
||||
- apps/stock/orchestrator/src/strategies/builtin/MeanReversionStrategy.ts
|
||||
- `apps/stock/orchestrator/src/contracts/builtin-strategy.ts` and `strategies/canonical-sma.ts`: one strategy/schema owner.
|
||||
- `apps/stock/orchestrator/src/contracts/strategy-replay.ts` and the existing native worker protocol/child/supervisor: a disjoint worker owner consumes the pinned selection schema.
|
||||
- Dedicated strategy and worker integration tests/fixtures follow those owners. Root owns planning/integration; review is independent.
|
||||
|
||||
Write locks: strategy-builtins. One agent owns this change. Lock names do not override actual overlapping files.
|
||||
Preserve the legacy registry, BaseStrategy and built-ins unchanged; reuse their alias mapping. No generic registry rewrite. Actual overlapping files override symbolic locks.
|
||||
|
||||
## Dependencies and blockers
|
||||
|
||||
|
|
@ -58,8 +57,20 @@ Report scope changes (if any), fixture expectations, API/schema changes, measure
|
|||
|
||||
## S01 integration handoff — 2026-10-23
|
||||
|
||||
Consume `contracts/canonical-strategy.ts` and `backtest/strategy-runtime.ts`: typed synchronous programs return JSON next state and financial intent; the host owns per-instance seeds/cursors and Rust owns admission/accounting. Reuse reviewed incremental calculation semantics. Preserve the current legacy factory contract; add only the small trusted built-in resolver/composition needed to select the canonical SMA version deliberately.
|
||||
Consume `contracts/canonical-strategy.ts` and `backtest/strategy-runtime.ts`: typed synchronous programs return JSON next state and financial intent; the host owns per-instance seeds/cursors and Rust owns admission/accounting. Reuse reviewed calculation semantics. Preserve the current legacy factory contract; add only the small trusted built-in resolver/composition needed to select the canonical SMA version deliberately.
|
||||
|
||||
Wire that reviewed built-in through the existing native worker with explicit strategy/version/parameters and retained dataset/config inputs. Never serialize callback functions/source or accept arbitrary module paths. Keep legacy and conformance requests intact; unknown canonical strategies/versions reject explicitly. R05 still owns durable default and public-result migration. No browser/default activation or paper migration is implied here.
|
||||
|
||||
S01 retries whole attempts from frozen inputs and original state/seeds. Its snapshots are diagnostic, not native resume tokens. `sma_checkpoint_restore` should verify indicator state serialization/recomputation and full retry equivalence without introducing TS-only mid-run financial resume. Admission feedback is not a complete fill-event feed; positions/open orders remain authoritative native views.
|
||||
|
||||
## Execution contract — 2026-10-23
|
||||
|
||||
S01 is accepted as `2bcadbd`. The trusted selection is `{ownerId, strategyId, strategyVersion, seed, instrumentId, seriesId, ownerBudget, parameters: {fastPeriod, slowPeriod}}`. Existing SMA aliases normalize to `sma_crossover`; the explicit new version is `sma-crossover-long-only/v1`. Reject legacy quantity/fraction/holding-period parameters and unknown fields on this version. It deliberately differs from legacy short entries and account-wide sizing.
|
||||
|
||||
One instance consumes one declared instrument/series included in its native cadence. Use the reviewed `movingAverageCrossover` with a bounded `slowPeriod + 1` close window, including warmup and its existing equality rules. Process availability-order observations only if their `(event_time, source_sequence)` advances; delayed older observations do not rewrite history. A real golden cross establishes a whole-share target `floor(ownerBudget / close)` using exact decimal inputs; no minimum-one purchase. Hold that target through the bullish phase, including ties; a death cross establishes zero. Repeat the same target on fresh selected input so native target reconciliation preserves or retries commitments. Missing, stale or no-new selected input emits sparse empty targets, preserving existing GTC intent. Match the last accepted observation to the native Fresh input before emitting a target. Budget is desired gross notional, not a new hard risk allocation; Rust alone handles fees, gaps, funding and risk.
|
||||
|
||||
Keep finite plain JSON indicator state; validate reconstruction without exposing initial-state injection over IPC. Whole-attempt retries start from original inputs. No rolling-sum arithmetic rewrite or feature-cache framework.
|
||||
|
||||
Add strict `runStrategyReplay` version1 requests with existing dataset/config/eventBudget/resultFormat and trusted selections only. Return a versioned `strategyReplayResult` envelope containing normalized selections actually executed and the unchanged native result. The parent captures detached normalized inputs before fork and binds selections, native identity, policy and format on return. No callbacks, source, arbitrary paths, checkpoint transport or second worker infrastructure. Existing legacy/conformance requests remain supported.
|
||||
|
||||
Required additions: warmup/tie/delayed-bar/freshness cases; exact budget and native fee/gap rejection; separate owners; whole retry and JSON reconstruction; real worker/direct equality in all formats; malformed/tampered responses, crashes and cancellation (including result-before-close); legacy worker regressions. Full repository and disposable recovery gates follow integration. Measure representative release SMA replay without calling it pure callback cost or claiming a performance improvement.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue