feat(research): add owner-aware ledger and intraday storage
Implement reviewed F02/D02: exact owner accounting, atomic funding checks, idempotent receipts and ledger checkpoints; connect existing EOD intraday storage through validated research admission without active financial-engine cutover.
This commit is contained in:
parent
b4af840d4e
commit
b65acccd91
15 changed files with 2704 additions and 104 deletions
|
|
@ -1,8 +1,8 @@
|
|||
# Revised development roadmap
|
||||
|
||||
Baseline `b7aeca4` · reviewed 2026-10-22 · **First five waves committed; ADR-002/003/004 approved; F01/D01 validated, uncommitted**
|
||||
Baseline `b7aeca4` · reviewed 2026-10-22 · **First six waves committed; F02/D02 validated, uncommitted**
|
||||
|
||||
Authorization update: the first five waves are independently reviewed, validated and committed. After the W04 closeout, the owner explicitly answered “yes” to ADR-002/003/004 as written and continuation with F01/D01. Those two tasks were independently reviewed and integrated from isolated worktrees; combined gates passed. They remain `review` / `validated_uncommitted` pending owner acceptance/commit. No other ADR is approved. Sixth-wave commits, pushes, PRs and trading operations remain outside scope.
|
||||
Authorization update: after explicitly approving ADR-002/003/004 and the validated F01/D01 implementation, the owner requested “commit and continue.” F01/D01 are committed as `b4af840`; F02/D02 were independently reviewed, integrated and validated from isolated worktrees. No other ADR is approved. Seventh-wave commits, pushes, PRs and trading operations remain outside scope.
|
||||
|
||||
## Strategy and review outcome
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ Completed wave; the table records its original rationale. Exact prompts, paths,
|
|||
|
||||
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.
|
||||
|
||||
O01/P01, W03 and W04 are committed. W04 adds validated real-browser end-to-end verification of the existing workbench. F01/D01 now have explicit ADR approval and passed integrated validation; subsequent tasks remain prerequisite-gated pending acceptance/commit.
|
||||
O01/P01, W03 and W04 are committed. W04 adds validated real-browser end-to-end verification of the existing workbench. F01/D01 passed integrated validation and are committed; F02/D02 passed integrated validation and await acceptance/commit, while subsequent tasks remain prerequisite-gated.
|
||||
|
||||
## Second-wave handoff — 2026-10-22
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ At the fifth-wave closeout, the readiness review found 32 remaining scheduled ta
|
|||
|
||||
## Sixth-wave handoff — 2026-10-22
|
||||
|
||||
F01 and D01 are independently accepted and `review` / `validated_uncommitted`. Base `243e9ab`; isolated worktrees under `/tmp/stock-bot-wave6.uIuYHz/`. Financial and dataset owners implemented in parallel, with an independent read-only reviewer; the integrator merged their common types exports.
|
||||
F01 and D01 are independently accepted and `done` / `validated_committed` in `b4af840`. Base `243e9ab`; isolated worktrees under `/tmp/stock-bot-wave6.uIuYHz/`. Financial and dataset owners implemented in parallel, with an independent read-only reviewer; the integrator merged their common types exports.
|
||||
|
||||
- **F01:** Pinned maintained decimal dependency; checked exact decimal ingress, fixed-8 half-away posting, bounded arithmetic, versioned Rust/TypeScript contracts, owner/decision identities and hand-derived economic fixtures. Strategy intents cannot parse as internal financial mutations. Safe integer, Unicode, strict decimal, overflow and wire-roundtrip regressions pass. The snapshot is only an economic projection. F02 still owns actual ledger/dedup transitions and operation-specific proportional basis arithmetic; generic multiply/divide was deliberately not introduced.
|
||||
- **D01:** Additive v2 normalizer retains interval/event/availability time, source sequence, explicit versioned calendars, execution-series selection, universe/action coverage and limitations. Hash-verified v1 conversion retains its parent hash and makes unverifiable legacy VWAP unknown. DST/half-days, delayed availability, conflicts, overlapping intervals, parent-hash syntax and prefix stability are tested. Unsupported action/adjusted execution data rejects; unknown coverage remains exploratory. Initial intraday support requires full-duration session-contained bars.
|
||||
|
|
@ -186,7 +186,27 @@ No PostgreSQL/Redis or Chromium rerun was needed for these additive, unused cont
|
|||
|
||||
Only the verified stalled sandbox test processes were stopped after the successful rerun. No user services or data were removed; worktrees and logs remain available.
|
||||
|
||||
Existing v1 snapshots and financial runtimes remain unchanged. F01 is not a working canonical ledger; D01 prefix tests are not F06 replay enforcement. No paper account conversion, extra backlog task, commit, push, PR or trading operation occurred. After acceptance/commit, the next coherent pair is **F02 owner-aware Rust ledger + D02 intraday storage integration**, with one financial owner and disjoint data ownership.
|
||||
Existing v1 snapshots and financial runtimes remain unchanged. F01 is not a working canonical ledger; D01 prefix tests are not F06 replay enforcement. The subsequent owner request authorized the F01/D01 commit and F02/D02 continuation, not a push, PR or trading operation.
|
||||
|
||||
## Seventh-wave handoff — 2026-10-22
|
||||
|
||||
F02/D02 are independently accepted and `review` / `validated_uncommitted`. Base `b4af840`; isolated worktrees under `/tmp/stock-bot-wave7.UIkAQD/`. Financial and data owners implemented in parallel; an independent reviewer checked both; root integrated all ten reviewed files with matching hashes.
|
||||
|
||||
- **F02:** Owner-keyed quantity, remaining basis, realized P&L and fees; exact rational intermediates rounded once into the maintained decimal posting type. Fee-inclusive funding, wrong-owner disposal, overflow and identity conflicts reject atomically. Command/fill aliases return original replay-labelled receipts, including after intervening operations. Explicit market marks remain separate from fill prices; owner-level marked postings reconcile to account equity. Same-session boundary repetition is an accepted no-op, not a false session-change effect. Ledger-only checkpoints retain and validate ordered receipts by replay; ordinary transitions touch only affected state.
|
||||
- **D02:** Existing EOD `1m`/`5m`/`1h` Mongo collections now feed the common research storage admission path. Unix-second timestamps/listing identities validate; supported-provider capability reports distinguish configuration/connectivity from coverage. Default QuestDB priority remains, explicit provider selection is available at the storage API, and missing/error ranges never switch to daily/synthetic data. Real writer/read/normalizer composition and repeated legacy native runs are tested on synthetic provider records; HTTP/Mongo transport alone is replaced.
|
||||
|
||||
Combined validation:
|
||||
|
||||
- `CARGO_BUILD_JOBS=2 bun run check`: 60 tooling, 43 utility, 35 calculation, 342 integration and 59 Rust tests passed, zero failures. Build, typecheck, contracts, lint and secret audit passed. One Rust test is intentionally ignored by the ordinary suite because it is a manually invoked release measurement.
|
||||
- Independent review: 22 financial Rust tests passed; 36 intraday/ingestion/dataset tests with 264 assertions passed. These overlap the combined totals, not additional independent cases.
|
||||
- Standalone strict TypeScript including the real ingestion import graph, explicit scoped ESLint, Prettier, scoped rustfmt and `git diff --check` passed. Cargo.toml line endings were normalized alongside its pinned dependency additions; no dependency upgrades occurred. Only num-bigint was newly added to the lockfile.
|
||||
- A repeatable release ledger workload runs 1k/10k prebuilt commands over one owner/asset or three owners/four assets, with three repeats and full state/effect byte equality. Transition, checkpoint-copy and restore times are recorded separately. Detailed raw measurements/build identities are in the manifest; these are not end-to-end backtest throughput or a speedup claim. Receipt memory and restore work grow with history; compaction is not implemented.
|
||||
|
||||
The manual release measurement also passed on the final integrated checkout (1 test, zero failures), with identical repeatability checksums to the author build. It is additional validation, not a skipped correctness test.
|
||||
|
||||
Limits: no F04 reservation/portfolio-risk policy, matcher, F06 replay, native session API, SQL/paper cutover, order/strategy/RNG session restoration or canonical-engine release. D02's provider selector is not a web/run-configuration control; no Mongo server-conformance, range-completeness or live-availability claim. Provider delayed-finalization caveats and the explicit bar-close simulation assumption are retained in the task evidence. PostgreSQL/Redis and Chromium suites were not rerun because their persistence/API/UI boundaries did not change. Existing build warnings remain.
|
||||
|
||||
Only exact identified stalled D02 sandbox test/worker processes were terminated after the successful escalated rerun; no development services/data were changed. Worktrees and logs remain available. The sixth-wave commit was made as requested; no seventh-wave commit, push, PR or trading operation occurred. Next after acceptance/commit: **F04 central cash reservations and portfolio risk enforcement**. Product/AI work remains subject to its unapproved ADRs.
|
||||
|
||||
## Deferred and rejected
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue