You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(server): audit successful item and currency transactions #162
Depends on the private journal contract in classic#159 and the item identity/provenance work in classic#160.
Classic already counts many item and economy actions, but the aggregates cannot show which item moved, who the counterparty was, why a balance changed, or the ordered before/after state needed for recovery. Instrument the semantic success paths so each completed logical transaction produces one structured journal transaction as well as the existing metrics.
object split/merge/insert/decrease/destroy in object.c, where low-level calls currently lack actor/reason context;
bank deposit/withdrawal and hidden bank balance mutation in bank.c;
shop payment, bank-funded payment, checkout, and sale in shop.c;
starting items, treasure, quest-objective grants, generated coins, and trusted Python insertion/removal paths that bypass ordinary floor pickup/drop.
Required coverage
Record one transaction-level event, not one record per unit or internal helper call, for successful:
acquisition into player custody, ground drop, cross-player/service transfer, and external-container transfer;
persisted player-item creation/grant, removal, and non-routine destruction, with a semantic reason;
shop purchase and sale, including item/quantity, total price, and carried-cash versus bank funding;
bank deposit, withdrawal, and every other bank-balance mutation, with balance before, delta, balance after, currency, and reason;
operator/scripted item or currency mutation through a reason-aware trusted API.
For each item operation, capture the persistent item/lineage identity, archetype/type and a bounded immutable snapshot, quantity, source/destination, actor/counterparty when known, and provenance before/after. Capture the item before a merge or destruction removes the source object.
Classify routine consumption/ammunition and purely internal same-player reordering explicitly. High-volume gameplay that is not useful for recovery should remain aggregate-only; do not infer semantic events from generic object_destroy() or log stack merge housekeeping.
Correctness rules
Emit only from an authoritative successful transaction boundary. The existing pickup/drop map events are pre-operation veto hooks and are not evidence of success.
Context
Depends on the private journal contract in classic#159 and the item identity/provenance work in classic#160.
Classic already counts many item and economy actions, but the aggregates cannot show which item moved, who the counterparty was, why a balance changed, or the ordered before/after state needed for recovery. Instrument the semantic success paths so each completed logical transaction produces one structured journal transaction as well as the existing metrics.
Prime native paths found during the survey:
player.c;object.c, where low-level calls currently lack actor/reason context;bank.c;shop.c;Required coverage
Record one transaction-level event, not one record per unit or internal helper call, for successful:
For each item operation, capture the persistent item/lineage identity, archetype/type and a bounded immutable snapshot, quantity, source/destination, actor/counterparty when known, and provenance before/after. Capture the item before a merge or destruction removes the source object.
Classify routine consumption/ammunition and purely internal same-player reordering explicitly. High-volume gameplay that is not useful for recovery should remain aggregate-only; do not infer semantic events from generic
object_destroy()or log stack merge housekeeping.Correctness rules
LOG()call alone does not close the crash window.Acceptance criteria
Non-goals