{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stocktrends-com/json-schema/stocktrends-com-public-artifact-envelope-schema.json",
  "title": "PublicArtifactEnvelope",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stocktrends-com-openapi.json#/components/schemas/PublicArtifactEnvelope",
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "1",
      "title": "Schema Version"
    },
    "artifact_id": {
      "type": "string",
      "minLength": 1,
      "title": "Artifact Id"
    },
    "artifact_type": {
      "type": "string",
      "enum": [
        "market_guidance",
        "market_research_report",
        "editorial_preview",
        "discovery_metadata"
      ],
      "title": "Artifact Type"
    },
    "publication_status": {
      "type": "string",
      "enum": [
        "publish_ready",
        "product_grade",
        "agent_actionable",
        "published"
      ],
      "title": "Publication Status"
    },
    "validation_status": {
      "type": "string",
      "enum": [
        "validated",
        "validated_with_warnings"
      ],
      "title": "Validation Status"
    },
    "generated_at": {
      "type": "string",
      "minLength": 1,
      "title": "Generated At"
    },
    "published_at": {
      "type": "string",
      "minLength": 1,
      "title": "Published At"
    },
    "weekdate": {
      "type": "string",
      "title": "Weekdate"
    },
    "exchange": {
      "type": "string",
      "title": "Exchange"
    },
    "provider": {
      "additionalProperties": true,
      "type": "object",
      "title": "Provider"
    },
    "lineage": {
      "additionalProperties": true,
      "type": "object",
      "title": "Lineage"
    },
    "payload": {
      "title": "Payload"
    },
    "revision": {
      "type": "integer",
      "minimum": 1.0,
      "title": "Revision"
    },
    "content_hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$",
      "title": "Content Hash"
    },
    "source_endpoints": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Endpoints"
    },
    "input_snapshot_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Input Snapshot Id"
    },
    "validation_summary": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Validation Summary"
    },
    "guardrail_summary": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Guardrail Summary"
    },
    "warnings": {
      "anyOf": [
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Warnings"
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expires At"
    },
    "access_tier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Access Tier"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "schema_version",
    "artifact_id",
    "artifact_type",
    "publication_status",
    "validation_status",
    "generated_at",
    "published_at",
    "weekdate",
    "exchange",
    "provider",
    "lineage",
    "payload",
    "revision",
    "content_hash"
  ]
}