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
Copy file name to clipboardExpand all lines: spec/protocol/item-template-store-bootstrap.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,11 +39,11 @@ Each template must pass the current `internal/itemstore` validation before the r
39
39
40
40
The store normalizes and persists deterministic JSON: template names and effect messages are trimmed, equipment slot names are normalized, and templates are sorted by `vnum`.
41
41
42
-
## Unknown-field hardening
42
+
## Strict JSON hardening
43
43
44
-
The file-backed loader now rejects unknown JSON fields instead of silently accepting them.
44
+
The file-backed loader now rejects unknown JSON fields and trailing JSON values instead of silently accepting them.
45
45
46
-
This is a fail-closed authoring guard: if a snapshot contains unowned metadata such as a future effect field, the runtime must reject the snapshot rather than booting while ignoring that metadata. This keeps item behavior template-backed only for fields the repository currently owns and tests.
46
+
This is a fail-closed authoring guard: if a snapshot contains unowned metadata such as a future effect field, or multiple concatenated top-level JSON values, the runtime must reject the snapshot rather than booting while ignoring or only partially reading that metadata. This keeps item behavior template-backed only for fields the repository currently owns and tests.
47
47
48
48
## Bootstrap fallback
49
49
@@ -55,11 +55,11 @@ If the default item-template file is missing, the minimal runtime still uses the
55
55
56
56
Missing-file fallback is a bootstrap compatibility aid, not the final production item-data model.
57
57
58
-
Malformed snapshots, invalid templates, duplicate `vnum` entries, and snapshots with unknown JSON fields are fatal for runtime construction.
58
+
Malformed snapshots, invalid templates, duplicate `vnum` entries, snapshots with unknown JSON fields, and snapshots with trailing JSON values are fatal for runtime construction.
59
59
60
60
## Tests
61
61
62
62
Current coverage:
63
63
64
-
-`internal/itemstore` freezes deterministic save/load behavior, validation failures, anti-flag metadata round trips, use/equip effect metadata, and unknown-field rejection on load.
64
+
-`internal/itemstore` freezes deterministic save/load behavior, validation failures, anti-flag metadata round trips, use/equip effect metadata, and strict load rejection for unknown fields or trailing JSON values.
65
65
- Runtime item-use, equip, merchant, drop/pickup, and drag-to-item stack slices resolve only through loaded template metadata or the deterministic missing-file fallback described above.
0 commit comments