Автономность продукта bhl-cli: тестовые данные внутри дерева (BHL-069)
Фикстура examples/synthetic-spec перенесена через git mv в products/bhl-cli/tests/fixtures/synthetic-spec (26 файлов), каталог examples/ в корне удалён: тестовые данные принадлежат дереву продукта (D-055). Нормативное требование req-single-quality-command закреплено в tests/fixtures/normative/ побайтовой копией с описанием происхождения и процедуры обновления — копия заменяется целиком, точечные правки запрещены. Актуальность копии исполняет проверка, а не читатель: tests/normative-sync.test.mjs сверяет байты копии с файлом нормативного дерева, путь которого разрешается через products.yaml по идентификатору продукта bhs-spec. Пока дерево products/bhs-spec не создано, тест использует задокументированный переходный откат на spec/ с указанием условия его удаления (BHL-066). Вне лаборатории тест пропускается: нормативное дерево — соседний продукт, а не зависимость npm-артефакта. Идентификаторы фикстуры в исполняемом коде решены по выбору владельца: привязки req-synth-* в реестре CHECKS сохранены, потому что после переезда фикстуры это собственные идентификаторы продукта, а их удаление оставило бы движок аудита без исполнения проверок lockfile и конфигурации CI. Вместо косметической чистки добавлен охраняющий тест tests/check-registry.test.mjs: посторонний идентификатор требования в поставляемом реестре даёт падение, отдельный контроль не позволяет удовлетворить охрану пустым реестром. CHECKS экспортирован только для теста; контракт вывода и коды выхода не изменены. Корневой тест синтетической спецификации разделён с объяснением выбора: поведение CLI на собственной фикстуре переехало в продукт (tests/fixture.test.mjs), межпродуктовая сверка копии схем с нормативным деревом осталась корневым интеграционным прогоном и переименована в tests/spec-schema-copy.test.mjs — корень спецификации обязан валидироваться без файлов лаборатории, поэтому копия схем необходима. Из дерева убраны markdown-ссылки в приватные каталоги лаборатории (library/, experiments/, spec/): происхождение осталось именем и путём в тексте, содержимое дерева потенциально публично целиком. Ссылка README на ../../spec/schemas/ сохранена как ссылка на соседнее продуктовое дерево. Проверки: местный quality gate — 56/56 зелёных (добавлено 8 тестов); изолированная копия дерева через rsync во временный каталог без node_modules и dist проходит npm ci --ignore-scripts и npm run quality — 55 зелёных и 1 пропуск (проверка свежести копии вне лаборатории пропускается, а не падает); npm pack → установка tarball → bhl version: артефакт 23 файла, тестов, фикстур и нормативной копии в нём нет; корневые npm run check — 0 ошибок и 0 предупреждений при 3 продуктах, npm test — 63/63, backlog doctor — без дубликатов и циклов. Находка: нормативный файл req-single-quality-command.yaml содержит текстовые ссылки на лабораторные пути (rationale, lifecycle.note), которые копия приносит в публичное дерево; правка возможна только нормативным изменением (D-020), потому что изменение байтов копии рассинхронизировало бы сверку с SSOT.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
changes:
|
||||
- id: chg-synth-init
|
||||
release: 0.0.0
|
||||
date: 2026-11-28
|
||||
type: ADDED
|
||||
requirements: [req-synth-alpha, req-synth-beta, req-synth-gamma]
|
||||
description: >-
|
||||
Синтетические требования введены в инфраструктурный пример для
|
||||
сквозных прогонов валидации и разрешения.
|
||||
motivation: >-
|
||||
Инфраструктура должна проверяться на полном наборе сущностей до
|
||||
согласования содержательной редакции BHS 0.1.0.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Синтетическая спецификация (тестовая фикстура `bhl-cli`)
|
||||
|
||||
Инфраструктурная фикстура продукта `bhl-cli`: синтетическая спецификация для прогонов
|
||||
валидации, разрешения и аудита (BHL-018). В дерево продукта переехала из
|
||||
`examples/synthetic-spec/` лаборатории по BHL-069, потому что тестовые данные принадлежат
|
||||
дереву продукта (D-055). Она **не является** содержательной редакцией BHS 0.1.0 (D-021):
|
||||
сущности вымышленные, формулировки служебные. Содержательная спецификация согласуется с
|
||||
владельцем отдельно (BHL-038).
|
||||
|
||||
Содержимое:
|
||||
|
||||
- `domains/`, `capabilities/`, `requirements/`, `parameters/` — минимальный набор
|
||||
сущностей со связями и типизированным параметром;
|
||||
- `profiles/` и `presets/` — явное ослабление и переопределение параметра;
|
||||
- `antipatterns/` — антипаттерн, связанный с требованием;
|
||||
- `CHANGELOG.yaml` — одна запись ADDED;
|
||||
- `schemas/` — побайтовая копия `schemas/` нормативного дерева `bhs-spec`: корень
|
||||
спецификации обязан быть самодостаточным, чтобы валидироваться без файлов лаборатории.
|
||||
Расхождение копии ловит межпродуктовый тест лаборатории `tests/spec-schema-copy.test.mjs`;
|
||||
копия обновляется переносом файлов нормативного дерева целиком, а не точечной правкой.
|
||||
|
||||
Идентификаторы `req-synth-*`, `dom-synth-*`, `cap-synth-*`, `param-synth-*`, `prof-synth-*`,
|
||||
`preset-synth-all` и `ant-synth-*` — собственные идентификаторы этого продукта: на них
|
||||
опираются тесты дерева и записи реестра детерминированных проверок аудита
|
||||
(`src/audit.ts`, охраняется `tests/check-registry.test.mjs`).
|
||||
|
||||
Прогоны из каталога продукта:
|
||||
|
||||
```text
|
||||
npm run bhl -- validate tests/fixtures/synthetic-spec
|
||||
npm run bhl -- profile resolve tests/fixtures/synthetic-spec --preset preset-synth-all
|
||||
```
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
id: ant-synth-late-check
|
||||
title: Проверка синтетического артефакта после отправки
|
||||
description: >-
|
||||
Проверка выполняется после отправки артефакта в реестр примеров, тогда
|
||||
как результат уже не влияет на отправку.
|
||||
level: MUST NOT
|
||||
lifecycle:
|
||||
status: proposed
|
||||
since: '2026-11-28'
|
||||
note: Инфраструктурный пример (BHL-018), не содержательная редакция BHS.
|
||||
relations:
|
||||
- target: req-synth-gamma
|
||||
kind: contradicts
|
||||
sources:
|
||||
- material: tests/fixtures/synthetic-spec/README.md
|
||||
note: Служебное происхождение — инфраструктурный пример, не грабля проекта.
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
id: cap-synth-verify
|
||||
domain: dom-synth-build
|
||||
title: Синтетическая проверка
|
||||
description: >-
|
||||
Вымышленная возможность проверки для прогонов валидации и разрешения
|
||||
профилей. Не является частью содержательной спецификации BHS.
|
||||
@@ -0,0 +1,5 @@
|
||||
id: dom-synth-build
|
||||
title: Синтетическая сборка
|
||||
description: >-
|
||||
Вымышленная область сборки для инфраструктурных прогонов валидации и
|
||||
разрешения. Не является частью содержательной спецификации BHS.
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
id: param-synth-mode
|
||||
type: enum
|
||||
description: Режим вывода синтетического прогона для проверки реестра параметров.
|
||||
default: json
|
||||
constraints:
|
||||
values: [json, plain]
|
||||
overridable_by: [profile]
|
||||
@@ -0,0 +1,6 @@
|
||||
id: preset-synth-all
|
||||
title: Полный синтетический набор
|
||||
description: >-
|
||||
Пресет обоих синтетических профилей для сквозных прогонов разрешения
|
||||
валидации, разрешения и аудита.
|
||||
profiles: [prof-synth-light, prof-synth-strict]
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
id: prof-synth-light
|
||||
title: Облегчённый синтетический профиль
|
||||
description: >-
|
||||
Явно ослабляет проверку до отправки и переопределяет бюджет подготовки
|
||||
для инфраструктурных прогонов разрешения.
|
||||
requirements:
|
||||
- requirement: req-synth-alpha
|
||||
relax_to: SHOULD
|
||||
note: ослабление только явное
|
||||
parameter_overrides:
|
||||
- parameter: param-synth-budget
|
||||
value: 4
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
id: prof-synth-strict
|
||||
title: Строгий синтетический профиль
|
||||
description: >-
|
||||
Не ослабляет требования и переопределяет режим вывода из реестра
|
||||
параметров для инфраструктурных прогонов разрешения.
|
||||
requirements:
|
||||
- requirement: req-synth-alpha
|
||||
- requirement: req-synth-beta
|
||||
- requirement: req-synth-gamma
|
||||
parameter_overrides:
|
||||
- parameter: param-synth-mode
|
||||
value: plain
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
id: req-synth-alpha
|
||||
domain: dom-synth-build
|
||||
capability: cap-synth-verify
|
||||
title: Проверка до отправки
|
||||
statement: >-
|
||||
Синтетический артефакт MUST проходить проверку перед отправкой в реестр
|
||||
примеров.
|
||||
level: MUST
|
||||
rationale: >-
|
||||
Служебное требование для проверки разрешения профилей и параметров;
|
||||
содержательного смысла для стандарта не несёт.
|
||||
applicability:
|
||||
- when: отправка синтетического артефакта
|
||||
unless: отправка выполняется в dry-run режиме
|
||||
parameters:
|
||||
- id: param-synth-budget
|
||||
type: integer
|
||||
description: Часов подготовки синтетического артефакта до проверки.
|
||||
default: 2
|
||||
constraints:
|
||||
minimum: 0
|
||||
maximum: 8
|
||||
acceptance_criteria:
|
||||
- criterion: Проверка выполнена до отправки
|
||||
measure: журнал прогона предшествует записи об отправке
|
||||
verification:
|
||||
kind: deterministic
|
||||
procedure: Детерминированная проверка порядка событий в журнале примера.
|
||||
automation: bhl audit
|
||||
expected_evidence:
|
||||
- kind: test-run
|
||||
description: Журнал прогона проверки с отметкой времени
|
||||
relations:
|
||||
- target: req-synth-beta
|
||||
kind: depends-on
|
||||
lifecycle:
|
||||
status: proposed
|
||||
since: '2026-11-28'
|
||||
note: Инфраструктурный пример (BHL-018), не содержательная редакция BHS.
|
||||
history_ref: CHANGELOG.yaml
|
||||
antipatterns:
|
||||
- ant-synth-late-check
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
id: req-synth-beta
|
||||
domain: dom-synth-build
|
||||
capability: cap-synth-verify
|
||||
title: Документирование шагов примера
|
||||
statement: >-
|
||||
Синтетический пример SHOULD документировать шаги воспроизведения в README.
|
||||
level: SHOULD
|
||||
rationale: >-
|
||||
Служебное требование для проверки разрешения параметров из реестра;
|
||||
содержательного смысла для стандарта не несёт.
|
||||
applicability:
|
||||
- when: публикация синтетического примера
|
||||
parameters:
|
||||
- id: param-synth-mode
|
||||
type: enum
|
||||
description: Режим вывода синтетического прогона для проверки реестра параметров.
|
||||
default: json
|
||||
constraints:
|
||||
values: [json, plain]
|
||||
acceptance_criteria:
|
||||
- criterion: Шаги воспроизведения описаны
|
||||
measure: README примера содержит команды прогона
|
||||
verification:
|
||||
kind: deterministic
|
||||
procedure: Проверка наличия раздела шагов воспроизведения в README примера.
|
||||
automation: bhl audit
|
||||
expected_evidence:
|
||||
- kind: file
|
||||
description: README примера с разделом шагов
|
||||
lifecycle:
|
||||
status: proposed
|
||||
since: '2026-11-28'
|
||||
note: Инфраструктурный пример (BHL-018), не содержательная редакция BHS.
|
||||
history_ref: CHANGELOG.yaml
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
id: req-synth-gamma
|
||||
domain: dom-synth-build
|
||||
capability: cap-synth-verify
|
||||
title: Проверка после отправки запрещена
|
||||
statement: >-
|
||||
Синтетический артефакт MUST NOT проверяться после отправки в реестр примеров.
|
||||
level: MUST NOT
|
||||
rationale: >-
|
||||
Служебное требование для проверки связей антипаттернов; содержательного
|
||||
смысла для стандарта не несёт.
|
||||
applicability:
|
||||
- when: отправка синтетического артефакта
|
||||
acceptance_criteria:
|
||||
- criterion: Проверка не выполняется после отправки
|
||||
measure: журнал не содержит проверок позже отметки отправки
|
||||
verification:
|
||||
kind: deterministic
|
||||
procedure: Детерминированная проверка порядка событий в журнале примера.
|
||||
automation: bhl audit
|
||||
expected_evidence:
|
||||
- kind: test-run
|
||||
description: Журнал прогона с отметками времени относительно отправки
|
||||
lifecycle:
|
||||
status: proposed
|
||||
since: '2026-11-28'
|
||||
note: Инфраструктурный пример (BHL-018), не содержательная редакция BHS.
|
||||
history_ref: CHANGELOG.yaml
|
||||
+62
@@ -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 }
|
||||
}
|
||||
}
|
||||
+50
@@ -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"] } }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+68
@@ -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 } }
|
||||
}
|
||||
}
|
||||
+23
@@ -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 }
|
||||
}
|
||||
}
|
||||
+104
@@ -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}$" }
|
||||
}
|
||||
}
|
||||
+31
@@ -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": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -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": "Состояние исключения; не смешивается с жизненным циклом требования."
|
||||
}
|
||||
}
|
||||
}
|
||||
+41
@@ -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 }
|
||||
}
|
||||
}
|
||||
+129
@@ -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); история не дублируется."
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user