Migrate examples and guidance to shared domain inputs
This commit is contained in:
@@ -258,7 +258,8 @@ Bind declared slots using `--reference SELECTOR=PATH`:
|
|||||||
Pipeline/lane selectors may match several targets and fail if they match none.
|
Pipeline/lane selectors may match several targets and fail if they match none.
|
||||||
A binding-specific selector requires its selected target to declare the slot.
|
A binding-specific selector requires its selected target to declare the slot.
|
||||||
There is no stage-wide merger shorthand. CLI paths override configured external
|
There is no stage-wide merger shorthand. CLI paths override configured external
|
||||||
paths; narrower selectors beat broader ones, with last occurrence winning at
|
paths while retaining each target's configured collection selection; CLI-only
|
||||||
|
bindings use slot defaults. Narrower selectors beat broader ones, with last occurrence winning at
|
||||||
equal scope. Binding and unbinding the same concrete target at equal scope fails;
|
equal scope. Binding and unbinding the same concrete target at equal scope fails;
|
||||||
narrower actions can make intentional exceptions to broader actions.
|
narrower actions can make intentional exceptions to broader actions.
|
||||||
|
|
||||||
@@ -273,8 +274,9 @@ For a complete D&D workflow, pipeline-level references are first-class inputs:
|
|||||||
~~~sh
|
~~~sh
|
||||||
notarius run dnd-session --config examples/dnd-complete/config.yml \
|
notarius run dnd-session --config examples/dnd-complete/config.yml \
|
||||||
--input-file examples/dnd-complete/transcript.json \
|
--input-file examples/dnd-complete/transcript.json \
|
||||||
--reference party=/data/references/party.txt \
|
--reference party=/data/references/party.yml \
|
||||||
--reference glossary=/data/references/glossary.txt \
|
--reference glossary=/data/references/glossary.yml \
|
||||||
|
--reference spell_catalog=/data/references/glossary.yml \
|
||||||
--output-dir /data/results --format json
|
--output-dir /data/results --format json
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ Logical formats belong to [chunk-map](integrations/chunk-map.md) and
|
|||||||
## References And Ordered Handoffs
|
## References And Ordered Handoffs
|
||||||
|
|
||||||
Reference maps bind named slots that the selected target declares. An external
|
Reference maps bind named slots that the selected target declares. An external
|
||||||
reference is an object with `path`. Pipeline-level maps accept only external
|
reference is an object with `path` and optional `collections`. Pipeline-level maps accept only external
|
||||||
paths; step-local and binding-local maps may also select a normalized artifact
|
paths; step-local and binding-local maps may also select a normalized artifact
|
||||||
from an earlier step:
|
from an earlier step:
|
||||||
|
|
||||||
@@ -409,6 +409,12 @@ slot. A generated binding supplies one normalized artifact in memory, including
|
|||||||
supported qualified fallback; it does not name a file. A configured generated
|
supported qualified fallback; it does not name a file. A configured generated
|
||||||
dependency remains required even when that consumer slot is otherwise optional.
|
dependency remains required even when that consumer slot is otherwise optional.
|
||||||
|
|
||||||
|
`collections` is an external-file selection, not an artifact selector. Omitted
|
||||||
|
or null uses the consuming slot's defaults; `[]` selects none. Names compare
|
||||||
|
exactly, empty names are invalid, and repeated names have no additional effect.
|
||||||
|
Explicit names must exist. See [shared domain inputs](integrations/shared-domain-inputs.md)
|
||||||
|
for the D&D collection roles and defaults.
|
||||||
|
|
||||||
Pipeline references are configuration defaults. A matching step-local or
|
Pipeline references are configuration defaults. A matching step-local or
|
||||||
binding-local external path overrides a pipeline default. CLI reference
|
binding-local external path overrides a pipeline default. CLI reference
|
||||||
bindings are then operational overrides of configured external paths; their
|
bindings are then operational overrides of configured external paths; their
|
||||||
@@ -419,6 +425,9 @@ after configuration and CLI reference actions are applied. A YAML reference
|
|||||||
path resolves from the file that supplies its surviving declaration, including
|
path resolves from the file that supplies its surviving declaration, including
|
||||||
an imported fragment or selected overlay. CLI reference paths resolve relative
|
an imported fragment or selected overlay. CLI reference paths resolve relative
|
||||||
to the process working directory.
|
to the process working directory.
|
||||||
|
Replacing an external reference object in a more local configuration scope
|
||||||
|
replaces its selection too. A CLI path override retains the surviving configured
|
||||||
|
selection for each target; a CLI-only binding uses slot defaults.
|
||||||
|
|
||||||
### D&D Reference Slots
|
### D&D Reference Slots
|
||||||
|
|
||||||
@@ -427,11 +436,11 @@ selected target declares them:
|
|||||||
|
|
||||||
| Slot | Source and use |
|
| Slot | Source and use |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| **party** | Optional text campaign context. This is the canonical party-roster spelling. |
|
| **party** | Optional shared party document; canonical party-roster spelling. |
|
||||||
| **roster** | Accepted compatibility alias for **party**. |
|
| **roster** | Accepted compatibility alias for **party**. |
|
||||||
| **players** | Optional text player context. |
|
| **players** | Optional text player context. |
|
||||||
| **glossary** | Optional text campaign glossary. |
|
| **glossary** | Optional shared glossary document for general campaign vocabulary. |
|
||||||
| **spell_catalog** | Optional JSON spell-catalog overlay for spell extraction and normalization. See [spell-catalog overlays](integrations/dnd-spell-catalog-overlays.md). |
|
| **spell_catalog** | Optional shared glossary document for spell recognition and normalization. |
|
||||||
| **location_registry** | Required normalized location registry for location-occurrence extraction and normalization. |
|
| **location_registry** | Required normalized location registry for location-occurrence extraction and normalization. |
|
||||||
| **item_registry** | Required normalized item registry for item-occurrence extraction and normalization. |
|
| **item_registry** | Required normalized item registry for item-occurrence extraction and normalization. |
|
||||||
| **npc_registry** | Normalized NPC registry. Optional for spells and combat turns; required for NPC occurrences and enemy-event extraction and normalization. |
|
| **npc_registry** | Normalized NPC registry. Optional for spells and combat turns; required for NPC occurrences and enemy-event extraction and normalization. |
|
||||||
|
|||||||
@@ -41,10 +41,9 @@ notarius run dnd-session \
|
|||||||
--config /absolute/path/to/notarius.yml \
|
--config /absolute/path/to/notarius.yml \
|
||||||
--input-file /absolute/path/to/transcripts/final.trimmed.json \
|
--input-file /absolute/path/to/transcripts/final.trimmed.json \
|
||||||
--output-dir /absolute/path/to/notarius-output \
|
--output-dir /absolute/path/to/notarius-output \
|
||||||
--reference party=/absolute/path/to/references/party.txt \
|
--reference party=/absolute/path/to/references/party.yml \
|
||||||
--reference players=/absolute/path/to/references/players.txt \
|
--reference glossary=/absolute/path/to/references/glossary.yml \
|
||||||
--reference glossary=/absolute/path/to/references/glossary.txt \
|
--reference spell_catalog=/absolute/path/to/references/glossary.yml \
|
||||||
--reference spell_catalog=/absolute/path/to/references/spells.json \
|
|
||||||
--format json
|
--format json
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
@@ -53,6 +52,10 @@ reach every selected target declaring the slot; narrower overrides follow the
|
|||||||
[selector contract](../cli.md#reference-selectors). Generated registry, scene,
|
[selector contract](../cli.md#reference-selectors). Generated registry, scene,
|
||||||
combat, and NPC-occurrence handoffs stay in pipeline configuration, not CLI file
|
combat, and NPC-occurrence handoffs stay in pipeline configuration, not CLI file
|
||||||
bindings.
|
bindings.
|
||||||
|
The [shared input contract](../integrations/shared-domain-inputs.md) explains
|
||||||
|
the party and glossary envelopes, selection defaults, and migration. Roster
|
||||||
|
player relationships do not require a separate player file; supplemental
|
||||||
|
`players` text remains optional.
|
||||||
|
|
||||||
For an optional online readiness check, use `notarius preflight dnd-session`
|
For an optional online readiness check, use `notarius preflight dnd-session`
|
||||||
with the same configuration, transcript, output root, and reference arguments as
|
with the same configuration, transcript, output root, and reference arguments as
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ that will be used for execution:
|
|||||||
notarius preflight pipeline-id \
|
notarius preflight pipeline-id \
|
||||||
--config /absolute/path/to/notarius.yml --overlay production \
|
--config /absolute/path/to/notarius.yml --overlay production \
|
||||||
--input-file /absolute/path/to/source.json \
|
--input-file /absolute/path/to/source.json \
|
||||||
--reference party=/absolute/path/to/party.txt \
|
--reference party=/absolute/path/to/party.yml \
|
||||||
--output-dir /absolute/path/to/output-root --format json
|
--output-dir /absolute/path/to/output-root --format json
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ Then run with the same selection and reference:
|
|||||||
notarius run pipeline-id \
|
notarius run pipeline-id \
|
||||||
--config /absolute/path/to/notarius.yml --overlay production \
|
--config /absolute/path/to/notarius.yml --overlay production \
|
||||||
--input-file /absolute/path/to/source.json \
|
--input-file /absolute/path/to/source.json \
|
||||||
--reference party=/absolute/path/to/party.txt \
|
--reference party=/absolute/path/to/party.yml \
|
||||||
--output-dir /absolute/path/to/output-root --format json
|
--output-dir /absolute/path/to/output-root --format json
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ implementing changes. It owns implementation discipline and local commit rules.
|
|||||||
| Building a subprocess caller or changing its result protocol | [Subprocess Consumer Guide](consumers/subprocess.md), [Complete D&D Consumer Guide](consumers/dnd-pipeline.md), [Native Completion Report](cli.md#completion-report), and [CLI Internals](internal/cli.md) | These separate generic caller workflow, the complete D&D workflow, the native completion report, and CLI implementation behavior. |
|
| Building a subprocess caller or changing its result protocol | [Subprocess Consumer Guide](consumers/subprocess.md), [Complete D&D Consumer Guide](consumers/dnd-pipeline.md), [Native Completion Report](cli.md#completion-report), and [CLI Internals](internal/cli.md) | These separate generic caller workflow, the complete D&D workflow, the native completion report, and CLI implementation behavior. |
|
||||||
| Configuration loading, resolution, or user-visible configuration behavior | [Configuration Internals](internal/configuration.md) and [Configuration](config.md) | The internal guide owns loading and resolution mechanics; the reference owns the configuration contract. |
|
| Configuration loading, resolution, or user-visible configuration behavior | [Configuration Internals](internal/configuration.md) and [Configuration](config.md) | The internal guide owns loading and resolution mechanics; the reference owns the configuration contract. |
|
||||||
| Pipeline resolution or execution | [Pipeline Internals](internal/pipeline.md) | It documents typed preparation, complete assessment, native continuation, workers, and handoff eligibility. |
|
| Pipeline resolution or execution | [Pipeline Internals](internal/pipeline.md) | It documents typed preparation, complete assessment, native continuation, workers, and handoff eligibility. |
|
||||||
| Production modules or validators | [Module Internals](internal/modules.md), [D&D Module Internals](internal/dnd.md), and [D&D integration contracts](integrations/) | The generic guide owns extension mechanics, the D&D guide owns shared family conventions, and the contracts own durable output shapes. |
|
| Production modules or validators | [Module Internals](internal/modules.md), [D&D Module Internals](internal/dnd.md), [shared domain inputs](integrations/shared-domain-inputs.md), and [D&D integration contracts](integrations/) | The generic guide owns extension mechanics, the D&D guide owns shared family conventions, and the contracts own input and durable output shapes. |
|
||||||
| Native execution, prompts, schemas, profiles, or admission | [LLM Integration](internal/llm.md) | It locates shared engine construction, native request/continuation calls, and evidence hooks. |
|
| Native execution, prompts, schemas, profiles, or admission | [LLM Integration](internal/llm.md) | It locates shared engine construction, native request/continuation calls, and evidence hooks. |
|
||||||
| Kit API, source handoff, or standard-suite integration | [ConfigKit](integrations/pkg-configkit.md), [PromptKit](integrations/pkg-promptkit.md), and [CommandKit](integrations/pkg-commandkit.md) | These define the selected upstream integration boundaries and link pinned native contracts. |
|
| Kit API, source handoff, or standard-suite integration | [ConfigKit](integrations/pkg-configkit.md), [PromptKit](integrations/pkg-promptkit.md), and [CommandKit](integrations/pkg-commandkit.md) | These define the selected upstream integration boundaries and link pinned native contracts. |
|
||||||
| Output, accepted-result reuse, or debug artifacts | [Run State Internals](internal/state.md), [Operations](operations.md), and [Configuration](config.md) | These separate implementation details, operator behavior, and configuration contracts. |
|
| Output, accepted-result reuse, or debug artifacts | [Run State Internals](internal/state.md), [Operations](operations.md), and [Configuration](config.md) | These separate implementation details, operator behavior, and configuration contracts. |
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ into `source_refs`.
|
|||||||
|
|
||||||
## Related contracts
|
## Related contracts
|
||||||
|
|
||||||
The [spell-catalog overlay contract](dnd-spell-catalog-overlays.md) defines
|
The [shared domain input contract](shared-domain-inputs.md) defines
|
||||||
the configured catalog additions. The [JSON output contract](json-output.md)
|
the configured catalog additions. The [JSON output contract](json-output.md)
|
||||||
defines where this logical artifact is published; [D&D module internals](../internal/dnd.md)
|
defines where this logical artifact is published; [D&D module internals](../internal/dnd.md)
|
||||||
describes extraction and validation mechanics.
|
describes extraction and validation mechanics.
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
# D&D Spell-Catalog Overlays
|
|
||||||
|
|
||||||
This document defines the optional JSON overlay consumed by the D&D spell
|
|
||||||
extractor. An overlay contributes campaign spell names and aliases for
|
|
||||||
recognition. It does not define spell rules, effects, levels, classes, or
|
|
||||||
transcript evidence. Bind the optional `spell_catalog` reference as described
|
|
||||||
in [Configuration](../config.md#references-and-ordered-handoffs).
|
|
||||||
|
|
||||||
## Contract Identity
|
|
||||||
|
|
||||||
| Property | Value |
|
|
||||||
| --- | --- |
|
|
||||||
| Consumer | D&D spell extraction and normalization |
|
|
||||||
| Reference slot | `spell_catalog` |
|
|
||||||
| Media type | `application/json` |
|
|
||||||
| Required schema version | `notarius.dnd.spell-catalog-overlay.v1` |
|
|
||||||
| Base catalog | Embedded D&D 5e 2014 SRD catalog |
|
|
||||||
|
|
||||||
At most one overlay document may be bound. The maintained example is
|
|
||||||
[spell-catalog.json](../../examples/dnd-complete/spell-catalog.json).
|
|
||||||
|
|
||||||
## Wire Shape
|
|
||||||
|
|
||||||
This is a minimal valid overlay:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"schema_version": "notarius.dnd.spell-catalog-overlay.v1",
|
|
||||||
"catalogs": [
|
|
||||||
{
|
|
||||||
"id": "campaign.example",
|
|
||||||
"ruleset": "dnd-5e-2014",
|
|
||||||
"source": {"title": "Example campaign spells"},
|
|
||||||
"spells": [{"name": "Aegis of Emberfall"}]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
| Field | Required | Meaning and constraints |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| `schema_version` | Yes | Exactly `notarius.dnd.spell-catalog-overlay.v1`. |
|
|
||||||
| `catalogs` | Yes | Non-empty array of catalog objects with unique IDs. |
|
|
||||||
| `catalogs[].id` | Yes | Non-empty trimmed string. |
|
|
||||||
| `catalogs[].ruleset` | Yes | Exactly `dnd-5e-2014`. |
|
|
||||||
| `catalogs[].source.title` | Yes | Non-empty trimmed string. |
|
|
||||||
| `catalogs[].source.version` | No | String when present. |
|
|
||||||
| `catalogs[].source.url` | No | String when present. |
|
|
||||||
| `catalogs[].source.license` | No | String when present. |
|
|
||||||
| `catalogs[].spells` | Yes | Non-empty array of spell objects. |
|
|
||||||
| `catalogs[].spells[].name` | Yes | Non-empty trimmed string. |
|
|
||||||
| `catalogs[].spells[].aliases` | No | Array of non-empty trimmed strings when present. |
|
|
||||||
|
|
||||||
Unknown fields are rejected at every object level. The document must contain
|
|
||||||
one JSON value; `null` is not accepted for optional strings or aliases.
|
|
||||||
|
|
||||||
## Composition And Compatibility
|
|
||||||
|
|
||||||
Notarius starts with the embedded base catalog, then applies overlay catalogs
|
|
||||||
in ascending catalog-ID order. A new canonical spell name adds a recognition
|
|
||||||
entry. If an overlay names an existing canonical spell, it augments that spell
|
|
||||||
with aliases while retaining the established display spelling.
|
|
||||||
|
|
||||||
Repeated aliases for the same spell are accepted. A canonical-name, canonical-
|
|
||||||
to-alias, or alias-to-alias collision between different spells is rejected,
|
|
||||||
including a collision with the embedded catalog. Matching uses the catalog’s
|
|
||||||
case, whitespace, and apostrophe normalization, so authors should avoid names
|
|
||||||
or aliases that normalize to another spell.
|
|
||||||
|
|
||||||
Spell extraction receives the effective catalog as deterministic canonical-name
|
|
||||||
and alias pairs. An alias in the transcript selects its associated canonical
|
|
||||||
name; the extractor is instructed to return that canonical spelling. The
|
|
||||||
projection contains no catalog source metadata or provenance, and aliases
|
|
||||||
remain recognition context rather than transcript evidence.
|
|
||||||
|
|
||||||
The overlay is a recognition aid only. The durable spell-artifact schema and
|
|
||||||
source-evidence rules are defined by the
|
|
||||||
[D&D spell artifact contract](dnd-spell-artifacts.md).
|
|
||||||
68
docs/integrations/shared-domain-inputs.md
Normal file
68
docs/integrations/shared-domain-inputs.md
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
# Shared Domain Reference Inputs
|
||||||
|
|
||||||
|
Notarius accepts shared party and glossary documents as optional D&D reference
|
||||||
|
inputs. The complete example provides a [party](../../examples/dnd-complete/party.yml)
|
||||||
|
and one [multi-collection glossary](../../examples/dnd-complete/glossary.yml).
|
||||||
|
The reference binding interface and defaults belong to
|
||||||
|
[Configuration](../config.md#references-and-ordered-handoffs).
|
||||||
|
|
||||||
|
## Supported Contracts
|
||||||
|
|
||||||
|
Notarius bundles the following contracts from shared schemas distribution
|
||||||
|
`2026.11.1`, commit `f7e3cedeca11ed903311cdf29ca4d81fb1f216b7`, for offline
|
||||||
|
validation. The document marker is not a schema-version selector.
|
||||||
|
|
||||||
|
| Role | Version and marker | Upstream semantics |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `party` and accepted `roster` aliases | RPG party `0.2.0`, `maximumdirect.rpg.party.v1` | [Party semantics](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/rpg/party/v0.2.0/semantics.md) |
|
||||||
|
| `glossary` and `spell_catalog` | Glossary `0.2.0`, `maximumdirect.glossary.v1` | [Glossary semantics](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/glossary/v0.2.0/semantics.md) |
|
||||||
|
|
||||||
|
Inputs are YAML or JSON, with media types `application/yaml`,
|
||||||
|
`application/x-yaml`, or `application/json`. JSON must use JSON syntax.
|
||||||
|
Both serializations pass through ConfigKit's native mapping load and are
|
||||||
|
validated as complete documents, including unselected collections. See the
|
||||||
|
pinned [ConfigKit native contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md)
|
||||||
|
for loading, dynamic numeric binding, limits, and reserved controls such as
|
||||||
|
`extends` and source-root `config`. Notarius adds exact per-collection entry-ID
|
||||||
|
uniqueness and task-specific suitability checks; ordinary extensions remain
|
||||||
|
data, not instructions.
|
||||||
|
|
||||||
|
## Task Views
|
||||||
|
|
||||||
|
Each binding selects collections independently. General glossary context defaults
|
||||||
|
to the available `campaign` and `setting` collections; a bound
|
||||||
|
`spell_catalog` defaults to `spells`, which must exist. Explicit selections
|
||||||
|
must exist, may be empty, and compare names exactly. Empty valid selections or
|
||||||
|
collections contribute no added vocabulary. No binding is required merely
|
||||||
|
because another is present. The same file can serve both roles.
|
||||||
|
|
||||||
|
Party context includes names, aliases, optional player relationships and
|
||||||
|
classes/levels, without exposing roster IDs to the model. Distinct roster
|
||||||
|
entries remain distinct even when names match. `party` takes presentation
|
||||||
|
precedence over `roster`; both supplied documents are validated.
|
||||||
|
`players` remains optional supplemental text. No duplicate player list is
|
||||||
|
needed for relationships already in the roster.
|
||||||
|
|
||||||
|
General glossary context projects names, aliases, categories, descriptions,
|
||||||
|
and plural forms. Spell recognition projects names and aliases only and starts
|
||||||
|
with the embedded D&D 5e 2014 SRD vocabulary. Existing canonical display
|
||||||
|
names take precedence; selected entries may augment their aliases. Conflicting
|
||||||
|
recognition keys for different spells are task errors. Collection names and
|
||||||
|
entry IDs determine deterministic traversal; IDs, provenance, and irrelevant
|
||||||
|
extensions are not promoted to model instructions or transcript evidence.
|
||||||
|
|
||||||
|
## Migration
|
||||||
|
|
||||||
|
Replace plain-text `party` or `roster` files with the shared party envelope
|
||||||
|
and move character/player relationships into roster entries. Replace text
|
||||||
|
`glossary` files and the private `notarius.dnd.spell-catalog-overlay.v1`
|
||||||
|
envelope with shared glossary entries under named collections. Map old spell
|
||||||
|
names and aliases directly to entries; old ruleset metadata is not required,
|
||||||
|
and source information may be optional collection provenance. Aliases may be
|
||||||
|
omitted, null, or empty. Add `collections` on an external binding only when
|
||||||
|
the slot defaults are not appropriate. Existing slot names and CLI selectors
|
||||||
|
remain unchanged. There is no legacy reader or automatic conversion.
|
||||||
|
|
||||||
|
Run and explicit preflight validate supplied documents during preparation,
|
||||||
|
before domain inference; offline pipeline validation does not read reference
|
||||||
|
files. See [CLI preflight](../cli.md#preflight) for its readiness scope.
|
||||||
@@ -42,6 +42,14 @@ separate from execution integration.
|
|||||||
|
|
||||||
## Prompt Construction
|
## Prompt Construction
|
||||||
|
|
||||||
|
The [shared context preparer](../../internal/modules/dnd/shared/context.go)
|
||||||
|
loads and validates selected party and glossary references at construction,
|
||||||
|
then retains narrow immutable prompt projections. Each operation combines them
|
||||||
|
with its own transcript; generated registry and scene handoffs remain dynamic.
|
||||||
|
The spell catalog builds recognition views from the same shared glossary
|
||||||
|
integration. The [shared input contract](../integrations/shared-domain-inputs.md)
|
||||||
|
owns supported formats and selection semantics.
|
||||||
|
|
||||||
Content lives beneath [assets/dnd](../../assets/dnd/), with ordinary native
|
Content lives beneath [assets/dnd](../../assets/dnd/), with ordinary native
|
||||||
declarations imported by [assets/notarius.yml](../../assets/notarius.yml).
|
declarations imported by [assets/notarius.yml](../../assets/notarius.yml).
|
||||||
The root assets package stays a content-only leaf. Declaration-relative content
|
The root assets package stays a content-only leaf. Declaration-relative content
|
||||||
@@ -275,7 +283,7 @@ not accepted-result cache identity.
|
|||||||
|
|
||||||
| Lane | Intentional behavior |
|
| Lane | Intentional behavior |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| Spells | May use a spell-catalog overlay and optional NPC grounding; the catalog validator supplies domain-specific semantic checks. |
|
| Spells | May use a shared glossary for recognition and optional NPC grounding; the catalog validator supplies domain-specific semantic checks. |
|
||||||
| NPC registry | Establishes transcript-grounded NPC identities, including factual third-party mentions, without assigning occurrence categories. It does not consume an NPC registry, and its normalizer is the LLM-assisted reconciliation exception described above. |
|
| NPC registry | Establishes transcript-grounded NPC identities, including factual third-party mentions, without assigning occurrence categories. It does not consume an NPC registry, and its normalizer is the LLM-assisted reconciliation exception described above. |
|
||||||
| Combat turns | Requires a scene-description artifact. It calls the LLM only for an exact `combat` classification; non-combat paths directly assess an empty result, while missing or mismatched classifications also retain a bounded warning. Optional NPC grounding never becomes evidence. |
|
| Combat turns | Requires a scene-description artifact. It calls the LLM only for an exact `combat` classification; non-combat paths directly assess an empty result, while missing or mismatched classifications also retain a bounded warning. Optional NPC grounding never becomes evidence. |
|
||||||
| Item occurrences | Requires the normalized item registry for exact deterministic grounding at extraction and normalization. Campaign context may disambiguate, but the registry never becomes occurrence evidence. |
|
| Item occurrences | Requires the normalized item registry for exact deterministic grounding at extraction and normalization. Campaign context may disambiguate, but the registry never becomes occurrence evidence. |
|
||||||
|
|||||||
@@ -383,9 +383,8 @@ validation simply because no chunks execute or accepted artifacts are cached.
|
|||||||
|
|
||||||
## Stage 9 — Verify Assembled Run And Preflight Behavior
|
## Stage 9 — Verify Assembled Run And Preflight Behavior
|
||||||
|
|
||||||
**Status:** Complete. Focused assembled checks pass; the broader CLI suite still
|
**Status:** Complete. Focused assembled checks, the preflight and framework
|
||||||
has failures in tests using the old maintained example files, whose migration is
|
pipeline suites, and the broader CLI suite pass after the example migration.
|
||||||
assigned below. The preflight and framework pipeline suites pass.
|
|
||||||
|
|
||||||
**Goal:** Prove the public workflow through real internal collaborators and fake
|
**Goal:** Prove the public workflow through real internal collaborators and fake
|
||||||
provider boundaries.
|
provider boundaries.
|
||||||
@@ -419,6 +418,8 @@ the final ordinary pipeline remains usable with optional references omitted.
|
|||||||
|
|
||||||
## Stage 10 — Migrate Maintained Examples And Canonical Documentation
|
## Stage 10 — Migrate Maintained Examples And Canonical Documentation
|
||||||
|
|
||||||
|
**Status:** Complete.
|
||||||
|
|
||||||
**Goal:** Make the supported workflow discoverable without duplicating upstream
|
**Goal:** Make the supported workflow discoverable without duplicating upstream
|
||||||
schema manuals.
|
schema manuals.
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ aliases and descriptions, and extensible domain information. The authoritative
|
|||||||
contract defines omission, null, and empty values. Notarius should honor those
|
contract defines omission, null, and empty values. Notarius should honor those
|
||||||
shapes rather than require the current spell overlay's different representation.
|
shapes rather than require the current spell overlay's different representation.
|
||||||
|
|
||||||
The existing [spell-catalog overlay](../integrations/dnd-spell-catalog-overlays.md)
|
The former [spell-catalog overlay](https://forge.maximumdirect.net/eric/notarius/src/commit/bff0fb44e86e024f1cb5f0987b2ba583c225a53b/docs/integrations/dnd-spell-catalog-overlays.md)
|
||||||
requires a separate schema marker and catalog structure, rejects unknown fields,
|
requires a separate schema marker and catalog structure, rejects unknown fields,
|
||||||
and couples input to catalog/ruleset requirements. Replace that operator-facing
|
and couples input to catalog/ruleset requirements. Replace that operator-facing
|
||||||
format with shared glossary consumption. The operator should be able to supply
|
format with shared glossary consumption. The operator should be able to supply
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Reviewed against Notarius commit
|
|||||||
- D&D shared prompt inputs treat `party`, `players`, and `glossary` as text.
|
- D&D shared prompt inputs treat `party`, `players`, and `glossary` as text.
|
||||||
Some modules also accept the existing `roster` alias. These inputs do not
|
Some modules also accept the existing `roster` alias. These inputs do not
|
||||||
currently establish conformance to the proposed shared contracts.
|
currently establish conformance to the proposed shared contracts.
|
||||||
- [Spell-catalog overlays](../integrations/dnd-spell-catalog-overlays.md) use the
|
- The former [spell-catalog overlay contract](https://forge.maximumdirect.net/eric/notarius/src/commit/bff0fb44e86e024f1cb5f0987b2ba583c225a53b/docs/integrations/dnd-spell-catalog-overlays.md) used the
|
||||||
private `notarius.dnd.spell-catalog-overlay.v1` JSON format. The reader rejects
|
private `notarius.dnd.spell-catalog-overlay.v1` JSON format. The reader rejects
|
||||||
unknown fields, requires catalog/ruleset/source information, and rejects null
|
unknown fields, requires catalog/ruleset/source information, and rejects null
|
||||||
aliases. That reader cannot consume a shared glossary unchanged.
|
aliases. That reader cannot consume a shared glossary unchanged.
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
Ravenfall watchtower: a ruined watchtower near the party's current route.
|
|
||||||
Mira Thorn: the watchtower's keeper.
|
|
||||||
Elder Rowan: a missing local scholar.
|
|
||||||
Kesh: a goblin captain leading raiders.
|
|
||||||
Moonblade: a blade found in the watchtower's hidden cache.
|
|
||||||
Cure Wounds: a healing spell.
|
|
||||||
Shield: a defensive reaction spell.
|
|
||||||
Aegis of Emberfall: a campaign spell recorded in the supplied catalog overlay.
|
|
||||||
34
examples/dnd-complete/glossary.yml
Normal file
34
examples/dnd-complete/glossary.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
schema_version: maximumdirect.glossary.v1
|
||||||
|
collections:
|
||||||
|
campaign:
|
||||||
|
entries:
|
||||||
|
- id: mira
|
||||||
|
name: Mira Thorn
|
||||||
|
category: person
|
||||||
|
description: The watchtower's keeper.
|
||||||
|
- id: rowan
|
||||||
|
name: Elder Rowan
|
||||||
|
category: person
|
||||||
|
description: A missing local scholar.
|
||||||
|
- id: kesh
|
||||||
|
name: Kesh
|
||||||
|
category: person
|
||||||
|
description: A goblin captain leading raiders.
|
||||||
|
- id: moonblade
|
||||||
|
name: Moonblade
|
||||||
|
category: item
|
||||||
|
description: A blade found in the watchtower's hidden cache.
|
||||||
|
setting:
|
||||||
|
entries:
|
||||||
|
- id: ravenfall
|
||||||
|
name: Ravenfall watchtower
|
||||||
|
category: place
|
||||||
|
description: A ruined watchtower near the party's current route.
|
||||||
|
spells:
|
||||||
|
provenance:
|
||||||
|
title: Notarius example campaign spell names
|
||||||
|
entries:
|
||||||
|
- id: aegis
|
||||||
|
name: Aegis of Emberfall
|
||||||
|
category: spell
|
||||||
|
aliases: [Emberfall Aegis]
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Aria: party cleric and recurring healer.
|
|
||||||
Borin: fighter ally.
|
|
||||||
18
examples/dnd-complete/party.yml
Normal file
18
examples/dnd-complete/party.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
schema_version: maximumdirect.rpg.party.v1
|
||||||
|
characters:
|
||||||
|
aria:
|
||||||
|
character:
|
||||||
|
name: Aria
|
||||||
|
aliases: [Brightmantle]
|
||||||
|
classes:
|
||||||
|
- name: Cleric
|
||||||
|
level: 3
|
||||||
|
player:
|
||||||
|
name: Alice
|
||||||
|
borin:
|
||||||
|
character:
|
||||||
|
name: Borin
|
||||||
|
classes:
|
||||||
|
- name: Fighter
|
||||||
|
player:
|
||||||
|
name: Ben
|
||||||
@@ -15,9 +15,9 @@ pipelines:
|
|||||||
# Stable campaign context is shared by every module that accepts these slots.
|
# Stable campaign context is shared by every module that accepts these slots.
|
||||||
references:
|
references:
|
||||||
party:
|
party:
|
||||||
path: ../party.txt
|
path: ../party.yml
|
||||||
glossary:
|
glossary:
|
||||||
path: ../glossary.txt
|
path: ../glossary.yml
|
||||||
chunk:
|
chunk:
|
||||||
module: dnd/scenes
|
module: dnd/scenes
|
||||||
output:
|
output:
|
||||||
@@ -71,7 +71,7 @@ pipelines:
|
|||||||
module: dnd/spells
|
module: dnd/spells
|
||||||
references:
|
references:
|
||||||
spell_catalog:
|
spell_catalog:
|
||||||
path: ../spell-catalog.json
|
path: ../glossary.yml
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
# Stage-local file references are intentionally bound at each stage.
|
# Stage-local file references are intentionally bound at each stage.
|
||||||
@@ -79,7 +79,7 @@ pipelines:
|
|||||||
module: dnd/spells
|
module: dnd/spells
|
||||||
references:
|
references:
|
||||||
spell_catalog:
|
spell_catalog:
|
||||||
path: ../spell-catalog.json
|
path: ../glossary.yml
|
||||||
combat-turns:
|
combat-turns:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/combat-turns
|
module: dnd/combat-turns
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"schema_version": "notarius.dnd.spell-catalog-overlay.v1",
|
|
||||||
"catalogs": [
|
|
||||||
{
|
|
||||||
"id": "notarius.example-campaign",
|
|
||||||
"ruleset": "dnd-5e-2014",
|
|
||||||
"source": {
|
|
||||||
"title": "Notarius example campaign spell names",
|
|
||||||
"version": "1",
|
|
||||||
"url": "",
|
|
||||||
"license": ""
|
|
||||||
},
|
|
||||||
"spells": [
|
|
||||||
{
|
|
||||||
"name": "Aegis of Emberfall",
|
|
||||||
"aliases": ["Emberfall Aegis"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -93,9 +93,9 @@ func TestMaintainedCompleteInvocationPublishesRegistryBackedEntityOccurrences(t
|
|||||||
code := RunWithOptions([]string{
|
code := RunWithOptions([]string{
|
||||||
"run", "dnd-session", "--config", configPath,
|
"run", "dnd-session", "--config", configPath,
|
||||||
"--input-file", repositoryPath("examples", "dnd-complete", "transcript.json"),
|
"--input-file", repositoryPath("examples", "dnd-complete", "transcript.json"),
|
||||||
"--reference", "party=" + repositoryPath("examples", "dnd-complete", "party.txt"),
|
"--reference", "party=" + repositoryPath("examples", "dnd-complete", "party.yml"),
|
||||||
"--reference", "glossary=" + repositoryPath("examples", "dnd-complete", "glossary.txt"),
|
"--reference", "glossary=" + repositoryPath("examples", "dnd-complete", "glossary.yml"),
|
||||||
"--reference", "spell_catalog=" + repositoryPath("examples", "dnd-complete", "spell-catalog.json"),
|
"--reference", "spell_catalog=" + repositoryPath("examples", "dnd-complete", "glossary.yml"),
|
||||||
"--cache", "bypass", "--output-dir", outputRoot,
|
"--cache", "bypass", "--output-dir", outputRoot,
|
||||||
"--llm-session-id", "enemy-event-session", "--format", "json",
|
"--llm-session-id", "enemy-event-session", "--format", "json",
|
||||||
}, &stdout, &stderr, options)
|
}, &stdout, &stderr, options)
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ func TestProductionNPCConfigurationValidatesOptionsReferencesAndPlacement(t *tes
|
|||||||
if err := resolve(func(profile *pipeline.PipelineProfile) {
|
if err := resolve(func(profile *pipeline.PipelineProfile) {
|
||||||
profile.References = pipeline.ExternalReferenceMap(map[string]string{
|
profile.References = pipeline.ExternalReferenceMap(map[string]string{
|
||||||
"players": "players.txt",
|
"players": "players.txt",
|
||||||
"party": "party.txt",
|
"party": "party.yml",
|
||||||
"glossary": "glossary.txt",
|
"glossary": "glossary.yml",
|
||||||
})
|
})
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
t.Fatalf("optional NPC references error = %v, want resolution success", err)
|
t.Fatalf("optional NPC references error = %v, want resolution success", err)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
"gitea.maximumdirect.net/eric/notarius/internal/core/config"
|
"gitea.maximumdirect.net/eric/notarius/internal/core/config"
|
||||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||||
|
"gitea.maximumdirect.net/eric/notarius/internal/integrations/domainrefs"
|
||||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
||||||
locationoccurrenceextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/locationoccurrences"
|
locationoccurrenceextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/locationoccurrences"
|
||||||
locationextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/locationregistry"
|
locationextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/locationregistry"
|
||||||
@@ -123,6 +124,25 @@ func TestMaintainedExamplesResolveComposition(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMaintainedSharedReferencesConform(t *testing.T) {
|
||||||
|
for _, item := range []struct {
|
||||||
|
name string
|
||||||
|
validate func(map[string]any) error
|
||||||
|
}{
|
||||||
|
{"party.yml", domainrefs.ValidateParty},
|
||||||
|
{"glossary.yml", domainrefs.ValidateGlossary},
|
||||||
|
} {
|
||||||
|
content := readRepositoryFile(t, "examples", "dnd-complete", item.name)
|
||||||
|
doc, err := domainrefs.Load(item.name, "application/yaml", content)
|
||||||
|
if err == nil {
|
||||||
|
err = item.validate(doc)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("%s: %v", item.name, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestMaintainedExampleDevelopmentInheritsComposition(t *testing.T) {
|
func TestMaintainedExampleDevelopmentInheritsComposition(t *testing.T) {
|
||||||
path := repositoryPath("examples", "dnd-complete", "config.yml")
|
path := repositoryPath("examples", "dnd-complete", "config.yml")
|
||||||
cfg := loadMaintainedExample(t, path)
|
cfg := loadMaintainedExample(t, path)
|
||||||
@@ -427,10 +447,10 @@ func TestCompleteDNDSharedCLIReferencesExpandAcrossCompatibleTargets(t *testing.
|
|||||||
cfg := loadMaintainedExample(t, repositoryPath("examples", "dnd-complete", "config.yml"))
|
cfg := loadMaintainedExample(t, repositoryPath("examples", "dnd-complete", "config.yml"))
|
||||||
catalog := catalogFromRegistries(productionTestComponents(t).registries)
|
catalog := catalogFromRegistries(productionTestComponents(t).registries)
|
||||||
sources := map[string]string{
|
sources := map[string]string{
|
||||||
"party": "/references/party.txt",
|
"party": "/references/party.yml",
|
||||||
"players": "/references/players.txt",
|
"players": "/references/players.txt",
|
||||||
"glossary": "/references/glossary.txt",
|
"glossary": "/references/glossary.yml",
|
||||||
"spell_catalog": "/references/spells.json",
|
"spell_catalog": "/references/glossary.yml",
|
||||||
}
|
}
|
||||||
requests := make([]cliReferenceRequest, 0, len(sources))
|
requests := make([]cliReferenceRequest, 0, len(sources))
|
||||||
for _, slot := range []string{"party", "players", "glossary", "spell_catalog"} {
|
for _, slot := range []string{"party", "players", "glossary", "spell_catalog"} {
|
||||||
|
|||||||
@@ -624,7 +624,7 @@ func productionSpellCatalogContractConfig(t *testing.T) string {
|
|||||||
t.Helper()
|
t.Helper()
|
||||||
partyPath := writeSharedReference(t, "party.yml", validPartyYAML)
|
partyPath := writeSharedReference(t, "party.yml", validPartyYAML)
|
||||||
glossaryPath := writeSharedReference(t, "glossary.json", validSharedGlossary)
|
glossaryPath := writeSharedReference(t, "glossary.json", validSharedGlossary)
|
||||||
catalogPath := filepath.Join(t.TempDir(), "spell-catalog.json")
|
catalogPath := filepath.Join(t.TempDir(), "spell-glossary.json")
|
||||||
if err := os.WriteFile(catalogPath, []byte(`{"schema_version":"maximumdirect.glossary.v1","collections":{"spells":{"entries":[{"id":"aegis","name":"Aegis of Emberfall","category":"spell","aliases":["Emberfall Aegis"]}]}}}`), 0o600); err != nil {
|
if err := os.WriteFile(catalogPath, []byte(`{"schema_version":"maximumdirect.glossary.v1","collections":{"spells":{"entries":[{"id":"aegis","name":"Aegis of Emberfall","category":"spell","aliases":["Emberfall Aegis"]}]}}}`), 0o600); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ type recoveryFixture struct {
|
|||||||
func newRecoveryFixture(t *testing.T) *recoveryFixture {
|
func newRecoveryFixture(t *testing.T) *recoveryFixture {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
root := t.TempDir()
|
root := t.TempDir()
|
||||||
for _, name := range []string{"prompts.yml", "transcript.json", "party.txt", "glossary.txt", "spell-catalog.json", "pipelines/dnd-session.yml", "pipelines/dnd-session.describe-session.yml"} {
|
for _, name := range []string{"prompts.yml", "transcript.json", "party.yml", "glossary.yml", "pipelines/dnd-session.yml", "pipelines/dnd-session.describe-session.yml"} {
|
||||||
content, err := os.ReadFile(repositoryPath("examples", "dnd-complete", name))
|
content, err := os.ReadFile(repositoryPath("examples", "dnd-complete", name))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ func TestMaterializedSpellCatalogOrderingPreservesSemanticContents(t *testing.T)
|
|||||||
func TestConfiguredSpellCatalogBindingChangesResolvedPipelineIdentity(t *testing.T) {
|
func TestConfiguredSpellCatalogBindingChangesResolvedPipelineIdentity(t *testing.T) {
|
||||||
base := productionSpellCatalogContractConfig(t)
|
base := productionSpellCatalogContractConfig(t)
|
||||||
source := loadMaintainedExample(t, writeProductionContractConfig(t, base)).Pipelines["dnd-session"].Artifacts["spells"].Extract.References["spell_catalog"].Path
|
source := loadMaintainedExample(t, writeProductionContractConfig(t, base)).Pipelines["dnd-session"].Artifacts["spells"].Extract.References["spell_catalog"].Path
|
||||||
changed := strings.Replace(base, source, filepath.Join(t.TempDir(), "alternate-spell-catalog.json"), 1)
|
changed := strings.Replace(base, source, filepath.Join(t.TempDir(), "alternate-glossary.json"), 1)
|
||||||
if changed == base {
|
if changed == base {
|
||||||
t.Fatal("production configuration did not contain the maintained catalog binding")
|
t.Fatal("production configuration did not contain the maintained catalog binding")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user