Skip to content

feat(classic): emit audit events for scripted quest and economy transactions #160

Description

@zoeyrose

Architecture amendment — one authored content source (2026-08-13)

Initiative atrinik/atrinik#357 supersedes every future live-branch instruction below. atrinik/content@main is the sole mutable authored source for replacement and Classic targets. Future authored changes land only on main; supported Classic artifacts are deterministically derived from the same immutable main revision. Do not create, restore, author, backport, validate, or publish through a live 1.x branch.

Exact historical 1.x commits, tags, releases, assets, preserved local snapshots, provenance, parity records, and comparisons remain valid immutable evidence. This amendment changes no other feature, balance, lore, compatibility, licensing, validation, or ownership acceptance criterion.

Context

Classic C code cannot observe the complete semantic outcome of transactions implemented by trusted content scripts. This issue covers the authored 1.x integration after these server contracts exist:

Do not make scripts append raw log text. They should call a narrow typed API with stable event/reason identifiers and transaction context; the server remains responsible for schema, privacy, durability, and storage.

Prime content-owned paths

The survey identified these centralized 1.x paths, rather than every individual map, as the first integration points:

  • quest and nested-part lifecycle in QuestManager.py, including objective-item removal/retention and repeat handling;
  • persistent post serialization/delivery in PostOffice.py and payment/send/destruction in postoffice_clerk.py;
  • auction purchase/payout/delivery in Auction.py and listing/withdrawal in auctions/clerk.py;
  • scripted item/spell purchase and item sale in Merchant.py;
  • low-volume existing metric sites for housing/apartment purchase and fees, bounty payment/clear, guild join/leave/storage, and jail placement;
  • privileged quest reset and XP adjustment commands.

Several post, auction, and merchant flows currently perform payment, serialization, insertion/destruction, payout, and metric updates as separate steps. A record written only after the last step cannot recover a crash in the middle.

Required integration

  • Emit centralized quest start/part-start/complete/fail/repeat/reset, objective-item acquisition/removal, and kill-threshold events with the stable identifiers defined by feat(maps): transfer crystal light ownership #161. Do not add bespoke raw logging to each quest.
  • Wrap each post, auction, merchant, housing, and similar logical exchange in one transaction identity using the intent/commit/reconciliation contract from fix(release-lines): synchronize classic descriptor #159.
  • Include actor, counterparty/service, item lineage and quantity, amount, carried/bank funding when known, and typed reason; correlate payout and delivery sides.
  • Make multi-step operations idempotent so reconciliation cannot duplicate money/items or lose a successfully paid-for delivery.
  • Audit the remaining scripted metric sites and classify each as gameplay journal, aggregate-only, operational/security log, or not recorded. Add events only where volume and recovery/support value justify them.
  • Replace or supplement pre-operation/human-text audit-like facilities such as guild storage logging with authoritative successful transaction events. Do not retain arbitrary player text in structured records.

Branch scope

The runtime target is 1.x, because this integration depends on the Classic trusted-Python API. In the implementation PR, explicitly record the branch disposition: forward-port framework-neutral changes to main when compatible, and keep Classic-only calls off main when they are not. Validate both branches when shared files are changed.

Acceptance criteria

  • Central QuestManager tests prove top-level/nested/repeat/reset and objective events are emitted once with stable IDs and no per-state-write noise.
  • Post send/receive, auction list/withdraw/buy/payout, merchant buy/sell, and selected service payments have one correlated logical transaction each.
  • Forced failure/crash tests at every multi-step boundary reconcile without item/currency loss or duplication.
  • Failed payment, rejected delivery, insufficient capacity, and script exceptions never appear as committed successes.
  • Existing metrics remain correct and are not double-counted through both generic payment and business-specific hooks.
  • Every existing scripted metric site is classified; high-volume or low-value exclusions are documented.
  • Structured events contain no secrets, chat, arbitrary inscription/item text, or raw script-supplied JSON/log lines.
  • 1.x validation passes, and the PR states what was or was not mirrored to main and why.

Non-goals

  • Implementing a separate content-owned audit file or recovery tool.
  • Adding one-off logging to every quest/map when the framework already owns the transition.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions