chore: JSPG Engine tuple decoupling and core routing optimizations

This commit is contained in:
2026-04-13 22:41:32 -04:00
parent 665a821bf9
commit 0017c598e1
57 changed files with 5510 additions and 5166 deletions

View File

@ -2,166 +2,182 @@
{
"description": "Strict Inheritance",
"database": {
"schemas": [
{
"$id": "parent_type",
"schemas": {
"parent_type": {
"type": "object",
"properties": {"a": {"type": "integer"}},
"required": ["a"]
"properties": {
"a": {
"type": "integer"
}
},
"required": [
"a"
]
},
{
"$id": "child_type",
"child_type": {
"type": "parent_type",
"properties": {"b": {"type": "integer"}}
"properties": {
"b": {
"type": "integer"
}
}
}
]
}
},
"tests": [
{
"description": "valid child inherits properties and strictness",
"schema_id": "child_type",
"data": {"a": 1, "b": 2},
"data": {
"a": 1,
"b": 2
},
"action": "validate",
"expect": {"success": true}
"expect": {
"success": true
}
},
{
"description": "missing inherited required property fails",
"schema_id": "child_type",
"data": {"b": 2},
"data": {
"b": 2
},
"action": "validate",
"expect": {"success": false}
"expect": {
"success": false
}
},
{
"description": "additional properties fail due to inherited strictness",
"schema_id": "child_type",
"data": {"a": 1, "b": 2, "c": 3},
"data": {
"a": 1,
"b": 2,
"c": 3
},
"action": "validate",
"expect": {"success": false}
"expect": {
"success": false
}
}
]
},
{
"description": "Local Shadowing (Composition & Proxies)",
"database": {
"schemas": [
{
"$id": "budget",
"schemas": {
"budget": {
"type": "object",
"properties": {
"max": {"type": "integer", "maximum": 100}
"max": {
"type": "integer",
"maximum": 100
}
}
},
{
"$id": "custom_budget",
"custom_budget": {
"type": "budget",
"properties": {
"max": {"type": "integer", "maximum": 50}
"max": {
"type": "integer",
"maximum": 50
}
}
}
]
}
},
"tests": [
{
"description": "shadowing override applies (50 is locally allowed)",
"schema_id": "custom_budget",
"data": {"max": 40},
"data": {
"max": 40
},
"action": "validate",
"expect": {"success": true}
"expect": {
"success": true
}
},
{
"description": "shadowing override applies natively, rejecting 60 even though parent allowed 100",
"schema_id": "custom_budget",
"data": {"max": 60},
"data": {
"max": 60
},
"action": "validate",
"expect": {"success": false}
}
]
},
{
"description": "Inline id Resolution",
"database": {
"schemas": [
{
"$id": "api.request",
"type": "object",
"properties": {
"inline_obj": {
"$id": "inline_nested",
"type": "object",
"properties": {"foo": {"type": "string"}},
"required": ["foo"]
},
"proxy_obj": {
"type": "inline_nested"
}
}
"expect": {
"success": false
}
]
},
"tests": [
{
"description": "proxy resolves and validates to the inline component",
"schema_id": "api.request",
"data": {
"inline_obj": {"foo": "bar"},
"proxy_obj": {"foo": "baz"}
},
"action": "validate",
"expect": {"success": true}
},
{
"description": "proxy resolves and catches violation targeting inline component constraints",
"schema_id": "api.request",
"data": {
"inline_obj": {"foo": "bar"},
"proxy_obj": {}
},
"action": "validate",
"expect": {"success": false}
}
]
},
{
"description": "Primitive Array Shorthand (Optionality)",
"database": {
"schemas": [
{
"$id": "invoice",
"type": "object",
"properties": {"amount": {"type": "integer"}},
"required": ["amount"]
},
{
"$id": "request",
"schemas": {
"invoice": {
"type": "object",
"properties": {
"inv": {"type": ["invoice", "null"]}
"amount": {
"type": "integer"
}
},
"required": [
"amount"
]
},
"request": {
"type": "object",
"properties": {
"inv": {
"type": [
"invoice",
"null"
]
}
}
}
]
}
},
"tests": [
{
"description": "valid object passes shorthand inheritance check",
"schema_id": "request",
"data": {"inv": {"amount": 5}},
"data": {
"inv": {
"amount": 5
}
},
"action": "validate",
"expect": {"success": true}
"expect": {
"success": true
}
},
{
"description": "null passes shorthand inheritance check",
"schema_id": "request",
"data": {"inv": null},
"data": {
"inv": null
},
"action": "validate",
"expect": {"success": true}
"expect": {
"success": true
}
},
{
"description": "invalid object fails inner constraints safely",
"schema_id": "request",
"data": {"inv": {"amount": "string"}},
"data": {
"inv": {
"amount": "string"
}
},
"action": "validate",
"expect": {"success": false}
"expect": {
"success": false
}
}
]
}
]
]