Schema guard
Check a proposed API or data contract against the current contract, real sample payloads, and a compatibility policy, and gate publication behind a refusable verdict with native digest evidence.
You’re reading version 0.1.8. Go to the current version
Overview
Schema Check decides whether a proposed contract change can move forward without silently breaking callers. It compares the current and proposed JSON Schema contracts field by field, validates every supplied sample payload against the proposed contract, applies the caller's compatibility policy, and either refuses or emits a gated publish proposal. It never publishes anything itself.
In the manual
Runner
check
Declared by its execution profile. Read the profile
SKILL.md
Schema Check
Schema Check decides whether a proposed contract change can move forward without silently breaking callers. It compares the current and proposed JSON Schema contracts field by field, validates every supplied sample payload against the proposed contract, applies the caller's compatibility policy, and either refuses or emits a gated publish proposal. It never publishes anything itself.
Procedure
- Native
data.digestbinds the exact current schema, proposed schema, and sample set before any judgment, so the verdict is tied to specific bytes. - Deterministic comparison walks both contracts: removed fields, type changes, fields that became required, new required fields, and narrowed enums are breaking; additive optional fields and expanded enums are notes.
- Native
data.validatecompiles both schemas and validates every sample against each contract using JSON Schema 2020-12, with external retrieval disabled. Coverage is reported honestly: paths no sample exercises are flagged, not assumed covered. - The policy decides the verdict. Breaking changes are refused unless
breaking_allowedis explicitly true, and policyrequired_fieldsmust exist in the proposed contract. - A compatible verdict emits a
proposalwith the three digests and changed paths, gated on a schema publisher or human approver. A refused verdict emits no proposal.live_write_performedis always false.
Invalid requests refuse with policy_result: invalid_input and findings rather
than guessing. Missing required inputs fail at admission.
Output
schema_check (runx/schema-check.check.v1) carries decision, policy_result,
breaking_changes, per-sample validation_results, migration_notes
including coverage, the gated proposal or null, and validation.
Inputs are current_schema, proposed_schema, sample_payloads, and
compatibility_policy.
What compatibility means
Sample validity is not a proof that every existing caller remains compatible. The inclusion comparison supports object properties, required fields, scalar types, enums and boolean additionalProperties. It compares root constraints as well as nested fields. A newly constrained enum and a newly closed object are changes that may reject existing callers.
The native validator supports the full self-contained schema, including
minLength, numeric bounds, nested arrays, composition and local references. If
a changed contract uses constraints outside the inclusion comparison's supported
language, the result is refused with compatibility.unsupported findings, even
if its samples happen to pass or breaking changes are allowed. Identical schemas
need no inclusion inference but still compile and validate their samples.
Formats are annotations. This skill never fetches remote schemas.
For example, adding minLength: 10 to a string with sample "x" fails native
validation; it cannot receive a compatible verdict. Missing required fields,
removed enum values and unknown comparison semantics remain visible. A proposal
is not publication approval. Its digests bind the exact proposed change; the
actual schema publisher owns authorization, publication and readback.
Published execution profile
The execution profile published with 0.1.8, shown as its exact bytes.
| Runner |
|
|---|---|
| Profile digest | sha256:2a1bb0a293478810b62236a423098852b89792d2bfa06dbcd7d6ef82b9b40296 |
skill: schema-check
version: "0.1.8"
catalog:
kind: graph
audience: public
visibility: public
category: code
role: canonical
execution: read
completion: runtime_receipt
approval: none
harness:
files:
- fixtures/support/composed.graph
cases:
- name: schema-check-additive-change-proposes
operator_journeys:
- mode: standalone
confusors:
- extract
- skill-review
request: Check whether this proposed contract change breaks existing callers before the schema is
published.
expected_outcome: Return a compatibility verdict with per-sample validation and a gated publish
proposal, with no live write.
- mode: composed
request: Continue from this already checked schema change and its compatibility verdict.
expected_outcome: Reuse the supplied verdict and digests without re-deriving the comparison.
prior_evidence:
- The current schema, proposed schema, samples, and policy supplied in the fixture.
must_not_repeat:
- Do not re-run the schema comparison already sealed in the verdict.
inputs:
current_schema:
type: object
required:
- id
properties:
id:
type: string
status:
type: string
enum:
- open
- closed
proposed_schema:
type: object
required:
- id
properties:
id:
type: string
status:
type: string
enum:
- open
- closed
note:
type: string
sample_payloads:
- id: case-1
status: open
- id: case-2
status: closed
note: resolved by provider
compatibility_policy:
breaking_allowed: false
required_fields:
- id
versioning_rule: minor_on_additive
expect:
status: sealed
steps:
- digest-current
- digest-proposed
- digest-samples
- validate-current
- validate-proposed
- check
step_outputs:
check:
subset:
schema_check:
data:
schema: runx/schema-check.check.v1
decision: compatible
policy_result: allowed
breaking_changes: []
proposal:
status: proposed
live_write_performed: false
changed_paths:
- $.note
validation:
status: pass
findings: []
receipt:
schema: runx.receipt.v1
- name: schema-check-breaking-change-refuses
inputs:
current_schema:
type: object
required:
- id
properties:
id:
type: string
amount:
type: number
proposed_schema:
type: object
required:
- id
- amount
properties:
id:
type: string
amount:
type: string
sample_payloads:
- id: case-1
amount: 12.5
compatibility_policy:
breaking_allowed: false
required_fields:
- id
expect:
status: sealed
steps:
- digest-current
- digest-proposed
- digest-samples
- validate-current
- validate-proposed
- check
step_outputs:
check:
subset:
schema_check:
data:
decision: refused
policy_result: blocked_by_policy
proposal: null
receipt:
schema: runx.receipt.v1
- name: schema-check-invalid-samples-refuse
inputs:
current_schema:
type: object
properties:
id:
type: string
proposed_schema:
type: object
properties:
id:
type: string
sample_payloads: []
compatibility_policy:
breaking_allowed: false
expect:
status: sealed
steps:
- digest-current
- digest-proposed
- digest-samples
- validate-current
- validate-proposed
- check
step_outputs:
check:
subset:
schema_check:
data:
decision: refused
policy_result: invalid_input
proposal: null
validation:
status: fail
receipt:
schema: runx.receipt.v1
- name: schema-check-needs-proposed-schema
inputs:
current_schema:
type: object
properties:
id:
type: string
sample_payloads:
- id: case-1
compatibility_policy:
breaking_allowed: false
expect:
status: failure
- name: refuses-minlength-regression
inputs:
current_schema:
type: string
proposed_schema:
type: string
minLength: 10
sample_payloads:
- x
compatibility_policy:
breaking_allowed: false
expect:
status: sealed
steps:
- digest-current
- digest-proposed
- digest-samples
- validate-current
- validate-proposed
- check
step_outputs:
check:
subset:
schema_check:
data:
decision: refused
receipt:
schema: runx.receipt.v1
- name: refuses-unproved-array-compatibility
inputs:
current_schema:
type: array
items:
type: number
proposed_schema:
type: array
items:
type: number
minimum: 0
sample_payloads:
- - 1
- 2
compatibility_policy:
breaking_allowed: false
expect:
status: sealed
steps:
- digest-current
- digest-proposed
- digest-samples
- validate-current
- validate-proposed
- check
step_outputs:
check:
subset:
schema_check:
data:
decision: refused
receipt:
schema: runx.receipt.v1
- name: accepts-integers-as-jsonschema-numbers
inputs:
current_schema:
type: number
proposed_schema:
type: number
sample_payloads:
- 2
compatibility_policy:
breaking_allowed: false
expect:
status: sealed
steps:
- digest-current
- digest-proposed
- digest-samples
- validate-current
- validate-proposed
- check
step_outputs:
check:
subset:
schema_check:
data:
decision: compatible
receipt:
schema: runx.receipt.v1
- name: refuses-new-root-enum
inputs:
current_schema:
type: string
proposed_schema:
type: string
enum:
- only
sample_payloads:
- only
compatibility_policy:
breaking_allowed: false
expect:
status: sealed
steps:
- digest-current
- digest-proposed
- digest-samples
- validate-current
- validate-proposed
- check
step_outputs:
check:
subset:
schema_check:
data:
decision: refused
receipt:
schema: runx.receipt.v1
- name: refuses-new-undeclared-required-field
inputs:
current_schema:
type: object
proposed_schema:
type: object
required:
- new
sample_payloads:
- new: true
compatibility_policy:
breaking_allowed: false
expect:
status: sealed
steps:
- digest-current
- digest-proposed
- digest-samples
- validate-current
- validate-proposed
- check
step_outputs:
check:
subset:
schema_check:
data:
decision: refused
receipt:
schema: runx.receipt.v1
runners:
check:
default: true
inputs:
current_schema:
type: json
required: true
description: Current JSON Schema object contract callers depend on today.
proposed_schema:
type: json
required: true
description: Proposed JSON Schema object contract to check before publication.
sample_payloads:
type: json
required: true
description: Non-empty array of real payloads validated against the proposed contract.
compatibility_policy:
type: object
required: true
description: Compatibility policy for this contract; breaking changes are refused unless explicitly
allowed.
schema:
additionalProperties: false
properties:
breaking_allowed:
type: boolean
description: Whether breaking changes may pass; defaults to refusal.
required_fields:
type: array
maxItems: 100
items:
type: string
minLength: 1
maxLength: 500
description: Field paths that must exist in the proposed contract.
versioning_rule:
type: string
maxLength: 200
description: Versioning rule recorded with the verdict.
examples:
- current_schema:
type: object
required:
- id
properties:
id:
type: string
proposed_schema:
type: object
required:
- id
properties:
id:
type: string
note:
type: string
sample_payloads:
- id: case-1
compatibility_policy:
breaking_allowed: false
required_fields:
- id
result_from:
- check
steps:
- id: digest-current
tool: data.digest
inputs:
value: $input.current_schema
- id: digest-proposed
tool: data.digest
inputs:
value: $input.proposed_schema
- id: digest-samples
tool: data.digest
inputs:
value: $input.sample_payloads
- id: validate-current
tool: data.validate
inputs:
schema: $input.current_schema
values: $input.sample_payloads
- id: validate-proposed
tool: data.validate
inputs:
schema: $input.proposed_schema
values: $input.sample_payloads
- id: check
label: compare contracts, validate samples, and gate the proposal
inputs:
current_schema: $input.current_schema
proposed_schema: $input.proposed_schema
sample_payloads: $input.sample_payloads
compatibility_policy: $input.compatibility_policy
current_digest: $steps.digest-current.digest_result.digest
proposed_digest: $steps.digest-proposed.digest_result.digest
samples_digest: $steps.digest-samples.digest_result.digest
current_validation: $steps.validate-current.validation
proposed_validation: $steps.validate-proposed.validation
tool:
module: schema-check.mjs
export: checkSchemaChange
outputs:
schema_check:
type: object
artifacts:
named_emits:
schema_check: schema_check
packets:
schema_check: runx/schema-check.check.v1
Published package and test evidence.
This exact version passed its recorded harness run: 11 checks passed · 0 failed.
Test result
| Harness result | Passed |
|---|---|
| Tested version | 0.1.8 |
| Recorded result | 11 checks passed · 0 failed |
| Result source | Run by the Runx registry at publication |
| Suite | runx-harness |
| Test recorded | |
| Declared cases | 9 |
| Test record | Open the recorded run |
Inspect receipt references
sha256:268c894689f31772083e0a6b3110709aca6e90f78183e22dc0f7b4e7e4e7dad1sha256:cf36d15295b91bdd94dda8dc6712a104268eb561fa15b767614b3fbd08b3133esha256:7dbba9be9d2c4743302e4458c0c74c71b4430b5b8dc0746c2767db0ad53a691csha256:85f5a90fcce9915bd4264a17c4612da45c7d815b0e164f87ef5ebda4c1ccfb6csha256:653a9e5c69c844e26e015fbf4b53775ff60749cec43272548bd7e644850c0f44sha256:ccfa9171b8ed614b3e2303c58fa45f6aa10796bfd9f53664e6092ae3f7d2cc51sha256:7637d7fcb3770013d505239a05ec52a19a025b0f7a59b2632a271bb7109e3de8sha256:9cc6ff5fc9508b4bb716a0075295bc00b8ec8a72373e5f50a9eeb545ec176477sha256:df02803f9cca23c4e1db4da35725cf6eaf4daf60b500d477d0b3b3227b320681sha256:9dd3958067060d0081e7cd5ae784561f020130cfcee0d2f530ffd0392721e5e0sha256:9ad501df9044d53fe63b641d2fb3f612b9a6c89d170cf9c674f31d1e3386aa13Package identity
| Published revision | 0.1.8 |
|---|---|
| Content digest | sha256:99baca00ac4239a70c77ac97cf975ac8814267397d944eb7cd26592eb02aebab |
| SKILL.md digest | sha256:a56e8663add5be22f5eabaf9fe99c47b4af064d51b89d5a2f1d400531052e9d9 |
| Execution profile digest | sha256:2a1bb0a293478810b62236a423098852b89792d2bfa06dbcd7d6ef82b9b40296 |
| Publisher identity | Verified publisher · runx |
| Trust tier | Verified publisherRunx has verified this publisher. This tier is not a code assessment. |
| Attestations |
|
| Source provenance | Not published with this version |
Version history
0.1.8ViewingContent digest sha256:99baca00ac4239a70c77ac97cf975ac8814267397d944eb7cd26592eb02aebabsha-a85b7a0b3f04Content digest sha256:a85b7a0b3f0456115d77c09be42bf1bc1e1b8f28ead5d3f2a99515a794d3f61e