Add NPC registry grounding for spell extraction
This commit is contained in:
10
docs/cli.md
10
docs/cli.md
@@ -94,6 +94,16 @@ go run ./cmd/notarius run dnd-session \
|
||||
--reference spells.extract.glossary=./campaign-glossary.txt
|
||||
```
|
||||
|
||||
For the operator-driven NPC-to-spell workflow, bind the normalized NPC lane
|
||||
payload from the completed NPC run to the spell extractor:
|
||||
|
||||
```sh
|
||||
go run ./cmd/notarius run dnd-spells \
|
||||
--config examples/dnd-npc-spell-sequential.config.yml \
|
||||
--input examples/seriatim-minimal-transcript.json \
|
||||
--reference spells.extract.npcs=./npc-run/lanes/npcs.json
|
||||
```
|
||||
|
||||
The same grammar can target chunk, merge, and normalize slots when the configured
|
||||
modules declare them:
|
||||
|
||||
|
||||
@@ -22,8 +22,9 @@ The explicit-path option is defined in the [CLI reference](cli.md).
|
||||
- [Minimal D&D spell configuration](../examples/dnd-spells.config.yml)
|
||||
- [Production-oriented D&D spell configuration](../examples/dnd-spells-production.config.yml)
|
||||
- [D&D NPC configuration](../examples/dnd-npcs.config.yml)
|
||||
- [Sequential D&D NPC and spell configuration](../examples/dnd-npc-spell-sequential.config.yml)
|
||||
|
||||
Both are complete version 3 files. The fragments below illustrate individual
|
||||
All are complete version 3 files. The fragments below illustrate individual
|
||||
fields and are not alternate complete configurations.
|
||||
|
||||
## Top-Level Fields
|
||||
@@ -284,9 +285,11 @@ production validators do not call the LLM and must not set `llm_profile`.
|
||||
| chunk | `generic` | Splits source units into ordered chunks. |
|
||||
| chunk | `dnd/scenes` | Uses an LLM to split transcript source units into D&D scenes. |
|
||||
| extract | `dnd/spells` | Extracts typed D&D spell-list artifacts. |
|
||||
| extract | `dnd/npcs` | Extracts typed D&D NPC-list artifacts. |
|
||||
| merge | `appendorder` | Combines typed artifacts in chunk order. |
|
||||
| normalize | `noop` | Passes merged typed artifacts through unchanged. |
|
||||
| normalize | `dnd/spells` | Deterministically canonicalizes and de-duplicates typed D&D spell-list artifacts. |
|
||||
| normalize | `dnd/npcs` | Deterministically consolidates typed D&D NPC-list artifacts by canonical identity and aliases. |
|
||||
| output | `json` | Produces JSON output files for normalized `application/json` lanes. |
|
||||
|
||||
## Implemented Production Validators
|
||||
@@ -301,6 +304,10 @@ production validators do not call the LLM and must not set `llm_profile`.
|
||||
| `extract/dnd/spells/catalog` | deterministic | Rejects spell-list artifacts containing names outside the effective SRD and overlay catalog. |
|
||||
| `extract/dnd/spells/source_refs` | deterministic | Rejects missing or invalid D&D spell source references. |
|
||||
| `extract/dnd/spells/source_relatedness` | deterministic | Emits warnings when a spell name is not found near its cited source text. |
|
||||
| `extract/dnd/npcs/shape` | deterministic | Rejects malformed D&D NPC-list artifacts. |
|
||||
| `extract/dnd/npcs/source_refs` | deterministic | Rejects missing or invalid D&D NPC source references. |
|
||||
| `extract/dnd/npcs/source_relatedness` | deterministic | Emits warnings when an NPC name or alias is not found near its cited source text. |
|
||||
| `normalize/dnd/npcs/identity` | deterministic | Rejects invalid canonical IDs, aliases, and cross-record identity collisions. |
|
||||
|
||||
The production default chain for `dnd/spells` is used for both its extract and
|
||||
normalize stages:
|
||||
@@ -315,8 +322,27 @@ validators:
|
||||
- extract/dnd/spells/source_relatedness
|
||||
```
|
||||
|
||||
No other production module currently has a default validator chain. Empty
|
||||
chains approve output by default.
|
||||
The production default chain for `dnd/npcs` uses the extraction chain for the
|
||||
extract stage and the identity chain for normalize-stage output:
|
||||
|
||||
```yaml
|
||||
extract:
|
||||
validators:
|
||||
- generic/valid_json
|
||||
- generic/valid_json_schema
|
||||
- extract/dnd/npcs/shape
|
||||
- extract/dnd/npcs/source_refs
|
||||
- extract/dnd/npcs/source_relatedness
|
||||
normalize:
|
||||
validators:
|
||||
- generic/valid_json
|
||||
- generic/valid_json_schema
|
||||
- normalize/dnd/npcs/identity
|
||||
- extract/dnd/npcs/source_refs
|
||||
- extract/dnd/npcs/source_relatedness
|
||||
```
|
||||
|
||||
Empty chains approve output by default.
|
||||
|
||||
The `generic` chunker accepts:
|
||||
|
||||
@@ -345,6 +371,17 @@ not allow multiple files. Its format is defined in the
|
||||
The extractor uses campaign references only as supporting disambiguation
|
||||
material; spell casts still must be present in the source transcript.
|
||||
|
||||
It also declares an optional `npcs` slot for a normalized NPC artifact. The
|
||||
slot accepts exactly one `application/json` file no larger than 1 MiB. During
|
||||
extractor preparation Notarius strictly decodes and identity-validates the
|
||||
artifact, then gives the model canonical JSON for caster-name grounding.
|
||||
Registry source references may belong to the NPC-producing session and are
|
||||
provenance only; they are not spell evidence. The bound registry contributes a
|
||||
semantic digest and NPC count to extractor metadata and checkpoint identity,
|
||||
while its names, aliases, content, and path do not appear there. When absent,
|
||||
the prompt receives the exact empty value `{"npcs":[]}` and no registry
|
||||
provenance or fingerprint is recorded.
|
||||
|
||||
The `dnd/spells` normalizer declares the same optional `spell_catalog` slot.
|
||||
When an overlay is used, bind it independently under
|
||||
`artifacts.<lane>.normalize.references.spell_catalog`; normalize-stage
|
||||
@@ -352,6 +389,12 @@ references are local to that stage and are not inherited from extraction. The
|
||||
normalizer uses the embedded SRD catalog when no normalize-stage overlay is
|
||||
bound.
|
||||
|
||||
The `dnd/npcs` extractor declares the same optional campaign slots as the spell
|
||||
extractor, but it does not declare the `npcs` registry slot. Its normalizer
|
||||
accepts no references. To pass an NPC result to a later spell run, bind the
|
||||
normalized payload explicitly at runtime; the maintained sequential example
|
||||
documents that operator workflow.
|
||||
|
||||
## State Surfaces
|
||||
|
||||
The `output`, `cache`, and `debug` top-level fields select independent physical
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# D&D NPC Artifact
|
||||
|
||||
This document defines the durable D&D NPC-list artifact and its JSON codec.
|
||||
The artifact type and codec are implemented, but no selectable production
|
||||
pipeline currently produces this artifact.
|
||||
This document defines the durable D&D NPC-list artifact, its JSON codec, and
|
||||
the selectable production NPC pipeline. The normalized JSON payload can be
|
||||
passed explicitly to the spell extractor as an optional caster-name registry;
|
||||
it remains a reference, not spell evidence.
|
||||
|
||||
## Identity
|
||||
|
||||
@@ -55,3 +56,51 @@ reference shapes, and the NPC ID pattern.
|
||||
|
||||
Codec metadata contains only `npc_count`. Schema bytes and returned metadata
|
||||
are independent values so callers cannot mutate codec-owned state.
|
||||
|
||||
## Production Pipeline
|
||||
|
||||
The production identities are:
|
||||
|
||||
- extractor: `dnd/npcs`;
|
||||
- artifact kind: `dnd/npc-list`;
|
||||
- normalizer: `dnd/npcs`; and
|
||||
- durable schema: `notarius.dnd.npcs`, version `v1`, media type
|
||||
`application/json`.
|
||||
|
||||
The extractor maps private model records to the current source identity and
|
||||
assigns deterministic IDs. Extraction validation checks shape, source
|
||||
references, and source relatedness. The normalizer then consolidates records
|
||||
by canonical identity or canonical-name/alias matches, preserves the first
|
||||
record's display and output position, unions relationships and exact evidence,
|
||||
rewrites unambiguous relationship targets to canonical names, and validates
|
||||
the retained registry's identity. No LLM is used for consolidation.
|
||||
|
||||
The default extraction chain is `generic/valid_json`,
|
||||
`generic/valid_json_schema`, `extract/dnd/npcs/shape`,
|
||||
`extract/dnd/npcs/source_refs`, and
|
||||
`extract/dnd/npcs/source_relatedness`. The normalize chain adds
|
||||
`normalize/dnd/npcs/identity` before the source-reference and relatedness
|
||||
checks. Relatedness emits bounded warnings when an NPC canonical name or
|
||||
alias is not present near its cited transcript text; opaque campaign
|
||||
references may explain such a warning but do not become evidence.
|
||||
|
||||
## Manifest And Sequential Consumption
|
||||
|
||||
The NPC extractor records prompt and response-schema identities. The durable
|
||||
codec records only `npc_count`; raw names, aliases, descriptions, source
|
||||
references, and payload bytes stay in the lane file rather than manifest
|
||||
metadata. The normalized lane is independently reusable as a file reference:
|
||||
|
||||
```sh
|
||||
go run ./cmd/notarius run dnd-spells \
|
||||
--config examples/dnd-npc-spell-sequential.config.yml \
|
||||
--input examples/seriatim-minimal-transcript.json \
|
||||
--reference spells.extract.npcs=./npc-output/<run-id>/lanes/npcs.json
|
||||
```
|
||||
|
||||
The spell extractor strictly decodes and identity-validates this file, accepts
|
||||
source references belonging to another session as registry provenance, and
|
||||
uses only canonical names and aliases for caster grounding. Those NPC source
|
||||
references are never accepted as spell evidence. The spell run's manifest
|
||||
keeps raw file provenance under `references` and records only the prepared
|
||||
registry's semantic digest and count in extractor metadata.
|
||||
|
||||
@@ -94,6 +94,22 @@ Reference slot keys and accepted file types are defined in
|
||||
supporting disambiguation material, not source evidence, and are not
|
||||
addressable through `source_refs`.
|
||||
|
||||
## Optional NPC Grounding
|
||||
|
||||
The `dnd/spells` extractor accepts an optional `npcs` reference containing one
|
||||
normalized NPC artifact as `application/json`, up to 1 MiB. Preparation uses
|
||||
the approved NPC codec and identity policy to validate the file, re-encodes
|
||||
canonical durable JSON, and supplies that JSON as a spell-owned prompt input.
|
||||
It helps the model prefer canonical caster names and recognize aliases; it
|
||||
does not establish that a spell was cast.
|
||||
|
||||
NPC source references may identify the run that produced the registry or any
|
||||
other session. They remain registry provenance and are never copied into a
|
||||
spell cast's `source_refs`; every spell evidence range must still identify the
|
||||
current transcript. When the slot is absent, the prompt receives exactly
|
||||
`{"npcs":[]}` and the run has no NPC reference provenance or NPC checkpoint
|
||||
fingerprint.
|
||||
|
||||
## Normalization Behavior
|
||||
|
||||
When the `dnd/spells` normalizer is selected, each recognized spell name is
|
||||
@@ -153,7 +169,9 @@ manifest metadata:
|
||||
"response_schema_sha256": "sha256:...",
|
||||
"catalog_base_id": "dnd-5e-2014-srd-spells",
|
||||
"catalog_digest": "sha256:...",
|
||||
"catalog_overlay_ids": ["campaign.example"]
|
||||
"catalog_overlay_ids": ["campaign.example"],
|
||||
"npc_registry_digest": "sha256:...",
|
||||
"npc_count": 3
|
||||
},
|
||||
"normalizer": {
|
||||
"catalog_base_id": "dnd-5e-2014-srd-spells",
|
||||
@@ -172,8 +190,15 @@ identity fields when that module is selected. Overlay origin, media type, byte
|
||||
size, and raw digest are recorded separately in the manifest's reference
|
||||
provenance; see the [JSON output contract](json-output.md#manifestjson).
|
||||
|
||||
The `npc_registry_digest` and `npc_count` fields in the example are present only
|
||||
when the optional NPC registry is bound. They contain no NPC names, aliases,
|
||||
source references, paths, or raw bytes.
|
||||
|
||||
The extractor's prompt hash, private response-schema hash, and effective catalog
|
||||
digest also contribute independently scoped semantic checkpoint fingerprints.
|
||||
Changing any of those prepared contracts intentionally produces a cold
|
||||
checkpoint miss. Fingerprints contain only digests, never prompt, schema,
|
||||
catalog, or reference content.
|
||||
catalog, or reference content. When an NPC registry is bound, its semantic
|
||||
digest contributes an additional local `npc_registry` fingerprint; the
|
||||
manifest metadata contains only that digest and `npc_count`. Raw NPC file
|
||||
provenance remains independently recorded in the manifest's `references` list.
|
||||
|
||||
@@ -151,7 +151,8 @@ accepts only artifacts whose codec media type is `application/json`. The file
|
||||
contains the codec-owned JSON bytes pretty-printed.
|
||||
|
||||
The schema of each lane payload is owned by that artifact contract. For the
|
||||
current D&D spell lane, see [D&D Spell Artifact](dnd-spell-artifacts.md).
|
||||
current D&D lanes, see [D&D Spell Artifact](dnd-spell-artifacts.md) and
|
||||
[D&D NPC Artifact](dnd-npc-artifacts.md).
|
||||
|
||||
## `rejected.json`
|
||||
|
||||
|
||||
@@ -39,9 +39,9 @@ without exposing Scriptorium types through stage contracts.
|
||||
7. injecting that one shared client into complete pipeline preparation before
|
||||
the source file is read or the runner is invoked.
|
||||
|
||||
The D&D scene chunker and spell extractor retain this injected client and use
|
||||
it for every structured completion. Operation requests do not carry an LLM
|
||||
client.
|
||||
The D&D scene chunker and spell and NPC extractors retain this injected client
|
||||
and use it for every structured completion. Operation requests do not carry an
|
||||
LLM client.
|
||||
|
||||
The CLI separately gathers explicit profile IDs from resolved LLM-capable stage
|
||||
and validator bindings. It prepares a small internal check prompt for each ID so
|
||||
@@ -104,11 +104,15 @@ The small framework registry contains only generic test schemas; production
|
||||
schemas remain package-owned.
|
||||
|
||||
The spell extractor's package-owned prompt declares a required
|
||||
`application/json` `spell_catalog` input. The extractor generates that input
|
||||
from its prepared effective catalog as `{"spell_names":[...]}` using sorted
|
||||
canonical names only. Its input digest covers those generated bytes; manifests
|
||||
record catalog identity and digest rather than names, aliases, overlay bytes,
|
||||
or source metadata.
|
||||
`application/json` `spell_catalog` input and an optional `application/json`
|
||||
`npcs` input. The extractor generates the catalog input from its prepared
|
||||
effective catalog as `{"spell_names":[...]}` using sorted canonical names only.
|
||||
When an NPC registry is bound, it strictly decodes and identity-validates one
|
||||
durable artifact, re-encodes canonical JSON, and generates a semantic digest
|
||||
over those bytes. The unbound input is exactly `{"npcs":[]}`. Input digests
|
||||
cover the generated bytes; manifests record catalog identity and optional NPC
|
||||
registry digest/count rather than names, aliases, overlay bytes, registry
|
||||
paths, or source metadata.
|
||||
|
||||
## Debug And Redaction Boundaries
|
||||
|
||||
|
||||
@@ -25,8 +25,9 @@ of that set; input and output builders receive no references. The spell
|
||||
extractor is typed over the canonical D&D model. D&D validators, merge, and
|
||||
normalize use typed variants; JSON representation validators use serialized
|
||||
requests; and unconditional validators expose separate chunk and typed
|
||||
variants. The D&D production registrar registers only the canonical typed spell
|
||||
implementations.
|
||||
variants. The D&D production registrar registers the canonical typed spell and
|
||||
NPC implementations, including their kind-specific merge and normalize
|
||||
behavior.
|
||||
|
||||
Prepared extractors, extract validators, and codecs may be reused concurrently
|
||||
by the run-wide extract pool. Production implementations are immutable after
|
||||
@@ -81,6 +82,15 @@ semantic digest; overlay content remains contextual reference material rather
|
||||
than source evidence. Its external JSON contract is defined in the
|
||||
[spell-catalog overlay contract](../integrations/dnd-spell-catalog-overlays.md).
|
||||
|
||||
### `internal/modules/dnd/npcs/identity` and `internal/modules/dnd/codec/npcs`
|
||||
|
||||
The NPC identity package owns Unicode comparison keys, deterministic
|
||||
`npc:sha256:` IDs, display normalization, and whole-registry collision issues.
|
||||
The NPC codec owns the strict durable `dnd/npc-list` JSON boundary and exposes
|
||||
candidate versus approved encode/decode operations. NPC source references are
|
||||
durable provenance and may later be consumed by another pipeline as registry
|
||||
context without being treated as evidence for that pipeline.
|
||||
|
||||
## Input Adapter
|
||||
|
||||
### `internal/modules/seriatim/input/transcript`
|
||||
@@ -186,9 +196,34 @@ stages, using the codec only for checkpoint, debug, and output boundaries.
|
||||
Shared D&D helpers keep prompt input
|
||||
names and source-unit reference conversion consistent with the scene chunker.
|
||||
|
||||
The extractor also declares the optional `npcs` registry slot. Preparation
|
||||
requires one approved `application/json` item no larger than 1 MiB, validates
|
||||
identity without relating registry source references to the current transcript,
|
||||
and supplies canonical JSON to a spell-owned prompt message. A bound registry
|
||||
adds only `npc_registry_digest` and `npc_count` to manifest metadata and an
|
||||
`npc_registry` checkpoint fingerprint. The unbound prompt input is exactly
|
||||
`{"npcs":[]}` and has no registry provenance or fingerprint.
|
||||
|
||||
The durable payload and manifest metadata shapes are defined in the
|
||||
[D&D spell artifact contract](../integrations/dnd-spell-artifacts.md).
|
||||
|
||||
### `internal/modules/dnd/extract/npcs`
|
||||
|
||||
The NPC extractor maps private model output to the canonical `dnd.NPCList`,
|
||||
assigns source identity and deterministic NPC IDs, and preserves source
|
||||
references for deterministic validation. It uses the shared campaign
|
||||
references only for disambiguation and does not consume the spell-owned NPC
|
||||
registry slot. Its prompt and private response schema are package-owned.
|
||||
|
||||
### `internal/modules/dnd/normalize/npcs`
|
||||
|
||||
The NPC normalizer performs deterministic identity-aware consolidation in
|
||||
merged input order. It unions only canonical identity or canonical/alias
|
||||
matches, retains the first display record, unions exact relationships and
|
||||
source references, rewrites unambiguous relationship targets, and leaves
|
||||
ambiguous collisions for identity validation. It exposes the identity policy
|
||||
as its local checkpoint fingerprint and emits bounded normalization warnings.
|
||||
|
||||
## Merger And Normalizer
|
||||
|
||||
### `internal/modules/generic/merge/appendorder`
|
||||
@@ -272,6 +307,17 @@ are defined in
|
||||
payload rules are defined in the
|
||||
[artifact contract](../integrations/dnd-spell-artifacts.md).
|
||||
|
||||
## D&D NPC Validators
|
||||
|
||||
NPC shape validation checks required strings, arrays, and source-reference
|
||||
shape. The source-reference validator checks current-document identity, unit
|
||||
existence, and range ordering; source relatedness emits at most one bounded
|
||||
warning per record when neither the canonical name nor an alias occurs near
|
||||
its cited text. Normalize identity validation checks deterministic IDs,
|
||||
canonical names, aliases, and cross-record ownership or canonical collisions.
|
||||
All are deterministic and expose the policy fingerprints used by the
|
||||
production chains.
|
||||
|
||||
## Production Registration
|
||||
|
||||
Production composition occurs through family registrars. The CLI allocates one
|
||||
@@ -280,8 +326,8 @@ complete framework registry set and one LLM asset registry. It invokes
|
||||
`internal/modules/seriatim/register`, and `internal/modules/dnd/register` in
|
||||
that order, then exposes the matching catalog for resolution. The generic and
|
||||
Seriatim registrars own their production leaf registrations. The D&D registrar
|
||||
owns D&D leaf registrations, the typed spell default-validator chains, and D&D
|
||||
prompt/schema asset collection.
|
||||
owns D&D leaf registrations, typed spell and NPC default-validator chains,
|
||||
typed append-order specializations, and D&D prompt/schema asset collection.
|
||||
|
||||
Concrete implementation packages do not import generic implementation
|
||||
packages directly. A concrete family's `register` package is its composition
|
||||
|
||||
@@ -65,9 +65,9 @@ run-local construction closures. Preparation injects shared dependencies and
|
||||
constructs input, chunk, validators, ordered lanes, and output before source
|
||||
parsing. Production modules use strict construction-time option decoding, and
|
||||
LLM-backed modules retain the injected shared client. The D&D family registers
|
||||
the canonical `dnd/spell-list` codec, typed spell extractor, normalizer, and
|
||||
validators, plus kind-specific generic merge strategies; generic JSON validators
|
||||
use the serialized-validation contract. The runner executes lanes through
|
||||
the canonical `dnd/spell-list` and `dnd/npc-list` codecs, typed spell and NPC
|
||||
extractors and normalizers, validators, plus kind-specific generic merge
|
||||
strategies; generic JSON validators use the serialized-validation contract. The runner executes lanes through
|
||||
private exact-type-checked closures, coordinates extract results independently
|
||||
of completion timing, and serializes artifacts only through their codec at
|
||||
checkpoint, debug, and output boundaries.
|
||||
@@ -84,13 +84,17 @@ Configuration. The implemented module packages are:
|
||||
| `internal/modules/seriatim/input/transcript` | Parses the supported Seriatim transcript format into the generic source model. |
|
||||
| `internal/modules/generic/chunk/units` | Splits ordered source units by unit count and overlap. |
|
||||
| `internal/modules/dnd/chunk/scenes` | Produces contiguous D&D scene chunks from structured model output. |
|
||||
| `internal/modules/dnd` | Owns the canonical D&D spell-list and spell-cast artifact types. |
|
||||
| `internal/modules/dnd` | Owns the canonical D&D spell-list, spell-cast, NPC-list, NPC, and relationship artifact types. |
|
||||
| `internal/modules/dnd/codec/spells` | Strictly decodes and stably encodes the durable D&D spell-list representation. |
|
||||
| `internal/modules/dnd/codec/npcs` | Strictly decodes and stably encodes the durable D&D NPC-list representation. |
|
||||
| `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/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. |
|
||||
| `internal/modules/generic/merge/appendorder` | Combines accepted extraction results in chunk order. |
|
||||
| `internal/modules/generic/normalize/noop` | Preserves accepted merged output. |
|
||||
| `internal/modules/dnd/normalize/spells` | Canonicalizes catalog-backed spell names and exact source references, conservatively collapses duplicate casts, and reports deterministic warnings and independently scoped catalog checkpoint identity. |
|
||||
| `internal/modules/dnd/normalize/npcs` | Consolidates NPC records deterministically by identity and aliases, rewrites unambiguous relationship targets, and reports bounded warnings. |
|
||||
| `internal/modules/generic/output/json` | Encodes manifests, lane payloads, warnings, and rejections as logical JSON files. |
|
||||
|
||||
`internal/modules/dnd/shared` owns reusable D&D prompt fragments,
|
||||
@@ -98,6 +102,14 @@ reference declarations, prompt input assembly, and source-unit reference
|
||||
helpers. Domain-neutral prompt filesystem composition lives in
|
||||
`internal/framework/promptfs`.
|
||||
|
||||
The spell extractor owns its optional `npcs` registry boundary. Preparation
|
||||
strictly decodes and identity-validates one normalized JSON artifact, emits
|
||||
canonical registry JSON to the spell prompt, and records only its semantic
|
||||
digest and count in prepared metadata. The raw reference remains independently
|
||||
tracked by pipeline provenance. An absent registry is represented only by the
|
||||
empty prompt value `{"npcs":[]}`; the shared D&D reference fragment is not
|
||||
changed.
|
||||
|
||||
Generic validators under `internal/modules/generic/validate` provide
|
||||
unconditional test decisions, JSON syntax validation, and JSON Schema
|
||||
validation. D&D spell validators under `internal/modules/dnd/validate/spells`
|
||||
|
||||
@@ -40,6 +40,36 @@ names, schemas, and media types inside a run directory.
|
||||
Remove an output run directory only after its consumer data is no longer
|
||||
needed. This is data deletion, not cache cleanup.
|
||||
|
||||
## Sequential NPC And Spell Runs
|
||||
|
||||
The maintained [sequential configuration](../examples/dnd-npc-spell-sequential.config.yml)
|
||||
contains two independent pipelines over the same Seriatim input shape. Run the
|
||||
NPC pipeline first and retain its normalized payload:
|
||||
|
||||
```sh
|
||||
go run ./cmd/notarius run dnd-npcs \
|
||||
--config examples/dnd-npc-spell-sequential.config.yml \
|
||||
--input examples/seriatim-minimal-transcript.json \
|
||||
--output-dir ./npc-output
|
||||
```
|
||||
|
||||
Then bind that completed run's `lanes/npcs.json` file to the spell extractor:
|
||||
|
||||
```sh
|
||||
go run ./cmd/notarius run dnd-spells \
|
||||
--config examples/dnd-npc-spell-sequential.config.yml \
|
||||
--input examples/seriatim-minimal-transcript.json \
|
||||
--reference spells.extract.npcs=./npc-output/<run-id>/lanes/npcs.json
|
||||
```
|
||||
|
||||
The NPC file is a reference for canonical caster names and aliases, not spell
|
||||
evidence. The spell manifest records the bound file's raw reference provenance
|
||||
and the prepared registry's count and semantic digest separately. The NPC
|
||||
payload, names, aliases, source references, and file bytes can be sensitive
|
||||
campaign data; protect both output roots and any checkpoint or debug roots that
|
||||
retain derived application data. A registry from another session is allowed,
|
||||
but its source references are never copied into spell output evidence.
|
||||
|
||||
## Chunk-Plan Cache
|
||||
|
||||
Chunk plans are stored at:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# D&D NPC Extraction And Registry
|
||||
|
||||
Status: Accepted.
|
||||
Status: Complete.
|
||||
|
||||
## Purpose
|
||||
|
||||
|
||||
@@ -18,10 +18,6 @@ not as committed release dates.
|
||||
|
||||
### Add Sequential D&D Artifacts
|
||||
|
||||
- Add the proposed [D&D NPC extraction and registry](dnd-npc-extraction.md) as
|
||||
the next sequential artifact. It defines canonical identity, aliases,
|
||||
descriptions, relationships, evidence, deterministic consolidation, and
|
||||
direct reuse as spell-pipeline reference material.
|
||||
- Add combat-turn extraction with explicit event and source-reference
|
||||
semantics. Use earlier NPC output as a reference to improve participant
|
||||
identity and consistency.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# D&D NPC Extraction And Registry Implementation Plan
|
||||
|
||||
Status: Ready for implementation.
|
||||
Status: Complete.
|
||||
|
||||
Implement this plan in order. The feature policy and target state are defined
|
||||
in [D&D NPC Extraction And Registry](dnd-npc-extraction.md); this document owns
|
||||
|
||||
Reference in New Issue
Block a user