PAR-301
Make the transaction/creation pipeline contexts honest: immutable inputs, minimal mutable result
The transaction pipeline read as a "mutable bag," but analysis showed most of the mutability was dead surface:
PreTransactionContext — setOwnerAccount/setOwnerInventory/setClientInventory had zero trade-path callers. Made those inputs (plus the already-final client/sign/type) final and removed the dead setters. What genuinely mutates is only the validation output: the outcome verdict, an optional partial-fill resize of stock/exactPrice, and the deferred free-shop rejection flag — now documented as such.
PreShopCreationContext — setCreator/setSign were dead (0 callers). Made creator/sign final, removed the setters; the genuine mutation is outcome + resolved ownerAccount + rewritten signLines.
TransactionContext was already clean (all inputs final; only settlementTxnId/salesTax mutate post-settlement).
This makes the design honest — immutable trade/creation inputs + a small, documented mutable result — without rewriting the ledger-critical validation/settlement flow into immutable step-transforms (high risk, debatable ROI). Behaviour-preserving: the compiler proves the removed setters were unused. :chestshop:build green; server enables cleanly; suite 41/42 (known proprietor-settle flake).
Resources
- commit52d85df Make the pipeline contexts honest: immutable inputs, minimal mutable result (PAR-301)ParadauxIO/hibernia-economy
Comments
No comments yet.
Activity
- tesks changed status to Status → Pending Release
- ParadauxIO linked a commit — Commit 52d85df — Make the pipeline contexts honest: immutable inputs, minimal mutable result (PAR-301)
- tesks created the issue