Bundle shared domain contracts and validation
This commit is contained in:
83
internal/domaininput/resources/glossary/v0.2.0/semantics.md
Normal file
83
internal/domaininput/resources/glossary/v0.2.0/semantics.md
Normal 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](../../docs/validation.md) and [compatibility rules](../../docs/compatibility.md)
|
||||
apply. Start with [campaign vocabulary](examples/glossary.yml),
|
||||
[weather](examples/weather.yml), or [sports](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](../../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.
|
||||
Reference in New Issue
Block a user