Files
harness-lab/examples/synthetic-spec/schemas/data-access-policy.schema.json
T
Suslov-MD 8c1f26e344 feat: схема политиков доступа к данным (BHL-034)
- data-access-policy: default deny; действия read/copy/retain/transmit/
  publish раздельно — чтение не влечёт копирование, хранение, передачу
- allow только с decision_ref владельца; неизвестные действия отвергаются
- применение к записям реестра описано в sources/README (D-024)
- копия схемы в examples/synthetic-spec/schemas; тесты 56/56
2026-11-29 03:04:17 +03:00

105 lines
2.9 KiB
JSON

{
"$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"
]
}
}
]
}
}
}