Skip to content

The monochange book · Reference

JSON Schema reference

classification.schema.json

command-snapshot.schema.json

monochange.schema.json

release-record.schema.json

Snapshot documents set additionalProperties: false, so unknown fields fail validation. That is deliberate: it turns a misspelled field in a foreign emitter into a local error instead of silently dropping data.

Schema-aware TOML editors such as Taplo can opt in to the configuration schema with a directive at the top of monochange.toml:

#:schema https://monochange.github.io/monochange/schemas/monochange.schema.json

Version namespaces

Contract versions are independent per artifact family:

  • Snapshot documents carry the monochange_snapshot contract version, derived from that crate's package version.
  • monochange.toml and release records carry the monochange_schema contract version.

A version bump only affects the artifact family it belongs to, so a new snapshot contract does not invalidate configuration or release-record assets. Versioned URLs are generated during release preparation; the moving aliases always describe the latest release.

Only versions on the breaking axis are listed above. While a family's major version is 0, every minor bump may break consumers, so each 0.N is published. From 1.0 onward only a major bump may break consumers, so only N.0 is published. Intermediate releases keep their moving alias and remain reachable by their exact URL.

Regenerating assets

Committed schema assets are generated from Rust wire types and documentation, so never hand-edit them. Run these commands inside the repository's devenv shell:

schema:update            # regenerate current aliases and fixtures
schema:check             # verify committed assets match generated output
schema:release:update    # regenerate planned release aliases and fixtures
schema:release:check     # verify planned release aliases and fixtures

The release wrappers do not include versioned copies. Refresh or verify the planned version's copies explicitly:

cargo xtask schema release update --versioned
cargo xtask schema release check --versioned

The current schema and the versioned copy named by SCHEMA_VERSION must agree apart from $id. Refresh an unreleased version's copy when its generated descriptions change. Preserve published versioned contracts and older schema assets; correcting a description does not require a wire-contract version bump.

schema:check runs as part of lint:all and in CI, so committed assets cannot drift from the types they describe. The version list above is generated from the committed versioned assets by scripts/schema-versions.ts, so it stays current without hand edits. To validate a document against an asset locally, use any draft 2020-12 validator; the CLI snapshot emitters page has copyable examples.

Raw GitHub URLs

The same files are available from GitHub raw content, which is useful when you want to diff a pinned commit:

Edit this chapter on GitHub