{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.connectsoft.ai/reference/schemas/resolved-execution-snapshot.schema.json",
  "title": "ResolvedExecutionSnapshot",
  "description": "Everything a run depends on, resolved at acceptance and immutable afterwards. A worker executes against the snapshot, never against current aliases.",
  "type": "object",
  "required": ["snapshotId", "runId", "release", "workflow", "policyRevision", "modelProfile", "sources", "runtime", "limits", "hash"],
  "additionalProperties": false,
  "properties": {
    "snapshotId": { "type": "string", "format": "uuid" },
    "runId": { "type": "string", "format": "uuid" },
    "release": {
      "type": "object", "required": ["releaseId", "hash"],
      "properties": { "releaseId": { "type": "string" }, "hash": { "type": "string" }, "sourceCommit": { "type": "string" } }
    },
    "workflow": {
      "type": "object", "required": ["workflowId", "version"],
      "properties": { "workflowId": { "type": "string" }, "version": { "type": "string" } }
    },
    "agents": {
      "type": "array",
      "items": { "type": "object", "required": ["agentId", "version", "hash"], "properties": { "agentId": { "type": "string" }, "version": { "type": "string" }, "hash": { "type": "string" } } }
    },
    "skills": { "type": "array", "items": { "type": "object", "required": ["skillId", "version", "hash"], "properties": { "skillId": { "type": "string" }, "version": { "type": "string" }, "hash": { "type": "string" } } } },
    "tools": { "type": "array", "items": { "type": "object", "required": ["toolId", "schemaVersion", "sideEffectClass"], "properties": { "toolId": { "type": "string" }, "schemaVersion": { "type": "string" }, "sideEffectClass": { "enum": ["read", "sandbox", "shared-write", "external", "production", "publication", "spend"] } } } },
    "policyRevision": { "type": "string" },
    "modelProfile": {
      "type": "object", "required": ["profileId", "profileRevision"],
      "properties": { "profileId": { "type": "string" }, "profileRevision": { "type": "string" }, "fallbackChain": { "type": "array", "items": { "type": "string" } } }
    },
    "sources": {
      "type": "array",
      "description": "Repository and document revisions the run may read.",
      "items": { "type": "object", "required": ["sourceId", "revision"], "properties": { "sourceId": { "type": "string" }, "kind": { "enum": ["repository", "documents", "index"] }, "revision": { "type": "string" }, "indexVersion": { "type": "string" } } }
    },
    "evaluationSuite": { "type": "object", "properties": { "suiteId": { "type": "string" }, "version": { "type": "string" } } },
    "runtime": {
      "type": "object", "required": ["adapter", "adapterVersion"],
      "properties": { "adapter": { "type": "string", "description": "e.g. microsoft-agent-framework" }, "adapterVersion": { "type": "string" }, "sandboxProfile": { "type": "string" }, "compatibility": { "type": "string" } }
    },
    "limits": { "type": "object", "properties": { "maxCostUsd": { "type": "number" }, "maxMinutes": { "type": "integer" }, "maxTokens": { "type": "integer" } } },
    "hash": { "type": "string", "description": "Content hash of this snapshot; equal inputs produce equal hashes." }
  }
}
