fix: enforce storage and tooling invariants
This commit is contained in:
@@ -78,7 +78,16 @@ NPCStateRecord v3 adds carried inventory. SimulationStateRecord v2 adds
|
||||
StorageStateRecord entries; world-schema v1 migrates legacy village food and
|
||||
wood into the stable `village_pantry` and `village_woodpile` records. Parsed
|
||||
storage values are canonicalized so save/restore continuation retains
|
||||
byte-stable checksums.
|
||||
byte-stable checksums. Current parsing rejects empty item IDs, negative or
|
||||
non-finite amounts, negative or non-finite capacity, and contents above
|
||||
capacity. Runtime deposit and withdrawal requests also reject empty item IDs
|
||||
and non-finite amounts without mutating authoritative stock. When the authored
|
||||
pantry or woodpile is present, current world parsing also requires its
|
||||
authoritative food or wood amount to match the duplicated village summary;
|
||||
contradictory saves are rejected instead of silently changing checksum during
|
||||
restore. World-v1 migration expands a storage's inferred capacity when needed
|
||||
so valid legacy stock above the current default is preserved rather than
|
||||
discarded.
|
||||
|
||||
SimulationStateRecord v3 adds ordered `EconomicEventRecord` entries and
|
||||
`next_event_id`. World schemas v1 and v2 migrate explicitly to an empty event
|
||||
|
||||
Reference in New Issue
Block a user