Files
schemas/docs/development.md

66 lines
3.6 KiB
Markdown
Raw Normal View History

# 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 every current version's examples through native ConfigKit loading
and checks active 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
- `glossary/v<version>/` and `rpg/{party,campaign}/v<version>/`: independent
schemas, adjacent `semantics.md`, and complete `examples/`.
- `catalog.json`: exact schema-version inventory; see [catalog format](catalog.md).
- `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/`: most-current local version selection by schema name; no consumer SDK.
- `internal/publication/` and `cmd/check-published/`: separate Git history checks
used only in explicitly requested release preparation.
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.
Published version directories are immutable; additions use a new version.
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).
## Schema authoring boundary
Every new schema or revision conforms to the pinned ConfigKit acquisition and
mapping-root handoff described in [validation](validation.md). Review field
types, numeric ranges and precision promises, reserved names/controls, and
extension values before publication. Resolve differences in the proposed
contract rather than introducing a decoder or compatibility adapter. Pin that
upstream baseline in each new version's semantic document.
Supply representative examples and focused boundary fixtures for new constraints.
The catalog drives native example checks for the highest version of each name;
missing or incompatible examples fail. Historical resources still compile offline.
Tests supply evidence, not a proof covering every accepted document. Repeat this
review and the same ordinary checks when upgrading ConfigKit. Broad-profile
fixtures under `tests/historical/` document the original tool only.