{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:awoooi:ai-agent-action-owner-acceptance-event-bus-v1",
  "title": "AWOOOI AI Agent action owner acceptance event bus v1",
  "description": "P2-411 承接 P2-409 / P2-410，建立 owner response acceptance、Agent handoff event 與 RAG memory proposal 的 no-write 基線。此 schema 只允許 committed snapshot、owner acceptance lane、handoff event template、RAG proposal 與 governance readback；不授權 event bus publish、audit DB、timeline、KM、PlayBook trust、Gateway queue、Telegram、Bot API、production write、secret read、host write、kubectl 或不可逆操作。",
  "type": "object",
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "source_refs",
    "source_readbacks",
    "event_bus_truth",
    "owner_acceptance_lanes",
    "handoff_event_templates",
    "rag_memory_proposals",
    "verifier_gates",
    "activation_boundaries",
    "display_redaction_contract",
    "rollups",
    "next_actions"
  ],
  "properties": {
    "schema_version": { "type": "string", "const": "ai_agent_action_owner_acceptance_event_bus_v1" },
    "generated_at": { "type": "string", "minLength": 1 },
    "program_status": {
      "type": "object",
      "required": [
        "overall_completion_percent",
        "current_priority",
        "current_task_id",
        "next_task_id",
        "read_only_mode",
        "runtime_authority",
        "status_note"
      ],
      "properties": {
        "overall_completion_percent": { "type": "integer", "const": 100 },
        "current_priority": { "type": "string", "const": "P0" },
        "current_task_id": { "type": "string", "const": "P2-411" },
        "next_task_id": { "type": "string", "const": "P2-412" },
        "read_only_mode": { "type": "boolean", "const": true },
        "runtime_authority": { "type": "string", "const": "agent_action_owner_acceptance_event_bus_no_write_committed_snapshot" },
        "status_note": { "type": "string", "minLength": 1 }
      },
      "additionalProperties": false
    },
    "source_refs": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
    "source_readbacks": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/source_readback" } },
    "event_bus_truth": { "type": "object", "additionalProperties": { "type": ["boolean", "integer", "string"] } },
    "owner_acceptance_lanes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/owner_acceptance_lane" } },
    "handoff_event_templates": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/handoff_event_template" } },
    "rag_memory_proposals": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/rag_memory_proposal" } },
    "verifier_gates": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/verifier_gate" } },
    "activation_boundaries": { "type": "object", "additionalProperties": { "type": "boolean" } },
    "display_redaction_contract": { "type": "object", "additionalProperties": { "type": ["boolean", "array", "string"] } },
    "rollups": { "type": "object", "additionalProperties": { "type": ["integer", "array"] } },
    "next_actions": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/next_action" } }
  },
  "$defs": {
    "source_readback": {
      "type": "object",
      "required": [
        "readback_id",
        "source_schema_version",
        "source_ref",
        "endpoint",
        "owner_agent",
        "status",
        "key_readback",
        "next_action"
      ],
      "properties": {
        "readback_id": { "type": "string", "minLength": 1 },
        "source_schema_version": { "type": "string", "minLength": 1 },
        "source_ref": { "type": "string", "minLength": 1 },
        "endpoint": { "type": "string", "minLength": 1 },
        "owner_agent": { "type": "string", "enum": ["openclaw", "hermes", "nemotron", "sre", "security", "devops"] },
        "status": { "type": "string", "minLength": 1 },
        "key_readback": { "type": "string", "minLength": 1 },
        "next_action": { "type": "string", "minLength": 1 }
      },
      "additionalProperties": false
    },
    "owner_acceptance_lane": {
      "type": "object",
      "required": [
        "lane_id",
        "display_name",
        "owner_agent",
        "risk_tier",
        "source_readback_ids",
        "required_owner_fields",
        "required_evidence_refs",
        "acceptance_status",
        "acceptance_decision",
        "response_received",
        "acceptance_passed",
        "acceptance_rejected",
        "runtime_write_allowed",
        "event_bus_publish_allowed",
        "telegram_send_allowed",
        "rag_write_allowed",
        "side_effect_count",
        "next_gate"
      ],
      "properties": {
        "lane_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "owner_agent": { "type": "string", "enum": ["openclaw", "hermes", "nemotron", "sre", "security", "devops"] },
        "risk_tier": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
        "source_readback_ids": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "required_owner_fields": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "required_evidence_refs": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "acceptance_status": { "type": "string", "enum": ["blocked_no_external_response", "blocked_missing_fields", "candidate_only_no_write"] },
        "acceptance_decision": { "type": "string", "const": "not_evaluated" },
        "response_received": { "type": "boolean", "const": false },
        "acceptance_passed": { "type": "boolean", "const": false },
        "acceptance_rejected": { "type": "boolean", "const": false },
        "runtime_write_allowed": { "type": "boolean", "const": false },
        "event_bus_publish_allowed": { "type": "boolean", "const": false },
        "telegram_send_allowed": { "type": "boolean", "const": false },
        "rag_write_allowed": { "type": "boolean", "const": false },
        "side_effect_count": { "type": "integer", "const": 0 },
        "next_gate": { "type": "string", "minLength": 1 }
      },
      "additionalProperties": false
    },
    "handoff_event_template": {
      "type": "object",
      "required": [
        "event_id",
        "display_name",
        "producer_agent",
        "consumer_agent",
        "event_stage",
        "risk_tier",
        "source_lane_ids",
        "required_event_fields",
        "blocked_writes",
        "event_bus_write_allowed",
        "audit_db_write_allowed",
        "timeline_write_allowed",
        "km_write_allowed",
        "playbook_trust_write_allowed",
        "gateway_queue_write_allowed",
        "telegram_send_allowed",
        "production_write_allowed",
        "side_effect_count",
        "next_gate"
      ],
      "properties": {
        "event_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "producer_agent": { "type": "string", "enum": ["openclaw", "hermes", "nemotron", "sre", "security", "devops"] },
        "consumer_agent": { "type": "string", "enum": ["openclaw", "hermes", "nemotron", "sre", "security", "devops"] },
        "event_stage": { "type": "string", "minLength": 1 },
        "risk_tier": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
        "source_lane_ids": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "required_event_fields": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "blocked_writes": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "event_bus_write_allowed": { "type": "boolean", "const": false },
        "audit_db_write_allowed": { "type": "boolean", "const": false },
        "timeline_write_allowed": { "type": "boolean", "const": false },
        "km_write_allowed": { "type": "boolean", "const": false },
        "playbook_trust_write_allowed": { "type": "boolean", "const": false },
        "gateway_queue_write_allowed": { "type": "boolean", "const": false },
        "telegram_send_allowed": { "type": "boolean", "const": false },
        "production_write_allowed": { "type": "boolean", "const": false },
        "side_effect_count": { "type": "integer", "const": 0 },
        "next_gate": { "type": "string", "minLength": 1 }
      },
      "additionalProperties": false
    },
    "rag_memory_proposal": {
      "type": "object",
      "required": [
        "proposal_id",
        "display_name",
        "owner_agent",
        "target_store",
        "source_event_ids",
        "required_redaction_checks",
        "proposal_status",
        "km_write_allowed",
        "playbook_trust_write_allowed",
        "embedding_write_allowed",
        "side_effect_count"
      ],
      "properties": {
        "proposal_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "owner_agent": { "type": "string", "enum": ["openclaw", "hermes", "nemotron", "sre", "security", "devops"] },
        "target_store": { "type": "string", "minLength": 1 },
        "source_event_ids": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "required_redaction_checks": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "proposal_status": { "type": "string", "const": "proposal_only_no_write" },
        "km_write_allowed": { "type": "boolean", "const": false },
        "playbook_trust_write_allowed": { "type": "boolean", "const": false },
        "embedding_write_allowed": { "type": "boolean", "const": false },
        "side_effect_count": { "type": "integer", "const": 0 }
      },
      "additionalProperties": false
    },
    "verifier_gate": {
      "type": "object",
      "required": [
        "gate_id",
        "display_name",
        "owner_agent",
        "required_checks",
        "failure_if_missing",
        "live_verifier_allowed",
        "receipt_write_allowed",
        "runtime_action_allowed"
      ],
      "properties": {
        "gate_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "owner_agent": { "type": "string", "enum": ["openclaw", "hermes", "nemotron", "sre", "security", "devops"] },
        "required_checks": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "failure_if_missing": { "type": "string", "minLength": 1 },
        "live_verifier_allowed": { "type": "boolean", "const": false },
        "receipt_write_allowed": { "type": "boolean", "const": false },
        "runtime_action_allowed": { "type": "boolean", "const": false }
      },
      "additionalProperties": false
    },
    "next_action": {
      "type": "object",
      "required": ["task_id", "priority", "summary", "gate"],
      "properties": {
        "task_id": { "type": "string", "minLength": 1 },
        "priority": { "type": "string", "enum": ["P0", "P1", "P2", "P3"] },
        "summary": { "type": "string", "minLength": 1 },
        "gate": { "type": "string", "minLength": 1 }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
