Files
harness-lab/examples/synthetic-spec/schemas/parameter.schema.json
T
Suslov-MD c50092f7e4 feat: синтетическая спецификация для сквозных прогонов (BHL-018)
- examples/synthetic-spec: полный набор сущностей, профилей, пресета и антипаттерна
- bhl validate и profile resolve проходят пример без диагностик
- тест сверяет копию схем с spec/schemas и порядок разрешения
- README карты лаборатории дополнен spec/ и examples/
2026-11-29 00:06:36 +03:00

88 lines
3.4 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/parameter.schema.json",
"title": "Parameter",
"description": "Типизированный параметр требования (D-018): значение переопределяется только в пределах ограничений.",
"type": "object",
"additionalProperties": false,
"required": ["id", "type", "description"],
"properties": {
"id": {
"type": "string",
"pattern": "^param-[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Постоянный идентификатор (D-031)."
},
"type": { "enum": ["boolean", "integer", "number", "string", "enum"] },
"description": { "type": "string", "minLength": 10 },
"default": {},
"unit": { "type": "string", "minLength": 1 },
"constraints": {
"type": "object",
"additionalProperties": false,
"properties": {
"minimum": { "type": "number" },
"maximum": { "type": "number" },
"values": { "type": "array", "minItems": 1, "items": { "type": ["string", "integer", "number", "boolean"] } },
"pattern": { "type": "string" },
"minLength": { "type": "integer", "minimum": 0 },
"maxLength": { "type": "integer", "minimum": 1 }
}
},
"overridable_by": {
"type": "array",
"minItems": 0,
"uniqueItems": true,
"items": { "enum": ["profile", "project"] },
"default": ["profile", "project"]
}
},
"allOf": [
{
"if": { "properties": { "type": { "const": "boolean" } }, "required": ["type"] },
"then": {
"properties": {
"default": { "type": "boolean" },
"constraints": { "type": "object", "additionalProperties": false, "properties": {} }
}
}
},
{
"if": { "properties": { "type": { "const": "integer" } }, "required": ["type"] },
"then": {
"properties": {
"default": { "type": "integer" },
"constraints": { "type": "object", "additionalProperties": false, "properties": { "minimum": { "type": "integer" }, "maximum": { "type": "integer" } } }
}
}
},
{
"if": { "properties": { "type": { "const": "number" } }, "required": ["type"] },
"then": {
"properties": {
"default": { "type": "number" },
"constraints": { "type": "object", "additionalProperties": false, "properties": { "minimum": { "type": "number" }, "maximum": { "type": "number" } } }
}
}
},
{
"if": { "properties": { "type": { "const": "string" } }, "required": ["type"] },
"then": {
"properties": {
"default": { "type": "string" },
"constraints": { "type": "object", "additionalProperties": false, "properties": { "pattern": { "type": "string" }, "minLength": { "type": "integer", "minimum": 0 }, "maxLength": { "type": "integer", "minimum": 1 } } }
}
}
},
{
"if": { "properties": { "type": { "const": "enum" } }, "required": ["type"] },
"then": {
"required": ["constraints"],
"properties": {
"default": {},
"constraints": { "type": "object", "additionalProperties": false, "required": ["values"], "properties": { "values": { "type": "array", "minItems": 1, "items": { "type": ["string", "integer", "number", "boolean"] } } } }
}
}
}
]
}