Add combat turn normalization and invariants
This commit is contained in:
@@ -284,6 +284,19 @@ raw overlay bytes are not included in either surface. The normalize-stage
|
||||
reference is stage-local, so an overlay-capable pipeline binds the catalog
|
||||
independently for extraction and normalization.
|
||||
|
||||
### `internal/modules/dnd/normalize/combatturns`
|
||||
|
||||
The combat normalizer prepares the optional NPC registry once and uses the
|
||||
immutable prepared view during runtime. It display-normalizes combat fields,
|
||||
rewrites exact canonical-name or alias matches for actors and targets, orders
|
||||
and deduplicates source references, stable-sorts records by source-document
|
||||
position, and collapses only exact duplicate identities with fully valid
|
||||
evidence. It deep-clones output storage and emits bounded warnings scoped to
|
||||
merged input indexes. Its metadata and fingerprints identify the normalization
|
||||
and NPC identity policies, with registry digest/count only when bound. The
|
||||
normalizer is package-complete but is not registered in the production D&D
|
||||
registrar.
|
||||
|
||||
## Output Encoder
|
||||
|
||||
### `internal/modules/generic/output/json`
|
||||
@@ -348,9 +361,12 @@ rounds, and supported enums. Combat source-reference validation defers invalid
|
||||
shape and checks source identity, unit existence, and range order. Combat
|
||||
source-relatedness defers invalid shape or ranges, combines overlapping cited
|
||||
units in document order, and emits at most one bounded advisory warning per
|
||||
turn for unrelated actor or declaration text. All three validators are
|
||||
deterministic and expose local policy fingerprints; they are package-complete
|
||||
but not yet in a production validator chain.
|
||||
turn for unrelated actor or declaration text. The normalized-invariants
|
||||
validator owns display normalization, comparison-unique targets, canonical
|
||||
source-reference order, chronology, and exact duplicate identity; it defers
|
||||
shape and source-reference failures. All four validators are deterministic and
|
||||
expose local policy fingerprints; they are package-complete but not yet in a
|
||||
production validator chain.
|
||||
|
||||
## Production Registration
|
||||
|
||||
|
||||
@@ -91,7 +91,8 @@ Configuration. The implemented module packages are:
|
||||
| `internal/modules/dnd/extract/spells` | Maps private structured model output to canonical source-grounded D&D spell lists. |
|
||||
| `internal/modules/dnd/extract/npcs` | Maps private structured model output to canonical source-grounded D&D NPC lists. |
|
||||
| `internal/modules/dnd/extract/combatturns` | Maps private structured model output to source-grounded D&D combat-turn candidates and preserves chronology and invalid candidate values for validators. |
|
||||
| `internal/modules/dnd/validate/combatturns` | Provides deterministic shape, source-reference, and source-relatedness validation for combat-turn candidates without production composition. |
|
||||
| `internal/modules/dnd/normalize/combatturns` | Canonicalizes and orders merged combat turns, applies exact NPC identity matches, and collapses only exact valid-evidence duplicates without production composition. |
|
||||
| `internal/modules/dnd/validate/combatturns` | Provides deterministic shape, source-reference, source-relatedness, and normalized-invariant validation for combat turns without production composition. |
|
||||
| `internal/modules/dnd/npcs/registry` | Resolves validated normalized NPC references into immutable grounding data and exact identity lookup. |
|
||||
| `internal/modules/dnd/npcs/identity` | Owns Unicode-aware NPC identity, ID derivation, and registry collision validation. |
|
||||
| `internal/modules/dnd/spells/catalog` | Embeds and validates the versioned D&D 5e 2014 SRD catalog, composes optional overlays, and provides immutable effective lookup. |
|
||||
|
||||
Reference in New Issue
Block a user