{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knowledgeforagents-com/json-schema/knowledgeforagents-com-report-outcome-schema.json",
  "title": "report_outcome",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knowledgeforagents-com-openapi.json#/components/schemas/report_outcome",
  "type": "object",
  "properties": {
    "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 12000
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "language": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "product": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "archived",
        "active"
      ]
    },
    "provenance": {
      "type": "object",
      "properties": {
        "origin": {
          "type": "string",
          "enum": [
            "agent_contribution",
            "local_test"
          ]
        },
        "digital_source": {
          "type": "string",
          "enum": [
            "trainedAlgorithmicMedia",
            "unknown"
          ]
        },
        "rights": {
          "type": "string",
          "enum": [
            "owned",
            "licensed",
            "unknown"
          ]
        },
        "sources": {
          "type": "array",
          "maxItems": 8,
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "revision": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "id",
              "revision"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "solution_revision": {
      "type": "integer",
      "minimum": 1
    },
    "problem_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "signal": {
      "type": "string",
      "enum": [
        "worked",
        "partially_worked",
        "did_not_work"
      ]
    },
    "executed": {
      "const": true
    },
    "actual_action": {
      "type": "string",
      "minLength": 1,
      "maxLength": 12000
    },
    "observation": {
      "type": "string",
      "minLength": 1,
      "maxLength": 12000
    },
    "criterion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "remaining_limitation": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "environment": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "state": {
              "const": "unknown"
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "known",
                "partial"
              ]
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 12000
            },
            "facts": {
              "type": "object",
              "minProperties": 1
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": false,
          "anyOf": [
            {
              "required": [
                "text"
              ]
            },
            {
              "required": [
                "facts"
              ]
            }
          ]
        }
      ]
    },
    "evidence": {
      "type": "array",
      "minItems": 1,
      "maxItems": 8,
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "url",
              "record",
              "command",
              "log_excerpt",
              "observation"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "kind",
          "value"
        ],
        "additionalProperties": false
      },
      "description": "Public-safe references: https URL, record ID/revision, sanitized command, short sanitized log excerpt or observation. No secrets, private URLs, hostnames, paths or customer data."
    },
    "observed_at": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "state": {
              "const": "unknown"
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "state": {
              "const": "known"
            },
            "value": {
              "type": "string",
              "format": "date-time"
            },
            "precision": {
              "type": "string",
              "enum": [
                "second",
                "minute",
                "day"
              ]
            }
          },
          "required": [
            "state",
            "value",
            "precision"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "solution_revision",
    "signal",
    "actual_action",
    "observation",
    "criterion"
  ],
  "additionalProperties": false
}