Use native ConfigKit loading for shared references
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
Implement [Shared Domain Schema Adoption](shared-domain-schemas.md). That roadmap
|
||||
owns the target state, intent, and approved input cutover. This document owns the
|
||||
ordered implementation tasks. The baseline is `3ba68e6`; application code still
|
||||
uses the private spell overlay and text party/glossary references.
|
||||
ordered implementation tasks. The planning baseline is `ea163dd`; application
|
||||
code still uses the private spell overlay and text party/glossary references.
|
||||
|
||||
Each numbered stage is one Luna implementation prompt. Execute in order during
|
||||
one end-to-end sprint. Intermediate stages may leave callers or tests broken;
|
||||
@@ -20,22 +20,38 @@ authorize future implementation, not implementation during the planning pass.
|
||||
|
||||
## Resolved Design Details
|
||||
|
||||
- Adopt `glossary@0.1.0` and `rpg/party@0.1.0` from schemas distribution
|
||||
`2026.11.0`, commit `1b8430bdcbf04eb98c8d45c98a1cb986a9e6d477`.
|
||||
Use that revision's schemas, semantics, and license terms. Its validation
|
||||
profile is reference context, not a requirement to expand native YAML support.
|
||||
- Adopt published ConfigKit-aligned glossary and RPG party contracts. The reviewed
|
||||
`0.1.0` schemas in `2026.11.0` predate that alignment and are not the target.
|
||||
Stage 1 verifies the new publication and records exact versions before reader
|
||||
implementation. Do not implement a local bridge while awaiting publication.
|
||||
- Bundle content under `assets/shared-domain/`, retaining upstream paths
|
||||
`glossary/v0.1.0/` and `rpg/party/v0.1.0/`. Add a small source/version record
|
||||
and the selected validation/compatibility documents. Keep the existing single
|
||||
assets Go file content-only; extend its embed declaration as necessary.
|
||||
- Put reusable decoding, validation, and retained document types in
|
||||
`internal/integrations/domainrefs`. Put D&D contextual projections in
|
||||
`internal/modules/dnd/shared`; spell recognition remains catalog-owned.
|
||||
No dependency on upstream internal Go packages or runtime schema downloads.
|
||||
`glossary/v<selected-version>/` and `rpg/party/v<selected-version>/`. Include
|
||||
schema files, adjacent semantics, and a small source/version record. Link
|
||||
upstream manuals rather than copying them. Keep the single assets Go file
|
||||
content-only; extend its embed declaration as necessary.
|
||||
- Put a small native-load/schema-validation integration in
|
||||
`internal/integrations/domainrefs`. Use ConfigKit `v1.4.0`'s public
|
||||
`Load[map[string]any](configkit.Bytes(label, content))` for both JSON and YAML.
|
||||
Pass `Result.Config` directly to JSON Schema validation. Keep that resolved
|
||||
mapping as the document; build narrow D&D projections in
|
||||
`internal/modules/dnd/shared` and recognition views in the spell catalog.
|
||||
No custom parser, generic document SDK, or upstream internal-package import.
|
||||
- Use a single-source native load with no enabled imports, selected overlay,
|
||||
defaults, application resolver, overrides, or secrets bootstrap. Native
|
||||
structural behavior still applies, including `extends` and source-root `config`
|
||||
controls. Do not pre-parse, disable, or reinterpret native reserved controls.
|
||||
Retain wrapped native causes instead of reconstructing parser diagnostics.
|
||||
This is a reference-document load, not another load of application settings.
|
||||
- Keep native dynamic number binding (`int64`/finite `float64`) and native value
|
||||
limits. Retain supported resolved extensions, not exact authored numeric
|
||||
spelling/precision or consumed controls. Do not create serialization/forwarding
|
||||
APIs or marshal/reload documents merely to construct typed views. Existing
|
||||
reference items retain original bytes independently where needed.
|
||||
- External reference objects gain `collections: [name, ...]`. Omission or null
|
||||
means slot defaults. Explicit `[]` selects no collections. Preserve this
|
||||
distinction through conversion, cloning, resolution, and inspection. Use a
|
||||
presence-aware document field and a runtime nil-versus-empty slice; do not
|
||||
distinction through conversion, cloning, resolution, and inspection. Use
|
||||
ordinary ConfigKit-bound nullable fields and its native presence/inspection
|
||||
behavior, then a runtime nil-versus-empty slice; do not add a presence tracker or
|
||||
collapse an explicit empty slice with `append(nil, values...)`.
|
||||
- Collection names compare exactly, without trimming or case folding. Empty
|
||||
names cannot identify a valid upstream collection and are input errors.
|
||||
@@ -62,19 +78,19 @@ authorize future implementation, not implementation during the planning pass.
|
||||
forms when supplied. Party context projects names, aliases, player relationships,
|
||||
and classes/levels when supplied. Sort roster keys for presentation but omit
|
||||
those IDs from model content. Preserve distinct same-name roster entries.
|
||||
Unknown extensions remain retained data, not interpreted instructions. Full
|
||||
document forwarding preserves extensions; these task views omit them.
|
||||
Ordinary extensions remain native resolved data, not model instructions;
|
||||
these task views omit them. Native reserved controls keep their upstream meaning.
|
||||
- Spell context projects canonical names/aliases only. Embedded vocabulary keeps
|
||||
display precedence. For new external names, traverse collections and entries
|
||||
in exact collection-name/entry-ID order so map/list order does not select the
|
||||
display spelling. Use existing lookup normalization; trim surrounding whitespace
|
||||
in the recognition view without changing authored data. A name/alias that
|
||||
in the recognition view without changing the resolved document. A name/alias that
|
||||
becomes unusable after normalization is a task suitability error. Preserve
|
||||
existing same-spell alias augmentation and cross-spell collision rejection.
|
||||
- Structured media types are `application/json`, `application/yaml`, and
|
||||
`application/x-yaml`, matching existing file-extension materialization. JSON
|
||||
media requires JSON syntax; YAML uses existing parser capabilities. Do not
|
||||
bridge ConfigKit's narrower YAML language to the full shared-schema profile.
|
||||
media requires JSON syntax via a standard `json.Valid` check, followed by the
|
||||
same native load used for YAML. Neither serialization bypasses native limits.
|
||||
Keep current byte bounds rather than adding new ones. Do not infer old text or
|
||||
overlay formats, require optional provenance/rulesets, or add a campaign reader.
|
||||
- Validate completed documents before task selection. Configuration composition
|
||||
@@ -82,97 +98,76 @@ authorize future implementation, not implementation during the planning pass.
|
||||
construction shared by run and explicit preflight, before domain inference.
|
||||
Keep ordinary offline pipeline validation free of reference-file reads.
|
||||
|
||||
## Stage 1 — Bundle The Selected Contract Content
|
||||
## Stage 1 — Confirm And Bundle The Aligned Contracts
|
||||
|
||||
**Goal:** Make exact adopted contracts available offline without behavioral asset
|
||||
registration.
|
||||
**Goal:** Pin released aligned definitions and make essential contracts available
|
||||
offline without behavioral asset registration.
|
||||
|
||||
**Inspect:** `assets/package.go`, schemas tag/catalog and selected version
|
||||
directories in `../schemas`, `docs/policy/oss.md`, and current attribution.
|
||||
|
||||
**Work:**
|
||||
|
||||
1. Copy the two schema directories, including adjacent semantics and synthetic
|
||||
examples, from the exact source revision into the selected asset subtree.
|
||||
Copy selected validation/compatibility documentation into its `docs/` folder,
|
||||
preserving contract text and identifying its source. Keep schemas verbatim;
|
||||
repair documentation links to pinned upstream sources for targets not bundled,
|
||||
recording those navigation adaptations in the material identification. Do not
|
||||
copy the full catalog as though the unbundled campaign schema were supported.
|
||||
2. Record distribution, revision, exact schema versions and canonical IDs in a
|
||||
small content record. No runtime release discovery or inventory framework.
|
||||
3. Extend the existing embed declaration. Update asset-package commentary to
|
||||
1. Verify publication of a ConfigKit-aligned schema distribution. At preparation
|
||||
time only the pre-alignment `2026.11.0` source tag was available. If alignment
|
||||
is not published yet, report that prerequisite and stop schema-dependent work;
|
||||
do not silently select old contracts, unpublished candidates, or local patches.
|
||||
2. Select the most current glossary and party versions from that published
|
||||
distribution's catalog and review their semantics against ConfigKit `v1.4.0`.
|
||||
Record distribution, full source commit, versions, document markers, and
|
||||
canonical IDs in the feature roadmap, this plan, and a small asset source record.
|
||||
No runtime release discovery or inventory framework.
|
||||
3. Copy only the selected schema files and adjacent semantics, plus exact schema
|
||||
dependencies if any, into the asset subtree. Keep schema files verbatim; link
|
||||
nonbundled documentation targets to the selected upstream revision and record
|
||||
any navigation adaptations. Do not copy upstream parser manuals, full example
|
||||
archives, or a catalog advertising unbundled campaign support.
|
||||
4. Extend the existing embed declaration. Update asset-package commentary to
|
||||
recognize shared input contracts as well as LLM content.
|
||||
4. Add the incorporated material's attribution and applicable CC0 license text
|
||||
using the existing OSS conventions and commit-pinned links.
|
||||
5. Add the incorporated material's attribution and applicable license text using
|
||||
the selected release's actual terms, existing OSS conventions, and pinned links.
|
||||
|
||||
**Acceptance:** The packaged filesystem contains the selected schemas and
|
||||
semantics; `assets` still has no business logic or kit dependency. Source/license
|
||||
records describe only incorporated material.
|
||||
**Acceptance:** Published aligned versions are pinned, and the packaged filesystem
|
||||
contains their schemas and semantics; `assets` still has no business logic or kit
|
||||
dependency. Source/license records describe only incorporated material.
|
||||
|
||||
**Validation:** `go test ./assets`; inspect copied files against `git show` at the
|
||||
selected upstream commit, and `git diff --check`.
|
||||
|
||||
## Stage 2 — Implement Lossless JSON Document Decoding
|
||||
## Stage 2 — Load Shared References Through ConfigKit
|
||||
|
||||
**Goal:** Establish the reusable completed-document representation and JSON path.
|
||||
**Goal:** Delegate parsing and resolution for both serializations to ConfigKit.
|
||||
|
||||
**Inspect:** Selected validation profile, existing jsonschema dependency usage,
|
||||
and upstream decoder behavior for guidance only.
|
||||
**Inspect:** ConfigKit's pinned public `Load`, `Bytes`, and dynamic-value contracts;
|
||||
the aligned schemas' semantics; existing reference byte/media-type transport.
|
||||
|
||||
**Work:**
|
||||
|
||||
1. Create `internal/integrations/domainrefs` with a decoder accepting bytes and
|
||||
media type and retaining string-keyed objects, arrays, strings, booleans,
|
||||
null, and exact JSON numbers. Retain a complete document separately from any
|
||||
later typed view; no general import/composition machinery.
|
||||
2. Use standard JSON token decoding with `UseNumber` to reject duplicate keys at
|
||||
every depth, including equivalent escaped spellings, before a map loses them.
|
||||
Require one complete JSON value; invalid JSON must not fall back to YAML when
|
||||
the declared media type is JSON.
|
||||
3. Return contextual decode errors using existing error wrapping, not a public
|
||||
taxonomy. Add ordinary serialization/forwarding support that preserves values
|
||||
and extensions without promising original whitespace or key order.
|
||||
1. Create a small shared-reference loader in `internal/integrations/domainrefs`
|
||||
that accepts already-materialized bytes, media type, and a useful diagnostic
|
||||
label. For JSON media, use only `json.Valid` to enforce JSON syntax. Then call
|
||||
the public native byte-source load for either media type.
|
||||
2. Return the native resolved mapping for subsequent schema/domain validation.
|
||||
Do not recreate a raw/typed document hierarchy, custom JSON token walker,
|
||||
direct YAML-library decoder, numeric adapter, or generic conversion API.
|
||||
3. Use the single-source selections above. Native parsing, structural resolution,
|
||||
scalar binding, limits, and error details remain authoritative. Wrap failures
|
||||
with reference context and retain their causes; do not create an error taxonomy.
|
||||
4. Add a few public-API integration tests: ordinary equivalent YAML/JSON input,
|
||||
one representative native rejection, resolved numeric/extension values, and
|
||||
native reserved-control handling. Do not reproduce ConfigKit's parser matrix.
|
||||
An `instruction` extension remains ordinary data. JSON receives no fallback
|
||||
path when ConfigKit rejects a syntactically valid document.
|
||||
|
||||
**Acceptance:** Precision-sensitive extension values survive a decode/encode
|
||||
round trip. Duplicate keys, trailing values, and invalid JSON fail distinctly
|
||||
from subsequent schema validation.
|
||||
**Acceptance:** Both serializations use one native loading boundary. No exact
|
||||
numeric-preservation guarantee, independent parser, or configuration reconstruction
|
||||
has been introduced. ConfigKit failures remain distinguishable from later schema
|
||||
and domain checks without reimplementing native error semantics.
|
||||
|
||||
**Validation:** `go test ./internal/integrations/domainrefs` with focused JSON
|
||||
fixtures; no network, engine, or credentials.
|
||||
**Validation:** `go test ./internal/integrations/domainrefs`; no network, engine,
|
||||
or credentials.
|
||||
|
||||
## Stage 3 — Add Straightforward YAML Input Support
|
||||
|
||||
**Goal:** Accept ordinary supported YAML without a custom compatibility parser.
|
||||
|
||||
**Inspect:** Pinned `go.yaml.in/yaml/v4` capabilities and ConfigKit's documented
|
||||
YAML boundary. Keep the broader shared-schema profile as context only.
|
||||
|
||||
**Work:**
|
||||
|
||||
1. Use the existing YAML library's ordinary decoder for completed reference
|
||||
documents, with native duplicate-key checking and a single-document boundary.
|
||||
Convert supported decoded containers to the Stage 2 representation only as
|
||||
needed for validation. No copied upstream decoder, custom node interpreter,
|
||||
`math/big` scalar adapter, or full-profile compatibility layer.
|
||||
2. Do not extend ConfigKit's parser or recreate configuration loading for these
|
||||
domain files. ConfigKit continues to own application configuration composition;
|
||||
domain reference loading does not execute imports or directives.
|
||||
3. Retain useful native decode errors. Document supported serialization behavior
|
||||
and recommend ordinary quoted strings/JSON-compatible scalars or JSON where
|
||||
the broader shared-schema YAML language would need extra machinery.
|
||||
4. Test representative ordinary YAML/JSON equivalents and native failure cases.
|
||||
Do not require aliases, alternate numeric spellings, arbitrary-precision YAML
|
||||
numbers, or other broader-profile forms merely because upstream supports them.
|
||||
|
||||
**Acceptance:** Supported YAML and JSON produce equivalent task views. Native
|
||||
parser capabilities define serialization support; neither code nor documentation
|
||||
claims full upstream YAML-profile compatibility. Supported decoded extension
|
||||
values survive forwarding without additional interpretation.
|
||||
|
||||
**Validation:** `go test ./internal/integrations/domainrefs`.
|
||||
|
||||
## Stage 4 — Add Offline Shared Validation And Typed Views
|
||||
## Stage 3 — Validate Resolved Shared Documents
|
||||
|
||||
**Goal:** Separate shared conformance from consumer requirements.
|
||||
|
||||
@@ -184,9 +179,13 @@ values survive forwarding without additional interpretation.
|
||||
jsonschema library. Compile once with safe shared reuse; configure unresolved
|
||||
resource loads to fail locally. Do not enumerate unrelated schemas or query
|
||||
canonical URLs at runtime.
|
||||
2. Provide glossary/party readers that decode and validate the complete envelope,
|
||||
then expose typed known-field views alongside the retained full document.
|
||||
Validate all known fields and all collections, not only selected entries.
|
||||
Schema resource JSON remains owned by the schema engine's resource loader,
|
||||
preserving exact numeric constraints; it is not a domain document to load
|
||||
through ConfigKit.
|
||||
2. Validate the Stage 2 native mapping directly. Check the complete resolved
|
||||
envelope, all known fields, and all collections, not only selected entries.
|
||||
Do not decode a second typed copy or marshal/reload subtrees. Add narrow typed
|
||||
accessors/projections only where needed by the concrete consumers.
|
||||
3. Check glossary entry-ID uniqueness within each collection using exact strings.
|
||||
Do not add name uniqueness, global ID uniqueness, required player/classes, or
|
||||
cross-document reference checks.
|
||||
@@ -195,15 +194,15 @@ values survive forwarding without additional interpretation.
|
||||
as task errors, not upstream schema errors.
|
||||
5. Cover omitted/null/empty aliases, permitted extensions at all relevant levels,
|
||||
invalid optional-field types, empty collections/rosters, shared IDs across
|
||||
collections, and duplicate IDs within a collection. Include a forwarding test
|
||||
showing that an `instruction` extension stays ordinary retained data.
|
||||
collections, and duplicate IDs within a collection. Retain supported resolved
|
||||
extensions in the mapping without inventing a forwarding subsystem.
|
||||
|
||||
**Acceptance:** Both readers conform offline to their exact selected contracts;
|
||||
typed projection neither discards forwarded extensions nor alters authored data.
|
||||
**Acceptance:** The native resolved mapping is validated offline against the exact
|
||||
aligned contracts. Domain checks add no new authoring format or decoding path.
|
||||
|
||||
**Validation:** `go test ./internal/integrations/domainrefs`.
|
||||
|
||||
## Stage 5 — Carry Collection Selection Through Configuration
|
||||
## Stage 4 — Carry Collection Selection Through Configuration
|
||||
|
||||
**Goal:** Preserve binding selection and its presence through normal configuration
|
||||
resolution without changing ConfigKit ownership.
|
||||
@@ -217,6 +216,8 @@ in `internal/framework/contracts/contracts.go`.
|
||||
1. Add the presence-aware `collections` field to external reference documents,
|
||||
runtime `ReferenceSource`, and resolved `ReferenceBinding`. Extend existing
|
||||
external-source constructors as needed; avoid duplicate legacy source types.
|
||||
Use ordinary typed ConfigKit binding and inspection. Do not create another
|
||||
presence index, source tracker, configuration merge, or cloning framework.
|
||||
2. Keep the reference source union explicit: collection selection accompanies
|
||||
`path`, not `artifact`. Reject wrong selection types and empty names; preserve
|
||||
null/omitted versus explicit empty according to the resolved design.
|
||||
@@ -235,7 +236,7 @@ explicit `[]` does not turn into defaults.
|
||||
`go test ./internal/core/config ./internal/framework/pipeline`. Temporary failures
|
||||
from later wiring must be identified, not hidden with compatibility scaffolding.
|
||||
|
||||
## Stage 6 — Preserve Selections Through CLI And Materialization
|
||||
## Stage 5 — Preserve Selections Through CLI And Materialization
|
||||
|
||||
**Goal:** Deliver selected input views consistently to consumers.
|
||||
|
||||
@@ -267,7 +268,7 @@ or configuration composition mechanism is introduced.
|
||||
**Validation:** Focused tests in `./internal/framework/pipeline` and
|
||||
`./internal/cli` for reference handling.
|
||||
|
||||
## Stage 7 — Cut Spell Recognition Over To Shared Glossaries
|
||||
## Stage 6 — Cut Spell Recognition Over To Shared Glossaries
|
||||
|
||||
**Goal:** Replace the private overlay format across the whole spell family.
|
||||
|
||||
@@ -300,7 +301,7 @@ no durable spell shape or evidence rule changes.
|
||||
**Validation:** `go test ./internal/modules/dnd/spells/... ./internal/modules/dnd/extract/spells ./internal/modules/dnd/normalize/spells ./internal/modules/dnd/validate/spells/...`
|
||||
and focused CLI spell-catalog tests after their fixture migration.
|
||||
|
||||
## Stage 8 — Prepare Shared Context For Scenes And Registry Lanes
|
||||
## Stage 7 — Prepare Shared Context For Scenes And Registry Lanes
|
||||
|
||||
**Goal:** Establish one reusable context preparation path and migrate its first
|
||||
coherent consumer group.
|
||||
@@ -311,7 +312,8 @@ and `assets/dnd/shared/prompts/common-dnd-references.md`.
|
||||
|
||||
**Work:**
|
||||
|
||||
1. Add a constructor-time shared context preparer using the Stage 4 readers.
|
||||
1. Add a constructor-time shared context preparer using Stage 3's validated native
|
||||
mappings and narrow task views.
|
||||
Prepare fixed party/glossary/player material and combine it with each operation's
|
||||
current transcript material. Keep generated references separate and dynamic.
|
||||
2. Change party/roster/glossary declarations to structured media; retain text
|
||||
@@ -333,7 +335,7 @@ missing optional context is supported and same-name roster members remain distin
|
||||
**Validation:** Shared projection tests plus scene chunker and four migrated
|
||||
extractor package tests. Update obsolete text fixtures for these consumers.
|
||||
|
||||
## Stage 9 — Migrate All Remaining D&D Context Consumers
|
||||
## Stage 8 — Migrate All Remaining D&D Context Consumers
|
||||
|
||||
**Goal:** Complete context cutover without leaving a text-input bypass.
|
||||
|
||||
@@ -343,7 +345,7 @@ calls and grounding helpers, including enemy-event material assembly.
|
||||
|
||||
**Work:**
|
||||
|
||||
1. Migrate these six extractors to the Stage 8 prepared context facility. Keep
|
||||
1. Migrate these six extractors to the Stage 7 prepared context facility. Keep
|
||||
their generated registry/scene/combat handoffs and operation-local inputs intact.
|
||||
2. Audit production calls to `shared.PromptInputs`, `ReferencePromptMaterial`,
|
||||
and `ReferencePromptInput`. Remove the obsolete party/glossary raw-text path;
|
||||
@@ -361,7 +363,7 @@ validation simply because no chunks execute or accepted artifacts are cached.
|
||||
|
||||
**Validation:** `go test ./internal/modules/dnd/... ./internal/modules/integration`.
|
||||
|
||||
## Stage 10 — Verify Assembled Run And Preflight Behavior
|
||||
## Stage 9 — Verify Assembled Run And Preflight Behavior
|
||||
|
||||
**Goal:** Prove the public workflow through real internal collaborators and fake
|
||||
provider boundaries.
|
||||
@@ -378,7 +380,7 @@ provider boundaries.
|
||||
2. Prove run and explicit preflight reject malformed party/glossary documents,
|
||||
duplicate IDs, absent explicit collections, and spell collisions before any
|
||||
fake domain inference/provider smoke call. Use representative cases rather
|
||||
than rerunning the decoder matrix in CLI tests.
|
||||
than rerunning ConfigKit's parser matrix in CLI tests.
|
||||
3. Prove valid shared inputs reach the expected tasks; use a controlled empty
|
||||
model extraction with populated references to verify the application does not
|
||||
synthesize reference-only events. Do not assert live model quality guarantees.
|
||||
@@ -393,7 +395,7 @@ the final ordinary pipeline remains usable with optional references omitted.
|
||||
|
||||
**Validation:** `go test ./internal/cli ./internal/preflight ./internal/framework/pipeline`.
|
||||
|
||||
## Stage 11 — Migrate Maintained Examples And Canonical Documentation
|
||||
## Stage 10 — Migrate Maintained Examples And Canonical Documentation
|
||||
|
||||
**Goal:** Make the supported workflow discoverable without duplicating upstream
|
||||
schema manuals.
|
||||
@@ -418,6 +420,8 @@ and the documentation/OSS policies.
|
||||
subprocess examples, and relevant internal ownership docs. Include a concise
|
||||
migration section: new envelopes, existing slot names, collection selection,
|
||||
nullable aliases, optional provenance, and roster-derived player relationships.
|
||||
Link native loading, numeric binding, limits, and reserved controls to the
|
||||
pinned ConfigKit documentation rather than maintaining a second manual.
|
||||
5. Recheck attribution and copied content. Do not publish a release, preselect a
|
||||
version, or claim other applications already support the shared format.
|
||||
|
||||
@@ -429,7 +433,7 @@ docs describe the implemented cutover, not legacy support or future campaigns.
|
||||
local link checks and searches for retired example paths/overlay marker. Intentional
|
||||
migration explanations are not stale references to delete.
|
||||
|
||||
## Stage 12 — Final Contract And Regression Pass
|
||||
## Stage 11 — Final Contract And Regression Pass
|
||||
|
||||
**Goal:** Finish the end-to-end sprint with all target behavior verified.
|
||||
|
||||
@@ -442,6 +446,10 @@ migration explanations are not stale references to delete.
|
||||
2. Check for accidental extra requirements: mandatory context/player/classes,
|
||||
trimmed authored strings, extra name/ID uniqueness, extension rejection,
|
||||
ruleset/provenance requirements, custom composition, new caps or retries.
|
||||
Confirm no parallel parser, scalar adapter, subtree conversion round trip,
|
||||
generic document/forwarding SDK, or copied upstream parser suite remains.
|
||||
Native reserved controls and dynamic-value limits are upstream behavior, not
|
||||
locally reimplemented restrictions or guarantees.
|
||||
Check durable outputs, session identity, native reports and cache policy remain
|
||||
unchanged. Remove temporary migration scaffolding and obsolete fixtures.
|
||||
3. Run `gofmt` on modified Go files, then `go test ./...`, `go vet ./...`, and
|
||||
@@ -455,4 +463,5 @@ migration explanations are not stale references to delete.
|
||||
|
||||
**Acceptance:** All stages' outcomes and the feature-roadmap acceptance criteria
|
||||
are satisfied; repository-wide checks pass and no compatibility reader or
|
||||
duplicated authoring workflow remains. No blocking design question is known.
|
||||
duplicated authoring workflow remains. No blocking product decision is known;
|
||||
the aligned-schema publication prerequisite must have been satisfied in Stage 1.
|
||||
|
||||
@@ -42,30 +42,42 @@ Reviewed against Notarius commit
|
||||
- The maintained [complete example](../../examples/dnd-complete/config.yml)
|
||||
supplies text party/glossary references and a separately authored spell overlay.
|
||||
The [D&D subprocess guide](../consumers/dnd-pipeline.md) reflects those inputs.
|
||||
- The repository already imports `go.yaml.in/yaml/v4` and
|
||||
`github.com/santhosh-tekuri/jsonschema/v6`. No new parser or schema-engine
|
||||
dependency is expected solely for this adoption.
|
||||
- The repository already imports ConfigKit `v1.4.0` and
|
||||
`github.com/santhosh-tekuri/jsonschema/v6`. Their public APIs supply native
|
||||
loading and external JSON Schema validation; no new parser dependency is needed.
|
||||
|
||||
## Selected Upstream Baseline
|
||||
## Upstream Baseline And Adoption Prerequisite
|
||||
|
||||
Use the shared schemas source distribution
|
||||
The reviewed shared schemas source distribution is
|
||||
[`2026.11.0`](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.0),
|
||||
whose published remote tag resolves to commit
|
||||
`1b8430bdcbf04eb98c8d45c98a1cb986a9e6d477`. Its
|
||||
[catalog](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.0/catalog.json)
|
||||
contains the following independently versioned contracts:
|
||||
|
||||
| Contract | Version | Document identifier | Adoption scope |
|
||||
| Contract | Reviewed version | Document identifier | Intended adoption scope |
|
||||
| --- | --- | --- | --- |
|
||||
| General glossary | `0.1.0` | `maximumdirect.glossary.v1` | Structured vocabulary and spell recognition. |
|
||||
| RPG party | `0.1.0` | `maximumdirect.rpg.party.v1` | Structured character roster and player relationships. |
|
||||
| RPG campaign | `0.1.0` | `maximumdirect.rpg.campaign.v1` | Reviewed; no new structured consumer in this work set. |
|
||||
|
||||
Adopt the glossary and party schemas together with their adjacent semantics and
|
||||
the selected distribution's
|
||||
[validation profile](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.0/docs/validation.md)
|
||||
and
|
||||
[compatibility guidance](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.0/docs/compatibility.md).
|
||||
That release's `0.1.0` contracts predate the upstream ConfigKit-alignment work
|
||||
and are not the implementation target. As of this revision, `2026.11.0` is the
|
||||
only published source tag verified. Select the published ConfigKit-aligned
|
||||
glossary and party versions when available, together with their adjacent
|
||||
semantics. Record the distribution, full source commit, exact schema versions,
|
||||
canonical IDs, and document markers before implementing their readers. Do not
|
||||
adapt the old contracts locally or treat unpublished schema work as released.
|
||||
|
||||
The adoption prerequisite is a published aligned schema distribution; no further
|
||||
product decision is needed to keep loading native. Preparation can proceed, but
|
||||
schema-dependent implementation must use the verified new definitions. Keep
|
||||
older source/version details above as review evidence, not accepted legacy input.
|
||||
|
||||
Use the existing ConfigKit `v1.4.0`
|
||||
[consumer guide](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/consumers/README.md)
|
||||
and [native contract](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md)
|
||||
for loading semantics; the aligned schema release must fit that boundary.
|
||||
Repository CalVer, individual schema SemVer, document generation markers, and
|
||||
canonical schema IDs remain distinct. Record exact selected versions and source
|
||||
revision; do not discover support from mutable `main` or live URL availability.
|
||||
@@ -125,26 +137,38 @@ modules. Internal transport details belong in the implementation plan.
|
||||
|
||||
### Shared Conformance And Task Suitability
|
||||
|
||||
Provide one reusable decoding/validation boundary for adopted shared documents,
|
||||
with small task-specific projections. Ordinary validation is offline, using
|
||||
Provide one small shared-reference loading/validation integration, with
|
||||
task-specific projections. Ordinary validation is offline, using
|
||||
bundled exact-version schemas registered under their canonical IDs. Bundle the
|
||||
adopted schema directories and semantics without importing the schema
|
||||
adopted schema files and adjacent semantics without importing the schema
|
||||
repository's internal Go validation harness or creating a runtime catalog client.
|
||||
|
||||
Adopt the shared domain structure and semantics without promising the full
|
||||
upstream YAML decoding profile. ConfigKit accepts a narrower YAML value language;
|
||||
do not widen it or build a compatibility bridge for shared-schema YAML forms.
|
||||
Use existing parser capabilities and straightforward decoding for supported
|
||||
documents. Operators can use supported plain YAML or equivalent JSON rather than
|
||||
requiring Notarius-specific scalar, alias, tag, or arbitrary-precision machinery.
|
||||
Document the serialization boundary separately from shared-schema validity.
|
||||
Load already-materialized reference bytes through ConfigKit's public
|
||||
`Load[map[string]any]` and `Bytes` APIs. YAML and JSON use the same native loading
|
||||
path. A standard JSON syntax check may enforce the JSON media convention, but
|
||||
does not provide an alternate decoder. Pass `Result.Config` directly to the
|
||||
existing JSON Schema engine, then apply shared semantic checks and D&D task
|
||||
selection. ConfigKit owns parsing, duplicate-key checks, scalar binding,
|
||||
structural resolution, native limits, and native diagnostic details.
|
||||
|
||||
Reference documents remain completed domain data, not another application
|
||||
configuration load. Avoid routing them through configuration imports/directives
|
||||
merely to reuse a parser. Preserve supported decoded values and extensions when
|
||||
forwarding; do not claim lossless handling of every upstream YAML value.
|
||||
Use a single-source load without enabling import traversal, selecting overlays,
|
||||
or supplying application defaults, custom resolvers, overrides, or secrets
|
||||
bootstrap. Native structural behavior still applies: `extends` is structural
|
||||
input and source-root `config` has native control semantics even when imports
|
||||
are off. Do not suppress or reinterpret these controls with a pre-parser.
|
||||
Nested ordinary `config` data follows upstream behavior. This shared-reference
|
||||
load is separate from the one application-owned configuration result and does
|
||||
not reconstruct Notarius's application configuration or its engine.
|
||||
|
||||
Validate the complete shared document before projecting selected collections.
|
||||
Keep the resolved mapping as the document representation and build only the
|
||||
small projections consumers need. No separate raw/typed document SDK, generic
|
||||
subtree converter, serialization round trip, or forwarding API is needed.
|
||||
Existing reference transport can retain original bytes; resolved values need
|
||||
not preserve authored spelling, numeric precision, or consumed controls. If a
|
||||
shared document is forwarded, use its supported resolved values and extensions.
|
||||
JSON is subject to the same native limits; it is not a universal escape hatch.
|
||||
|
||||
Validate the complete resolved document before projecting selected collections.
|
||||
Enforce the upstream semantic rule that glossary entry IDs are unique within
|
||||
each collection using exact comparison. Reuse of an ID in another collection is
|
||||
valid. Do not require globally unique names, aliases, player names, or IDs, or
|
||||
@@ -156,10 +180,10 @@ supported, while null is not interchangeable with omission for every optional
|
||||
field. Shared authored-input schemas are not private LLM response schemas and
|
||||
do not inherit provider-specific restrictions on optional response properties.
|
||||
|
||||
Accept permitted extensions and preserve them when forwarding a shared document.
|
||||
Task-specific projections may intentionally omit irrelevant fields. An extension
|
||||
named `instruction` has no instruction or configuration semantics. Supported
|
||||
domain interpretation must be deliberate rather than inferred from field names.
|
||||
Accept permitted extensions within the native resolved-value boundary.
|
||||
Task-specific projections may omit irrelevant fields. An ordinary extension
|
||||
named `instruction` does not become model guidance. Native reserved controls keep
|
||||
their upstream meaning; additional domain interpretation must be deliberate.
|
||||
|
||||
Keep shared conformance separate from task suitability. A valid document may
|
||||
still lack a selected collection or contain spell-recognition ambiguities.
|
||||
@@ -167,11 +191,10 @@ Report those as task requirements with reference/collection/field context where
|
||||
practical, rather than redefining the upstream schema. A selected empty spell
|
||||
collection adds no vocabulary to the embedded catalog; it is not malformed.
|
||||
|
||||
ConfigKit retains ownership of configuration loading and composition. Shared
|
||||
reference readers consume completed domain documents; they do not add imports,
|
||||
overlays, or another authoring merge language. Roster, glossary, and provenance
|
||||
content remain auxiliary context. The current transcript remains the sole source
|
||||
of event evidence and durable source ranges.
|
||||
ConfigKit retains ownership of loading and composition. Notarius does not add
|
||||
another authoring merge language or a compatibility parser. Roster, glossary,
|
||||
and provenance content remain auxiliary context. The current transcript remains
|
||||
the sole source of event evidence and durable source ranges.
|
||||
|
||||
### Spell Recognition
|
||||
|
||||
@@ -274,7 +297,7 @@ are input/preparation errors, not model-quality failures to repair with retries.
|
||||
| Area | Work needed |
|
||||
| --- | --- |
|
||||
| Shared contract assets | Bundle exact adopted schemas and adjacent semantics, source/version identification, and applicable license material in the content-only asset tree. Keep validation logic outside `assets`. |
|
||||
| Shared input integration | Implement reusable offline decoding, schema validation, and glossary semantic checks. Preserve full documents separately from task projections. |
|
||||
| Shared input integration | Use one native ConfigKit byte-source load, validate the resolved mapping against bundled schemas, and apply glossary semantic checks. Build only the task projections needed by consumers. |
|
||||
| Reference binding | Add binding-level `collections` selection and carry it through normal configuration/CLI override resolution without implementing a new composition system. Update reference declarations and accepted media types for affected consumers. |
|
||||
| Spell family | Replace private overlay parsing in `internal/modules/dnd/spells/catalog`; adapt effective-catalog composition, prompt projection, and useful input diagnostics. Exercise extraction, normalization, and catalog-validator constructors together. |
|
||||
| D&D context consumers | Update `internal/modules/dnd/shared`, applicable chunk/extract constructors, shared reference prompt content, and any direct reference presentations bypassing those helpers. Derive player context from the roster without requiring duplicate authored data. |
|
||||
@@ -292,7 +315,10 @@ Create a focused integration document for Notarius's shared-input support. It
|
||||
owns exact supported versions, accepted serializations, consumer roles,
|
||||
collection selection, recognition adaptations, and task suitability. Link to
|
||||
the selected upstream semantics and validation documentation for the shared
|
||||
formats rather than maintaining a competing format specification.
|
||||
formats rather than maintaining a competing format specification. Link native
|
||||
loading behavior to ConfigKit; do not copy its parser manual or maintain a local
|
||||
compatibility matrix. Bundle essential schema/semantic content, not copies of
|
||||
upstream validation manuals or example archives.
|
||||
|
||||
Replace or retire `docs/integrations/dnd-spell-catalog-overlays.md` when its reader
|
||||
is removed, updating inbound links. Update `docs/config.md` for binding fields and
|
||||
@@ -327,9 +353,10 @@ The implemented feature should demonstrate:
|
||||
3. One shared roster supplies character aliases and player relationships to the
|
||||
maintained pipeline without duplicate player/party-vocabulary authoring.
|
||||
Optional attributes and duplicate display labels follow the shared contract.
|
||||
4. Equivalent supported YAML and JSON inputs produce equivalent task material.
|
||||
Focused tests cover ordinary supported values and native decoding failures,
|
||||
without requiring full upstream YAML-profile parity or a custom bridge.
|
||||
4. Equivalent native-supported YAML and JSON inputs produce equivalent task
|
||||
material through the same ConfigKit load. A few public-API integration tests
|
||||
cover successful handoff and representative native failures, without copying
|
||||
ConfigKit's parser suite or adding precision/serialization guarantees.
|
||||
Structural and semantic tests cover omission/null/empty behavior,
|
||||
extensions, per-collection ID uniqueness, and incompatible markers.
|
||||
5. Recognition tests preserve embedded vocabulary, canonical display, same-spell
|
||||
@@ -339,8 +366,9 @@ The implemented feature should demonstrate:
|
||||
before domain inference. Fake provider boundaries prove valid projections
|
||||
reach their intended tasks and reference-only entries do not create events.
|
||||
7. Bundled schema validation requires no network, schema-repository installation,
|
||||
or credentials. Full-document forwarding retains extensions; model-facing
|
||||
projections omit opaque IDs and do not promote extensions to instructions.
|
||||
or credentials. The native resolved mapping retains supported domain
|
||||
extensions; model-facing projections omit opaque IDs and do not promote
|
||||
ordinary extensions to instructions or override native reserved controls.
|
||||
8. Existing output artifact contracts, generated handoffs, input-based session
|
||||
identity, native report shape, and cache policy remain intact. Updated prompt
|
||||
material participates in existing native cache identity; add no separate
|
||||
|
||||
Reference in New Issue
Block a user