$schema: https://json-schema.org/draft/2020-12/schema
$id: https://example.invalid/sadave/schemas/exceptions_inventory_v1.schema.json
title: Sadave Exceptions Inventory (v1)
type: object
additionalProperties: false
required:
  - schema_id
  - schema_version
  - generated_at_utc
  - generator
  - workspace
  - data
properties:
  schema_id:
    const: sadave.exceptions_inventory.v1
  schema_version:
    const: "1"
  generated_at_utc:
    type: string
    format: date-time
  generator:
    type: object
    additionalProperties: false
    required:
      - name
      - version
    properties:
      name:
        const: sadave
      version:
        type: string
  workspace:
    type: object
    additionalProperties: false
    required:
      - workspace_root
      - subproject_root
      - snapshot
    properties:
      workspace_root:
        type: string
      subproject_root:
        type: string
      snapshot:
        type: object
        additionalProperties: false
        required:
          - kind
          - value
        properties:
          kind:
            type: string
            enum: [git_head, git_tree, fs]
          value:
            type: string
  data:
    type: object
    additionalProperties: false
    required:
      - items
      - notes
    properties:
      items:
        type: array
        items:
          type: object
          additionalProperties: false
          required:
            - exception_id
            - kind
            - canonical_source_ref
            - write_surface
            - state
            - reason
          properties:
            exception_id:
              type: string
            kind:
              type: string
              enum: [suppression, waiver]
            canonical_source_ref:
              type: string
            write_surface:
              type: string
            state:
              type: string
              enum: [active]
            reason:
              type: string
            fingerprint:
              type: string
            waiver_id:
              type: string
            zone:
              type: string
            added_at_utc:
              type: string
              format: date-time
            added_by:
              type: string
            owner:
              type: string
            review_horizon:
              type: string
            rule_refs:
              type: array
              items:
                type: string
            scope_globs:
              type: array
              items:
                type: string
            derived_views:
              type: array
              items:
                type: string
            metadata:
              type: object
              additionalProperties: true
      notes:
        type: array
        items:
          type: string
