Files
notarius/docs/integrations/dnd-item-event-artifacts.md

61 lines
2.1 KiB
Markdown
Raw Normal View History

2026-08-05 19:55:34 +00:00
# D&D Item-Occurrence Artifact
2026-07-25 22:16:29 +00:00
2026-08-05 19:55:34 +00:00
`dnd/item-events` currently produces this source-grounded item and currency
occurrence list. It records discoveries and possession changes, not an
inventory, balance, or ledger.
2026-07-25 22:16:29 +00:00
2026-07-26 13:43:45 +00:00
## Identity and compatibility
2026-07-25 22:16:29 +00:00
| Property | Value |
| --- | --- |
2026-08-05 19:55:34 +00:00
| Artifact kind | `dnd/item-occurrence-list` |
| Schema ID | `notarius.dnd.item_occurrences` |
| Schema name | `notarius_dnd_item_occurrences_v1` |
2026-07-25 22:16:29 +00:00
| Schema version | `v1` |
| Media type | `application/json` |
2026-08-05 19:55:34 +00:00
The strict root has required `occurrences`. Records require `item_id`, `name`,
`kind`, and `source_refs`; unknown fields are rejected. `quantity`, `from`, and
`to` appear only when their kind permits them.
2026-07-25 22:16:29 +00:00
2026-08-05 19:55:34 +00:00
## Registry grounding
2026-07-25 22:16:29 +00:00
2026-08-05 19:55:34 +00:00
Both extraction and normalization require an `item_registry` reference bound to
an earlier normalized `dnd/item-registry` artifact. The registry is immutable
for an operation and contributes only its ordered `{id,name}` projection after
the shared evidence message. It is never occurrence evidence.
2026-07-25 22:16:29 +00:00
2026-08-05 19:55:34 +00:00
Each occurrence must use one exact registry ID/name pair. Extraction omits an
unknown ID or mismatched name rather than creating an item. Normalization
canonicalizes a recognized name by ID, preserves unknown values for the
registry validator, and the registry validator rejects unknown or mismatched
pairs.
2026-07-25 22:16:29 +00:00
2026-08-05 19:55:34 +00:00
## Wire shape
2026-07-25 22:16:29 +00:00
```json
{
2026-08-05 19:55:34 +00:00
"occurrences": [
2026-07-25 22:16:29 +00:00
{
2026-08-05 19:55:34 +00:00
"item_id": "item:sha256:…",
2026-07-25 22:16:29 +00:00
"name": "Silver Pieces",
"kind": "acquired",
"quantity": 20,
"to": "party",
2026-07-26 13:43:45 +00:00
"source_refs": [
{"source_id": "session-7", "start_unit_id": 2, "end_unit_id": 2}
]
2026-07-25 22:16:29 +00:00
}
]
}
```
2026-08-05 19:55:34 +00:00
The five kinds remain `discovered`, `acquired`, `lost`, `consumed`, and
`transferred`. Holder, quantity, currency, ordering, and exact-duplicate rules
are unchanged: discovered has no holder; acquired requires `to`; lost and
consumed require `from`; transferred requires distinct non-`party` holders.
Each source reference is an inclusive current-transcript range.
2026-07-26 13:43:45 +00:00
2026-08-05 19:55:34 +00:00
See [item registry](dnd-item-registry-artifacts.md) for the grounding artifact
and [D&D module internals](../internal/dnd.md) for implementation details.