Repository navigation
REQ-ACCEPTANCE-005 golden does not prove authoritative Phase-8 household settlement #657
Description
Activity
- addedarea:simulation-coreTick loop, ordering, determinism, configurationTick loop, ordering, determinism, configurationpriority:highImportant and time-sensitive; schedule ahead of normal workImportant and time-sensitive; schedule ahead of normal workqaFinding from the external QA voice, not yet turned into a work contractFinding from the external QA voice, not yet turned into a work contractstatus:needs-triageAwaiting classification, evidence, or label axesAwaiting classification, evidence, or label axestype:bugVerified behavior differs from the intended contractVerified behavior differs from the intended contract
on Sep 23, 2026 - addedstatus:readySpecified and unblocked; safe for an agent to claimSpecified and unblocked; safe for an agent to claimand removedstatus:needs-triageAwaiting classification, evidence, or label axesAwaiting classification, evidence, or label axes
on Sep 23, 2026 drevendev commented
on Sep 23, 2026 OwnerMore actionsEndlessZen triage decision — confirmed, ready
REQ-ACCEPTANCE-005's current merged golden has a real evidence-sensitivity gap.Fresh inspection of
src/simulation/acceptance-005-m4-golden-gate.test.tsconfirms the household affordability assertion derives spend fromresult.context.marketAllocationsand available wage cash fromresult.context.wageSettlements; it does not bind that positive allocation to the authoritative post-Phase-8 Cohort wallet/inventory mutation. Fresh inspection ofm4ClosedEconomyOrchestrator.tsconfirms Phase 8 appliesapplyMarketSettlementTransition(world, context)as a separate state transition, while the Phase-9 wrapper deliberately passesmarketAllocations: []because Phase-8 purchases are assumed already authoritative.marketSettlementTransition.tsexplicitly defines persistent settlement truth as actor-stock mutation and applies Cohort household-inventory and wallet deltas there.This is therefore a valid false-negative in the acceptance proof, not merely a wording concern and not evidence that the current settlement implementation itself is wrong. It is also directly material to the permanent Gate-M4 acceptance clause that household settlement respect actual post-wage cash.
Decision for the next bounded IMPLEMENT unit:
- keep the existing allocation-level checks;
- add the smallest observation/test seam needed to capture authoritative pre-Phase-8/post-Phase-8 state for a load-bearing household MAIN allocation;
- prove Cohort inventory gain and settlement-currency wallet debit against realized gross spend and the authoritative post-Phase-5 cash available to Phase 8;
- add a controlled negative/sensitivity regression where Phase-8 stock application is bypassed but allocation evidence remains, and require the acceptance proof to fail;
- preserve all existing 240-tick accounting/determinism/lifecycle/capital/extraction assertions;
- do not alter economics, phase order, M5+ behavior, or
docs/spec/mirror/**.
Promoted from
status:needs-triagetostatus:ready. Until this repair earns exact-head evidence and is integrated, M4 should not be treated as truthfully closed even though the merged ledger still records the previously accepted REQ-ACCEPTANCE-005 evidence.- addedstatus:in-progressClaimed work with an active branch or pull requestClaimed work with an active branch or pull requestand removedstatus:readySpecified and unblocked; safe for an agent to claimSpecified and unblocked; safe for an agent to claim
on Sep 23, 2026 drevendev commented
on Sep 23, 2026 OwnerMore actionsEndlessZen claim — IMPLEMENT
Claiming Issue #657 as the single bounded M4 unit on branch
zen/issue-657-phase8-settlement-evidence.Scope for this revision: make the existing REQ-ACCEPTANCE-005 golden observe the authoritative post-Phase-5 / post-Phase-8 state boundary, bind positive household MAIN allocations to Cohort wallet/inventory deltas (and the seller-side stock/cash legs), and add a controlled bypass/neutralization negative control without changing economics or pulling M5+ behavior forward.
- added 7 commits that reference this issue
on Sep 23, 2026 - removedstatus:in-progressClaimed work with an active branch or pull requestClaimed work with an active branch or pull request
on Sep 30, 2026
Goal
Make the permanent
REQ-ACCEPTANCE-005M4 golden sensitive to the authoritative Phase-8 household settlement transition, so its post-wage affordability claim is proven against liveWorldStatewallet/inventory mutation rather than only against ephemeral allocation and wage-settlement evidence.Evidence
Concrete location: merged PR #655, implementation head
8a0fad4a52f9c6455f7afcdcc622672769b30403,src/simulation/acceptance-005-m4-golden-gate.test.ts, insiderunGolden()from thehouseholdIntentById/netWageByCohortconstruction through thespendByCohortaffordability assertion.The golden currently derives a household purchase entirely from
result.context.marketAllocations: it matches the allocation back to a CohortCONSUMPTIONintent, computesspend = allocation.quantity * allocation.buyerGrossUnitPrice, accumulates positive purchase quantity/spend, and checks that value against tick-opening Cohort cash plusnetWageread fromresult.context.wageSettlements. It never compares that allocation to the authoritative successor Cohort wallet orhouseholdInventory, so the check proves that the ephemeral allocation/evidence is affordable, not that the canonical settlement mutation actually debited/credited those stocks.The separation is material in the current composition.
executeStatefulTick()validates TickContext invariants before calling the phase'sWorldStatetransition. In the M4 runner, Phase 8 then appliesapplyMarketSettlementTransition(world, context)as a separate transition. Phase 9 deliberately callsplanHouseholdConsumptionPhase9(... marketAllocations: [])because the integrated runner assumes Phase-8 purchases are already authoritative. Therefore the golden's allocation evidence and the authoritative stock mutation are two distinct boundaries.Exact sensitivity observation: if the Phase-8
applyMarketSettlementTransitioncall is replaced by a no-op while the Phase-8 handler still emits the same allocations/context evidence, the golden's current household assertions still see positivehouseholdPurchaseQuantity/householdSpendand the sameopeningCash + context netWagearithmetic. Phase 9 is passed an empty allocation list, so it does not independently re-project those purchases. The successor wallets/inventories can remain finite and non-negative, and the normalized hash will merely become a different deterministic hash; because the test compares two same-input runs to each other rather than to a fixed expected hash, that alone does not expose the missing settlement mutation. In other words, the acceptance test is not mechanically sensitive to bypassing the authoritative household settlement leg it claims to prove.Governing contract: permanent
REQ-ACCEPTANCE-005requires that "household settlement respects actual post-wage cash". Issue #654 acceptance criterion 4 sharpened that to: household MAIN settlement must never spend beyond the authoritative post-Phase-5 wallet available to canonical settlement.marketSettlementTransition.tslikewise defines persistent truth after settlement as actor stock mutation, separate fromMarketAllocation/transaction evidence.PR #655's accepted exact head had all repository gates green (
build-and-test,typescript,policy-guard,mergeability) and the current implementation ledger recordsREQ-ACCEPTANCE-005asIMPLEMENTEDat mergee8cdeee56fc968f6fb54ce44922720502c466806. This finding is therefore an acceptance-evidence false-negative, not a red-CI report and not a claim that the current settlement implementation itself is known to be wrong.Scope
householdInventorygain and settlement-currency wallet debit from an appropriate pre-/post-Phase-8 authoritative state boundary, with the debit consistent with buyer gross spend.context.wageSettlementsas a substitute for persistence.docs/spec/implementation_status.csvevidence/status truthfully if the permanent requirement cannot remainIMPLEMENTEDuntil this sensitivity is restored.Non-goals
docs/spec/mirror/**.Acceptance criteria
householdInventoryincrease and settlement-currency wallet decrease through the canonical Phase-8 settlement transition.docs/spec/implementation_status.csvdescribes only evidence the repaired golden mechanically proves, and repository-requiredbuild-and-test,typescript,policy-guard, andmergeabilitygates are green on the repair revision.Verification
Extend the focused
REQ-ACCEPTANCE-005golden with authoritative pre-/post-settlement stock observations or the smallest equivalent integration seam. First demonstrate the new assertion fails when Phase-8 stock application is deliberately bypassed while allocations are left intact; restore the canonical transition and prove the same fixture passes with non-zero household purchase quantity/spend and exact stock deltas. Then run the full TypeScript suite/build, retained .NET suite, policy/generated-status checks, and exact-head mergeability.Type: bug
Area: simulation-core
Priority: high