Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions governance/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ already-defined outcome. Tags are immutable. Consumers pin the exact 40-characte
A contract change is accepted only after every implementation claiming the affected capability
passes the candidate commit. Capabilities are `syntax`, `semantics`, `layout`, and `safety`.

## Schema identity

Every file in `schemas/` carries an `$id` ending `/schemas/<MAJOR.MINOR>/<name>.schema.json`. The
`$id` is an identity, not a fetch target: it names the contract revision a schema belongs to, so
two consumers that resolve "the case schema" through a pinned commit are resolving the same
document. The `<MAJOR.MINOR>` segment tracks the `VERSION` file's major and minor. A schema change
that alters what validates is at least a minor release and moves the segment with it; a patch
release leaves every `$id` untouched. Consumers still pin the commit SHA, which is what makes any
`$id` reproducible.

## The consumer manifest

A consumer records what it pins and what it claims in a `medui-conformance.toml` at its repository
Expand Down
2 changes: 1 addition & 1 deletion schemas/case.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Compliatory/MedUI/raw/main/schemas/case.schema.json",
"$id": "https://github.com/Compliatory/MedUI/schemas/0.2/case.schema.json",
"title": "MedUI conformance case",
"type": "object",
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion schemas/consumer-manifest.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Compliatory/MedUI/raw/main/schemas/consumer-manifest.schema.json",
"$id": "https://github.com/Compliatory/MedUI/schemas/0.2/consumer-manifest.schema.json",
"title": "MedUI consumer manifest",
"description": "The parsed structure of a consumer's medui-conformance.toml. The file on disk is TOML; this describes what a harness sees after parsing it.",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schemas/diagnostic.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Compliatory/MedUI/raw/main/schemas/diagnostic.schema.json",
"$id": "https://github.com/Compliatory/MedUI/schemas/0.2/diagnostic.schema.json",
"title": "MedUI diagnostic envelope",
"type": "object",
"additionalProperties": false,
Expand Down
9 changes: 9 additions & 0 deletions tools/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ def main() -> None:
if decision_numbers != list(range(1, len(decision_numbers) + 1)):
fail(f"decision identifiers are not contiguous from 001: {decision_numbers}")

# Every schema's $id names the contract minor it belongs to (governance/versioning.md).
minor = ".".join(version.split(".")[:2])
for schema_path in sorted((ROOT / "schemas").glob("*.schema.json")):
schema_id = load_json(schema_path).get("$id")
if not isinstance(schema_id, str):
fail(f"{schema_path.name} has no string $id")
if not schema_id.endswith(f"/schemas/{minor}/{schema_path.name}"):
fail(f"{schema_path.name} $id does not carry the {minor} contract minor: {schema_id}")

registry_text = (ROOT / "spec/diagnostics.md").read_text(encoding="utf-8")
code_phase = {code: phase for code, phase in REGISTRY_ROW.findall(registry_text)}
code_list = re.findall(r"^\|\s*`(MEDUI-E[0-9]{3})`\s*\|", registry_text, flags=re.MULTILINE)
Expand Down
Loading