- examples/synthetic-spec: полный набор сущностей, профилей, пресета и антипаттерна - bhl validate и profile resolve проходят пример без диагностик - тест сверяет копию схем с spec/schemas и порядок разрешения - README карты лаборатории дополнен spec/ и examples/
130 lines
5.0 KiB
JSON
130 lines
5.0 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://baseline-harness.dev/spec/schemas/requirement.schema.json",
|
|
"title": "Atomic Requirement",
|
|
"description": "Минимальная независимо проверяемая нормативная единица (D-009, §5 задания 0.1.0). Нормативный уровень, жизненный цикл и статус библиотечного материала — разные сущности (D-029, исправление §5.7 продолжения).",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"id",
|
|
"domain",
|
|
"capability",
|
|
"title",
|
|
"statement",
|
|
"level",
|
|
"rationale",
|
|
"applicability",
|
|
"acceptance_criteria",
|
|
"verification",
|
|
"expected_evidence",
|
|
"lifecycle"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^req-[a-z0-9]+(-[a-z0-9]+)*$",
|
|
"description": "Постоянный идентификатор (D-031): не зависит от названия, пути и позиции; освобождённые идентификаторы не переиспользуются (проверка — валидатор)."
|
|
},
|
|
"domain": { "type": "string", "pattern": "^dom-[a-z0-9]+(-[a-z0-9]+)*$" },
|
|
"capability": { "type": "string", "pattern": "^cap-[a-z0-9]+(-[a-z0-9]+)*$" },
|
|
"title": { "type": "string", "minLength": 3, "maxLength": 120 },
|
|
"statement": {
|
|
"type": "string",
|
|
"minLength": 10,
|
|
"description": "Нормативная формулировка с ключевым словом RFC 2119/8174 (D-029); сверка слова с полем level — задача валидатора (BHL-011)."
|
|
},
|
|
"level": {
|
|
"enum": ["MUST", "MUST NOT", "SHOULD", "SHOULD NOT", "MAY"],
|
|
"description": "Нормативный уровень; не смешивается с жизненным циклом и статусом библиотеки."
|
|
},
|
|
"rationale": { "type": "string", "minLength": 10 },
|
|
"applicability": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["when"],
|
|
"properties": {
|
|
"when": { "type": "string", "minLength": 3 },
|
|
"unless": { "type": "string", "minLength": 3 }
|
|
}
|
|
}
|
|
},
|
|
"parameters": {
|
|
"type": "array",
|
|
"items": { "$ref": "https://baseline-harness.dev/spec/schemas/parameter.schema.json" },
|
|
"description": "Типизированные параметры (D-018); переопределение вне ограничений отклоняет валидатор."
|
|
},
|
|
"acceptance_criteria": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["criterion"],
|
|
"properties": {
|
|
"criterion": { "type": "string", "minLength": 3 },
|
|
"measure": { "type": "string", "minLength": 3 }
|
|
}
|
|
}
|
|
},
|
|
"verification": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["kind", "procedure"],
|
|
"properties": {
|
|
"kind": { "enum": ["deterministic", "semantic", "hybrid"] },
|
|
"procedure": { "type": "string", "minLength": 10 },
|
|
"automation": { "type": "string", "minLength": 1 }
|
|
}
|
|
},
|
|
"expected_evidence": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["kind", "description"],
|
|
"properties": {
|
|
"kind": {
|
|
"enum": ["file", "command-output", "test-run", "session-observation", "review-note", "hash", "other"]
|
|
},
|
|
"description": { "type": "string", "minLength": 3 }
|
|
}
|
|
}
|
|
},
|
|
"relations": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["target", "kind"],
|
|
"properties": {
|
|
"target": { "type": "string", "pattern": "^req-[a-z0-9]+(-[a-z0-9]+)*$" },
|
|
"kind": { "enum": ["depends-on", "refines", "related", "supersedes"] }
|
|
}
|
|
}
|
|
},
|
|
"antipatterns": {
|
|
"type": "array",
|
|
"items": { "type": "string", "pattern": "^ant-[a-z0-9]+(-[a-z0-9]+)*$" }
|
|
},
|
|
"lifecycle": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["status"],
|
|
"properties": {
|
|
"status": { "enum": ["draft", "proposed", "accepted", "deprecated", "removed"] },
|
|
"since": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
"note": { "type": "string", "minLength": 3 }
|
|
}
|
|
},
|
|
"history_ref": {
|
|
"type": "string",
|
|
"minLength": 3,
|
|
"description": "Ссылка на канонический источник истории нормативных изменений (spec/CHANGELOG.yaml, BHL-016); история не дублируется."
|
|
}
|
|
}
|
|
}
|