Establish shared domain schemas and offline validation
This commit is contained in:
37
docs/campaign.md
Normal file
37
docs/campaign.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Campaign contract
|
||||
|
||||
Contract: `maximumdirect.campaign.v1`. [Schema](../schemas/campaign.schema.json).
|
||||
The [validation profile](validation.md) and [compatibility rules](compatibility.md)
|
||||
apply. See the [example](../examples/campaign.yml).
|
||||
|
||||
| Field | Required | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `schema_version` | Yes | Exactly `maximumdirect.campaign.v1`. |
|
||||
| `id` | Yes | Nonempty stable campaign identity, independent of its display name. |
|
||||
| `name` | No | Nonempty campaign display name. |
|
||||
| `description` | No | Free text campaign context; an empty string is valid. |
|
||||
| `setting` | No | Nonempty domain setting label or identifier. |
|
||||
| `system` | No | Nonempty game-system label or identifier. |
|
||||
| `references` | No | Relationships to domain documents. |
|
||||
| `references.party` | No | Nonempty locator for a party document. |
|
||||
| `references.glossaries` | No | List of nonempty locators for glossary documents; may be empty. |
|
||||
|
||||
Optional fields accept omission, not null. An empty `references` object is
|
||||
valid. Objects allow additional fields. IDs, labels, and locator strings are
|
||||
preserved without normalization. The issuer supplies the identity's namespace;
|
||||
this contract does not require globally unique campaign IDs.
|
||||
|
||||
References are locator strings, including URI references and relative file
|
||||
references. Consumers select supported locator forms and resolve relative
|
||||
references against the domain document's location (or a base
|
||||
provided with an in-memory document). Resolving authored configuration paths
|
||||
before this boundary remains the composing application's responsibility.
|
||||
References express relationships; the harness neither fetches them nor requires
|
||||
local installation. List order does not prescribe merge order, precedence, or
|
||||
execution. Those belong to the consuming application.
|
||||
|
||||
This document records shared context. Narratio's `campaign.yml` remains
|
||||
application configuration with its own operational fields. Session templates,
|
||||
speaker-file choices, execution paths, provider policy, and credentials are
|
||||
outside the defined shared campaign fields. Additional fields gain no execution
|
||||
or credential semantics through schema conformance.
|
||||
57
docs/compatibility.md
Normal file
57
docs/compatibility.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# Compatibility
|
||||
|
||||
The initial candidate is the `v1.0.0` schema set. Publication status is established
|
||||
by the immutable upstream tag, not by this candidate's `VERSION` file. Contracts
|
||||
jointly comprise their JSON Schemas and semantic documents.
|
||||
|
||||
## Version identities
|
||||
|
||||
Schema-set releases use Semantic Versioning and ship together. Contract markers
|
||||
`maximumdirect.party.v1`, `maximumdirect.campaign.v1`, and
|
||||
`maximumdirect.glossary.v1` identify major domain contracts. A compatible schema
|
||||
release does not require editing operator document headers.
|
||||
|
||||
- Major: incompatible structure, validation, or meaning.
|
||||
- Minor: compatible additions that preserve interpretation of existing data.
|
||||
- Patch: compatible corrections. A tighter validation rule that rejects previously
|
||||
valid documents is not automatically a patch fix.
|
||||
|
||||
Each release pins absolute `$id` values to its immutable raw tag URLs. These are
|
||||
schema resource identities, distinct from the operator's contract marker.
|
||||
Vocabulary, schema-set, and consumer application versions evolve independently.
|
||||
|
||||
## Both directions matter
|
||||
|
||||
A new consumer should accept old documents within its claimed major contract.
|
||||
An older consumer can accept and preserve new optional extension fields without
|
||||
claiming their meaning. Additional fields are compatible only when ignoring
|
||||
them preserves interpretation of the known data. A field changing that
|
||||
interpretation needs a new major contract or an explicitly selected extension
|
||||
contract with its own documented semantics.
|
||||
|
||||
Consumers forwarding or republishing shared documents should preserve extensions;
|
||||
task-specific projections may omit them. Extensions cannot redefine a standard
|
||||
field. Consumers can require additional data for a task without claiming that
|
||||
every shared document must contain it.
|
||||
|
||||
Contract changes include a compatibility assessment, updated schema and semantics,
|
||||
examples and focused fixtures, and migration guidance for incompatible changes.
|
||||
Retain representative valid documents from supported releases in `tests/valid/`
|
||||
as compatibility evidence. A schema diff alone does not detect changed meanings.
|
||||
The initial release has no earlier shared-schema releases to compare against.
|
||||
|
||||
## Existing consumers
|
||||
|
||||
No existing application is declared compatible by this repository's initial
|
||||
release. Adoption requires explicit implementation and verification.
|
||||
|
||||
| Consumer | Current gap / later adoption responsibility |
|
||||
| --- | --- |
|
||||
| Narratio | Uses `narratio.party.v1`, stricter roster requirements, and the wrapperless glossary schema. Separate shared domain documents from operational campaign configuration and adopt the shared marker, alias spelling, and extension semantics. |
|
||||
| Audita v4.2.0 | Runtime glossary input is wrapperless and can contain task instructions. Adopt the shared envelope and obtain instructions through application configuration. |
|
||||
| Notarius v0.9.0 | Spell recognition consumes a strict JSON overlay with separate catalog and ruleset semantics. Reconcile its embedded catalog, merges, and ambiguity rules with shared spell entries and provenance; recognize names and aliases without asking operators to duplicate the source vocabulary. |
|
||||
| Scriptorium prompts | Adopt shared party and glossary structures in the prompt input contracts that need them; no generic application compatibility is implied. |
|
||||
| Reference catalog | Retains a wrapperless glossary and partial authoring format. Adopt shared completed envelopes while leaving composition to ConfigKit and vocabulary distribution independent. |
|
||||
|
||||
The [inventory](inventory.md) identifies source baselines and the deliberate
|
||||
differences. Consumer release order and conversion code belong to later work.
|
||||
46
docs/development.md
Normal file
46
docs/development.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Development
|
||||
|
||||
Start with the [README](../README.md), [agent guidance](../AGENTS.md), and the
|
||||
affected contract's schema and semantic document. [Inventory](inventory.md)
|
||||
records the initial scope decisions; [compatibility](compatibility.md) owns
|
||||
change classification and current consumer gaps.
|
||||
|
||||
Go 1.27.0 is the harness minimum. Maintained checks use the official Go 1.27.4
|
||||
toolchain. Prepare the pinned dependencies with `go mod download`, then run:
|
||||
|
||||
```sh
|
||||
go test ./...
|
||||
go vet ./...
|
||||
```
|
||||
|
||||
`go test ./...` compiles and meta-validates all schemas, validates all examples
|
||||
and fixtures, checks semantic uniqueness and YAML/JSON equivalence, exercises
|
||||
decoding and CLI failures, and checks that distribution content and local
|
||||
documentation links are present. Tests are offline and use synthetic data.
|
||||
|
||||
`sh scripts/check.sh` runs those checks and verifies an unpacked `git archive`
|
||||
of the committed candidate. Use it after committing when preparing a release.
|
||||
CI uses the same command. It tests the source archive independently of the
|
||||
original checkout so missing files and accidental outside references are caught.
|
||||
|
||||
## Layout and changes
|
||||
|
||||
- `schemas/`: language-neutral Draft 2020-12 contracts.
|
||||
- `docs/{party,campaign,glossary}.md`: field meanings and semantic rules.
|
||||
- `examples/`: complete authoring examples, including equivalent YAML and JSON.
|
||||
- `tests/valid/`: valid compatibility fixtures.
|
||||
- `tests/invalid/`: focused invalid documents; prefixes identify failure phase.
|
||||
- `internal/validation/`: local YAML profile, schema registration, semantic check.
|
||||
- `cmd/validate/`: developer CLI; no application SDK or configuration loader.
|
||||
|
||||
Implement a contract change in its schema, semantics, and relevant examples and
|
||||
fixtures together. Test observable acceptance and rejection, extension retention,
|
||||
and semantic boundaries. Avoid duplicating the upstream libraries' own suites.
|
||||
New standard fields need a compatibility assessment. Routine editing does not
|
||||
publish a release or upgrade any consumer.
|
||||
|
||||
Keep one canonical owner for each definition. Link to upstream library guides
|
||||
for their features. Use original synthetic examples. Before incorporating source
|
||||
material, record its origin, revision, applicable license, and modifications in
|
||||
[attribution](oss/attribution.md); the repository's CC0 choice does not change
|
||||
third-party terms. New code and prose here are dedicated under [CC0](../COPYRIGHT).
|
||||
67
docs/glossary.md
Normal file
67
docs/glossary.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# Glossary contract
|
||||
|
||||
Contract: `maximumdirect.glossary.v1`. [Schema](../schemas/glossary.schema.json).
|
||||
The [validation profile](validation.md) and [compatibility rules](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`, `ruleset`, 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. Values are preserved without 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 catalog and ruleset. 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](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.
|
||||
23
docs/inventory.md
Normal file
23
docs/inventory.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Initial field and ownership inventory
|
||||
|
||||
This inventory precedes and explains the initial contracts. It is design history;
|
||||
the linked contract documents own current semantics.
|
||||
|
||||
| Source and baseline | Shared domain information | Consumer-owned information | Initial disposition |
|
||||
| --- | --- | --- | --- |
|
||||
| Narratio [`party.md`](https://forge.maximumdirect.net/eric/narratio/src/commit/782bcceb1c59bc71d782c7113ed440b47c608d51/docs/integrations/party.md) | Character IDs, names, aliases, player relationships, class names and levels | Artifact-key grammar, roster iteration order, generated players projection | [Party](party.md) retains the nested character/player shape; classes and player are optional, aliases use the common plural spelling, and mapping order has no meaning. |
|
||||
| Narratio [`config.md`](https://forge.maximumdirect.net/eric/narratio/src/commit/782bcceb1c59bc71d782c7113ed440b47c608d51/docs/config.md) | Campaign identity, setting/system labels, relationships to party and glossary resources | Session templates, input staging, provider settings, paths used by execution, secrets | [Campaign](campaign.md) defines a small domain document independent of Narratio configuration. |
|
||||
| CC0 reference catalog `FORMAT.md` and [schema snapshot](origins/reference-catalog-glossary-v1.schema.json) at `a1a87edafd59a1de545a1c0b4efe5feeb80348e0` | Named collections, entry IDs, names, categories, descriptions, aliases, plural forms, extensions | Collection instruction and native composition controls | [Glossary](glossary.md) adds an explicit envelope, permits structural extensions, and removes task instructions from the defined fields. |
|
||||
| Audita v4.2.0 [glossary input](https://forge.maximumdirect.net/eric/audita/src/tag/v4.2.0/docs/integrations/transcript-glossary-files.md) | Canonical names, aliases, optional null aliases/plural, rich entries | Pipeline selection, correction instructions, replacement rules | Preserve the shared field shapes; the new envelope requires later Audita adoption. |
|
||||
| Notarius v0.9.0 [spell overlay](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/integrations/dnd-spell-catalog-overlays.md) | Spell names and aliases, catalog/ruleset provenance | Embedded base catalog, recognition and collision policy, merge order | Spell entries use the general glossary. Catalog/ruleset context is collection provenance; later consumer adoption defines its interpretation. |
|
||||
|
||||
The party and campaign schemas and their documentation are new, independently
|
||||
written specifications informed by the interfaces above; no Narratio or Audita
|
||||
implementation or prose is copied. The glossary schema is adapted from the CC0
|
||||
reference catalog; [attribution](oss/attribution.md) records that source.
|
||||
|
||||
No cross-document relationship is enforced by the initial harness. Campaign
|
||||
references are locators, not assertions that resources exist or are installed.
|
||||
The semantic check beyond JSON Schema is glossary entry-ID uniqueness within
|
||||
each collection. Duplicate mapping keys are decoding failures, including
|
||||
duplicate party IDs. Consumers can add operational requirements at adoption.
|
||||
17
docs/origins/README.md
Normal file
17
docs/origins/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Incorporated schema origin
|
||||
|
||||
The [original glossary schema](reference-catalog-glossary-v1.schema.json) is an
|
||||
unmodified snapshot of `schemas/glossary-v1.schema.json` from the local
|
||||
`narratio-reference-catalog` repository at commit
|
||||
`a1a87edafd59a1de545a1c0b4efe5feeb80348e0`.
|
||||
|
||||
That repository's README dedicates its original vocabulary, schema, examples,
|
||||
and documentation to CC0 1.0. Its LICENSE contains the CC0 1.0 text also supplied
|
||||
in this distribution's [LICENSE](../../LICENSE). The selected revision is not
|
||||
publicly available at the forge during this adoption. This snapshot makes the
|
||||
incorporated source independently inspectable in the distribution.
|
||||
|
||||
The active [shared glossary schema](../../schemas/glossary.schema.json) adapts
|
||||
that source with an envelope, changed defined fields, structural extensions,
|
||||
and provenance. The snapshot records origin; it is not a supported contract
|
||||
or an additional schema that consumers need to register.
|
||||
85
docs/origins/reference-catalog-glossary-v1.schema.json
Normal file
85
docs/origins/reference-catalog-glossary-v1.schema.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://forge.maximumdirect.net/eric/narratio-reference-catalog/schemas/glossary-v1.schema.json",
|
||||
"title": "Glossary named collections v1",
|
||||
"$ref": "#/$defs/document",
|
||||
"$defs": {
|
||||
"entry": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"category"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"category": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"aliases": {
|
||||
"type": ["array", "null"],
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"plural": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
},
|
||||
"partialCollection": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"instruction": {
|
||||
"type": "string"
|
||||
},
|
||||
"entries": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/entry"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"collection": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/$defs/partialCollection"
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"entries"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"document": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"$ref": "#/$defs/collection"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
52
docs/oss/attribution.md
Normal file
52
docs/oss/attribution.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Open Source Attribution Notices
|
||||
|
||||
## Narratio reference catalog
|
||||
|
||||
Material: `schemas/glossary.schema.json`, adapted from the catalog's glossary-v1
|
||||
schema at `a1a87edafd59a1de545a1c0b4efe5feeb80348e0`. The unmodified source is
|
||||
retained in `docs/origins/reference-catalog-glossary-v1.schema.json`. The shared
|
||||
envelope, defined fields, provenance, and structural extension behavior were changed.
|
||||
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
License and notices: [CC0 1.0](../../LICENSE).
|
||||
|
||||
[Source](../origins/reference-catalog-glossary-v1.schema.json).
|
||||
|
||||
## go-yaml
|
||||
|
||||
Selected module: `go.yaml.in/yaml/v4` at `v4.0.0`.
|
||||
|
||||
Copyright 2006-2010 Kirill Simonov
|
||||
|
||||
Copyright 2011-2019 Canonical Ltd
|
||||
|
||||
Copyright 2025 The go-yaml Project Contributors
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 AND MIT
|
||||
|
||||
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) | [MIT](licenses/MIT.txt) | [LICENSE](https://github.com/yaml/go-yaml/blob/f2f9563503f11b7a60da0c532175dcc693ce8d5a/LICENSE) | [NOTICE](https://github.com/yaml/go-yaml/blob/f2f9563503f11b7a60da0c532175dcc693ce8d5a/NOTICE).
|
||||
|
||||
[Source](https://github.com/yaml/go-yaml/tree/f2f9563503f11b7a60da0c532175dcc693ce8d5a).
|
||||
|
||||
## jsonschema
|
||||
|
||||
Selected module: `github.com/santhosh-tekuri/jsonschema/v6` at `v6.0.3`.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) | [LICENSE](https://github.com/santhosh-tekuri/jsonschema/blob/b0fc661f4939578bc429f408c18202573dbafcc4/LICENSE).
|
||||
|
||||
[Source](https://github.com/santhosh-tekuri/jsonschema/tree/b0fc661f4939578bc429f408c18202573dbafcc4).
|
||||
|
||||
## Go text
|
||||
|
||||
Selected module: `golang.org/x/text` at `v0.14.0` (transitive dependency).
|
||||
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) | [LICENSE](https://go.googlesource.com/text/+/6c97a165dd661335ff7bce6104a008558123c353/LICENSE) | [PATENTS](https://go.googlesource.com/text/+/6c97a165dd661335ff7bce6104a008558123c353/PATENTS).
|
||||
|
||||
[Source](https://go.googlesource.com/text/+/6c97a165dd661335ff7bce6104a008558123c353).
|
||||
202
docs/oss/licenses/Apache-2.0.txt
Normal file
202
docs/oss/licenses/Apache-2.0.txt
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
27
docs/oss/licenses/BSD-3-Clause.txt
Normal file
27
docs/oss/licenses/BSD-3-Clause.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
18
docs/oss/licenses/MIT.txt
Normal file
18
docs/oss/licenses/MIT.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
||||
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
39
docs/party.md
Normal file
39
docs/party.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Party contract
|
||||
|
||||
Contract: `maximumdirect.party.v1`. [Schema](../schemas/party.schema.json).
|
||||
The [validation profile](validation.md) and [compatibility rules](compatibility.md)
|
||||
apply. See the [example](../examples/party.yml).
|
||||
|
||||
| Field | Required | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `schema_version` | Yes | Exactly `maximumdirect.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 positive integer `level`. |
|
||||
| `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. Strings are preserved as authored.
|
||||
|
||||
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.
|
||||
85
docs/release.md
Normal file
85
docs/release.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# Release procedure
|
||||
|
||||
This is a source-only schema distribution. The authoritative remote is `origin`
|
||||
at `ssh://git@forge.maximumdirect.net:22222/eric/schemas.git`, branch `main`.
|
||||
Publication requires an explicit release request. Implementing the repository
|
||||
does not publish the initial candidate.
|
||||
|
||||
## Prepare the candidate
|
||||
|
||||
1. Select a fresh Semantic Versioning tag under the [compatibility rules](compatibility.md).
|
||||
2. Update `VERSION`, each schema's raw-tag `$id`, release-specific README examples,
|
||||
and references between schemas to that version. Contract markers change only
|
||||
when their major domain contract changes.
|
||||
3. Write `docs/releases/<version>.md` with the changes, compatibility assessment,
|
||||
and migration instructions where needed. Include links to COPYRIGHT, LICENSE,
|
||||
and ATTRIBUTION at the intended immutable tag. The initial candidate note is
|
||||
[v1.0.0](releases/v1.0.0.md).
|
||||
4. Prepare Go 1.27.4 and `go mod download`. Commit the intended source with a
|
||||
short descriptive message. Review the diff for unintended data or credentials.
|
||||
|
||||
Run `sh scripts/check.sh` on that committed candidate. It performs the same checks
|
||||
as CI, including offline compilation and validation from the unpacked tagged-source
|
||||
archive format. Validation dependencies are prepared separately; tests need no
|
||||
network, consumer applications, provider credentials, or LLM calls.
|
||||
|
||||
## Distribution
|
||||
|
||||
The forge's immutable tagged source archive is the distribution:
|
||||
|
||||
```text
|
||||
https://forge.maximumdirect.net/eric/schemas/archive/v1.0.0.tar.gz
|
||||
```
|
||||
|
||||
It contains the complete schema directory, semantic documentation, examples,
|
||||
license and attribution, release note, and pinned optional Go harness and fixtures.
|
||||
A consumer can bundle the schemas and semantic documents, register each `$id`
|
||||
against its local file, and resolve all references offline. The harness is not a
|
||||
runtime dependency. No binaries or separate registry are published.
|
||||
|
||||
To inspect the candidate distribution locally before publication:
|
||||
|
||||
```sh
|
||||
mkdir -p dist
|
||||
git archive --format=tar.gz --prefix=schemas-v1.0.0/ \
|
||||
--output=dist/schemas-v1.0.0.tar.gz HEAD
|
||||
```
|
||||
|
||||
Individual schema/editor URLs use the raw tag route, for example:
|
||||
|
||||
```text
|
||||
https://forge.maximumdirect.net/eric/schemas/raw/tag/v1.0.0/schemas/glossary.schema.json
|
||||
```
|
||||
|
||||
The forge's raw-commit route was checked against the initial repository revision;
|
||||
the public raw-tag JSON route was checked against a released sibling JSON document.
|
||||
The exact URLs above become available only after this tag is published. Optional
|
||||
post-publication inspection can use `curl --fail` on them and decode the response
|
||||
as JSON, not an HTML forge page. It does not delay source-release completion.
|
||||
|
||||
## Publish when requested
|
||||
|
||||
Start from a clean `main` whose HEAD is the validated candidate. Fetch `origin`
|
||||
and verify that advancing `origin/main` to HEAD is fast-forward. Check that the
|
||||
selected tag is absent locally and on `origin`. Publish only the intended branch
|
||||
and fresh annotated tag. For the initial candidate:
|
||||
|
||||
```sh
|
||||
git fetch origin main --tags
|
||||
git merge-base --is-ancestor origin/main HEAD
|
||||
git status --short
|
||||
git tag --list v1.0.0
|
||||
git ls-remote --tags origin refs/tags/v1.0.0
|
||||
git tag -a v1.0.0 -F docs/releases/v1.0.0.md
|
||||
git push --atomic origin HEAD:refs/heads/main refs/tags/v1.0.0
|
||||
```
|
||||
|
||||
The status and tag checks must be empty before creating the tag. Stop if the
|
||||
branch is not `main`, the candidate changed, the worktree is dirty, the version
|
||||
is already used, or validation failed. Publication completes when the push
|
||||
succeeds; do not wait for CI. The forge supplies the tagged source archive.
|
||||
|
||||
Published tags and contents are immutable. A defect is corrected in a new
|
||||
version. On an ambiguous push result, inspect the exact upstream branch and tag
|
||||
before reporting success or retrying. Preserve already-published tags. Routine
|
||||
releases do not require installed-consumer checks or a new external approval gate.
|
||||
18
docs/releases/v1.0.0.md
Normal file
18
docs/releases/v1.0.0.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Maximum Direct shared schemas v1.0.0
|
||||
|
||||
Initial shared party, campaign, and general glossary contracts, identified by
|
||||
`maximumdirect.party.v1`, `maximumdirect.campaign.v1`, and
|
||||
`maximumdirect.glossary.v1`.
|
||||
|
||||
The distribution includes Draft 2020-12 schemas, semantic documentation,
|
||||
synthetic YAML/JSON examples, compatibility rules, and an optional offline Go
|
||||
validation harness. Objects support extensions; semantic validation checks
|
||||
glossary entry IDs within collections. Glossaries use a versioned envelope and
|
||||
keep task instructions in consumer configuration.
|
||||
|
||||
This is a new independent contract set. Existing Narratio, Audita, Notarius,
|
||||
Scriptorium prompt, and reference catalog formats require separately planned
|
||||
adoption. See [compatibility](../compatibility.md#existing-consumers) for the
|
||||
initial differences. There is no earlier shared release to migrate.
|
||||
|
||||
[COPYRIGHT](https://forge.maximumdirect.net/eric/schemas/src/tag/v1.0.0/COPYRIGHT) | [LICENSE](https://forge.maximumdirect.net/eric/schemas/src/tag/v1.0.0/LICENSE) | [ATTRIBUTION](https://forge.maximumdirect.net/eric/schemas/src/tag/v1.0.0/docs/oss/attribution.md)
|
||||
102
docs/validation.md
Normal file
102
docs/validation.md
Normal file
@@ -0,0 +1,102 @@
|
||||
# Validation
|
||||
|
||||
Validate a completed domain document after the composing application has resolved
|
||||
imports, inheritance, and layering. ConfigKit owns those operations; this
|
||||
repository defines the handoff format. Partial authoring contributions may use
|
||||
schema definitions for editor assistance without conforming to a complete root.
|
||||
|
||||
## Command
|
||||
|
||||
With Go 1.27 or later, run from the selected schema-set checkout or unpacked
|
||||
source archive:
|
||||
|
||||
```sh
|
||||
go mod download
|
||||
go run ./cmd/validate examples/party.yml examples/campaign.yml examples/glossary.yml
|
||||
```
|
||||
|
||||
Dependencies are pinned in `go.mod` and `go.sum`. Once prepared, validation is
|
||||
offline. A built tool can select another unpacked distribution:
|
||||
|
||||
```sh
|
||||
go build -o /tmp/schemas-validate ./cmd/validate
|
||||
/tmp/schemas-validate -root /path/to/schemas-v1.0.0 /path/to/completed-glossary.yml
|
||||
```
|
||||
|
||||
Flags precede filenames. All files are checked even if an earlier file fails.
|
||||
Exit 0 means all documents passed; 1 means a document could not be read or
|
||||
validated; 2 means invalid command usage or an unusable schema set. Errors identify
|
||||
the document and distinguish `decode`, `structure`, and `semantic`. Decoding
|
||||
errors include field paths and source positions where the YAML library or node
|
||||
profile provides them. Structural errors include JSON instance locations.
|
||||
Semantic duplicate-ID errors identify the collection and entry index.
|
||||
|
||||
The harness uses [go-yaml v4](https://github.com/yaml/go-yaml/tree/v4.0.0) for
|
||||
parsing and [jsonschema v6](https://github.com/santhosh-tekuri/jsonschema/tree/v6.0.3)
|
||||
for Draft 2020-12 validation. It performs glossary ID uniqueness after structural
|
||||
validation. It does not resolve domain references, check resource installation,
|
||||
infer consumer support, populate defaults, or rewrite files.
|
||||
|
||||
## YAML decoding profile
|
||||
|
||||
Use one document containing string-keyed mappings, sequences, strings, finite
|
||||
numbers, booleans, and null. JSON is an equivalent serialization; `.json` files
|
||||
must use JSON syntax. The same duplicate-key and semantic rules apply to both.
|
||||
|
||||
- Duplicate mapping keys are errors at every level. Keys compare as strings.
|
||||
- Mapping keys must resolve to strings; quote numeric or boolean-looking keys
|
||||
when they are intended to be names. Mapping order carries no domain meaning.
|
||||
- `true` and `false` (including YAML case variants) are booleans. `yes`, `no`,
|
||||
`on`, and `off` remain strings; a schema never coerces them into booleans.
|
||||
- Date-like and timestamp scalars are strings containing their authored text.
|
||||
Quote ambiguous values when authoring for other YAML tools with different
|
||||
scalar-resolution policies.
|
||||
- `null`, `Null`, `NULL`, `~`, and an empty scalar are null. Quoted forms are
|
||||
strings. Absence, null, and empty containers are distinct.
|
||||
- YAML integer spellings supported by go-yaml include decimal, `0x` hexadecimal,
|
||||
`0o` octal, `0b` binary, legacy leading-zero octal, and separators. Decimal
|
||||
floats may use a sign, exponent, leading dot, trailing dot, or separators.
|
||||
Numeric scalar resolution follows go-yaml, with plain JSON number spellings
|
||||
additionally recognized beyond machine numeric range. The adapter preserves
|
||||
decimal precision as JSON numbers rather than converting through machine
|
||||
floating point. NaN and infinities are errors.
|
||||
- Anchors and aliases are accepted and resolved to values. Cycles are errors.
|
||||
Anchors, aliases, comments, and formatting are serialization details.
|
||||
- Standard mapping, sequence, string, integer, float, boolean, null, and
|
||||
timestamp tags have the representations above. Custom tags, binary values,
|
||||
sets, ordered-map tags, complex keys, and merge keys have no representation
|
||||
in this completed-document profile. Resolve authoring composition before this
|
||||
boundary; a quoted string key `"<<"` remains an ordinary extension key.
|
||||
|
||||
This is an explicit profile, not a promise to accept every YAML feature.
|
||||
Consumers using other parsers should test the same cases before claiming
|
||||
compatibility. Native library limits remain implementation safeguards, not
|
||||
additional domain constraints.
|
||||
|
||||
## Structural and semantic boundaries
|
||||
|
||||
All defined fields are validated when present. Objects permit extensions unless
|
||||
a field is itself a named-record mapping, whose values must satisfy that record
|
||||
schema. For example, every item in `collections` is a collection, not arbitrary
|
||||
document metadata. Put metadata on the envelope, collection, or entry.
|
||||
|
||||
The semantic inventory is in [the initial inventory](inventory.md). The harness
|
||||
checks entry-ID uniqueness within each glossary collection using exact string
|
||||
comparison. Party-ID uniqueness is already covered by duplicate-key rejection.
|
||||
The initial contract defines no cross-document referential-integrity rule.
|
||||
Structural success alone does not prove these semantic rules or that a consumer
|
||||
can use the document for a particular operation.
|
||||
|
||||
## Offline schema use and editors
|
||||
|
||||
Every schema declares Draft 2020-12 and an immutable release `$id`. The harness
|
||||
registers the bundled schemas under those IDs before compiling them and rejects
|
||||
unresolved resource loads. The schema engine supplies the standard meta-schema;
|
||||
ordinary validation performs no network requests.
|
||||
|
||||
Other validators can likewise register local files under their `$id` values.
|
||||
Keep the complete schema directory from one release together. Configure editors
|
||||
externally to associate document paths with a local schema or its immutable raw
|
||||
URL. Operator documents use `schema_version`; they do not need a `$schema` field.
|
||||
Schema validation supplies editor feedback for known fields. Optional tooling
|
||||
can warn about likely misspellings without rejecting extensions.
|
||||
Reference in New Issue
Block a user