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.
|
||||
A binding-specific selector requires its selected target to declare the slot.
|
||||
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;
|
||||
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
|
||||
notarius run dnd-session --config examples/dnd-complete/config.yml \
|
||||
--input-file examples/dnd-complete/transcript.json \
|
||||
--reference party=/data/references/party.txt \
|
||||
--reference glossary=/data/references/glossary.txt \
|
||||
--reference party=/data/references/party.yml \
|
||||
--reference glossary=/data/references/glossary.yml \
|
||||
--reference spell_catalog=/data/references/glossary.yml \
|
||||
--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
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
binding-local external path overrides a pipeline default. CLI reference
|
||||
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
|
||||
an imported fragment or selected overlay. CLI reference paths resolve relative
|
||||
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
|
||||
|
||||
@@ -427,11 +436,11 @@ selected target declares them:
|
||||
|
||||
| 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**. |
|
||||
| **players** | Optional text player context. |
|
||||
| **glossary** | Optional text campaign glossary. |
|
||||
| **spell_catalog** | Optional JSON spell-catalog overlay for spell extraction and normalization. See [spell-catalog overlays](integrations/dnd-spell-catalog-overlays.md). |
|
||||
| **glossary** | Optional shared glossary document for general campaign vocabulary. |
|
||||
| **spell_catalog** | Optional shared glossary document for spell recognition 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. |
|
||||
| **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 \
|
||||
--input-file /absolute/path/to/transcripts/final.trimmed.json \
|
||||
--output-dir /absolute/path/to/notarius-output \
|
||||
--reference party=/absolute/path/to/references/party.txt \
|
||||
--reference players=/absolute/path/to/references/players.txt \
|
||||
--reference glossary=/absolute/path/to/references/glossary.txt \
|
||||
--reference spell_catalog=/absolute/path/to/references/spells.json \
|
||||
--reference party=/absolute/path/to/references/party.yml \
|
||||
--reference glossary=/absolute/path/to/references/glossary.yml \
|
||||
--reference spell_catalog=/absolute/path/to/references/glossary.yml \
|
||||
--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,
|
||||
combat, and NPC-occurrence handoffs stay in pipeline configuration, not CLI file
|
||||
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`
|
||||
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 \
|
||||
--config /absolute/path/to/notarius.yml --overlay production \
|
||||
--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
|
||||
~~~
|
||||
|
||||
@@ -52,7 +52,7 @@ Then run with the same selection and reference:
|
||||
notarius run pipeline-id \
|
||||
--config /absolute/path/to/notarius.yml --overlay production \
|
||||
--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
|
||||
~~~
|
||||
|
||||
|
||||
@@ -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. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
|
||||
@@ -67,7 +67,7 @@ into `source_refs`.
|
||||
|
||||
## 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)
|
||||
defines where this logical artifact is published; [D&D module internals](../internal/dnd.md)
|
||||
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
|
||||
|
||||
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
|
||||
declarations imported by [assets/notarius.yml](../../assets/notarius.yml).
|
||||
The root assets package stays a content-only leaf. Declaration-relative content
|
||||
@@ -275,7 +283,7 @@ not accepted-result cache identity.
|
||||
|
||||
| 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. |
|
||||
| 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. |
|
||||
|
||||
@@ -383,9 +383,8 @@ validation simply because no chunks execute or accepted artifacts are cached.
|
||||
|
||||
## Stage 9 — Verify Assembled Run And Preflight Behavior
|
||||
|
||||
**Status:** Complete. Focused assembled checks pass; the broader CLI suite still
|
||||
has failures in tests using the old maintained example files, whose migration is
|
||||
assigned below. The preflight and framework pipeline suites pass.
|
||||
**Status:** Complete. Focused assembled checks, the preflight and framework
|
||||
pipeline suites, and the broader CLI suite pass after the example migration.
|
||||
|
||||
**Goal:** Prove the public workflow through real internal collaborators and fake
|
||||
provider boundaries.
|
||||
@@ -419,6 +418,8 @@ the final ordinary pipeline remains usable with optional references omitted.
|
||||
|
||||
## Stage 10 — Migrate Maintained Examples And Canonical Documentation
|
||||
|
||||
**Status:** Complete.
|
||||
|
||||
**Goal:** Make the supported workflow discoverable without duplicating upstream
|
||||
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
|
||||
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,
|
||||
and couples input to catalog/ruleset requirements. Replace that operator-facing
|
||||
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.
|
||||
Some modules also accept the existing `roster` alias. These inputs do not
|
||||
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
|
||||
unknown fields, requires catalog/ruleset/source information, and rejects null
|
||||
aliases. That reader cannot consume a shared glossary unchanged.
|
||||
|
||||
Reference in New Issue
Block a user