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(classic): emit audit events for scripted quest and economy transactions #160
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:
classic#159: durable private journal and trusted-Python API;
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;
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.
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.
Architecture amendment — one authored content source (2026-08-13)
Initiative atrinik/atrinik#357 supersedes every future live-branch instruction below.
atrinik/content@mainis the sole mutable authored source for replacement and Classic targets. Future authored changes land only onmain; supported Classic artifacts are deterministically derived from the same immutablemainrevision. Do not create, restore, author, backport, validate, or publish through a live1.xbranch.Exact historical
1.xcommits, 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.xintegration 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.xpaths, rather than every individual map, as the first integration points:QuestManager.py, including objective-item removal/retention and repeat handling;PostOffice.pyand payment/send/destruction inpostoffice_clerk.py;Auction.pyand listing/withdrawal inauctions/clerk.py;Merchant.py;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
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 tomainwhen compatible, and keep Classic-only calls offmainwhen they are not. Validate both branches when shared files are changed.Acceptance criteria
1.xvalidation passes, and the PR states what was or was not mirrored tomainand why.Non-goals