2026-11-28 19:44:30 +00:00
|
|
|
# Validation
|
|
|
|
|
|
2026-11-29 16:36:50 +00:00
|
|
|
## Current and historical boundaries
|
|
|
|
|
|
|
|
|
|
Current tooling uses ConfigKit v1.4.0 for every domain document. The
|
|
|
|
|
[pinned input contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md)
|
|
|
|
|
owns syntax, resolution, resource limits, and native values; its
|
|
|
|
|
[consumer guide](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/consumers/README.md)
|
|
|
|
|
owns library use.
|
|
|
|
|
|
|
|
|
|
Published `0.1.0` contracts used a broader decoding profile. Their complete
|
|
|
|
|
historical validation requires the
|
|
|
|
|
[2026.11.0 guide](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.0/docs/validation.md)
|
|
|
|
|
and [historical tool](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.0/cmd/validate/main.go).
|
|
|
|
|
Choosing an older root with this newer binary does not restore a historical
|
|
|
|
|
decoder. Historical definitions remain bundled for offline structural use;
|
|
|
|
|
current native example checks target the most current local version of each name.
|
2026-11-28 19:44:30 +00:00
|
|
|
|
|
|
|
|
## Command
|
|
|
|
|
|
2026-11-29 16:36:50 +00:00
|
|
|
With Go 1.27 or later, prepare pinned dependencies and validate:
|
2026-11-28 19:44:30 +00:00
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
go mod download
|
2026-11-29 16:36:50 +00:00
|
|
|
go run ./cmd/validate -schema rpg/party rpg/party/v0.2.0/examples/party.yml
|
|
|
|
|
go run ./cmd/validate -schema glossary glossary/v0.2.0/examples/weather.yml
|
2026-11-28 19:44:30 +00:00
|
|
|
```
|
|
|
|
|
|
2026-11-29 16:36:50 +00:00
|
|
|
`-schema NAME` selects that name's highest SemVer in the local
|
|
|
|
|
[catalog](catalog.md). It reports the exact selected version and document marker.
|
|
|
|
|
There is no historical version flag or `NAME@VERSION` syntax. A checkout may
|
|
|
|
|
select unpublished candidates; an immutable distribution has its own catalog.
|
|
|
|
|
Selection never downloads a new catalog or retries older schemas after failure.
|
2026-11-28 19:44:30 +00:00
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
go build -o /tmp/schemas-validate ./cmd/validate
|
2026-11-29 16:36:50 +00:00
|
|
|
/tmp/schemas-validate -root /path/to/distribution -schema glossary /path/to/glossary.yml
|
2026-11-28 19:44:30 +00:00
|
|
|
```
|
|
|
|
|
|
2026-11-29 16:36:50 +00:00
|
|
|
Flags precede filenames. Every document in an invocation uses the selected schema;
|
|
|
|
|
later files are still checked after an earlier failure. Exit 0 means success,
|
|
|
|
|
1 means document read/load/structural/semantic failure, and 2 means usage,
|
|
|
|
|
selection, or distribution failure. Native failures retain library diagnostics
|
|
|
|
|
with filename context; schema and semantic failures identify relevant locations.
|
|
|
|
|
|
|
|
|
|
## Native domain handoff
|
|
|
|
|
|
|
|
|
|
Supply a completed mapping after the composing application has resolved its
|
|
|
|
|
inputs. The harness calls native `Load[map[string]any]` on `Bytes`, then passes
|
|
|
|
|
`Result.Config` directly to structural and semantic validation. It enables no
|
|
|
|
|
imports, discovery, overlays, startup bootstrap, overrides, or application defaults.
|
|
|
|
|
Native structural processing still applies: `extends` is a directive and
|
|
|
|
|
source-root `config` is a control namespace. Nested ordinary `config` data
|
|
|
|
|
follows upstream behavior.
|
|
|
|
|
|
|
|
|
|
Quote ambiguous strings such as `"yes"`, use supported decimal numeric syntax,
|
|
|
|
|
and avoid explicit tags, anchors, and aliases. Dynamic integer syntax binds to
|
|
|
|
|
int64; fractional/exponent syntax binds to finite float64 and may round. Native
|
|
|
|
|
source limits apply, including the baseline's 8 MiB per source. This repository
|
|
|
|
|
does not duplicate those checks or repair rejected inputs. Both YAML and JSON
|
|
|
|
|
use the same native loader; JSON is not an escape from native restrictions.
|
|
|
|
|
Files ending in `.json` additionally require JSON syntax.
|
|
|
|
|
|
|
|
|
|
Full conformance includes native acquisition, JSON Schema structure, and applicable
|
|
|
|
|
semantic rules. The harness checks exact glossary entry-ID uniqueness within
|
|
|
|
|
each collection. It does not fetch campaign locators, infer consumer support,
|
|
|
|
|
populate domain defaults, or mutate the loaded configuration. Extensions preserve
|
|
|
|
|
supported resolved values; task projections can omit irrelevant data.
|
|
|
|
|
|
|
|
|
|
## Offline resources and editors
|
|
|
|
|
|
|
|
|
|
Schema resources and catalogs use standard JSON decoding, independently of
|
|
|
|
|
domain acquisition. Resource numbers remain exact so schema constraints do not
|
|
|
|
|
round. The maintained JSON Schema engine compiles every bundled schema under its
|
|
|
|
|
canonical ID, registers dependencies locally, and rejects absent resource loads.
|
|
|
|
|
Only current versions' examples are checked through native acquisition.
|
|
|
|
|
|
|
|
|
|
Consumers can pin exact schema versions and a published CalVer archive, bundle
|
|
|
|
|
their dependency closure and semantic documents, and register local files under
|
|
|
|
|
canonical IDs. Consumer pinning is independent of this CLI's name selection.
|
|
|
|
|
Editors can associate documents externally with their selected schema. Structural
|
|
|
|
|
editor feedback alone does not prove native acquisition or full conformance.
|