Establish shared domain schemas and offline validation
This commit is contained in:
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).
|
||||
Reference in New Issue
Block a user