the-custodian/canon/standards/schemas/work-records/decision.schema.json

44 lines
2 KiB
JSON
Raw Normal View History

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://canon.coulomb.social/schemas/work-records/decision.schema.json",
"title": "Decision",
"description": "Authored YAML block for kind=decision (approval package + resolution). Id: {PREFIX}-DEC-YYYY-NNN; legacy DEC-YYYY-NNN grandfathered. Lifecycle: prepared -> resolved(approved|rejected|revised|deferred). 'deferred' is also accepted as a stored status (legacy binky template).",
"type": "object",
"required": ["id", "title", "status", "lane"],
"properties": {
"id": { "type": "string", "pattern": "^([A-Z]+-)?DEC-[0-9]{4}-[0-9]{3}$" },
"kind": { "const": "decision" },
"title": { "type": "string", "minLength": 5 },
"status": { "enum": ["prepared", "resolved", "deferred"] },
"outcome": {
"type": "string",
"description": "Free text beginning with approved|rejected|revised|deferred; qualifiers allowed (e.g. 'approved with edits')."
},
"lane": { "$ref": "spine.schema.json#/$defs/lane" },
"owner": { "$ref": "spine.schema.json#/$defs/owner" },
"tags": { "$ref": "spine.schema.json#/$defs/tags" },
"created_at": { "$ref": "spine.schema.json#/$defs/date" },
"needed_by": { "type": "string" },
"attention_cost": { "type": "string" },
"agent_recommendation": { "type": "string" },
"evidence": { "type": "array" },
"options": { "type": "array" },
"fallback_if_no_response": { "type": "string" },
"resolved_at": { "$ref": "spine.schema.json#/$defs/date" },
"resolved_by": { "type": "string" },
"consequence": { "type": "string" },
"state_hub_decision_id": { "$ref": "spine.schema.json#/$defs/uuid" }
},
"allOf": [
{
"if": { "properties": { "status": { "const": "resolved" } }, "required": ["status"] },
"then": { "required": ["outcome", "resolved_at", "resolved_by"] }
},
{
"if": { "properties": { "status": { "const": "prepared" } }, "required": ["status"] },
"then": { "required": ["agent_recommendation", "fallback_if_no_response"] }
}
],
"additionalProperties": true
}