Repository navigation
Implement REQ-CORE-005: PendingTransitions for future policy/jurisdiction/lifecycle effects - #247
Conversation
…tion/lifecycle effects Implements the PendingTransitions contract to ensure Phase-14 decisions cannot mutate current-tick authoritative state. Changes are queued with activateTick = N+1 and only become effective at their designated tick, providing deterministic causality per CORE_SCHEMA_AND_LIFECYCLES.md section 9. Changes: - Added PendingTransitions interface to WorldState with jurisdictionChanges, stateCreations, policyChanges, and monetaryPolicyChanges arrays - Created pendingTransitions.ts module with helper functions (createEmptyPendingTransitions, addJurisdictionChange, getActiveTransitionsAtTick, etc.) - Implemented 17 comprehensive tests in pendingTransitions.test.ts including CORE-T7 validation (N+1 changes don't affect tick N) - Added pendingTransitions field to WorldState initialization in buildInitialWorld() - Updated tickOrchestrator.ts to import PendingTransitions from worldState instead of duplicating definition - Updated all test fixtures to include stateCreations field Verification: - npm run typecheck: passed - npm test: 304 tests passed (17 new PendingTransitions tests) - npm run build: succeeded Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
REQUEST_CHANGES
Gate: Incomplete handoff record (docs/spec files undeclared)
The scope-guard check (required) identified 2 changed files not listed in the PR body's "Changed artifacts" section:
docs/spec/IMPLEMENTATION_STATUS.mddocs/spec/implementation_status.csv
Per ACCEPTOR runbook section 2:
the pull request body does not contain the full handoff record
What satisfies this:
Add both files to the "Changed artifacts" section in the PR body, listed exactly as git names them. If either file should not be part of this PR, drop the change from the commit.
Head revision judged: 495c101
The conflict was confined to docs/spec/implementation_status.csv and the document generated from it. Rows were merged by requirement identifier, each taken from the side that changed it, and the document was regenerated rather than merged. No product file was touched. See scripts/resolve_ledger_conflicts.py.
ACCEPTHead revision judged: 9ce54f6 Verification summary1. All required checks green at head revision:
2. All acceptance criteria met with evidence:
3. Diff confined to declared scope:
4. No invariant or test weakening:
5. No secrets, credentials, or personal data in diff 6. Handoff record complete:
REQ-CORE-005 implementation ready for merge. |
master has been red since 22:55:17Z. Two type errors, both integration tails of #208, whose branch was opened 36 hours before it merged: - WorldState gained `pendingTransitions` in #247 (REQ-CORE-005), and the temporary WorldState this reconciliation builds predates it. It gets the same empty value the real WorldState is built with fifty lines below: genesis queues no transition, and reconciliation reads stocks, never the queue. - `minimumPrice` and `maximumPrice` are real fields, but they belong to the pricing config in marketPricing.ts, not to MarketConfig in simulationConfig.ts, which #250 reshaped. Nothing reads them where the test put them, so they go. The underlying cause is not in this diff: branch protection runs with strict: false, so a branch whose own checks are green merges into a base it may no longer fit. That is a deliberate setting — requiring every branch to be current would serialize the queue — and the cost of it is exactly this, once, at a manual merge of a very old branch. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Summary
Implements the PendingTransitions contract to ensure Phase-14 decisions cannot mutate current-tick authoritative state. Changes are queued with activateTick = N+1 and only become effective at their designated tick, providing deterministic causality per CORE_SCHEMA_AND_LIFECYCLES.md section 9.
Changed artifacts
Acceptance criteria
Checks
Assumptions and unknowns
Highest-risk area
Type consolidation: PendingTransitions was previously defined in tickOrchestrator.ts; moved to worldState.ts and updated all imports. All builds and tests green.
Remaining gates
None. REQ-CORE-005 implementation complete. Closes #188.
Co-Authored-By: Claude Haiku 4.5 noreply@anthropic.com