dsl-task-request:
  version: 1
  description: Request to execute a DSL management task
  schema:
    type: object
    properties:
      task_id:
        type: string
        description: Identifier of the task to execute
      scope:
        type: string
        description: Scope of changes (agents, tasks, artifacts, workflow, bindings, etc.)
      context:
        type: string
        description: Background and purpose of the change
    required:
      - task_id

dsl-task-result:
  version: 3
  description: Result of a DSL management task execution
  schema:
    type: object
    properties:
      changed_files:
        type: array
        items:
          type: string
        description: List of changed file paths
      validation_result:
        type: string
        enum:
          - pass
          - fail
        description: Result of agent-contracts validate
      lint_result:
        type: string
        enum:
          - pass
          - fail
          - skipped
        description: Result of agent-contracts lint (separate from validate)
      generate_result:
        type: string
        enum:
          - pass
          - fail
          - skipped
        description: >-
          Result of agent-contracts generate guardrails (binding task).
          Used by post-binding gate to block render on failure.
      render_result:
        type: string
        enum:
          - pass
          - fail
          - skipped
        description: >-
          Result of agent-contracts render execution.
          Distinct from drift_detected — captures whether render itself succeeded.
      drift_detected:
        type: boolean
        description: >-
          True if render --check detected drift between DSL source
          and generated outputs
      cross_reference_check:
        type: string
        enum:
          - pass
          - fail
          - skipped
        description: >-
          Result of cross-reference integrity verification for newly
          added entities (update-dsl-definitions completion criterion).
      score:
        type: number
        description: Score command result (0-100)
      score_dimensions:
        type: object
        description: Per-dimension score breakdown
      notes:
        type: string
        description: Additional notes or improvement suggestions
    required:
      - validation_result

audit-result:
  version: 1
  description: >-
    Generic audit result for tool/agent execution.
    Uses canonical agent-audit-result schema from components.schemas.
  schema:
    $ref: "#/components/schemas/agent-audit-result"

dsl-audit-result:
  version: 4
  description: Result of DSL audit (completeness, semantic design, prompt fidelity, or extensions)
  schema:
    type: object
    properties:
      audit_type:
        type: string
        enum:
          - completeness
          - semantic
          - prompt
          - extensions
        description: Which audit task produced this result
      total_dimensions:
        type: integer
        description: Number of dimensions inspected
      pass_count:
        type: integer
        description: Number of PASS dimensions
      miss_count:
        type: integer
        description: Number of MISS dimensions
      partial_count:
        type: integer
        description: Number of PARTIAL dimensions
      agents_reviewed:
        type: integer
        description: Number of agents reviewed (semantic and prompt audits)
      prompts_reviewed:
        type: integer
        description: Number of generated prompts compared (prompt audit)
      completion_criteria_coverage:
        type: object
        properties:
          all_dimensions_inspected:
            type: boolean
            description: All required dimensions were inspected for all agents
          gaps_classified:
            type: boolean
            description: Every detected gap has a root-cause classification
          gate_analysis_complete:
            type: boolean
            description: Workflow gate placement analysis has been performed
          guardrail_enforcement_verified:
            type: boolean
            description: All declared guardrails verified to exist in execution paths
          scope_overlap_analyzed:
            type: boolean
            description: All agents reviewed for responsibility scope and role overlap
          x_property_misuse_checked:
            type: boolean
            description: Custom x-* properties checked for standard DSL overlap
          hallucinated_permissions_checked:
            type: boolean
            description: Generated prompts verified for permissions not declared in DSL
          extension_consumption_checked:
            type: boolean
            description: All declared extensions checked for template/runtime consumption
        description: >-
          Per-criterion completion status. Each field maps to a
          completion_criteria entry in the corresponding audit task.
      critical_gaps:
        type: array
        items:
          type: object
          properties:
            dimension:
              type: string
            agent:
              type: string
            gap_type:
              type: string
              enum:
                - template_gap
                - data_gap
                - dsl_gap
            severity:
              type: string
              enum:
                - critical
                - warning
                - info
        description: List of detected gaps
      recommendations:
        type: array
        items:
          type: object
          properties:
            priority:
              type: string
              enum:
                - P0
                - P1
                - P2
            description:
              type: string
            fix_type:
              type: string
              enum:
                - template_fix
                - dsl_fix
                - regeneration
        description: Prioritized improvement recommendation list
    required:
      - audit_type
      - total_dimensions
      - pass_count
      - miss_count
      - completion_criteria_coverage
