Skip to content

Audit and Signature ​

After a successful forge, EmakiForge writes audit data into the result item so the source recipe can be traced and tampering with material contribution data can be detected

Where the data lives ​

Forge audit data exists in two places:

  1. CoreLib item layer snapshot: namespace forge, layer version 1, whose payload is the audit field table below. Item refresh reads it back from here
  2. The emakiforge:forge PDC partition: key fields flattened so the placeholder and variable systems can read them. See Forge layer PDC keys

Audit fields ​

After a successful forge the following fields are written into the audit payload:

FieldDescription
schemaAudit structure marker, currently always forge_audit_v2
schema_versionAudit structure version, currently 2
stageOriginating stage, currently always forge
recipe_idRecipe id used for forging
qualityQuality tier name; an empty string when no tier resolved
multiplierQuality multiplier
forged_atForge timestamp in milliseconds
materials_signatureStable hash signature of material contribution data
output_itemOutput item source shorthand. Written only when the recipe configures an output item source
materialsMaterial contribution list, see the table below

Fields of each materials[] entry:

FieldDescription
material_id / count_key / audit_idMaterial identity keys. Written only when declared explicitly in config; the key is removed when it was not declared
material_itemCompatibility identity: the item source shorthand, or matcher:<digest>
categoryMaterial category (required / optional)
amountPlanned amount
amount_consumedActually consumed amount
slotGUI slot the material occupied
sequenceProcessing order
matched_sourceItem source shorthand actually matched
matcherMatcher digest key; an empty string when there is no matcher
allocationSlot allocation detail for this entry
legacy_identity / identity_diagnosticCompatibility identity and diagnostic marker added when some identity key was not declared

Material signature ​

materials_signature is computed only from material contributions whose consumed amount is greater than zero; the signature input covers the material definition digest, amount, consumed amount, slot, category, sequence, matched source, and allocation detail. The same set of material contributions always yields the same signature, so it can be used to compare an item's forging material data against an expected value

Forge layer PDC keys ​

Flat keys under namespace emakiforge, partition forge:

KeyTypeDescription
forge_recipe_idstringRecipe id that forged the item
quality_idstringQuality id (same value as the tier name)
quality_displaystringQuality display name
quality_multiplierstringQuality multiplier, stored formatted as 0.##
material_idstringComma-joined list of explicitly declared material_id values; removed when empty
count_keystringComma-joined list of explicitly declared count_key values; removed when empty
audit_idstringComma-joined list of explicitly declared audit_id values; removed when empty
matched_sourcestringComma-joined list of matched source shorthands
amount_consumedintegerTotal consumed amount across all materials
matcher_digeststringComma-joined list of matcher digests
allocationstringStable signature of the allocation detail

The CoreLib variable system exposes these as the variables forge_quality_id, forge_quality_display, forge_quality_multiplier, and forge_recipe_id, plus the partition-relative PDC strings

Relationship with refresh ​

The Forge item refresh service reads recipe_id and quality from the audit data to rebuild the forge layer presentation. Items whose audit data is missing, whose quality is no longer in the current pool, or whose recipe has been deleted cannot have their forge layer rebuilt and produce a warning

When resolving material audit records, the current implementation falls back in this order: audit_id → material_id → count_key → legacy material_item / source. A successful legacy lookup is marked for migration and rebuilt during refresh; when no identity resolves, the original item is kept and a warning is logged rather than overwriting it with incomplete state. Material identity keys must stay stable: a matcher-only material derives its identity from the matcher content digest, so editing the matcher makes already-forged items report a missing material (console.forge_refresh_missing_material). This behaviour is established by source inspection, but old PDC audit data was not tested on a live Paper/Folia server in this cycle

Use cases ​

  • Trading or recycling systems can read audit data to determine an item's source recipe and quality
  • External analytics can aggregate forge output by recipe_id, quality, and forged_at

NOTE

Forge does not ship a built-in command for viewing audit data. Use an external tool that can read item PDC and item layer snapshots when manual inspection is needed