Bundle pinned shared domain contracts

This commit is contained in:
2026-11-29 17:47:34 +00:00
parent 30bc424343
commit 0361b199c4
10 changed files with 410 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
// Package assets exposes embedded LLM-facing content.
// Package assets exposes embedded LLM-facing content and shared input contracts.
package assets
import (
@@ -6,7 +6,7 @@ import (
"io/fs"
)
//go:embed notarius.yml dnd generic
//go:embed notarius.yml dnd generic shared-domain
var embedded embed.FS
// FS returns the embedded read-only asset filesystem.

View File

@@ -0,0 +1,11 @@
# Shared domain contract sources
Source distribution: `2026.11.1`, commit `f7e3cedeca11ed903311cdf29ca4d81fb1f216b7` of [Maximum Direct shared schemas](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7).
| Contract | Version | Document marker | Canonical schema ID |
| --- | --- | --- | --- |
| Glossary | `0.2.0` | `maximumdirect.glossary.v1` | https://schemas.maximumdirect.net/glossary/v0.2.0/schema.json |
| RPG party | `0.2.0` | `maximumdirect.rpg.party.v1` | https://schemas.maximumdirect.net/rpg/party/v0.2.0/schema.json |
The schemas are unchanged. Adjacent semantics are copied with links to unbundled
upstream documentation and examples redirected to the pinned source revision.

View File

@@ -0,0 +1,51 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.maximumdirect.net/glossary/v0.2.0/schema.json",
"title": "MAXIMUMDIRECT Glossary v1",
"type": "object",
"required": ["schema_version", "collections"],
"properties": {
"schema_version": {"const": "maximumdirect.glossary.v1"},
"collections": {
"type": "object",
"propertyNames": {"minLength": 1},
"additionalProperties": {"$ref": "#/$defs/collection"}
}
},
"$defs": {
"text": {"type": "string", "minLength": 1},
"aliases": {"type": ["array", "null"], "items": {"$ref": "#/$defs/text"}},
"entry": {
"type": "object",
"required": ["id", "name", "category"],
"properties": {
"id": {"$ref": "#/$defs/text"},
"name": {"$ref": "#/$defs/text"},
"category": {"$ref": "#/$defs/text"},
"description": {"type": "string"},
"aliases": {"$ref": "#/$defs/aliases"},
"plural": {"type": ["string", "null"], "minLength": 1}
}
},
"provenance": {
"type": "object",
"properties": {
"id": {"$ref": "#/$defs/text"},
"title": {"$ref": "#/$defs/text"},
"version": {"type": "string"},
"url": {"type": "string"},
"license": {"type": "string"}
}
},
"partialCollection": {
"type": "object",
"properties": {
"entries": {"type": "array", "items": {"$ref": "#/$defs/entry"}},
"provenance": {"$ref": "#/$defs/provenance"}
}
},
"collection": {
"allOf": [{"$ref": "#/$defs/partialCollection"}, {"required": ["entries"]}]
}
}
}

View File

@@ -0,0 +1,83 @@
# Glossary contract
## Native loading boundary
Full conformance includes acquisition through the public mapping-root handoff of
[ConfigKit v1.4.0](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md),
followed by this schema and its semantic checks. ConfigKit owns syntax, structural
controls, numeric binding, and resource limits, including its 8 MiB source limit.
Dynamic integers bind as int64 and fractional/exponent values as finite float64;
authored decimal precision is not guaranteed. Preserve supported resolved values.
`extends` is structural input and source-root `config` is a control namespace;
nested ordinary `config` follows upstream rules. Other supported domain extensions
remain permitted. Schema validation adds no trimming, case folding, or defaults.
Structural validation alone does not prove native loading compatibility. The
pinned upstream contract defines this version's boundary independently of later
changes to the repository's general guidance.
Contract: `maximumdirect.glossary.v1`. [Schema](schema.json).
The [validation profile](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/docs/validation.md) and [compatibility rules](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/docs/compatibility.md)
apply. Start with [campaign vocabulary](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/glossary/v0.2.0/examples/glossary.yml),
[weather](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/glossary/v0.2.0/examples/weather.yml), or [sports](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/glossary/v0.2.0/examples/sports.yml).
| Field | Required | Meaning |
| --- | --- | --- |
| `schema_version` | Yes | Exactly `maximumdirect.glossary.v1`. |
| `collections` | Yes | Mapping of nonempty collection names to collections; may be empty. |
| `collections.<name>.entries` | Yes | List of entries; may be empty. |
| `entries[].id` | Yes | Stable, nonempty identity unique within this collection. |
| `entries[].name` | Yes | Nonempty canonical display name. |
| `entries[].category` | Yes | Nonempty domain-defined category. |
| `entries[].description` | No | Description; an empty string is valid. |
| `entries[].aliases` | No | Alternative names for the same entity. May be null, empty, or a list of nonempty strings. |
| `entries[].plural` | No | Nonempty plural display form, or null. |
| `collections.<name>.provenance` | No | Source metadata object, possibly empty. Optional `id` and `title` are nonempty strings; optional `version`, `url`, and `license` are strings that may be empty. |
All objects permit extensions. Optional fields accept omission; only `aliases`
and `plural` additionally accept null. Supported resolved values are preserved; schema validation adds no trimming,
case folding, coercion, or defaults. IDs and names compare exactly. Distinct
collections can reuse an ID. Display names, aliases, and categories need not be
unique. Lists retain their authored order but establish no precedence or execution
order. Collection names and categories are strings chosen by the domain, not a
fixed set of D&D labels.
For example, `spells` entries contain names, aliases, and optionally extended
domain information such as `casting_time`. Their collection's provenance can
identify a source catalog. Domain-specific metadata can use extension fields.
Provenance describes origin and applicability;
it is not transcript evidence or a spell rule. If different source contexts
matter, use separately named collections with their own provenance. A consumer
can derive its recognition input from these entries instead of requiring a second
operator-maintained spell list. Embedded vocabulary, source precedence,
normalization, inference, and conflicts remain consumer policy.
Entry-ID uniqueness is a semantic rule checked separately from JSON Schema.
The [validator](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/docs/validation.md) performs both checks. No cross-document identity or
reference-resolution check is part of this initial contract.
## Extensions and task instructions
Extensions describe domain information. Consumers forwarding a shared document
should retain them; task-specific projections may intentionally omit them.
Acceptance and preservation do not claim interpretation. Defined fields retain
their schema constraints in an extended document.
Task instructions belong to consumer configuration. `instruction` is not a
defined field in this contract. Like other unknown fields, it can be retained
without acquiring instruction semantics. Maintained examples contain domain
data only.
## Authoring contributions
`#/$defs/partialCollection` is an editor-assistance definition with optional
`entries`. `#/$defs/entry` and `#/$defs/collection` assist entry and complete
collection editing. A partial contribution is not a standalone valid domain
document. ConfigKit owns imports, inheritance, and composition before validation
of the complete envelope.
## Differences from the reference catalog and Audita v4.2
The old format maps collection names directly at the root. The shared format
requires `schema_version` and `collections`. It removes defined collection
instructions, permits structural extensions, and adds defined provenance.
Existing consumers must explicitly adopt this envelope and its semantics.

View File

@@ -0,0 +1,51 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.maximumdirect.net/rpg/party/v0.2.0/schema.json",
"title": "MAXIMUMDIRECT RPG Party v1",
"type": "object",
"required": ["schema_version", "characters"],
"properties": {
"schema_version": {"const": "maximumdirect.rpg.party.v1"},
"characters": {
"type": "object",
"propertyNames": {"minLength": 1},
"additionalProperties": {"$ref": "#/$defs/rosterEntry"}
}
},
"$defs": {
"text": {"type": "string", "minLength": 1},
"rosterEntry": {
"type": "object",
"required": ["character"],
"properties": {
"player": {
"type": "object",
"required": ["name"],
"properties": {"name": {"$ref": "#/$defs/text"}}
},
"character": {
"type": "object",
"required": ["name"],
"properties": {
"name": {"$ref": "#/$defs/text"},
"aliases": {
"type": ["array", "null"],
"items": {"$ref": "#/$defs/text"}
},
"classes": {
"type": "array",
"items": {
"type": "object",
"required": ["name"],
"properties": {
"name": {"$ref": "#/$defs/text"},
"level": {"type": "integer", "minimum": 1, "maximum": 9223372036854775807}
}
}
}
}
}
}
}
}
}

View File

@@ -0,0 +1,54 @@
# Party contract
## Native loading boundary
Full conformance includes acquisition through the public mapping-root handoff of
[ConfigKit v1.4.0](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md),
followed by this schema and its semantic checks. ConfigKit owns syntax, structural
controls, numeric binding, and resource limits, including its 8 MiB source limit.
Dynamic integers bind as int64 and fractional/exponent values as finite float64;
authored decimal precision is not guaranteed. Preserve supported resolved values.
`extends` is structural input and source-root `config` is a control namespace;
nested ordinary `config` follows upstream rules. Other supported domain extensions
remain permitted. Schema validation adds no trimming, case folding, or defaults.
Structural validation alone does not prove native loading compatibility. The
pinned upstream contract defines this version's boundary independently of later
changes to the repository's general guidance.
Contract: `maximumdirect.rpg.party.v1`. [Schema](schema.json).
The [validation profile](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/docs/validation.md) and [compatibility rules](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/docs/compatibility.md)
apply. See the [example](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/rpg/party/v0.2.0/examples/party.yml).
| Field | Required | Meaning |
| --- | --- | --- |
| `schema_version` | Yes | Exactly `maximumdirect.rpg.party.v1`. |
| `characters` | Yes | Mapping from stable character IDs to roster entries; an empty mapping is valid. |
| `characters.<id>.character` | Yes | Character information. |
| `character.name` | Yes | Nonempty canonical display name. |
| `character.aliases` | No | Alternative names for the same character; omission, null, an empty list, or a list of nonempty strings. |
| `character.classes` | No | List of class objects, possibly empty. Each has a nonempty `name` and optional integer `level` from 1 through 9223372036854775807 after native binding. |
| `characters.<id>.player` | No | Player relationship. When present, an object with a required nonempty `name`. Multiple characters may have the same player. |
IDs are nonempty strings scoped to this party, independent of display names and
application artifact names. They remain stable when a display name changes.
Player names are display labels, not globally unique player identifiers.
Equal character names and aliases do not establish identity; consumers decide
how to handle ambiguity in a particular task. Supported strings are preserved in the resolved handoff.
Every object permits additional fields. Classes are optional domain information
for campaigns that use them. Other character attributes may be extensions.
Known fields have the documented type even when other fields are present.
Optional objects and `classes` accept omission, not null. List order carries no
additional contract meaning; mapping order never establishes character order.
A consumer can derive a party glossary from this roster. It uses character IDs
as entry IDs, canonical names and aliases, and its selected domain category.
Operators need not maintain a duplicate party vocabulary document.
## Differences from Narratio's existing party input
This contract uses a shared marker and `aliases` rather than `alias`. Player and
class information is optional. IDs follow domain identity rather than artifact
key syntax. Name uniqueness, class requirements, and mapping iteration order are
consumer decisions. Narratio's existing `narratio.party.v1` format remains a
separate released interface until adoption is implemented.

View File

@@ -0,0 +1,20 @@
package assets
import (
"io/fs"
"testing"
)
func TestSharedDomainContractsAreEmbedded(t *testing.T) {
for _, path := range []string{
"shared-domain/SOURCE.md",
"shared-domain/glossary/v0.2.0/schema.json",
"shared-domain/glossary/v0.2.0/semantics.md",
"shared-domain/rpg/party/v0.2.0/schema.json",
"shared-domain/rpg/party/v0.2.0/semantics.md",
} {
if _, err := fs.ReadFile(FS(), path); err != nil {
t.Errorf("read embedded %s: %v", path, err)
}
}
}