Files
breadcrumb-the-shire/agent-system/contracts/finalizer.schema.json

106 lines
2.6 KiB
JSON
Raw Normal View History

2026-03-06 00:44:52 +01:00
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Finalizer Output",
"type": "object",
"required": [
"task_id",
"ready_to_finalize",
"guard_review",
"acceptance_review",
"ci_status",
"final_action"
],
"properties": {
"task_id": { "type": "string", "minLength": 1 },
"ready_to_finalize": { "type": "boolean" },
"guard_review": { "type": "string", "enum": ["pass", "fail"] },
"acceptance_review": { "type": "string", "enum": ["pass", "fail"] },
"ci_status": { "type": "string", "enum": ["pass", "fail", "unknown"] },
"final_action": { "type": "string", "enum": ["commit", "merge", "hold"] },
"hold_reason": { "type": "string", "minLength": 1 },
"commit_message": { "type": "string" },
"notes": { "type": "string" }
},
"allOf": [
{
"if": {
"properties": { "final_action": { "const": "hold" } },
"required": ["final_action"]
},
"then": {
"required": ["hold_reason"]
}
},
{
"if": {
"properties": {
"final_action": { "enum": ["commit", "merge"] }
},
"required": ["final_action"]
},
"then": {
"properties": {
"ready_to_finalize": { "const": true },
"guard_review": { "const": "pass" },
"acceptance_review": { "const": "pass" },
"ci_status": { "const": "pass" }
}
}
},
{
"if": {
"properties": { "ci_status": { "const": "fail" } },
"required": ["ci_status"]
},
"then": {
"properties": { "final_action": { "enum": ["hold"] } }
}
},
{
"if": {
"properties": {
"guard_review": { "const": "fail" }
},
"required": ["guard_review"]
},
"then": {
"properties": { "final_action": { "enum": ["hold"] } }
}
},
{
"if": {
"properties": {
"acceptance_review": { "const": "fail" }
},
"required": ["acceptance_review"]
},
"then": {
"properties": { "final_action": { "enum": ["hold"] } }
}
},
{
"if": {
"properties": {
"ci_status": { "const": "unknown" }
},
"required": ["ci_status"]
},
"then": {
"properties": { "final_action": { "enum": ["hold"] } }
}
},
{
"if": {
"properties": {
"ready_to_finalize": { "const": false }
},
"required": ["ready_to_finalize"]
},
"then": {
"properties": { "final_action": { "enum": ["hold"] } }
}
}
],
"additionalProperties": false
}