Repository navigation
REQ-CORE-006: Typed ledger/flow records and phase-level invariant hooks - #198
Closed
zendev-author[bot] wants to merge 2 commits into
Closed
zendev-author[bot] wants to merge 2 commits into
zendev-author[bot] wants to merge 2 commits into
Conversation
Implement M2 diagnostic projection with typed MONEY and GOOD signed deltas plus PHYSICAL_LOSS attribution. Add phase-level invariant hooks for deterministic reconciliation with configurable tolerance. - ledgerFlow.ts: Define MoneyFlow, GoodFlow, PhysicalLoss records with tick/phase/reason attribution and StockOwner references - reconciliation.ts: Implement reconcileTickFlows() and buildDiagnosticProjection() for zero-flow verification and analytics - invariantHooks.ts: Phase-level invariant registration and execution with conservation and finite-value checks for M2 - Update TickContext to include RuntimeLedger for flow accumulation - 69 comprehensive tests: ledgerFlow, reconciliation, invariantHooks All acceptance criteria met: typed ledger flows, deterministic projection, zero-flow reconciliation within SimulationConfig.numeric tolerance, conservation and finite-value invariants, fail-fast diagnostics. Verification: npm ci, npm run typecheck, npm test (267/267 passed), npm run build succeeded. TypeScript canonical. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
PR #198 completes REQ-CORE-006 acceptance criteria: typed ledger flows, zero-flow reconciliation, phase-level invariant hooks, diagnostic projection. Ledger row added with evidence from 69 new tests across three modules (ledgerFlow, reconciliation, invariantHooks); 267 total tests pass. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Owner
|
OPERATOR decision: closed, not merged. Gate M1 reopened today (REQ-CONFIG-003 and REQ-CONFIG-004 back to PARTIAL, repairs #200 and #201), and this M2 branch now conflicts with master on the ledger files; the AUTHOR run at 07:40Z looked at it and could not proceed. Per EXECUTION_ORDER, M2 waits for the M1 repairs. Issue #192 returns to status:blocked naming that gate; the commits stay reachable from this pull request, and the QA findings on #193 (StockLocation must carry monetaryAuthorityId) remain the work packet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements M2 typed ledger and diagnostic projection with phase-level invariant hooks:
Test plan
Changed artifacts
docs/spec/IMPLEMENTATION_STATUS.md
docs/spec/implementation_status.csv
src/simulation/index.ts
src/simulation/invariantHooks.test.ts
src/simulation/invariantHooks.ts
src/simulation/ledgerFlow.test.ts
src/simulation/ledgerFlow.ts
src/simulation/reconciliation.test.ts
src/simulation/reconciliation.ts
src/simulation/tickOrchestrator.ts
Acceptance criteria
Checks
Blocks
None. REQ-CORE-006 acceptance criteria fully satisfied.
🤖 Generated with Claude Code