spec: add reporting governance event model

This commit is contained in:
Eve
2026-05-07 15:55:53 +08:00
parent 299ded3cdf
commit 6921217ca3
3 changed files with 1243 additions and 0 deletions

View File

@@ -0,0 +1,169 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cowbay.org/schemas/reporting-governance/event-envelope.schema.json",
"title": "Reporting Governance Event Envelope",
"description": "Canonical top-level envelope for reporting-governance plugin events.",
"type": "object",
"additionalProperties": false,
"required": [
"event_id",
"event_type",
"runtime",
"adapter_version",
"agent_id",
"task_id",
"correlation_id",
"timestamp",
"payload",
"evidence_refs",
"operator_context"
],
"properties": {
"event_id": {
"type": "string",
"minLength": 1,
"description": "Unique event identifier."
},
"event_type": {
"type": "string",
"enum": [
"task_started",
"task_checkpoint_due",
"task_checkpoint_sent",
"task_status_changed",
"task_claimed_complete",
"task_evidence_attached",
"subagent_spawned",
"subagent_spawn_failed",
"subagent_completed",
"subagent_result_forwarded",
"subagent_result_not_forwarded",
"silence_timeout",
"watchdog_fired",
"operator_review_requested",
"report_anchor_missing",
"forced_operator_update"
],
"description": "Canonical reporting-governance event type."
},
"runtime": {
"type": "string",
"minLength": 1
},
"adapter_version": {
"type": "string",
"minLength": 1
},
"agent_id": {
"type": "string",
"minLength": 1
},
"task_id": {
"type": "string",
"minLength": 1
},
"correlation_id": {
"type": "string",
"minLength": 1
},
"timestamp": {
"type": "string",
"format": "date-time"
},
"payload": {
"type": "object",
"description": "Event-specific payload validated by the event catalog schema."
},
"evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
},
"operator_context": {
"$ref": "#/$defs/operatorContext"
}
},
"$defs": {
"evidenceRef": {
"type": "object",
"additionalProperties": true,
"required": [
"kind",
"ref"
],
"properties": {
"kind": {
"type": "string",
"minLength": 1
},
"ref": {
"type": "string",
"minLength": 1
},
"label": {
"type": "string"
},
"sha256": {
"type": "string"
},
"mime_type": {
"type": "string"
}
}
},
"reportAnchor": {
"type": "object",
"additionalProperties": true,
"required": [
"present"
],
"properties": {
"present": {
"type": "boolean"
},
"anchor_id": {
"type": "string"
},
"anchor_kind": {
"type": "string"
}
}
},
"operatorContext": {
"type": "object",
"additionalProperties": true,
"required": [
"channel",
"report_anchor",
"reporting_mode",
"silent_task"
],
"properties": {
"channel": {
"type": "string",
"minLength": 1
},
"operator_id": {
"type": "string"
},
"report_anchor": {
"$ref": "#/$defs/reportAnchor"
},
"reporting_mode": {
"type": "string",
"minLength": 1
},
"silent_task": {
"type": "boolean"
},
"checkpoint_policy_id": {
"type": "string"
},
"watchdog_policy_id": {
"type": "string"
}
}
}
}
}