pub const API_V1_SCHEMA_JSON: &str = {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/lemma/lemma/blob/main/engine/schemas/api.v1.json",
"title": "Lemma engine API",
"description": "Schema for the JSON document shapes the engine produces at its consumer boundary: Show (Engine::show), Response (Engine::evaluate), specs (Engine::specs, array of Repository), errors (array of EngineError), and RepositoryInstallResult (SDK install). Explanation trees live under RuleResult.explanation (RuleNode / ExplanationNode).",
"$defs": {
"DecimalString": {
"type": "string",
"format": "lemma-decimal",
"description": "Arbitrary-precision decimal literal (never a JSON number, to avoid float precision loss). Maps to Java BigDecimal, a plain string in TypeScript/Elixir."
},
"RationalFactor": {
"type": "object",
"required": [
"numer",
"denom"
],
"additionalProperties": false,
"description": "Exact rational as a reduced numerator/denominator pair of arbitrary-precision integer strings.",
"properties": {
"numer": {
"$ref": "#/$defs/DecimalString"
},
"denom": {
"$ref": "#/$defs/DecimalString"
}
}
},
"NamedBound": {
"type": "object",
"required": [
"value",
"unit"
],
"additionalProperties": false,
"description": "A unit-scoped bound (Measure/DateRange/TimeRange/MeasureRange minimum/maximum/lower/upper).",
"properties": {
"value": {
"$ref": "#/$defs/DecimalString"
},
"unit": {
"type": "string"
}
}
},
"MeasureUnit": {
"type": "object",
"required": [
"name",
"derived_measure_factors",
"decomposition"
],
"additionalProperties": false,
"description": "One declared unit of a Measure type. When `scale_factors` is absent or empty, `factor` is required (1 of this unit equals `factor` canonical units). When `scale_factors` is non-empty, the effective scale is `coefficient * Π settled(t_i)^e_i` where optional `factor` is the plan-time coefficient (omitted when 1).",
"properties": {
"name": {
"type": "string"
},
"factor": {
"$ref": "#/$defs/RationalFactor"
},
"scale_factors": {
"type": "array",
"description": "(reference path, exponent) pairs of a dynamic scale product. Empty or omitted for a literal unit.",
"items": {
"type": "array",
"prefixItems": [
{
"type": "string"
},
{
"type": "integer"
}
],
"items": false,
"minItems": 2,
"maxItems": 2
}
},
"derived_measure_factors": {
"type": "array",
"description": "(measure_ref, exponent) pairs from a compound unit declaration (e.g. meter/second). Empty for base units.",
"items": {
"type": "array",
"prefixItems": [
{
"type": "string"
},
{
"type": "integer"
}
],
"items": false,
"minItems": 2,
"maxItems": 2
}
},
"decomposition": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"minimum": {
"$ref": "#/$defs/DecimalString"
},
"maximum": {
"$ref": "#/$defs/DecimalString"
},
"suggestion": {
"$ref": "#/$defs/DecimalString"
}
}
},
"RatioUnit": {
"type": "object",
"required": [
"name",
"value"
],
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"value": {
"$ref": "#/$defs/RationalFactor"
},
"minimum": {
"$ref": "#/$defs/DecimalString"
},
"maximum": {
"$ref": "#/$defs/DecimalString"
},
"suggestion": {
"$ref": "#/$defs/DecimalString"
}
}
},
"TypeDefiningSpec": {
"description": "Where a custom type's extension chain is rooted.",
"oneOf": [
{
"type": "object",
"required": [
"kind"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "local"
}
}
},
{
"type": "object",
"required": [
"kind"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "import"
}
}
}
]
},
"TypeExtends": {
"description": "What a type extends: a primitive built-in, or a custom type by name.",
"oneOf": [
{
"type": "object",
"required": [
"kind"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "primitive"
}
}
},
{
"type": "object",
"required": [
"kind",
"parent",
"family",
"defining_spec"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "custom"
},
"parent": {
"type": "string"
},
"family": {
"type": "string"
},
"defining_spec": {
"$ref": "#/$defs/TypeDefiningSpec"
}
}
}
]
},
"LemmaType": {
"description": "Resolved Lemma type: `TypeSpecification` fields flattened alongside `name` and `extends`. Sentinel-only specifications (`veto`, `undetermined`) never reach the API and are excluded.",
"oneOf": [
{
"$ref": "#/$defs/LemmaTypeBoolean"
},
{
"$ref": "#/$defs/LemmaTypeMeasure"
},
{
"$ref": "#/$defs/LemmaTypeNumber"
},
{
"$ref": "#/$defs/LemmaTypeNumberRange"
},
{
"$ref": "#/$defs/LemmaTypeRatio"
},
{
"$ref": "#/$defs/LemmaTypeRatioRange"
},
{
"$ref": "#/$defs/LemmaTypeText"
},
{
"$ref": "#/$defs/LemmaTypeDate"
},
{
"$ref": "#/$defs/LemmaTypeDateRange"
},
{
"$ref": "#/$defs/LemmaTypeTime"
},
{
"$ref": "#/$defs/LemmaTypeTimeRange"
},
{
"$ref": "#/$defs/LemmaTypeMeasureRange"
},
{
"$ref": "#/$defs/LemmaTypeSpec"
},
{
"$ref": "#/$defs/LemmaTypeList"
}
]
},
"TypeSpecification": {
"description": "Element type of a list: the `LemmaType` fields without `name` and `extends`. A spec element names the row spec of an instance list. Lists do not nest.",
"oneOf": [
{
"type": "object",
"required": [
"kind",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "boolean"
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"minimum",
"maximum",
"units",
"traits",
"decomposition",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "measure"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/MeasureUnit"
}
},
"traits": {
"type": "array",
"items": {
"enum": [
"duration",
"calendar"
]
}
},
"decomposition": {
"anyOf": [
{
"type": "null"
},
{
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
]
},
"help": {
"type": "string"
},
"unit": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"minimum",
"maximum",
"decimals",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "number"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"decimals": {
"type": [
"integer",
"null"
]
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "number_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"minimum",
"maximum",
"units",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "ratio"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/RatioUnit"
}
},
"help": {
"type": "string"
},
"unit": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum",
"units",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "ratio_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/RatioUnit"
}
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"length",
"options",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "text"
},
"length": {
"type": [
"integer",
"null"
]
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"minimum",
"maximum",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "date"
},
"minimum": {
"type": [
"string",
"null"
]
},
"maximum": {
"type": [
"string",
"null"
]
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "date_range"
},
"lower": {
"type": [
"string",
"null"
]
},
"upper": {
"type": [
"string",
"null"
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"minimum",
"maximum",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "time"
},
"minimum": {
"type": [
"string",
"null"
]
},
"maximum": {
"type": [
"string",
"null"
]
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "time_range"
},
"lower": {
"type": [
"string",
"null"
]
},
"upper": {
"type": [
"string",
"null"
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum",
"units",
"decomposition",
"help"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "measure_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/MeasureUnit"
}
},
"decomposition": {
"anyOf": [
{
"type": "null"
},
{
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
]
},
"help": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"kind",
"spec",
"effective"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "spec"
},
"spec": {
"type": "string"
},
"effective": {
"type": "string"
},
"repository": {
"type": "string"
}
}
}
]
},
"ListKey": {
"description": "How a list addresses its rows: \"numbered\" (by row number), or the ordered `-> key` field names.",
"oneOf": [
{
"const": "numbered"
},
{
"type": "object",
"required": [
"fields"
],
"additionalProperties": false,
"properties": {
"fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
]
},
"LemmaTypeBoolean": {
"type": "object",
"required": [
"name",
"kind",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "boolean"
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeMeasure": {
"type": "object",
"required": [
"name",
"kind",
"minimum",
"maximum",
"units",
"traits",
"decomposition",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "measure"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/MeasureUnit"
}
},
"traits": {
"type": "array",
"items": {
"enum": [
"duration",
"calendar"
]
}
},
"decomposition": {
"anyOf": [
{
"type": "null"
},
{
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
]
},
"help": {
"type": "string"
},
"unit": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeNumber": {
"type": "object",
"required": [
"name",
"kind",
"minimum",
"maximum",
"decimals",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "number"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"decimals": {
"type": [
"integer",
"null"
]
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeNumberRange": {
"type": "object",
"required": [
"name",
"kind",
"lower",
"upper",
"minimum",
"maximum",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "number_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeRatio": {
"type": "object",
"required": [
"name",
"kind",
"minimum",
"maximum",
"units",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "ratio"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/RatioUnit"
}
},
"help": {
"type": "string"
},
"unit": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeRatioRange": {
"type": "object",
"required": [
"name",
"kind",
"lower",
"upper",
"minimum",
"maximum",
"units",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "ratio_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/RatioUnit"
}
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeText": {
"type": "object",
"required": [
"name",
"kind",
"length",
"options",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "text"
},
"length": {
"type": [
"integer",
"null"
]
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeDate": {
"type": "object",
"required": [
"name",
"kind",
"minimum",
"maximum",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "date"
},
"minimum": {
"type": [
"string",
"null"
]
},
"maximum": {
"type": [
"string",
"null"
]
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeDateRange": {
"type": "object",
"required": [
"name",
"kind",
"lower",
"upper",
"minimum",
"maximum",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "date_range"
},
"lower": {
"type": [
"string",
"null"
]
},
"upper": {
"type": [
"string",
"null"
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeTime": {
"type": "object",
"required": [
"name",
"kind",
"minimum",
"maximum",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "time"
},
"minimum": {
"type": [
"string",
"null"
]
},
"maximum": {
"type": [
"string",
"null"
]
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeTimeRange": {
"type": "object",
"required": [
"name",
"kind",
"lower",
"upper",
"minimum",
"maximum",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "time_range"
},
"lower": {
"type": [
"string",
"null"
]
},
"upper": {
"type": [
"string",
"null"
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeMeasureRange": {
"type": "object",
"required": [
"name",
"kind",
"lower",
"upper",
"minimum",
"maximum",
"units",
"decomposition",
"help",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "measure_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/MeasureUnit"
}
},
"decomposition": {
"anyOf": [
{
"type": "null"
},
{
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
]
},
"help": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeSpec": {
"type": "object",
"required": [
"name",
"kind",
"spec",
"effective",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "spec"
},
"spec": {
"type": "string"
},
"effective": {
"type": "string"
},
"repository": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"LemmaTypeList": {
"type": "object",
"required": [
"name",
"kind",
"element",
"key",
"extends"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "list"
},
"element": {
"$ref": "#/$defs/TypeSpecification"
},
"key": {
"$ref": "#/$defs/ListKey"
},
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
},
"CalendarResult": {
"type": "object",
"required": [
"value",
"unit"
],
"additionalProperties": false,
"properties": {
"value": {
"$ref": "#/$defs/DecimalString"
},
"unit": {
"type": "string"
}
}
},
"RuleResultValueEndpoint": {
"type": "object",
"additionalProperties": false,
"description": "RuleResultValue fields without `range` — a range endpoint must never itself be a range.",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
}
}
},
"RangeResult": {
"type": "object",
"required": [
"from",
"to"
],
"additionalProperties": false,
"properties": {
"from": {
"$ref": "#/$defs/RuleResultValueEndpoint"
},
"to": {
"$ref": "#/$defs/RuleResultValueEndpoint"
}
}
},
"SpecRuleResult": {
"type": "object",
"required": [
"vetoed",
"rule_type"
],
"additionalProperties": false,
"description": "One rule of a spec instance, or one evaluated data slot of a spec instance. A spec-valued rule nests SpecResult in result.spec.",
"properties": {
"vetoed": {
"type": "boolean"
},
"veto_reason": {
"type": "string"
},
"rule_type": {
"type": "string"
},
"result": {
"$ref": "#/$defs/RuleResultValue"
}
}
},
"SpecResult": {
"type": "object",
"required": [
"spec",
"effective",
"instance",
"path",
"data",
"rules"
],
"additionalProperties": false,
"description": "Spec instance returned by a rule. data holds one evaluated entry per data slot, keyed relative to the spec; unbound slots are omitted.",
"properties": {
"repository": {
"type": "string"
},
"spec": {
"type": "string"
},
"effective": {
"type": "string"
},
"instance": {
"type": "string"
},
"path": {
"type": "array",
"items": {
"$ref": "#/$defs/PathSegment"
},
"minItems": 1,
"description": "One segment per uses hop of instance."
},
"data": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/SpecRuleResult"
}
},
"rules": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/SpecRuleResult"
}
}
}
},
"RowReference": {
"type": "object",
"required": [
"spec",
"effective",
"index"
],
"additionalProperties": false,
"description": "A row of an instance list. Its data and rules are Response.rows[index]. instance is the row path relative to the spec holding this value (lines.2); omitted for a row appended with -> with, whose identity is its place in the list.",
"properties": {
"repository": {
"type": "string"
},
"spec": {
"type": "string"
},
"effective": {
"type": "string"
},
"instance": {
"type": "string"
},
"index": {
"type": "integer",
"minimum": 0
}
}
},
"RowResult": {
"type": "object",
"required": [
"spec",
"effective",
"data",
"rules"
],
"additionalProperties": false,
"description": "Data and rules of one distinct row reached by a response, filled once and referenced by RowReference.index. Keys are relative to the row spec; unbound slots are omitted.",
"properties": {
"repository": {
"type": "string"
},
"spec": {
"type": "string"
},
"effective": {
"type": "string"
},
"data": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/SpecRuleResult"
}
},
"rules": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/SpecRuleResult"
}
}
}
},
"RuleResultValue": {
"type": "object",
"additionalProperties": false,
"description": "API value shared by RuleResult (flattened), Show property x-lemma-value/x-lemma-suggestion, and explanation Rule/Data nodes (flattened). When present: always `result`, plus exactly one typed field for a non-range value; `range` is set instead for a range value. A list sets `list`, one value per row. A list row sets `row` in rule results and RowResult members; in explanation nodes and Show it carries `result` only.",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
}
}
},
"PathSegment": {
"type": "object",
"required": [
"uses",
"spec"
],
"additionalProperties": false,
"description": "One hop on a Show data or rule path: a uses alias, or (with row) the row written at that 1-based position in the data list named uses. repository is omitted for the unnamed workspace; spec is the resolved target name.",
"properties": {
"uses": {
"type": "string"
},
"row": {
"type": "integer",
"minimum": 1
},
"repository": {
"type": "string"
},
"spec": {
"type": "string"
}
}
},
"EvaluateDataJson": {
"description": "An evaluation-data JSON value: a literal string, a boolean, a list (array), or an object (list row, or single-unit measure map). JSON numbers and null are not evaluation data.",
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/EvaluateDataJson"
}
},
{
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/EvaluateDataJson"
}
}
]
},
"ShowPropertyType": {
"description": "x-lemma-type of a Show property: the LemmaType without help and text options/length, which the property states as description, enum and minLength/maxLength. Single spec types are uses aliases, never properties.",
"oneOf": [
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeBoolean"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeMeasure"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeNumber"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeNumberRange"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeRatio"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeRatioRange"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeText"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeDate"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeDateRange"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeTime"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeTimeRange"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeMeasureRange"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeList"
},
{
"$ref": "#/$defs/ShowTypeNameExtends"
}
],
"unevaluatedProperties": false
}
]
},
"ShowPropertyElementType": {
"description": "Element of a list ShowPropertyType: the TypeSpecification without help and text options/length.",
"oneOf": [
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeBoolean"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeMeasure"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeNumber"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeNumberRange"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeRatio"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeRatioRange"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeText"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeDate"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeDateRange"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeTime"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeTimeRange"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeMeasureRange"
}
],
"unevaluatedProperties": false
},
{
"allOf": [
{
"$ref": "#/$defs/ShowTypeSpec"
}
],
"unevaluatedProperties": false
}
]
},
"ShowItems": {
"description": "items of a list property: the element literal schema of a value list, or a $ref to the row object schema of an instance list in the document's $defs.",
"oneOf": [
{
"type": "object",
"anyOf": [
{
"required": [
"type"
]
},
{
"required": [
"oneOf"
]
}
],
"additionalProperties": false,
"properties": {
"type": {
"enum": [
"string",
"boolean"
]
},
"oneOf": {
"type": "array",
"minItems": 2,
"items": {
"type": "object"
}
},
"pattern": {
"type": "string"
},
"format": {
"type": "string",
"const": "time"
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
},
"minLength": {
"type": "integer",
"minimum": 0
},
"maxLength": {
"type": "integer",
"minimum": 0
}
}
},
{
"type": "object",
"required": [
"$ref"
],
"additionalProperties": false,
"properties": {
"$ref": {
"type": "string",
"pattern": "^#/\\$defs/LemmaRow_[A-Za-z0-9_-]+$"
}
}
}
]
},
"ShowProperty": {
"type": "object",
"required": [
"x-lemma-type",
"x-lemma-path",
"x-lemma-needed-by-rules"
],
"anyOf": [
{
"required": [
"type"
]
},
{
"required": [
"oneOf"
]
}
],
"additionalProperties": false,
"description": "One evaluation-data input of a Show document, keyed by its input key (dotted keys included). Standard keywords state the JSON shape; default/examples are the evaluation-data JSON of x-lemma-value/x-lemma-suggestion.",
"properties": {
"type": {
"enum": [
"boolean",
"string",
"array"
]
},
"oneOf": {
"type": "array",
"minItems": 2,
"items": {
"type": "object"
},
"description": "Alternatives: text, boolean, date|date-time, or a single-unit object for measure and ratio data."
},
"pattern": {
"type": "string",
"description": "Boolean text form (ECMA-262); only on the boolean string alternative."
},
"format": {
"type": "string",
"const": "time",
"description": "Present on time inputs. Date inputs use oneOf with format date|date-time on each arm."
},
"enum": {
"type": "array",
"items": {
"type": "string"
},
"description": "Text options."
},
"minLength": {
"type": "integer",
"minimum": 0
},
"maxLength": {
"type": "integer",
"minimum": 0
},
"description": {
"type": "string",
"description": "Type help."
},
"default": {
"$ref": "#/$defs/EvaluateDataJson"
},
"examples": {
"type": "array",
"items": {
"$ref": "#/$defs/EvaluateDataJson"
},
"minItems": 1,
"maxItems": 1
},
"items": {
"$ref": "#/$defs/ShowItems"
},
"maxItems": {
"type": "integer",
"minimum": 0,
"description": "max_list_rows."
},
"x-lemma-type": {
"$ref": "#/$defs/ShowPropertyType"
},
"x-lemma-path": {
"type": "array",
"items": {
"$ref": "#/$defs/PathSegment"
},
"description": "Import hops to this slot. Empty means this spec."
},
"x-lemma-needed-by-rules": {
"type": "array",
"items": {
"type": "string"
},
"description": "On top-level properties: x-lemma-rules keys that transitively need this data after normalize. Empty = reuse catalog only (not an eval intake key for this spec). On $defs row properties always empty — parent field consumers are x-lemma-row-field-needed-by-rules."
},
"x-lemma-value": {
"$ref": "#/$defs/RuleResultValue"
},
"x-lemma-suggestion": {
"$ref": "#/$defs/RuleResultValue"
}
}
},
"ShowRowSchema": {
"type": "object",
"required": [
"title",
"type",
"additionalProperties",
"properties"
],
"additionalProperties": false,
"description": "Row object schema of an instance list, one per row spec in the Show document's $defs. Identity-keyed and identical across Show documents; parent field consumers are document-level x-lemma-row-field-needed-by-rules. Every row-spec data entry is a property, dotted uses fields included.",
"properties": {
"title": {
"type": "string"
},
"type": {
"const": "object"
},
"additionalProperties": {
"const": true
},
"properties": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/ShowProperty"
}
},
"required": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"ShowConversionTarget": {
"description": "Target of a Show `as` conversion (inspection only).",
"oneOf": [
{
"type": "object",
"required": [
"type"
],
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"enum": [
"boolean",
"measure",
"number",
"ratio",
"date",
"time"
]
}
}
},
{
"type": "object",
"required": [
"unit"
],
"additionalProperties": false,
"properties": {
"unit": {
"type": "object",
"required": [
"unit_name"
],
"additionalProperties": false,
"properties": {
"unit_name": {
"type": "string"
}
}
}
}
}
]
},
"ShowExpression": {
"description": "Resolved expression on a Show rule branch. Internally tagged by `type`.",
"oneOf": [
{
"type": "object",
"required": [
"type"
],
"additionalProperties": false,
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"type": {
"const": "literal"
}
}
},
{
"type": "object",
"required": [
"type",
"name"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "data"
},
"name": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type",
"name"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "rule"
},
"name": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type",
"operands"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "and"
},
"operands": {
"type": "array",
"minItems": 2,
"items": {
"$ref": "#/$defs/ShowExpression"
}
}
}
},
{
"type": "object",
"required": [
"type",
"operands"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "or"
},
"operands": {
"type": "array",
"minItems": 2,
"items": {
"$ref": "#/$defs/ShowExpression"
}
}
}
},
{
"type": "object",
"required": [
"type",
"operand"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "not"
},
"operand": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"first",
"steps"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "arithmetic"
},
"first": {
"$ref": "#/$defs/ShowExpression"
},
"steps": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"op",
"operand"
],
"additionalProperties": false,
"properties": {
"op": {
"type": "string",
"enum": [
"add",
"subtract",
"multiply",
"divide",
"modulo",
"power"
]
},
"operand": {
"$ref": "#/$defs/ShowExpression"
}
}
}
}
}
},
{
"type": "object",
"required": [
"type",
"op",
"left",
"right"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "comparison"
},
"op": {
"type": "string",
"enum": [
"greater_than",
"less_than",
"greater_than_or_equal",
"less_than_or_equal",
"is",
"is_not"
]
},
"left": {
"$ref": "#/$defs/ShowExpression"
},
"right": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"operand",
"targets"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "unit_conversion"
},
"operand": {
"$ref": "#/$defs/ShowExpression"
},
"targets": {
"type": "array",
"items": {
"$ref": "#/$defs/ShowConversionTarget"
}
}
}
},
{
"type": "object",
"required": [
"type",
"op",
"operand"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "math"
},
"op": {
"type": "string",
"enum": [
"sqrt",
"sin",
"cos",
"tan",
"asin",
"acos",
"atan",
"log",
"exp",
"abs"
]
},
"operand": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"mode",
"operand"
],
"additionalProperties": false,
"description": "Postfix rounding: `x -> round`, or `price -> round 0.05 eur` with a step.",
"properties": {
"type": {
"const": "step_rounding"
},
"mode": {
"type": "string",
"enum": [
"round",
"floor",
"ceil"
]
},
"operand": {
"$ref": "#/$defs/ShowExpression"
},
"step": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "veto"
},
"message": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "now"
}
}
},
{
"type": "object",
"required": [
"type",
"kind",
"operand"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "date_relative"
},
"kind": {
"type": "string",
"enum": [
"in_past",
"in_future"
]
},
"operand": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"kind",
"unit",
"operand"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "date_calendar"
},
"kind": {
"type": "string",
"enum": [
"current",
"past",
"future",
"not_in"
]
},
"unit": {
"type": "string",
"enum": [
"year",
"month",
"week"
]
},
"operand": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"from",
"to"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "range_literal"
},
"from": {
"$ref": "#/$defs/ShowExpression"
},
"to": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"kind",
"operand"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "past_future_range"
},
"kind": {
"type": "string",
"enum": [
"in_past",
"in_future"
]
},
"operand": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"value",
"range"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "range_containment"
},
"value": {
"$ref": "#/$defs/ShowExpression"
},
"range": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"bound",
"operand"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "range_bound"
},
"bound": {
"type": "string",
"enum": [
"lower",
"upper"
]
},
"operand": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"operand"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "is_veto"
},
"operand": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"base",
"member"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "spec_member"
},
"base": {
"type": "string"
},
"member": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type",
"base",
"member"
],
"additionalProperties": false,
"description": "Field of a computed row value: `(menu -> find ordered).price`.",
"properties": {
"type": {
"const": "member"
},
"base": {
"$ref": "#/$defs/ShowExpression"
},
"member": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type",
"field"
],
"additionalProperties": false,
"description": "Field of the current row inside a list command argument.",
"properties": {
"type": {
"const": "row_field"
},
"field": {
"type": "string"
},
"qualifier": {
"type": "array",
"items": {
"type": "string"
},
"description": "List path prefix when the row field was authored with a qualifier."
}
}
},
{
"type": "object",
"required": [
"type"
],
"additionalProperties": false,
"description": "The current row's value inside a value-list command argument.",
"properties": {
"type": {
"const": "row_value"
}
}
},
{
"type": "object",
"required": [
"type",
"field",
"value"
],
"additionalProperties": false,
"description": "One `field: value` pair of an inline row appended by `-> with`.",
"properties": {
"type": {
"const": "row_field_value"
},
"field": {
"type": "string"
},
"value": {
"$ref": "#/$defs/ShowExpression"
}
}
},
{
"type": "object",
"required": [
"type",
"list",
"command",
"args"
],
"additionalProperties": false,
"description": "Postfix list command (`staff -> sum bonus`). direction is present exactly on sort. A value-list condition is a comparison or range_containment whose left operand is row_value, or a logical `and`/`or` of those comparisons.",
"properties": {
"type": {
"const": "list_command"
},
"list": {
"$ref": "#/$defs/ShowExpression"
},
"command": {
"type": "string",
"enum": [
"find",
"first",
"last",
"count",
"sum",
"avg",
"product",
"min",
"max",
"any",
"all",
"where",
"sort",
"top",
"with",
"key"
]
},
"direction": {
"type": "string",
"enum": [
"asc",
"desc"
]
},
"args": {
"type": "array",
"items": {
"$ref": "#/$defs/ShowExpression"
}
}
}
}
]
},
"ShowBranch": {
"type": "object",
"required": [
"result"
],
"additionalProperties": false,
"description": "One arm of a rule's flat last-match table. Default arm omits condition.",
"properties": {
"condition": {
"$ref": "#/$defs/ShowExpression"
},
"result": {
"$ref": "#/$defs/ShowExpression"
}
}
},
"ShowRule": {
"type": "object",
"required": [
"type",
"path",
"branches",
"depends_on_rules"
],
"additionalProperties": false,
"description": "Rule on Show: result type, import path ([] = this spec), authored default/unless branches, and depends_on_rules (Show.rules keys).",
"properties": {
"type": {
"$ref": "#/$defs/LemmaType"
},
"path": {
"type": "array",
"items": {
"$ref": "#/$defs/PathSegment"
},
"description": "Import hops to this rule. Empty means this spec."
},
"branches": {
"type": "array",
"items": {
"$ref": "#/$defs/ShowBranch"
}
},
"depends_on_rules": {
"type": "array",
"items": {
"type": "string"
},
"description": "Show.rules keys this rule depends on (planning topo). Always present."
}
}
},
"SourceType": {
"description": "Provenance of a loaded source. Externally tagged; the unit `Volatile` variant is the bare string \"volatile\".",
"oneOf": [
{
"const": "volatile"
},
{
"type": "object",
"required": [
"path"
],
"additionalProperties": false,
"properties": {
"path": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"dependency"
],
"additionalProperties": false,
"properties": {
"dependency": {
"type": "string"
}
}
}
]
},
"LiteralValue": {
"description": "Parsed literal value. Externally tagged.",
"oneOf": [
{
"type": "object",
"required": [
"number"
],
"additionalProperties": false,
"properties": {
"number": {
"$ref": "#/$defs/DecimalString"
}
}
},
{
"type": "object",
"required": [
"number_with_unit"
],
"additionalProperties": false,
"properties": {
"number_with_unit": {
"type": "array",
"prefixItems": [
{
"$ref": "#/$defs/DecimalString"
},
{
"type": "string"
}
],
"items": false,
"minItems": 2,
"maxItems": 2
}
}
},
{
"type": "object",
"required": [
"text"
],
"additionalProperties": false,
"properties": {
"text": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"date"
],
"additionalProperties": false,
"properties": {
"date": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"time"
],
"additionalProperties": false,
"properties": {
"time": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"boolean"
],
"additionalProperties": false,
"properties": {
"boolean": {
"enum": [
"true",
"false",
"yes",
"no"
]
}
}
},
{
"type": "object",
"required": [
"range"
],
"additionalProperties": false,
"properties": {
"range": {
"type": "array",
"prefixItems": [
{
"$ref": "#/$defs/LiteralValue"
},
{
"$ref": "#/$defs/LiteralValue"
}
],
"items": false,
"minItems": 2,
"maxItems": 2
}
}
}
]
},
"Show": {
"description": "Result of Engine::show: a Draft 2020-12 JSON Schema for the spec's evaluation-data inputs. properties holds inputs rules need (non-empty x-lemma-needed-by-rules), required the unbound ones, $defs instance-list row schemas (identity-stable across Show documents). x-lemma-row-field-needed-by-rules maps each LemmaRow_* def to the parent rules that need each row field. x-lemma-types is local data declarations; x-lemma-rules is this spec's own rules (branch Rule leaves may name imports outside that map).",
"allOf": [
{
"$ref": "https://json-schema.org/draft/2020-12/schema"
},
{
"type": "object",
"required": [
"$schema",
"title",
"type",
"additionalProperties",
"properties",
"x-lemma-start-line",
"x-lemma-meta",
"x-lemma-types",
"x-lemma-rules"
],
"additionalProperties": false,
"properties": {
"$schema": {
"const": "https://json-schema.org/draft/2020-12/schema"
},
"title": {
"type": "string",
"description": "Spec name."
},
"description": {
"type": "string",
"description": "Spec commentary."
},
"type": {
"const": "object"
},
"additionalProperties": {
"const": true
},
"properties": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/ShowProperty"
}
},
"required": {
"type": "array",
"items": {
"type": "string"
}
},
"$defs": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/ShowRowSchema"
}
},
"x-lemma-repository": {
"type": "string",
"description": "Interned repository name. Omitted for the unnamed workspace."
},
"x-lemma-effective-from": {
"type": "string"
},
"x-lemma-effective-to": {
"type": "string"
},
"x-lemma-start-line": {
"type": "integer"
},
"x-lemma-source-type": {
"$ref": "#/$defs/SourceType"
},
"x-lemma-meta": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/LiteralValue"
}
},
"x-lemma-types": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/LemmaType"
},
"description": "Local data declarations (empty path), declaration order."
},
"x-lemma-rules": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/ShowRule"
}
},
"x-lemma-row-field-needed-by-rules": {
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Per $defs LemmaRow_* name: map of row field input key to parent x-lemma-rules keys that need that field through an instance list. Omitted when no row field is needed by a parent rule. Kept off $defs so row schemas stay identical across Show documents."
}
}
}
]
},
"RuleResult": {
"type": "object",
"required": [
"vetoed",
"rule_type"
],
"additionalProperties": false,
"description": "Result of evaluating one rule. RuleResultValue fields are flattened directly onto this object (no `value` wrapper key) when the rule is not vetoed.",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"vetoed": {
"type": "boolean"
},
"veto_reason": {
"type": "string"
},
"rule_type": {
"type": "string"
},
"explanation": {
"$ref": "#/$defs/RuleNode"
},
"missing_data": {
"type": "array",
"items": {
"type": "string"
}
},
"missing_data_options": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {}
},
"description": "Closed values for keys in missing_data on this run. A key with no entry is not constrained by a set. An empty array means nothing is valid. Each item is evaluation data. Static options come first, then rows from the options rule."
}
}
},
"Response": {
"type": "object",
"required": [
"spec",
"effective",
"results"
],
"additionalProperties": false,
"description": "Result of Engine::evaluate.",
"properties": {
"spec": {
"type": "string"
},
"effective": {
"type": "string"
},
"spec_effective_from": {
"type": "string"
},
"spec_effective_to": {
"type": "string"
},
"results": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResult"
}
},
"rows": {
"type": "array",
"items": {
"$ref": "#/$defs/RowResult"
},
"description": "Rows reached by results, in first-reached order, indexed by RowReference.index. Omitted when no result reaches a row."
}
}
},
"SpecDependency": {
"type": "object",
"required": [
"name"
],
"additionalProperties": false,
"description": "One uses target written on a spec version.",
"properties": {
"repository": {
"type": "string"
},
"name": {
"type": "string"
},
"effective": {
"type": "string"
}
}
},
"SpecVersion": {
"type": "object",
"required": [
"name"
],
"additionalProperties": false,
"description": "One temporal spec version from Engine::specs.",
"properties": {
"name": {
"type": "string"
},
"effective_from": {
"type": "string"
},
"effective_to": {
"type": "string"
},
"dependencies": {
"type": "array",
"items": {
"$ref": "#/$defs/SpecDependency"
},
"description": "uses targets in declaration order. Omitted when empty."
}
}
},
"Repository": {
"type": "object",
"required": [
"specs"
],
"additionalProperties": false,
"description": "One repository group from Engine::specs. `repository` is absent for the default unnamed repository.",
"properties": {
"repository": {
"type": "string"
},
"specs": {
"type": "array",
"items": {
"$ref": "#/$defs/SpecVersion"
}
}
}
},
"EngineErrorSource": {
"type": "object",
"required": [
"attribute",
"line",
"column",
"length"
],
"additionalProperties": false,
"description": "Source location attached to an EngineError. Line/column are 1-based; length is the UTF-8 byte length of the offending span.",
"properties": {
"attribute": {
"type": "string"
},
"line": {
"type": "integer"
},
"column": {
"type": "integer"
},
"length": {
"type": "integer"
}
}
},
"Recommendation": {
"type": "object",
"required": [
"message",
"spec",
"effective_from",
"repository",
"source"
],
"additionalProperties": false,
"description": "Structural quality recommendation from Engine::quality. Advisory only.",
"properties": {
"message": {
"type": "string"
},
"spec": {
"type": "string"
},
"effective_from": {
"type": [
"string",
"null"
],
"description": "Declared temporal start of the analyzed slice, or null for Origin."
},
"repository": {
"type": [
"string",
"null"
]
},
"source": {
"$ref": "#/$defs/EngineErrorSource"
}
}
},
"EngineError": {
"type": "object",
"required": [
"kind",
"message",
"related_data",
"spec",
"related_spec",
"source",
"suggestion",
"repository",
"registry_kind",
"request_kind",
"limit_name",
"limit_value",
"actual_value"
],
"additionalProperties": false,
"description": "Structured error thrown by Engine::evaluate/show/load/fetch.",
"properties": {
"kind": {
"enum": [
"parsing",
"validation",
"registry",
"missing_repository",
"request",
"resource_limit"
]
},
"message": {
"type": "string"
},
"related_data": {
"type": [
"string",
"null"
]
},
"spec": {
"type": [
"string",
"null"
]
},
"related_spec": {
"type": [
"string",
"null"
]
},
"source": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/EngineErrorSource"
}
]
},
"suggestion": {
"type": [
"string",
"null"
]
},
"repository": {
"type": [
"string",
"null"
]
},
"registry_kind": {
"anyOf": [
{
"type": "null"
},
{
"enum": [
"not_found",
"unauthorized",
"network_error",
"server_error",
"other"
]
}
]
},
"request_kind": {
"anyOf": [
{
"type": "null"
},
{
"enum": [
"spec_not_found",
"rule_not_found",
"invalid_request"
]
}
]
},
"limit_name": {
"type": [
"string",
"null"
]
},
"limit_value": {
"type": [
"string",
"null"
]
},
"actual_value": {
"type": [
"string",
"null"
]
}
}
},
"Cause": {
"type": "object",
"required": [
"condition",
"value"
],
"additionalProperties": false,
"description": "One evaluated unless condition, stated as a fact. A falsified comparison is flipped to its complement, so the condition text describes what held.",
"properties": {
"condition": {
"type": "string",
"description": "True-form condition expression text from the source rule."
},
"value": {
"type": "string",
"description": "\"true\" for facts stated positively (including flipped conditions), \"false\" when the condition could not be flipped into a positive statement, or the veto text when evaluating the condition vetoed."
},
"children": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
}
}
}
},
"ConversionStep": {
"type": "object",
"required": [
"role",
"text"
],
"additionalProperties": false,
"properties": {
"role": {
"enum": [
"outcome",
"rule"
]
},
"text": {
"type": "string"
}
}
},
"ExplanationNode": {
"oneOf": [
{
"$ref": "#/$defs/RuleRefNode"
},
{
"$ref": "#/$defs/ComposeNode"
},
{
"$ref": "#/$defs/ListCommandNode"
},
{
"$ref": "#/$defs/DataNode"
},
{
"$ref": "#/$defs/DataUnusedNode"
},
{
"$ref": "#/$defs/ConversionNode"
},
{
"$ref": "#/$defs/VetoNode"
},
{
"$ref": "#/$defs/RowNode"
},
{
"$ref": "#/$defs/FilterNode"
}
]
},
"ExplainedListOp": {
"description": "List command identity on a list_command explanation node.",
"oneOf": [
{
"type": "string",
"enum": [
"find",
"first",
"last",
"count",
"sum",
"avg",
"product",
"min",
"max",
"any",
"all",
"where",
"top",
"with",
"key"
]
},
{
"type": "object",
"required": [
"sort"
],
"additionalProperties": false,
"properties": {
"sort": {
"type": "object",
"required": [
"descending"
],
"additionalProperties": false,
"properties": {
"descending": {
"type": "boolean"
}
}
}
}
}
]
},
"ListCommandNode": {
"type": "object",
"required": [
"type",
"expression",
"stage",
"op",
"operands"
],
"additionalProperties": false,
"description": "One NormalForm list command cell (menu -> sum price). stage is the command fragment after ->. RuleResultValue fields are flattened.",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"type": {
"const": "list_command"
},
"expression": {
"type": "string"
},
"stage": {
"type": "string"
},
"op": {
"$ref": "#/$defs/ExplainedListOp"
},
"operands": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
}
}
}
},
"RuleNode": {
"type": "object",
"required": [
"type",
"name",
"result",
"body"
],
"additionalProperties": false,
"description": "Root rule explanation under RuleResult.explanation. Nested rule uses are rule_ref into the rules table. RuleResultValue fields are flattened.",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"type": {
"const": "rule"
},
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"causes": {
"type": "array",
"items": {
"$ref": "#/$defs/Cause"
}
},
"children": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
}
},
"rules": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplainedRule"
},
"description": "Narrated rules reachable from this root, referenced by rule_ref nodes. Ids are dense from 0 in first-reach order."
}
}
},
"ExplainedRule": {
"type": "object",
"required": [
"id",
"name",
"result",
"body"
],
"additionalProperties": false,
"description": "One narrated rule body in a root explanation's rules table.",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"id": {
"type": "integer",
"minimum": 0
},
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"causes": {
"type": "array",
"items": {
"$ref": "#/$defs/Cause"
}
},
"children": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
}
}
}
},
"RuleRefNode": {
"type": "object",
"required": [
"type",
"id",
"name",
"result"
],
"additionalProperties": false,
"description": "Reference to an ExplainedRule in the enclosing root explanation's rules table. RuleResultValue fields are flattened.",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"type": {
"const": "rule_ref"
},
"id": {
"type": "integer",
"minimum": 0
},
"name": {
"type": "string"
}
}
},
"RowNode": {
"type": "object",
"required": [
"type",
"number",
"fields"
],
"additionalProperties": false,
"description": "One instance-list row a list command read. ASCII: numbered rows use n.; keyed rows print key and data fields as comma columns (no brackets).",
"properties": {
"type": {
"const": "row"
},
"number": {
"type": "integer",
"minimum": 1
},
"appended": {
"type": "boolean",
"description": "True when the row was appended by an expression -> with."
},
"key": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
},
"description": "Key field Data nodes in -> key order; empty for numbered lists."
},
"fields": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
}
}
}
},
"FilterNode": {
"type": "object",
"required": [
"type",
"condition",
"matched",
"total"
],
"additionalProperties": false,
"description": "Summary of a where filter: matched of total rows satisfied the condition.",
"properties": {
"type": {
"const": "filter"
},
"condition": {
"type": "string"
},
"matched": {
"type": "integer",
"minimum": 0
},
"total": {
"type": "integer",
"minimum": 0
},
"children": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
}
}
}
},
"ComposeNode": {
"type": "object",
"required": [
"type",
"expression",
"operands"
],
"additionalProperties": false,
"description": "Composed expression (arithmetic, comparison, logical, …). RuleResultValue fields are flattened.",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"type": {
"const": "compose"
},
"expression": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"add",
"subtract",
"multiply",
"divide",
"modulo",
"power"
]
},
"operands": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
}
}
}
},
"DataNode": {
"type": "object",
"required": [
"type",
"name",
"result"
],
"additionalProperties": false,
"description": "Bound data narration. RuleResultValue fields are flattened (result plus typed measure/ratio/… maps).",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"type": {
"const": "data"
},
"name": {
"type": "string"
}
}
},
"DataUnusedNode": {
"type": "object",
"required": [
"type",
"name"
],
"additionalProperties": false,
"description": "Data path present in a cause condition structure but never looked up (short-circuit or static and-false).",
"properties": {
"type": {
"const": "data_unused"
},
"name": {
"type": "string"
}
}
},
"ConversionNode": {
"type": "object",
"required": [
"type",
"expression",
"steps",
"operands"
],
"additionalProperties": false,
"description": "Unit conversion. RuleResultValue fields are flattened (outcome on the expression line).",
"properties": {
"result": {
"type": "string"
},
"measure": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"ratio": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/DecimalString"
}
},
"number": {
"$ref": "#/$defs/DecimalString"
},
"boolean": {
"type": "boolean"
},
"text": {
"type": "string"
},
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"calendar": {
"$ref": "#/$defs/CalendarResult"
},
"unit": {
"type": "string"
},
"range": {
"$ref": "#/$defs/RangeResult"
},
"spec": {
"$ref": "#/$defs/SpecResult"
},
"row": {
"$ref": "#/$defs/RowReference"
},
"list": {
"type": "array",
"items": {
"$ref": "#/$defs/RuleResultValue"
}
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/RuleResultValue"
},
"description": "Show only: on a source row of an instance list value, the fields the row sets, keyed relative to the row spec. Such rows and their list carry no result; row order is array order."
},
"reference": {
"type": "string",
"description": "Show only: on a source-row field whose value is a reference; the input key of the referenced data in the spec declaring the list."
},
"type": {
"const": "conversion"
},
"expression": {
"type": "string"
},
"steps": {
"type": "array",
"items": {
"$ref": "#/$defs/ConversionStep"
}
},
"operands": {
"type": "array",
"items": {
"$ref": "#/$defs/ExplanationNode"
}
}
}
},
"VetoNode": {
"type": "object",
"required": [
"type"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "veto"
},
"message": {
"type": "string"
}
}
},
"RepositoryInstallResult": {
"type": "object",
"required": [
"source",
"id"
],
"additionalProperties": false,
"description": "Result of Engine.install / Lemma.install: LemmaBase repository source text and normalized id. Not yet loaded.",
"properties": {
"source": {
"type": "string"
},
"id": {
"type": "string"
}
}
},
"ShowTypeBoolean": {
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"const": "boolean"
}
}
},
"ShowTypeMeasure": {
"type": "object",
"required": [
"kind",
"minimum",
"maximum",
"units",
"traits",
"decomposition"
],
"properties": {
"kind": {
"const": "measure"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/MeasureUnit"
}
},
"traits": {
"type": "array",
"items": {
"enum": [
"duration",
"calendar"
]
}
},
"decomposition": {
"anyOf": [
{
"type": "null"
},
{
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
]
},
"unit": {
"type": "string"
}
}
},
"ShowTypeNumber": {
"type": "object",
"required": [
"kind",
"minimum",
"maximum",
"decimals"
],
"properties": {
"kind": {
"const": "number"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"decimals": {
"type": [
"integer",
"null"
]
}
}
},
"ShowTypeNumberRange": {
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum"
],
"properties": {
"kind": {
"const": "number_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
}
}
},
"ShowTypeRatio": {
"type": "object",
"required": [
"kind",
"minimum",
"maximum",
"units"
],
"properties": {
"kind": {
"const": "ratio"
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/RatioUnit"
}
},
"unit": {
"type": "string"
}
}
},
"ShowTypeRatioRange": {
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum",
"units"
],
"properties": {
"kind": {
"const": "ratio_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/DecimalString"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/RatioUnit"
}
}
}
},
"ShowTypeText": {
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"const": "text"
}
}
},
"ShowTypeDate": {
"type": "object",
"required": [
"kind",
"minimum",
"maximum"
],
"properties": {
"kind": {
"const": "date"
},
"minimum": {
"type": [
"string",
"null"
]
},
"maximum": {
"type": [
"string",
"null"
]
}
}
},
"ShowTypeDateRange": {
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum"
],
"properties": {
"kind": {
"const": "date_range"
},
"lower": {
"type": [
"string",
"null"
]
},
"upper": {
"type": [
"string",
"null"
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
}
}
},
"ShowTypeTime": {
"type": "object",
"required": [
"kind",
"minimum",
"maximum"
],
"properties": {
"kind": {
"const": "time"
},
"minimum": {
"type": [
"string",
"null"
]
},
"maximum": {
"type": [
"string",
"null"
]
}
}
},
"ShowTypeTimeRange": {
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum"
],
"properties": {
"kind": {
"const": "time_range"
},
"lower": {
"type": [
"string",
"null"
]
},
"upper": {
"type": [
"string",
"null"
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
}
}
},
"ShowTypeMeasureRange": {
"type": "object",
"required": [
"kind",
"lower",
"upper",
"minimum",
"maximum",
"units",
"decomposition"
],
"properties": {
"kind": {
"const": "measure_range"
},
"lower": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"upper": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"minimum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"maximum": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/NamedBound"
}
]
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/MeasureUnit"
}
},
"decomposition": {
"anyOf": [
{
"type": "null"
},
{
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
]
}
}
},
"ShowTypeSpec": {
"type": "object",
"required": [
"kind",
"spec",
"effective"
],
"properties": {
"kind": {
"const": "spec"
},
"spec": {
"type": "string"
},
"effective": {
"type": "string"
},
"repository": {
"type": "string"
}
}
},
"ShowTypeList": {
"type": "object",
"required": [
"kind",
"element",
"key"
],
"properties": {
"kind": {
"const": "list"
},
"element": {
"$ref": "#/$defs/ShowPropertyElementType"
},
"key": {
"$ref": "#/$defs/ListKey"
}
}
},
"ShowTypeNameExtends": {
"type": "object",
"required": [
"name",
"extends"
],
"properties": {
"name": {
"type": [
"string",
"null"
]
},
"extends": {
"$ref": "#/$defs/TypeExtends"
}
}
}
},
"anyOf": [
{
"$ref": "#/$defs/Show"
},
{
"$ref": "#/$defs/Response"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/Repository"
}
},
{
"type": "array",
"items": {
"$ref": "#/$defs/EngineError"
}
},
{
"$ref": "#/$defs/RepositoryInstallResult"
}
]
}
;Expand description
Checked-in JSON Schema for Show, Response, and related wire types
(engine/schemas/api.v1.json). Regenerated by cargo run -p xtask -- schema.