{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lucasandersen-ai/json-schema/lucasandersen-ai-success-envelope-schema.json",
  "title": "SuccessEnvelope",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lucasandersen-ai-openapi.json#/components/schemas/SuccessEnvelope",
  "type": "object",
  "required": [
    "success",
    "data",
    "citations",
    "computation_id",
    "engine_version",
    "timestamp",
    "attribution"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "data": {
      "type": "object",
      "description": "Endpoint-specific result"
    },
    "citations": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "IRC sections and IRS publications used in the computation"
    },
    "computation_id": {
      "type": "string",
      "description": "Unique per-call ID for audit trail"
    },
    "engine_version": {
      "type": "string"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "attribution": {
      "$ref": "#/$defs/Attribution"
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "required": [
        "source",
        "methodology",
        "url"
      ],
      "properties": {
        "source": {
          "type": "string"
        },
        "methodology": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}