Спецификация BHS стала продуктовым деревом products/bhs-spec (BHL-066)

Перенос выполнен git mv: spec/ → products/bhs-spec/spec/ — корень нормативного
дерева и корень сборки релизного артефакта, docs/spec/ → products/bhs-spec/docs/ —
сгенерированные страницы. Каталоги spec/ и docs/ в корне лаборатории исчезли,
история не переписана: 90 файлов ушли переименованиями, новых коммитов достаточно.

Содержимое сохранено. 58 нормативных YAML/JSON и 31 сгенерированная страница
байт-идентичны прежнему состоянию — сверка списков SHA-256 до и после переноса
расхождений не дала, перегенерация docs/ не потребовалась. Единственный изменённый
файл дерева — spec/README.md (45769aaf… → 47e3bd12…): перенацелены цели ссылок и
путь команды сборки, потому что глубина каталога выросла на два уровня. Факты и
нормативный текст не правлены, записей chg-… не добавлялось: README не нормативная
сущность. Из него же убраны markdown-ссылки в приватные каталоги лаборатории
(backlog/, backlog/decisions/, library/, корневые schemas/) — они остались текстом,
иначе проверка продуктовых границ по BHL-071 AC #1 дала бы по ним ошибки. Ссылка на
фикстуру соседнего продукта bhl-cli сохранена: документационные ссылки на соседние
деревья допустимы (D-055).

Воспроизводимость прежних кандидатов проверена сборкой CLI той же ревизии по
git archive: 0.1.1 из c7ed8e2 даёт 5e7922f9fd630b31b70fab2e5b3a8eb1f80ee8b87dd51d9b99c024e528d8d8bf,
0.1.0 из a17c027 — 9b3adb7a7ea361f178303874c7ab3721ba8d4956af9367e51f6b599497953007,
обе суммы совпадают с записями результатов. Имена путей внутри tarball задаются
префиксом bhs-spec-<version>/ и относительными путями от корня сборки, поэтому
сборка из products/bhs-spec/spec и из копии того же содержимого вне лаборатории даёт
байт-идентичный артефакт. Сборка 0.1.1 из текущего дерева отличается от кандидата
c7ed8e2 ровно README.md при том же составе — 58 файлов; зафиксированные суммы не
переписаны, следствие записано комментарием к BHL-062.

Потребители пути переведены: tests/lab-connection.test.mjs, tests/spec-docs.test.mjs,
tests/spec-schema-copy.test.mjs, tests/spec-schemas.test.mjs и
products/bhl-cli/tests/normative-sync.test.mjs (переходный откат на spec/ удалён
вместе с переходной записью реестра, переходных состояний в products.yaml не осталось).
Ссылки перенацелены в README корня, AGENTS.md, products/bhl-cli/README.md,
products/bhs-implementations/README.md и двух его SKILL.md, sources/README.md,
одной записи results/ и текстовом пути seed в карточке библиотеки. Добавлено
README продуктового дерева с раскладкой, местной командой качества и тем, что в
дерево не входит; отдельный package.json не заводили — его version создал бы
второй источник версии стандарта, которая живёт в CHANGELOG.yaml.

Проверки: корневой quality gate — npm run check 0 ошибок и 0 предупреждений при
3 продуктах, npm test 60/60, backlog doctor без дубликатов и циклов; местная
валидация дерева — 43 файла, 0 диагностик; products/bhl-cli — 56/56 из корня и из
дерева, в изолированной копии через rsync 55 зелёных и 1 пропуск сверки норматива
вне лаборатории, npm pack изнутри дерева — 23 файла без тестов и фикстур;
products/bhs-implementations — 5/5 и в изолированной копии проходит без установки.
This commit is contained in:
Suslov-MD
2026-11-30 15:56:13 +03:00
parent c28a993c06
commit a511bb1d08
110 changed files with 133 additions and 67 deletions
@@ -0,0 +1,62 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/antipattern.schema.json",
"title": "Antipattern",
"description": "Нормативный антипаттерн с историей отказов (D-004). Нормативный уровень (level) и жизненный цикл (lifecycle) — разные enum (D-029); связи с требованиями и происхождение из материалов библиотеки обязательны.",
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "description", "level", "lifecycle", "relations", "sources"],
"properties": {
"id": {
"type": "string",
"pattern": "^ant-[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Постоянный идентификатор (D-031)."
},
"title": { "type": "string", "minLength": 3, "maxLength": 120 },
"description": { "type": "string", "minLength": 10 },
"level": {
"enum": ["SHOULD NOT", "MUST NOT"],
"description": "Нормативная сила запрета; не смешивается с жизненным циклом."
},
"lifecycle": {
"type": "object",
"additionalProperties": false,
"required": ["status"],
"properties": {
"status": {
"enum": ["proposed", "discouraged", "forbidden", "deprecated", "removed"],
"description": "Путь антипаттерна: proposed → discouraged → forbidden; deprecated → removed. Не нормативный уровень."
},
"since": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
"note": { "type": "string", "minLength": 3 }
}
},
"relations": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["target", "kind"],
"properties": {
"target": { "type": "string", "pattern": "^req-[a-z0-9]+(-[a-z0-9]+)*$" },
"kind": { "enum": ["contradicts"] }
}
}
},
"sources": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["material"],
"properties": {
"material": { "type": "string", "minLength": 3 },
"note": { "type": "string", "minLength": 3 }
}
}
},
"note": { "type": "string", "minLength": 3 }
}
}
@@ -0,0 +1,50 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/audit-finding.schema.json",
"title": "Audit Finding",
"description": "Проверка одного требования в отчёте аудита (D-005, D-019). Статус аудита не смешивается с уровнем и жизненным циклом требования.",
"type": "object",
"additionalProperties": false,
"required": ["requirement", "status", "method", "evidence", "rationale"],
"properties": {
"requirement": { "type": "string", "pattern": "^req-[a-z0-9]+(-[a-z0-9]+)*$" },
"status": {
"enum": ["PASS", "FAIL", "PARTIAL", "EXEMPT", "NOT_APPLICABLE", "UNKNOWN", "BLOCKED"]
},
"method": { "enum": ["deterministic", "semantic", "hybrid"] },
"evidence": {
"type": "array",
"minItems": 1,
"items": { "$ref": "https://baseline-harness.dev/spec/schemas/evidence.schema.json" }
},
"issues": { "type": "array", "items": { "type": "string", "minLength": 3 } },
"recommendations": { "type": "array", "items": { "type": "string", "minLength": 3 } },
"corrections": { "type": "array", "items": { "type": "string", "minLength": 3 } },
"rationale": { "type": "string", "minLength": 10 },
"confidence": {
"enum": ["high", "medium", "low"],
"description": "Уверенность семантической проверки; для deterministic не требуется."
},
"exemption_ref": {
"type": "string",
"minLength": 3,
"description": "Ссылка на утверждённое исключение при status EXEMPT."
}
},
"allOf": [
{
"if": { "properties": { "status": { "const": "EXEMPT" } }, "required": ["status"] },
"then": {
"required": ["exemption_ref"],
"properties": { "exemption_ref": { "type": "string", "minLength": 3 } }
}
},
{
"if": { "properties": { "method": { "const": "semantic" } }, "required": ["method"] },
"then": {
"required": ["confidence"],
"properties": { "confidence": { "enum": ["high", "medium", "low"] } }
}
}
]
}
@@ -0,0 +1,68 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/audit-report.schema.json",
"title": "Audit Report",
"description": "Структурированный отчёт аудита (D-005, D-019). Состояние проверяемого дерева фиксируется отпечатком, а не только commit SHA; процентный рейтинг отсутствует по замыслу.",
"type": "object",
"additionalProperties": false,
"required": ["id", "generated_at", "tool", "subject", "spec_version", "findings"],
"properties": {
"id": { "type": "string", "pattern": "^rep-[a-z0-9]+(-[a-z0-9]+)*$" },
"generated_at": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
"tool": {
"type": "object",
"additionalProperties": false,
"required": ["name", "version"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" }
}
},
"agent": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"version": { "type": "string", "minLength": 1 }
},
"description": "Агент семантической части, если она выполнялась."
},
"subject": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "fingerprint"],
"properties": {
"kind": { "enum": ["repository", "directory", "spec"] },
"fingerprint": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
"revision": { "type": "string", "minLength": 1 },
"dirty": { "type": "boolean" }
}
},
"spec_version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" },
"profiles": {
"type": "array",
"items": { "type": "string", "pattern": "^prof-[a-z0-9]+(-[a-z0-9]+)*$" }
},
"findings": {
"type": "array",
"items": { "$ref": "https://baseline-harness.dev/spec/schemas/audit-finding.schema.json" }
},
"summary": {
"type": "object",
"additionalProperties": false,
"required": ["PASS", "FAIL", "PARTIAL", "EXEMPT", "NOT_APPLICABLE", "UNKNOWN", "BLOCKED"],
"properties": {
"PASS": { "type": "integer", "minimum": 0 },
"FAIL": { "type": "integer", "minimum": 0 },
"PARTIAL": { "type": "integer", "minimum": 0 },
"EXEMPT": { "type": "integer", "minimum": 0 },
"NOT_APPLICABLE": { "type": "integer", "minimum": 0 },
"UNKNOWN": { "type": "integer", "minimum": 0 },
"BLOCKED": { "type": "integer", "minimum": 0 }
},
"description": "Сверка сумм с findings — задача bhl report validate (BHL-023)."
},
"notes": { "type": "array", "items": { "type": "string", "minLength": 3 } }
}
}
@@ -0,0 +1,23 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/capability.schema.json",
"title": "Capability",
"description": "Средний уровень иерархии Domain → Capability → Atomic Requirement (D-009).",
"type": "object",
"additionalProperties": false,
"required": ["id", "domain", "title", "description"],
"properties": {
"id": {
"type": "string",
"pattern": "^cap-[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Постоянный идентификатор (D-031)."
},
"domain": {
"type": "string",
"pattern": "^dom-[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Ссылка на существующий домен; целостность проверяет валидатор (BHL-011)."
},
"title": { "type": "string", "minLength": 3 },
"description": { "type": "string", "minLength": 10 }
}
}
@@ -0,0 +1,104 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/data-access-policy.schema.json",
"title": "Data Access Policy",
"description": "Политика доступа к данным проекта (D-024). Консервативный default: чтение репозитория или сессии не включает автоматически копирование, хранение и передачу. Каждое разрешение allow — со ссылкой на решение владельца.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"project",
"default",
"actions"
],
"properties": {
"id": {
"type": "string",
"pattern": "^dap-[a-z0-9-]+$"
},
"project": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9-]*$",
"description": "Идентификатор проекта из реестра sources/<project-id>.md."
},
"default": {
"const": "deny",
"description": "Консервативное значение по умолчанию: всё, что не разрешено явно, запрещено."
},
"actions": {
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"description": "Действия перечислены раздельно: разрешение одного не распространяется на другие.",
"properties": {
"read-original": {
"$ref": "#/$defs/rule"
},
"copy-to-lab": {
"$ref": "#/$defs/rule"
},
"retain-derived": {
"$ref": "#/$defs/rule"
},
"transmit-external-model": {
"$ref": "#/$defs/rule"
},
"publish": {
"$ref": "#/$defs/rule"
}
}
},
"notes": {
"type": "string",
"minLength": 3
}
},
"$defs": {
"rule": {
"type": "object",
"additionalProperties": false,
"required": [
"effect"
],
"properties": {
"effect": {
"enum": [
"allow",
"deny"
]
},
"reason": {
"type": "string",
"minLength": 3
},
"decision_ref": {
"type": "string",
"pattern": "^D-\\d{3}$",
"description": "Ссылка на принятое решение владельца (Backlog.md Decisions)."
}
},
"allOf": [
{
"if": {
"properties": {
"effect": {
"const": "allow"
}
},
"required": [
"effect"
]
},
"then": {
"properties": {
"decision_ref": true
},
"required": [
"decision_ref"
]
}
}
]
}
}
}
@@ -0,0 +1,18 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/domain.schema.json",
"title": "Domain",
"description": "Верхний уровень иерархии спецификации BHS (D-009).",
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "description"],
"properties": {
"id": {
"type": "string",
"pattern": "^dom-[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Постоянный идентификатор (D-031): не зависит от имени, пути и позиции."
},
"title": { "type": "string", "minLength": 3 },
"description": { "type": "string", "minLength": 10 }
}
}
@@ -0,0 +1,26 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/evidence.schema.json",
"title": "Evidence",
"description": "Доказательство для Audit Finding (D-005, D-019). Класс доказательств отличает наблюдение от интерпретации.",
"type": "object",
"additionalProperties": false,
"required": ["kind", "locator", "description"],
"properties": {
"kind": {
"enum": ["file", "command-output", "test-run", "session-observation", "review-note", "hash", "other"]
},
"locator": {
"type": "string",
"minLength": 1,
"description": "Путь, команда или идентификатор наблюдения."
},
"description": { "type": "string", "minLength": 3 },
"fingerprint": {
"type": "string",
"pattern": "^sha256:[a-f0-9]{64}$",
"description": "Отпечаток состояния источника доказательства (D-019)."
},
"captured_at": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
}
}
@@ -0,0 +1,31 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/normative-change.schema.json",
"title": "Normative Change",
"description": "Запись канонического журнала нормативных изменений BHS (D-011). История в требованиях не дублируется: требование несёт только history_ref.",
"type": "object",
"additionalProperties": false,
"required": ["id", "release", "date", "type", "requirements", "description"],
"properties": {
"id": {
"type": "string",
"pattern": "^chg-[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Постоянный идентификатор (D-031)."
},
"release": {
"type": "string",
"pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$",
"description": "Версия спецификации, в которой изменение опубликовано."
},
"date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
"type": { "enum": ["ADDED", "STRENGTHENED", "RELAXED", "CLARIFIED", "DEPRECATED", "REMOVED"] },
"requirements": {
"type": "array",
"minItems": 1,
"items": { "type": "string", "pattern": "^req-[a-z0-9]+(-[a-z0-9]+)*$" }
},
"description": { "type": "string", "minLength": 10 },
"motivation": { "type": "string", "minLength": 3 },
"migration": { "type": "string", "minLength": 3, "description": "Инструкция переноса для потребителей при REMOVED/STRENGTHENED." }
}
}
@@ -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"] } } } }
}
}
}
]
}
@@ -0,0 +1,20 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/preset.schema.json",
"title": "Preset",
"description": "Именованная композиция профилей (D-013): разворачивается в набор профилей до разрешения.",
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "description", "profiles"],
"properties": {
"id": { "type": "string", "pattern": "^preset-[a-z0-9]+(-[a-z0-9]+)*$" },
"title": { "type": "string", "minLength": 3 },
"description": { "type": "string", "minLength": 10 },
"profiles": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "pattern": "^prof-[a-z0-9]+(-[a-z0-9]+)*$" }
}
}
}
@@ -0,0 +1,40 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/profile.schema.json",
"title": "Profile",
"description": "Композиционный профиль (D-013, D-002): набор требований и переопределений параметров. Ослабление только явное (relax_to).",
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "description", "requirements"],
"properties": {
"id": { "type": "string", "pattern": "^prof-[a-z0-9]+(-[a-z0-9]+)*$" },
"title": { "type": "string", "minLength": 3 },
"description": { "type": "string", "minLength": 10 },
"requirements": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["requirement"],
"properties": {
"requirement": { "type": "string", "pattern": "^req-[a-z0-9]+(-[a-z0-9]+)*$" },
"relax_to": { "enum": ["SHOULD", "MAY"] },
"note": { "type": "string", "minLength": 3 }
}
}
},
"parameter_overrides": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["parameter", "value"],
"properties": {
"parameter": { "type": "string", "pattern": "^param-[a-z0-9]+(-[a-z0-9]+)*$" },
"value": {}
}
}
}
}
}
@@ -0,0 +1,46 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/project-exception.schema.json",
"title": "Project Exception",
"description": "Документированное обоснованное исключение, утверждаемое владельцем (D-002, D-008). Отличие от N/A: N/A — требование неприменимо, EXEMPT — применимо, но снято обоснованным решением. Не проходит: исключение без области, причины, ссылки на решение владельца или условия пересмотра.",
"type": "object",
"additionalProperties": false,
"required": ["id", "requirement", "scope", "reason", "decision_ref", "review_condition"],
"properties": {
"id": {
"type": "string",
"pattern": "^ex-[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Постоянный идентификатор (D-031)."
},
"requirement": { "type": "string", "pattern": "^req-[a-z0-9]+(-[a-z0-9]+)*$" },
"scope": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "description"],
"properties": {
"kind": { "enum": ["path", "capability", "tool", "other"] },
"paths": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
"description": { "type": "string", "minLength": 10 }
},
"allOf": [
{
"if": { "properties": { "kind": { "const": "path" } }, "required": ["kind"] },
"then": { "required": ["paths"], "properties": { "paths": true } }
}
]
},
"reason": { "type": "string", "minLength": 10 },
"decision_ref": {
"type": "string",
"minLength": 3,
"description": "Ссылка на утверждённое решение владельца (например, решение Backlog D-0xx). Без неё исключение неутверждённое."
},
"review_condition": { "type": "string", "minLength": 3 },
"expires": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
"status": {
"enum": ["active", "revoked", "expired"],
"default": "active",
"description": "Состояние исключения; не смешивается с жизненным циклом требования."
}
}
}
@@ -0,0 +1,41 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baseline-harness.dev/spec/schemas/project-manifest.schema.json",
"title": "Project Manifest",
"description": "Источник истины о подключении проекта к спецификации (D-008): версия спецификации, выбранные профили/пресеты, проектный слой параметров и исключения. Манифест не переопределяет требования и не дублирует реестр проектов; независимо редактируемые копии конфигурации запрещены — проектные значения живут только здесь.",
"type": "object",
"additionalProperties": false,
"required": ["project", "spec_version", "profiles"],
"properties": {
"project": { "type": "string", "minLength": 1 },
"spec_version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" },
"profiles": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "pattern": "^prof-[a-z0-9]+(-[a-z0-9]+)*$" }
},
"presets": {
"type": "array",
"uniqueItems": true,
"items": { "type": "string", "pattern": "^preset-[a-z0-9]+(-[a-z0-9]+)*$" }
},
"parameter_overrides": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["parameter", "value"],
"properties": {
"parameter": { "type": "string", "pattern": "^param-[a-z0-9]+(-[a-z0-9]+)*$" },
"value": {}
}
}
},
"exceptions": {
"type": "array",
"items": { "$ref": "https://baseline-harness.dev/spec/schemas/project-exception.schema.json" }
},
"note": { "type": "string", "minLength": 3 }
}
}
@@ -0,0 +1,129 @@
{
"$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); история не дублируется."
}
}
}