feat: схемы ядра спецификации и журнал нормативных изменений (BHL-010, BHL-016)
JSON Schema 2020-12 для Domain, Capability, Parameter, Atomic Requirement и Normative Change; level/lifecycle/статус библиотеки раздельно; ID dom-, cap-, req-, param-, chg- валидируются паттернами. Канонический журнал — spec/CHANGELOG.yaml (требования ссылаются history_ref, история не дублируется). Черновик SemVer-политики — D-039 (proposed). Тесты ajv: 7, включая отрицательные фикстуры.
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"$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"] } } } }
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user