Schema Compatibility
check_schema_compat
POST /v1/check/schema-compat. MCP: check_schema_compat. Send old_schema, new_schema and optional timeout_ms (100..5000, default 3000). No API key or account required. Zero-logging execution.
Directions and results
Backward: every payload accepted by old_schema is accepted by new_schema. Forward: every payload accepted by new_schema is accepted by old_schema. These definitions describe accepted data languages; choose the direction for your producer or consumer role.
verdict=complete and verified=true returns backward_compatible and forward_compatible. Each false flag has a corresponding backward_counterexample or forward_counterexample wrapper: {payload: <JSON value>}. A null payload is a concrete example. A null wrapper means no counterexample. Both true means equivalent, including two empty languages.
Supported schemas
Draft 2020-12 validation semantics for boolean schemas and these keywords only: type, enum, minimum, maximum, exclusiveMinimum, exclusiveMaximum, pattern, properties, required, additionalProperties, anyOf, oneOf. type is a supported name or unique nonempty list: null, boolean, integer, number, string, object. Integer-valued numbers satisfy integer; booleans are distinct from numbers. enum has 1..64 unique primitive values; numeric 1 and 1.0 are equal.
Objects support nested schemas, optional or required properties, required names without property declarations, and boolean or schema-valued additionalProperties (default true). Keywords constrain only their applicable types; properties without type does not require an object. anyOf accepts at least one branch; oneOf accepts exactly one, including overlaps. Sibling keywords are conjunctive.
All unknown keywords are rejected with UNSUPPORTED_FEATURE, including annotations, $schema, $ref, allOf, not, const, array constraints, formats and unevaluatedProperties. No network references are resolved. Unconstrained schemas can still accept all JSON values, including arrays, which this subset cannot inspect.
String patterns
Patterns use search semantics over full Unicode payload strings, with ASCII pattern syntax: literals, escaped punctuation, explicit character ranges/classes and their negations, dot (except newline), groups, non-capturing groups, alternation and regular quantifiers *, +, ?, {m}, {m,}, {m,n}; lazy suffixes preserve the language. Boundary ^ and $ are allowed; $ also matches before a final newline. Use ^(?:a|b)$ for anchored alternation.
Unsupported: character class escapes such as backslash-d, backslash-w and backslash-s or their uppercase complements (use explicit ranges), internal anchors, anchored top-level alternation, backreferences, lookarounds, inline flags, atomic groups and possessive quantifiers. Empty pattern accepts every string. This intentionally narrow regex dialect is separate from analyze_regex's full-string ASCII domain.
Schema verification and limits
Exact bottom-up semantic partitions cover every type and object shape. The existing symbolic solver exhausts numeric and object membership vectors; the existing position automaton exhausts string-language products. Unnamed properties are partitioned by value membership; several extra properties may be necessary to falsify different union branches. These are exhaustive abstractions, not bounded payload samples.
Every returned concrete payload is serialized and independently validated against both original schemas by a Draft 2020-12 validator. Its pattern keyword uses the separate Thompson automaton compiler and lockstep membership; no backtracking engine is invoked. Any mismatch returns INTERNAL_ERROR without findings. Compatibility proofs rely on partition construction and solver exhaustion; witness validation does not independently prove negative claims.
Combined schemas: <=128 nodes, depth <=12; <=64 properties and required names per node (names <=128 characters), <=64 distinct names per object level; anyOf/oneOf 1..16 branches. Names and enum strings must contain Unicode scalar values. Primitive numeric constants are finite within -1000000000..1000000000; enum strings <=256 characters. Numeric solving is exact rational arithmetic; a witness that cannot be represented safely as a finite JSON number produces unknown.
Patterns <=1024 characters, <=512 syntax nodes, depth <=32, repeat bounds <=64, <=2048 expanded positions and <=8192 expanded nodes. String product <=16384 states, Unicode enum character set <=128 representatives including one other character; semantic partitions <=1024 classes, total work <=200000 steps; returned strings <=16384 characters. Exceeding a cap returns RESOURCE_LIMIT_EXCEEDED without partial findings.
One timeout_ms budget covers analysis and independent validation. timeout or unknown has verified=false, null compatibility flags and no counterexamples. The supervisor kills and reaps at timeout_ms +500 ms. Same isolated no-egress worker, three compute slots, payment gate, 65536-byte request and 262144-byte response caps, including MCP wrapping. Aggregate telemetry contains only bounded labels; no schemas, property names or payloads are retained. Errors contain only static reasons and index paths.
MCP reference: oracle://docs/schema-compat. Prompt: check_schema_compat(). Verified examples: oracle://examples.
check_schema_compat request
{
"additionalProperties": false,
"properties": {
"new_schema": {
"anyOf": [
{
"type": "boolean"
},
{
"additionalProperties": true,
"type": "object"
}
]
},
"old_schema": {
"anyOf": [
{
"type": "boolean"
},
{
"additionalProperties": true,
"type": "object"
}
]
},
"timeout_ms": {
"default": 3000,
"maximum": 5000,
"minimum": 100,
"type": "integer"
}
},
"required": [
"old_schema",
"new_schema"
],
"type": "object"
}check_schema_compat response
{
"$defs": {
"JsonValue": {},
"SchemaCounterexample": {
"additionalProperties": false,
"properties": {
"payload": {
"$ref": "#/$defs/JsonValue"
}
},
"required": [
"payload"
],
"type": "object"
},
"Stats": {
"additionalProperties": false,
"properties": {
"elapsed_ms": {
"minimum": 0,
"type": "integer"
},
"timed_out": {
"type": "boolean"
}
},
"required": [
"elapsed_ms",
"timed_out"
],
"type": "object"
}
},
"additionalProperties": false,
"properties": {
"backward_compatible": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"backward_counterexample": {
"anyOf": [
{
"$ref": "#/$defs/SchemaCounterexample"
},
{
"type": "null"
}
]
},
"forward_compatible": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"forward_counterexample": {
"anyOf": [
{
"$ref": "#/$defs/SchemaCounterexample"
},
{
"type": "null"
}
]
},
"stats": {
"$ref": "#/$defs/Stats"
},
"verdict": {
"enum": [
"complete",
"timeout",
"unknown"
],
"type": "string"
},
"verified": {
"type": "boolean"
}
},
"required": [
"verdict",
"verified",
"stats"
],
"type": "object"
}