schema-guard
Check API or data schema changes against sample payloads and a compatibility policy before a schema proposal is published.
You’re reading version sha-9f1f50fac384. Go to the current version
Overview
schema-guard checks whether a proposed API or data contract can move forward
without silently breaking callers. It reads the current schema, proposed schema,
real sample payloads, and a compatibility policy. It reports breaking changes,
validates samples against the proposed contract, and emits a
publish_schema_proposal only when the change is allowed by policy.
The skill never writes a live schema. Its proposal is a gated handoff for a human schema approver or a separate schema-publisher executor.
In the manual
Runner
default
Declared by its execution profile. Read the profile
SKILL.md
Schema Guard
schema-guard checks whether a proposed API or data contract can move forward
without silently breaking callers. It reads the current schema, proposed schema,
real sample payloads, and a compatibility policy. It reports breaking changes,
validates samples against the proposed contract, and emits a
publish_schema_proposal only when the change is allowed by policy.
The skill never writes a live schema. Its proposal is a gated handoff for a human schema approver or a separate schema-publisher executor.
Use This Skill When
- A migration, API version, or event contract is about to land.
- A maintainer needs a deterministic compatibility report before publishing.
- A workflow needs a receipt showing why a schema proposal was allowed or held.
Do Not Use This Skill For
- Live schema writes or registry publication.
- Inventing sample coverage. If a sample does not cover a path, the report says that directly.
- Broad API design review. This skill only checks the supplied contract delta, policy, and payload samples.
Inputs
current_schema: JSON-schema-like object contract currently in force.proposed_schema: JSON-schema-like object contract being reviewed.sample_payloads: array of real sample payload objects.compatibility_policy: object with:breaking_allowed: boolean.required_fields: array of field paths that must remain present.versioning_rule: string such asminor_allows_additive_only.
Outputs
compatibility: object withstatus,breaking_changes, and policy result.validation_results: array of sample validation results against the proposed schema.migration_notes: array of notes about additive, removed, or changed fields and sample coverage.publish_schema_proposal: emitted only when the proposal is compatible under the supplied policy. It is a proposal, not a live schema write.
Procedure
- Normalize both schemas into field paths.
- Compare field paths, required status, type, enum, and object shape.
- Mark removals, type changes, enum narrowing, newly required fields, and required policy-field removals as breaking changes.
- Validate every supplied sample payload against the proposed schema.
- Record sample coverage by field path without inventing missing coverage.
- Emit
publish_schema_proposalonly when policy permits the change and all samples validate.
Refusal Conditions
breaking_allowedis false and at least one breaking change is found.- Any sample payload fails the proposed schema.
- A field named in
compatibility_policy.required_fieldsis absent from the proposed schema. - Inputs are malformed or
sample_payloadsis not an array.
Published execution profile
The execution profile published with sha-9f1f50fac384, shown as its exact bytes.
| Runner |
|
|---|---|
| Profile digest | sha256:525ff9d0ca42a462e91a5d63b41a0fff80b12f396630663e4eb12b71e6558279 |
skill: schema-guard
version: 0.1.0
catalog:
kind: skill
audience: public
visibility: public
role: canonical
category: ops
runners:
default:
default: true
inputs:
current_schema:
type: json
required: true
description: Current JSON-schema-like object contract.
proposed_schema:
type: json
required: true
description: Proposed JSON-schema-like object contract.
sample_payloads:
type: json
required: true
description: Array of real sample payloads to validate against the proposed schema.
compatibility_policy:
type: json
required: true
description: Policy object with breaking_allowed, required_fields, and versioning_rule.
steps:
- id: default
tool:
command: node
args:
- run.mjs
timeout_seconds: 15
inputs:
current_schema: $input.current_schema
proposed_schema: $input.proposed_schema
sample_payloads: $input.sample_payloads
compatibility_policy: $input.compatibility_policy
artifacts:
named_emits:
compatibility: runx.schema_guard.compatibility.v1
validation_results: runx.schema_guard.validation_results.v1
migration_notes: runx.schema_guard.migration_notes.v1
publish_schema_proposal: runx.schema_guard.publish_schema_proposal.v1
harness:
cases:
- name: schema-guard-additive-compatible
runner: default
inputs:
current_schema:
type: object
title: OrderEvent
version: 1.2.0
required:
- order_id
- status
properties:
order_id:
type: string
status:
type: string
enum:
- pending
- paid
total_cents:
type: integer
proposed_schema:
type: object
title: OrderEvent
version: 1.3.0
required:
- order_id
- status
properties:
order_id:
type: string
status:
type: string
enum:
- pending
- paid
- refunded
total_cents:
type: integer
coupon_code:
type: string
sample_payloads:
- order_id: ord_1001
status: paid
total_cents: 2599
- order_id: ord_1002
status: refunded
total_cents: 1200
coupon_code: WELCOME10
compatibility_policy:
breaking_allowed: false
required_fields:
- order_id
- status
versioning_rule: minor_allows_additive_only
expect:
status: sealed
receipt:
schema: runx.receipt.v1
operator_journeys:
- mode: standalone
confusors:
- extract
- skill-review
request: Check whether this schema change breaks existing callers.
expected_outcome: Return a compatibility verdict and enforce the policy before anything publishes.
- mode: composed
request: Continue this schema-guard work from evidence already gathered upstream.
expected_outcome: Return a compatibility verdict and enforce the policy before anything publishes.
prior_evidence:
- The current schema, proposed schema and samples already supplied.
must_not_repeat:
- Do not publish the schema.
- name: schema-guard-breaking-refused
runner: default
inputs:
current_schema:
type: object
title: OrderEvent
version: 1.2.0
required:
- order_id
- status
properties:
order_id:
type: string
status:
type: string
enum:
- pending
- paid
total_cents:
type: integer
proposed_schema:
type: object
title: OrderEvent
version: 2.0.0
required:
- order_id
- status
- currency
properties:
order_id:
type: integer
status:
type: string
enum:
- paid
currency:
type: string
sample_payloads:
- order_id: ord_2001
status: pending
total_cents: 500
compatibility_policy:
breaking_allowed: false
required_fields:
- order_id
- status
versioning_rule: major_required_for_breaking
expect:
status: sealed
receipt:
schema: runx.receipt.v1
Published package and test evidence.
The latest recorded test covers an earlier version, sha-bbf14daccae2. It does not establish a result for this version.
Test result
| Harness result | An earlier version was tested |
|---|---|
| Tested version | sha-bbf14daccae2Not this page’s version, sha-9f1f50fac384 |
| Recorded result | 2 checks passed · 0 failed |
| Result source | Reported by the publisher (runx_registry_publish) |
| Suite | runx-harness |
| Test recorded | |
| Declared cases | 2 |
Package identity
| Published revision | sha-9f1f50fac384 |
|---|---|
| Content digest | sha256:9f1f50fac3841921039749ad49614a4c25e4b84656ca61b302d5bd0e0c3a9177 |
| SKILL.md digest | sha256:a7319fa1ea06745c3d807f5e735ea5f9e5a3ca7b10e62d434902916ceb66dee5 |
| Execution profile digest | sha256:525ff9d0ca42a462e91a5d63b41a0fff80b12f396630663e4eb12b71e6558279 |
| Publisher identity | Unverified publisher · zhtwangk |
| Trust tier | CommunityPublished through the registry without publisher verification. This tier is not a code assessment. |
| Attestations |
|
| Source provenance | Not published with this version |
Version history
sha-bbf14daccae2Content digest sha256:bbf14daccae2149af8dbd732c3244d56ea4f769f590d54576a2252c8ffda7f67sha-c2976b4be165Content digest sha256:c2976b4be1656f70b5349f3e63ae7b1fc007432fb28387b6108df3714198c814sha-87218315b28fContent digest sha256:87218315b28f1694402a001aabb443072d599ad2db4831772cb5e6658e3461f0sha-9f1f50fac384ViewingContent digest sha256:9f1f50fac3841921039749ad49614a4c25e4b84656ca61b302d5bd0e0c3a9177