OpenTPW

UI-051: Route ticket purchases through ledger#

Status and classification#

Source-verified residual#

HUD ticket count and spending use park state instead of global player earned-minus-spent ledger; key count is already matched.

Source sites#

Implementation cross-check#

Evidence needed#

Bounded investigation and implementation plan#

  1. Confirm current ownership and rebase the proposal against the latest main before runtime changes.

  2. Plan one consistent ledger transaction route and HUD read model, coordinating persistence rather than patching display alone.

  3. Turn each verified behavioral distinction into a small deterministic regression fixture before editing runtime paths.

  4. Keep unknown behavior explicitly unresolved; an evidence-only outcome is valid if no mismatch is established.

  5. Submit any later implementation with exact evidence, changed scope and test output for review.

Acceptance tests to author and run later#

Ownership and overlap#

Completion boundary#

Current-source reconciliation (2026-10-19)#

At public main fd8ff52eec12354fba02f23d23c5a217b2515a3b, a global PlayerTicketLedger already exists, but its spent-ticket value is currently restored rather than used as the live purchase debit. The actual key callback is wired by GameFlow through EconomyParkStatus.ForLevel(level, PlayerKeys); key display is not an unproven hypothetical caller.

The purchase route is also present: Level.Objects calls Park.Economy.TryBuild; CheckBuild refuses a cost above park GoldenTicketsAvailable, and successful TryBuild increases park TicketsSpent and records the ticket-bought item. Thus park-local spending remains a substantive residual. The HUD ticket count also remains park-local. Do not add an early-placement refusal test as though commit-time refusal were absent.

The next bounded design must define global ledger transaction ownership, cross-park ticket-bought items, failed-placement/rollback behavior and save continuation, using the existing ledger and economy ticket tests. Coordinate with the current command/build owner (#696) before implementation. No live transaction route is changed by this documentation reconciliation; original global/local/secret-ticket equivalence remains subject to the evidence gate above. No new native verification or executed-test claim.

Source: docs/proposals/ui-051-route-ticket-purchases-through-ledger.md in the project repository.