{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.connectsoft.ai/reference/schemas/artifact.schema.json",
  "title": "Artifact (artifact-v1)",
  "description": "A versioned, content-addressed output with producing run, source evidence, validation status and access scope (BC-12). Content lives in the artifact store; this is the metadata record.",
  "type": "object",
  "required": ["artifactId", "tenantId", "projectId", "kind", "contentHash", "contentRef", "producedBy", "classification", "validation", "createdAt"],
  "additionalProperties": false,
  "properties": {
    "artifactId": { "type": "string", "format": "uuid" },
    "tenantId": { "type": "string" }, "projectId": { "type": "string" },
    "kind": { "enum": ["report", "change-set", "diff", "document", "code", "test-results", "evaluation-record", "deployment-manifest", "blueprint", "descriptor", "log", "screenshot", "other"] },
    "name": { "type": "string" },
    "mediaType": { "type": "string" },
    "contentHash": { "type": "string" },
    "contentRef": { "type": "string", "description": "Store reference (blob path) resolved only after authorization." },
    "sizeBytes": { "type": "integer" },
    "version": { "type": "integer", "minimum": 1 },
    "previousVersionId": { "type": "string", "format": "uuid" },
    "producedBy": { "type": "object", "required": ["runId", "attemptId"], "properties": { "runId": { "type": "string", "format": "uuid" }, "stepId": { "type": "string", "format": "uuid" }, "attemptId": { "type": "string", "format": "uuid" }, "agentId": { "type": "string" }, "releaseId": { "type": "string" } } },
    "sources": { "type": "array", "items": { "type": "object", "properties": { "sourceId": { "type": "string" }, "revision": { "type": "string" }, "chunkIds": { "type": "array", "items": { "type": "string" } } } }, "description": "Evidence lineage: which sources and revisions this artifact cites." },
    "classification": { "enum": ["public", "internal", "confidential", "restricted"] },
    "validation": { "type": "object", "required": ["status"], "properties": { "status": { "enum": ["unvalidated", "valid", "invalid", "partial"] }, "checks": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "result": { "enum": ["pass", "fail", "skip"] }, "detailsRef": { "type": "string" } } } }, "unverifiedClaims": { "type": "array", "items": { "type": "string" } } } },
    "retention": { "type": "object", "properties": { "policy": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } },
    "createdAt": { "type": "string", "format": "date-time" }
  }
}
