{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:mosaic:planning:issue-53:runtime:candidate-1", "title": "Planning candidate: mediated runtime records, input and artifact contracts", "description": "No runtime consumes this schema. Cross-record identity, authorization, hash and transition checks are mandatory in addition to shape validation.", "oneOf": [ { "$ref": "#/$defs/runtime-authorization" }, { "$ref": "#/$defs/runtime-launch-manifest" }, { "$ref": "#/$defs/runtime-execution-transition" }, { "$ref": "#/$defs/runtime-claim-transition" }, { "$ref": "#/$defs/runtime-connection-transition" }, { "$ref": "#/$defs/runtime-message" }, { "$ref": "#/$defs/runtime-message-delivery" }, { "$ref": "#/$defs/runtime-command-spec" }, { "$ref": "#/$defs/runtime-sandbox-limits" }, { "$ref": "#/$defs/runtime-artifact-index" }, { "$ref": "#/$defs/runtime-configuration-check" }, { "$ref": "#/$defs/inputRequest" }, { "$ref": "#/$defs/controlRequest" }, { "$ref": "#/$defs/runtime-process-observation" }, { "$ref": "#/$defs/runtime-termination-proof" }, { "$ref": "#/$defs/runtime-delegation-basis" }, { "$ref": "#/$defs/runtime-decision-basis" }, { "$ref": "#/$defs/controlResponse" }, { "$ref": "#/$defs/runtime-command-result" } ], "$defs": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$" }, "runtimeId": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" }, "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }, "time": { "type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" }, "actor": { "type": "object", "additionalProperties": false, "required": [ "kind", "principalId", "executionId" ], "properties": { "kind": { "enum": [ "human", "service", "agent" ] }, "principalId": { "$ref": "#/$defs/id" }, "executionId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] } }, "if": { "properties": { "kind": { "const": "agent" } } }, "then": { "properties": { "executionId": { "$ref": "#/$defs/runtimeId" } } }, "else": { "properties": { "executionId": { "type": "null" } } } }, "artifactRef": { "type": "object", "additionalProperties": false, "required": [ "runId", "artifactId", "digest" ], "properties": { "runId": { "$ref": "#/$defs/id" }, "artifactId": { "$ref": "#/$defs/id" }, "digest": { "$ref": "#/$defs/digest" } } }, "workspaceScope": { "type": "object", "additionalProperties": false, "required": [ "kind", "projectId", "workspaceId" ], "properties": { "kind": { "const": "workspace" }, "projectId": { "$ref": "#/$defs/id" }, "workspaceId": { "$ref": "#/$defs/id" } } }, "projectScope": { "type": "object", "additionalProperties": false, "required": [ "kind", "projectId" ], "properties": { "kind": { "const": "project" }, "projectId": { "$ref": "#/$defs/id" } } }, "systemScope": { "type": "object", "additionalProperties": false, "required": [ "kind" ], "properties": { "kind": { "const": "system" } } }, "scope": { "oneOf": [ { "$ref": "#/$defs/systemScope" }, { "$ref": "#/$defs/projectScope" }, { "$ref": "#/$defs/workspaceScope" } ] }, "recordRef": { "type": "object", "additionalProperties": false, "required": [ "kind", "id", "scope", "revision" ], "properties": { "kind": { "enum": [ "agent-definition", "project", "workspace", "registration", "mission", "task", "assignment", "decision", "session", "context-source", "adapter-capability" ] }, "id": { "$ref": "#/$defs/id" }, "scope": { "$ref": "#/$defs/scope" }, "revision": { "$ref": "#/$defs/revision" } } }, "registryRef": { "type": "object", "additionalProperties": false, "required": [ "registry", "id", "revision", "digest" ], "properties": { "registry": { "enum": [ "harness", "settings", "context-content", "scope-role", "agent-policy", "project-policy", "endpoint" ] }, "id": { "$ref": "#/$defs/id" }, "revision": { "$ref": "#/$defs/revision" }, "digest": { "$ref": "#/$defs/digest" } } }, "operation": { "enum": [ "work.read", "file.read", "file.change", "command.execute", "work.propose", "task.create", "assignment.change", "result.submit", "task.accept", "registration.manage", "conversation.read", "conversation.observe", "execution.launch", "execution.control", "execution.transfer", "workspace.retire", "workspace.reopen", "message.send", "audit.read", "project.create", "project.change", "workspace.create", "workspace.change", "mission.create", "mission.change", "mission.accept", "task.change", "decision.issue", "session.adopt" ] }, "relativePath": { "type": "string", "format": "mosaic-relative-path", "minLength": 1, "maxLength": 4096, "pattern": "^(?!/)(?!.*[\\\\\\u0000-\\u001f\\u007f])(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$" }, "pathGrant": { "type": "object", "additionalProperties": false, "required": [ "root", "path" ], "properties": { "root": { "const": "workspace" }, "path": { "oneOf": [ { "$ref": "#/$defs/relativePath" }, { "type": "null" } ] } } }, "restrictions": { "type": "object", "additionalProperties": false, "required": [ "operations", "readPaths", "writePaths", "network", "endpointRefs" ], "properties": { "operations": { "type": "array", "items": { "$ref": "#/$defs/operation" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "readPaths": { "type": "array", "items": { "$ref": "#/$defs/pathGrant" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "writePaths": { "type": "array", "items": { "$ref": "#/$defs/pathGrant" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "network": { "enum": [ "none", "approved-endpoints" ] }, "endpointRefs": { "type": "array", "items": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "endpoint" } } } ] }, "minItems": 0, "maxItems": 1024, "uniqueItems": true } }, "allOf": [ { "if": { "properties": { "network": { "const": "none" } } }, "then": { "properties": { "endpointRefs": { "maxItems": 0 } } }, "else": { "properties": { "endpointRefs": { "minItems": 1 } } } } ] }, "criterion": { "type": "object", "additionalProperties": false, "required": [ "id", "text" ], "properties": { "id": { "$ref": "#/$defs/id" }, "text": { "type": "string", "minLength": 1, "maxLength": 4000 } } }, "contentRefs": { "type": "array", "items": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "context-content" } } } ] }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "envelope": { "type": "object", "additionalProperties": false, "required": [ "schemaVersion", "kind", "id", "scope", "revision", "createdAt", "createdBy", "supersedes", "authorizationRef", "payload" ], "properties": { "schemaVersion": { "const": 1 }, "kind": { "enum": [ "agent-definition", "project", "workspace", "registration", "mission", "task", "assignment", "decision", "session", "context-source", "adapter-capability" ] }, "id": { "$ref": "#/$defs/id" }, "scope": { "$ref": "#/$defs/scope" }, "revision": { "$ref": "#/$defs/revision" }, "createdAt": { "$ref": "#/$defs/time" }, "createdBy": { "$ref": "#/$defs/actor" }, "supersedes": { "oneOf": [ { "$ref": "#/$defs/recordRef" }, { "type": "null" } ] }, "authorizationRef": { "$ref": "#/$defs/runtimeId" }, "payload": { "type": "object" } }, "allOf": [ { "if": { "properties": { "revision": { "const": 1 } } }, "then": { "properties": { "supersedes": { "type": "null" } } }, "else": { "properties": { "supersedes": { "$ref": "#/$defs/recordRef" } } } } ] }, "agent-definitionPayload": { "type": "object", "additionalProperties": false, "required": [ "displayName", "agentType", "harnessRef", "settingsRef", "soulRef", "instructionRefs", "skillRefs", "policyRef", "status" ], "properties": { "displayName": { "type": "string", "minLength": 1, "maxLength": 128 }, "agentType": { "$ref": "#/$defs/id" }, "harnessRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "harness" } } } ] }, "settingsRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "settings" } } } ] }, "soulRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "context-content" } } } ] }, "instructionRefs": { "$ref": "#/$defs/contentRefs" }, "skillRefs": { "$ref": "#/$defs/contentRefs" }, "policyRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "agent-policy" } } } ] }, "status": { "enum": [ "enabled", "disabled" ] } } }, "agent-definition": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "agent-definition" }, "payload": { "$ref": "#/$defs/agent-definitionPayload" }, "scope": { "$ref": "#/$defs/systemScope" } } } ] }, "projectPayload": { "type": "object", "additionalProperties": false, "required": [ "displayName", "policyRef", "status" ], "properties": { "displayName": { "type": "string", "minLength": 1, "maxLength": 128 }, "policyRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "project-policy" } } } ] }, "status": { "enum": [ "active", "retired" ] } } }, "project": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "project" }, "payload": { "$ref": "#/$defs/projectPayload" }, "scope": { "$ref": "#/$defs/projectScope" } } } ] }, "workspacePayload": { "type": "object", "additionalProperties": false, "required": [ "displayName", "policyRef", "status", "fileRootId" ], "properties": { "displayName": { "type": "string", "minLength": 1, "maxLength": 128 }, "policyRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "project-policy" } } } ] }, "status": { "enum": [ "active", "retiring", "retired" ] }, "fileRootId": { "$ref": "#/$defs/id" } } }, "workspace": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "workspace" }, "payload": { "$ref": "#/$defs/workspacePayload" }, "scope": { "$ref": "#/$defs/workspaceScope" } } } ] }, "registrationPayload": { "type": "object", "additionalProperties": false, "required": [ "agentId", "scopeRoleRef", "restrictions", "projectRegistrationRef", "status", "delegationRef" ], "properties": { "agentId": { "$ref": "#/$defs/id" }, "scopeRoleRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "scope-role" } } } ] }, "restrictions": { "oneOf": [ { "$ref": "#/$defs/restrictions" }, { "type": "null" } ] }, "projectRegistrationRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "registration" } } } ] }, { "type": "null" } ] }, "status": { "enum": [ "active", "revoked" ] }, "delegationRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] }, { "type": "null" } ] } } }, "registration": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "registration" }, "payload": { "$ref": "#/$defs/registrationPayload" }, "scope": { "oneOf": [ { "$ref": "#/$defs/projectScope" }, { "$ref": "#/$defs/workspaceScope" } ] } } }, { "if": { "properties": { "scope": { "properties": { "kind": { "const": "project" } } } } }, "then": { "properties": { "payload": { "properties": { "projectRegistrationRef": { "type": "null" } } } } }, "else": { "properties": { "payload": { "properties": { "projectRegistrationRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "registration" } } } ] } } } } } } ] }, "missionPayload": { "type": "object", "additionalProperties": false, "required": [ "objective", "criteria", "parentMissionRef", "restrictions", "status" ], "properties": { "objective": { "type": "string", "minLength": 1, "maxLength": 4000 }, "criteria": { "type": "array", "items": { "$ref": "#/$defs/criterion" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "parentMissionRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "mission" } } } ] }, { "type": "null" } ] }, "restrictions": { "oneOf": [ { "$ref": "#/$defs/restrictions" }, { "type": "null" } ] }, "status": { "enum": [ "proposed", "active", "blocked", "ready-for-review", "accepted", "canceled" ] } } }, "mission": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "mission" }, "payload": { "$ref": "#/$defs/missionPayload" }, "scope": { "oneOf": [ { "$ref": "#/$defs/projectScope" }, { "$ref": "#/$defs/workspaceScope" } ] } } }, { "if": { "properties": { "scope": { "properties": { "kind": { "const": "project" } } } } }, "then": { "properties": { "payload": { "properties": { "parentMissionRef": { "type": "null" } } } } } } ] }, "taskPayload": { "type": "object", "additionalProperties": false, "required": [ "purpose", "criteria", "missionRef", "intentRef", "dependencies", "restrictions", "status" ], "properties": { "purpose": { "type": "string", "minLength": 1, "maxLength": 4000 }, "criteria": { "type": "array", "items": { "$ref": "#/$defs/criterion" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "missionRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "mission" } } } ] }, { "type": "null" } ] }, "intentRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] }, "dependencies": { "type": "array", "items": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "task" } } } ] }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "restrictions": { "oneOf": [ { "$ref": "#/$defs/restrictions" }, { "type": "null" } ] }, "status": { "enum": [ "proposed", "ready", "active", "blocked", "ready-for-review", "accepted", "canceled" ] } } }, "task": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "task" }, "payload": { "$ref": "#/$defs/taskPayload" }, "scope": { "$ref": "#/$defs/workspaceScope" } } } ] }, "assignmentPayload": { "type": "object", "additionalProperties": false, "required": [ "taskRef", "agentId", "intentRef", "status", "endReason" ], "properties": { "taskRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "task" } } } ] }, "agentId": { "$ref": "#/$defs/id" }, "intentRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] }, "status": { "enum": [ "selected", "paused", "ended" ] }, "endReason": { "enum": [ null, "completed", "abandoned", "revoked", "reassigned", "canceled" ] } }, "allOf": [ { "if": { "properties": { "status": { "const": "ended" } } }, "then": { "properties": { "endReason": { "type": "string" } } }, "else": { "properties": { "endReason": { "type": "null" } } } } ] }, "assignment": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "assignment" }, "payload": { "$ref": "#/$defs/assignmentPayload" }, "scope": { "$ref": "#/$defs/workspaceScope" } } } ] }, "decisionPayload": { "type": "object", "additionalProperties": false, "required": [ "decisionKind", "subjectRefs", "outcome", "basisRef", "evidenceRefs", "delegatedOperations" ], "properties": { "decisionKind": { "enum": [ "plan-approval", "delegation", "assignment-change", "acceptance", "owner-checkpoint", "reconciliation" ] }, "subjectRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "outcome": { "enum": [ "approved", "rejected" ] }, "basisRef": { "$ref": "#/$defs/artifactRef" }, "evidenceRefs": { "type": "array", "items": { "$ref": "#/$defs/artifactRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "delegatedOperations": { "type": "array", "items": { "$ref": "#/$defs/operation" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true } }, "allOf": [ { "if": { "properties": { "decisionKind": { "const": "delegation" }, "outcome": { "const": "approved" } } }, "then": { "properties": { "delegatedOperations": { "minItems": 1 } } }, "else": { "properties": { "delegatedOperations": { "maxItems": 0 } } } } ] }, "decision": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "decision" }, "payload": { "$ref": "#/$defs/decisionPayload" } } } ] }, "sessionPayload": { "type": "object", "additionalProperties": false, "required": [ "agentId", "creationMode", "predecessorRef", "harnessRef", "harnessSessionId", "sessionArtifactId" ], "properties": { "agentId": { "$ref": "#/$defs/id" }, "creationMode": { "enum": [ "initial", "fresh", "adopted" ] }, "predecessorRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "session" } } } ] }, { "type": "null" } ] }, "harnessRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "harness" } } } ] }, "harnessSessionId": { "$ref": "#/$defs/id" }, "sessionArtifactId": { "$ref": "#/$defs/id" } }, "allOf": [ { "if": { "properties": { "creationMode": { "const": "initial" } } }, "then": { "properties": { "predecessorRef": { "type": "null" } } } } ] }, "session": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "session" }, "payload": { "$ref": "#/$defs/sessionPayload" }, "scope": { "$ref": "#/$defs/workspaceScope" } } } ] }, "context-sourcePayload": { "type": "object", "additionalProperties": false, "required": [ "contentRef", "category", "sharedByDefault", "permittedScopes", "relevanceRefs" ], "properties": { "contentRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "context-content" } } } ] }, "category": { "enum": [ "general-preference", "personal", "project", "work" ] }, "sharedByDefault": { "type": "boolean" }, "permittedScopes": { "type": "array", "items": { "$ref": "#/$defs/scope" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "relevanceRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true } }, "allOf": [ { "if": { "properties": { "sharedByDefault": { "const": true } } }, "then": { "properties": { "category": { "const": "general-preference" } } } } ] }, "context-source": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "context-source" }, "payload": { "$ref": "#/$defs/context-sourcePayload" } } } ] }, "adapter-capabilityPayload": { "type": "object", "additionalProperties": false, "required": [ "harnessRef", "operations", "observableClasses", "enforceableClasses", "evidenceRefs", "status" ], "properties": { "harnessRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "harness" } } } ] }, "operations": { "type": "array", "items": { "$ref": "#/$defs/operation" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "observableClasses": { "type": "array", "items": { "$ref": "#/$defs/id" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "enforceableClasses": { "type": "array", "items": { "$ref": "#/$defs/id" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "evidenceRefs": { "type": "array", "items": { "$ref": "#/$defs/artifactRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "status": { "enum": [ "documented-only", "verified" ] } }, "allOf": [ { "if": { "properties": { "status": { "const": "verified" } } }, "then": { "properties": { "evidenceRefs": { "minItems": 1 } } } } ] }, "adapter-capability": { "allOf": [ { "$ref": "#/$defs/envelope" }, { "properties": { "kind": { "const": "adapter-capability" }, "payload": { "$ref": "#/$defs/adapter-capabilityPayload" }, "scope": { "$ref": "#/$defs/systemScope" } } } ] }, "producer": { "type": "object", "additionalProperties": false, "required": [ "componentId", "instanceId" ], "properties": { "componentId": { "$ref": "#/$defs/id" }, "instanceId": { "$ref": "#/$defs/runtimeId" } } }, "executionBinding": { "type": "object", "additionalProperties": false, "required": [ "agentId", "scope", "sessionId", "executionId", "claimGeneration" ], "properties": { "agentId": { "$ref": "#/$defs/id" }, "scope": { "$ref": "#/$defs/workspaceScope" }, "sessionId": { "$ref": "#/$defs/runtimeId" }, "executionId": { "$ref": "#/$defs/runtimeId" }, "claimGeneration": { "$ref": "#/$defs/revision" } } }, "reviewedArtifact": { "type": "object", "additionalProperties": false, "required": [ "catalog", "id", "sourceCommit", "digest" ], "properties": { "catalog": { "enum": [ "command-profile", "sandbox-profile", "parameter-schema" ] }, "id": { "$ref": "#/$defs/id" }, "sourceCommit": { "type": "string", "pattern": "^[0-9a-f]{40}$" }, "digest": { "$ref": "#/$defs/digest" } } }, "accountRef": { "type": "object", "additionalProperties": false, "required": [ "providerId", "accountId" ], "properties": { "providerId": { "$ref": "#/$defs/id" }, "accountId": { "$ref": "#/$defs/id" } } }, "sourceComponent": { "type": "object", "additionalProperties": false, "required": [ "id", "digest" ], "properties": { "id": { "$ref": "#/$defs/id" }, "digest": { "$ref": "#/$defs/digest" } } }, "versionedComponent": { "type": "object", "additionalProperties": false, "required": [ "id", "version", "digest" ], "properties": { "id": { "$ref": "#/$defs/id" }, "version": { "$ref": "#/$defs/id" }, "digest": { "$ref": "#/$defs/digest" } } }, "baseProjection": { "type": "object", "additionalProperties": false, "required": [ "hashScopeVersion", "agentId", "soulDigest", "instructions", "skills", "harness", "modelSettingsDigest", "roleConfigDigest" ], "properties": { "hashScopeVersion": { "const": 1 }, "agentId": { "$ref": "#/$defs/id" }, "soulDigest": { "$ref": "#/$defs/digest" }, "instructions": { "type": "array", "items": { "$ref": "#/$defs/sourceComponent" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "skills": { "type": "array", "items": { "$ref": "#/$defs/versionedComponent" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "harness": { "$ref": "#/$defs/versionedComponent" }, "modelSettingsDigest": { "$ref": "#/$defs/digest" }, "roleConfigDigest": { "$ref": "#/$defs/digest" } } }, "contextInput": { "type": "object", "additionalProperties": false, "required": [ "category", "sourceRef", "snapshotRef", "classificationRef" ], "properties": { "category": { "enum": [ "governance", "identity", "skill", "general-preference", "personal", "project", "work" ] }, "sourceRef": { "oneOf": [ { "$ref": "#/$defs/registryRef" }, { "$ref": "#/$defs/recordRef" } ] }, "snapshotRef": { "$ref": "#/$defs/artifactRef" }, "classificationRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "context-source" } } } ] }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "category": { "enum": [ "general-preference", "personal", "project" ] } } }, "then": { "properties": { "classificationRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "context-source" } } } ] } } } } ] }, "launchInputs": { "type": "object", "additionalProperties": false, "required": [ "binding", "conversationMode", "priorConversationRef", "selectedAssignments", "contextInputs", "baseProjection", "policyRefs", "accountRef", "adapterCapabilityRef", "imageDigest", "agentDefinitionRef", "sessionRecordRef", "settingsRef", "resumeSnapshotRef", "resumeLeafId" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "conversationMode": { "enum": [ "initial", "resume", "fresh" ] }, "priorConversationRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "session" } } } ] }, { "type": "null" } ] }, "selectedAssignments": { "type": "array", "items": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "assignment" } } } ] }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "contextInputs": { "type": "array", "items": { "$ref": "#/$defs/contextInput" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "baseProjection": { "$ref": "#/$defs/baseProjection" }, "policyRefs": { "type": "array", "items": { "$ref": "#/$defs/registryRef" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "accountRef": { "oneOf": [ { "$ref": "#/$defs/accountRef" }, { "type": "null" } ] }, "adapterCapabilityRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "adapter-capability" } } } ] }, "imageDigest": { "$ref": "#/$defs/digest" }, "agentDefinitionRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "agent-definition" } } } ] }, "sessionRecordRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "session" } } } ] }, "settingsRef": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "settings" } } } ] }, "resumeSnapshotRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] }, "resumeLeafId": { "oneOf": [ { "$ref": "#/$defs/id" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "conversationMode": { "const": "resume" } } }, "then": { "properties": { "priorConversationRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "session" } } } ] } } }, "else": { "properties": { "priorConversationRef": { "type": "null" } } } }, { "if": { "properties": { "conversationMode": { "const": "resume" } } }, "then": { "properties": { "resumeSnapshotRef": { "$ref": "#/$defs/artifactRef" } } }, "else": { "properties": { "resumeSnapshotRef": { "type": "null" }, "resumeLeafId": { "type": "null" } } } } ] }, "recipient": { "type": "object", "additionalProperties": false, "required": [ "agentId", "scope", "routing", "sessionId", "executionId" ], "properties": { "agentId": { "$ref": "#/$defs/id" }, "scope": { "$ref": "#/$defs/workspaceScope" }, "routing": { "enum": [ "current-scoped-session", "exact-session", "exact-execution" ] }, "sessionId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] }, "executionId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "routing": { "const": "current-scoped-session" } } }, "then": { "properties": { "sessionId": { "type": "null" }, "executionId": { "type": "null" } } } }, { "if": { "properties": { "routing": { "const": "exact-session" } } }, "then": { "properties": { "sessionId": { "$ref": "#/$defs/runtimeId" }, "executionId": { "type": "null" } } } }, { "if": { "properties": { "routing": { "const": "exact-execution" } } }, "then": { "properties": { "sessionId": { "$ref": "#/$defs/runtimeId" }, "executionId": { "$ref": "#/$defs/runtimeId" } } } } ] }, "runtimeEnvelope": { "type": "object", "additionalProperties": false, "required": [ "documentVersion", "kind", "id", "runId", "recordedAt", "observedAt", "producer", "causedById", "payload" ], "properties": { "documentVersion": { "const": 1 }, "kind": { "enum": [ "authorization", "launch-manifest", "execution-transition", "claim-transition", "connection-transition", "message", "message-delivery", "command-spec", "sandbox-limits", "artifact-index", "configuration-check", "process-observation", "termination-proof", "delegation-basis", "decision-basis", "command-result" ] }, "id": { "$ref": "#/$defs/runtimeId" }, "runId": { "$ref": "#/$defs/id" }, "recordedAt": { "$ref": "#/$defs/time" }, "observedAt": { "$ref": "#/$defs/time" }, "producer": { "$ref": "#/$defs/producer" }, "causedById": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] }, "payload": { "type": "object" } } }, "authorizationRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "requestId", "requestDigest", "requester", "scope", "operation", "outcome", "reasonCode", "policyRefs", "checkedRecordRefs" ], "properties": { "requestId": { "$ref": "#/$defs/runtimeId" }, "requestDigest": { "$ref": "#/$defs/digest" }, "requester": { "$ref": "#/$defs/actor" }, "scope": { "$ref": "#/$defs/scope" }, "operation": { "$ref": "#/$defs/operation" }, "outcome": { "enum": [ "allowed", "refused" ] }, "reasonCode": { "enum": [ "allowed", "invalid-request", "not-authorized", "stale-revision", "missing-state", "already-active", "control-conflict", "retired", "unsupported-capability", "audit-unavailable", "unknown-effects", "unsafe-replacement", "request-id-conflict", "expired" ] }, "policyRefs": { "type": "array", "items": { "$ref": "#/$defs/registryRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "checkedRecordRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true } }, "allOf": [ { "if": { "properties": { "outcome": { "const": "allowed" } } }, "then": { "properties": { "reasonCode": { "const": "allowed" }, "policyRefs": { "minItems": 1 } } }, "else": { "properties": { "reasonCode": { "not": { "const": "allowed" } } } } } ] }, "runtime-authorization": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "authorization" }, "payload": { "$ref": "#/$defs/authorizationRuntimePayload" } } } ] }, "launch-manifestRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "inputs", "agentConfigHash", "launchManifestHash", "hashAlgorithm" ], "properties": { "inputs": { "$ref": "#/$defs/launchInputs" }, "agentConfigHash": { "$ref": "#/$defs/digest" }, "launchManifestHash": { "$ref": "#/$defs/digest" }, "hashAlgorithm": { "const": "sha256-rfc8785-v1" } } }, "runtime-launch-manifest": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "launch-manifest" }, "payload": { "$ref": "#/$defs/launch-manifestRuntimePayload" } } } ] }, "execution-transitionRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "binding", "authorizationId", "manifestRef", "state", "processRef", "terminationProofRef", "resultRef" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "authorizationId": { "$ref": "#/$defs/runtimeId" }, "manifestRef": { "$ref": "#/$defs/artifactRef" }, "state": { "enum": [ "admitted", "started", "stop-requested", "terminated", "unknown" ] }, "processRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] }, "terminationProofRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] }, "resultRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "state": { "const": "started" } } }, "then": { "properties": { "processRef": { "$ref": "#/$defs/artifactRef" } } } }, { "if": { "properties": { "state": { "const": "terminated" } } }, "then": { "properties": { "terminationProofRef": { "$ref": "#/$defs/artifactRef" } } } } ] }, "runtime-execution-transition": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "execution-transition" }, "payload": { "$ref": "#/$defs/execution-transitionRuntimePayload" } } } ] }, "claim-transitionRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "binding", "claimId", "state", "authorizationId", "terminationProofRef" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "claimId": { "$ref": "#/$defs/runtimeId" }, "state": { "enum": [ "reserved", "active", "stopping", "released", "uncertain" ] }, "authorizationId": { "$ref": "#/$defs/runtimeId" }, "terminationProofRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "state": { "const": "released" } } }, "then": { "properties": { "terminationProofRef": { "$ref": "#/$defs/artifactRef" } } } } ] }, "runtime-claim-transition": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "claim-transition" }, "payload": { "$ref": "#/$defs/claim-transitionRuntimePayload" } } } ] }, "connection-transitionRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "binding", "connectionId", "client", "mode", "state", "controlGeneration", "authorizationId" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "connectionId": { "$ref": "#/$defs/runtimeId" }, "client": { "$ref": "#/$defs/actor" }, "mode": { "enum": [ "observe", "control" ] }, "state": { "enum": [ "granted", "revoked", "disconnected" ] }, "controlGeneration": { "oneOf": [ { "$ref": "#/$defs/revision" }, { "type": "null" } ] }, "authorizationId": { "$ref": "#/$defs/runtimeId" } }, "allOf": [ { "if": { "properties": { "mode": { "const": "control" } } }, "then": { "properties": { "controlGeneration": { "$ref": "#/$defs/revision" } } }, "else": { "properties": { "controlGeneration": { "type": "null" } } } } ] }, "runtime-connection-transition": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "connection-transition" }, "payload": { "$ref": "#/$defs/connection-transitionRuntimePayload" } } } ] }, "messageRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "messageId", "sender", "sourceScope", "recipient", "messageKind", "bodyRef", "subjectRefs", "expiresAt", "replyToMessageId", "authorizationId" ], "properties": { "messageId": { "$ref": "#/$defs/runtimeId" }, "sender": { "$ref": "#/$defs/actor" }, "sourceScope": { "$ref": "#/$defs/scope" }, "recipient": { "$ref": "#/$defs/recipient" }, "messageKind": { "enum": [ "work-notice", "conversation", "execution-result", "approval" ] }, "bodyRef": { "$ref": "#/$defs/artifactRef" }, "subjectRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "expiresAt": { "$ref": "#/$defs/time" }, "replyToMessageId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] }, "authorizationId": { "$ref": "#/$defs/runtimeId" } }, "allOf": [ { "if": { "properties": { "messageKind": { "enum": [ "execution-result", "approval" ] } } }, "then": { "properties": { "recipient": { "properties": { "routing": { "const": "exact-execution" } } }, "subjectRefs": { "minItems": 1 } } } } ] }, "runtime-message": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "message" }, "payload": { "$ref": "#/$defs/messageRuntimePayload" } } } ] }, "message-deliveryRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "messageId", "outcome", "recipientBinding", "authorizationId", "observationRef" ], "properties": { "messageId": { "$ref": "#/$defs/runtimeId" }, "outcome": { "enum": [ "queued", "delivered", "refused", "expired", "unknown" ] }, "recipientBinding": { "oneOf": [ { "$ref": "#/$defs/executionBinding" }, { "type": "null" } ] }, "authorizationId": { "$ref": "#/$defs/runtimeId" }, "observationRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "outcome": { "const": "delivered" } } }, "then": { "properties": { "recipientBinding": { "$ref": "#/$defs/executionBinding" }, "observationRef": { "$ref": "#/$defs/artifactRef" } } } } ] }, "runtime-message-delivery": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "message-delivery" }, "payload": { "$ref": "#/$defs/message-deliveryRuntimePayload" } } } ] }, "command-specRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "profileRef", "parameterSchemaRef", "parametersRef", "cwd", "inputRefs", "outputPolicy" ], "properties": { "profileRef": { "allOf": [ { "$ref": "#/$defs/reviewedArtifact" }, { "properties": { "catalog": { "const": "command-profile" } } } ] }, "parameterSchemaRef": { "allOf": [ { "$ref": "#/$defs/reviewedArtifact" }, { "properties": { "catalog": { "const": "parameter-schema" } } } ] }, "parametersRef": { "$ref": "#/$defs/artifactRef" }, "cwd": { "oneOf": [ { "$ref": "#/$defs/relativePath" }, { "type": "null" } ] }, "inputRefs": { "type": "array", "items": { "$ref": "#/$defs/artifactRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "outputPolicy": { "const": "classified-artifacts-only" } } }, "runtime-command-spec": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "command-spec" }, "payload": { "$ref": "#/$defs/command-specRuntimePayload" } } } ] }, "sandbox-limitsRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "profileRef", "scope", "readPaths", "writePaths", "network", "endpointRefs", "timeoutSeconds", "memoryMiB", "processLimit", "credentialAccess", "hostControlAccess", "coverage" ], "properties": { "profileRef": { "allOf": [ { "$ref": "#/$defs/reviewedArtifact" }, { "properties": { "catalog": { "const": "sandbox-profile" } } } ] }, "scope": { "$ref": "#/$defs/workspaceScope" }, "readPaths": { "type": "array", "items": { "$ref": "#/$defs/pathGrant" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "writePaths": { "type": "array", "items": { "$ref": "#/$defs/pathGrant" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "network": { "enum": [ "none", "approved-endpoints" ] }, "endpointRefs": { "type": "array", "items": { "allOf": [ { "$ref": "#/$defs/registryRef" }, { "properties": { "registry": { "const": "endpoint" } } } ] }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "timeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 600 }, "memoryMiB": { "type": "integer", "minimum": 16, "maximum": 1048576 }, "processLimit": { "type": "integer", "minimum": 1, "maximum": 65536 }, "credentialAccess": { "const": false }, "hostControlAccess": { "const": false }, "coverage": { "const": "command-invocation-v1" } }, "allOf": [ { "if": { "properties": { "network": { "const": "none" } } }, "then": { "properties": { "endpointRefs": { "maxItems": 0 } } }, "else": { "properties": { "endpointRefs": { "minItems": 1 } } } } ] }, "runtime-sandbox-limits": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "sandbox-limits" }, "payload": { "$ref": "#/$defs/sandbox-limitsRuntimePayload" } } } ] }, "artifact-indexRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "artifactId", "artifactKind", "scope", "digest", "byteLength", "mediaType", "visibility", "publisher", "authorizationId" ], "properties": { "artifactId": { "$ref": "#/$defs/id" }, "artifactKind": { "enum": [ "command-spec", "sandbox-limits", "parameters", "process-observation", "termination-proof", "command-result", "context", "message-body", "decision-basis", "review-evidence", "launch-manifest", "delegation-basis" ] }, "scope": { "$ref": "#/$defs/scope" }, "digest": { "$ref": "#/$defs/digest" }, "byteLength": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mediaType": { "enum": [ "application/json", "text/plain", "text/markdown", "application/octet-stream" ] }, "visibility": { "enum": [ "work", "conversation", "restricted" ] }, "publisher": { "$ref": "#/$defs/actor" }, "authorizationId": { "$ref": "#/$defs/runtimeId" } } }, "runtime-artifact-index": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "artifact-index" }, "payload": { "$ref": "#/$defs/artifact-indexRuntimePayload" } } } ] }, "configuration-checkRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "binding", "launchHash", "currentHash", "status", "sourceRefs", "noticeKey" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "launchHash": { "$ref": "#/$defs/digest" }, "currentHash": { "oneOf": [ { "$ref": "#/$defs/digest" }, { "type": "null" } ] }, "status": { "enum": [ "matching", "changed", "unknown" ] }, "sourceRefs": { "type": "array", "items": { "$ref": "#/$defs/registryRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "noticeKey": { "$ref": "#/$defs/id" } }, "allOf": [ { "if": { "properties": { "status": { "const": "unknown" } } }, "then": { "properties": { "currentHash": { "type": "null" } } }, "else": { "properties": { "currentHash": { "$ref": "#/$defs/digest" } } } } ] }, "runtime-configuration-check": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "configuration-check" }, "payload": { "$ref": "#/$defs/configuration-checkRuntimePayload" } } } ] }, "inputRequest": { "type": "object", "additionalProperties": false, "required": [ "requestVersion", "requestId", "operation", "binding", "connectionId", "expectedControlGeneration", "bodyRef", "dialogId" ], "properties": { "requestVersion": { "const": 1 }, "requestId": { "$ref": "#/$defs/runtimeId" }, "operation": { "enum": [ "prompt", "stop", "dialog-reply" ] }, "binding": { "$ref": "#/$defs/executionBinding" }, "connectionId": { "$ref": "#/$defs/runtimeId" }, "expectedControlGeneration": { "$ref": "#/$defs/revision" }, "bodyRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] }, "dialogId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "operation": { "const": "stop" } } }, "then": { "properties": { "bodyRef": { "type": "null" }, "dialogId": { "type": "null" } } } }, { "if": { "properties": { "operation": { "const": "prompt" } } }, "then": { "properties": { "bodyRef": { "$ref": "#/$defs/artifactRef" }, "dialogId": { "type": "null" } } } }, { "if": { "properties": { "operation": { "const": "dialog-reply" } } }, "then": { "properties": { "bodyRef": { "$ref": "#/$defs/artifactRef" }, "dialogId": { "$ref": "#/$defs/runtimeId" } } } } ] }, "controlRequest": { "type": "object", "additionalProperties": false, "required": [ "requestVersion", "requestId", "operation", "scope", "expectedRefs", "assignmentRef", "parameters" ], "properties": { "requestVersion": { "const": 1 }, "requestId": { "$ref": "#/$defs/runtimeId" }, "operation": { "enum": [ "project.create", "project.change", "workspace.create", "workspace.change", "mission.create", "mission.change", "task.create", "task.change", "mission.accept", "task.accept", "work.read", "file.read", "file.change", "work.propose", "assignment.change", "result.submit", "registration.manage", "conversation.read", "conversation.observe", "execution.launch", "execution.control", "execution.transfer", "workspace.retire", "workspace.reopen", "message.send", "audit.read", "decision.issue", "session.adopt" ] }, "scope": { "$ref": "#/$defs/scope" }, "expectedRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "assignmentRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "assignment" } } } ] }, { "type": "null" } ] }, "parameters": { "type": "object" } }, "allOf": [ { "if": { "properties": { "operation": { "const": "project.create" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-project.create" } } } }, { "if": { "properties": { "operation": { "const": "project.change" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-project.change" } } } }, { "if": { "properties": { "operation": { "const": "workspace.create" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-workspace.create" } } } }, { "if": { "properties": { "operation": { "const": "workspace.change" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-workspace.change" } } } }, { "if": { "properties": { "operation": { "const": "mission.create" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-mission.create" } } } }, { "if": { "properties": { "operation": { "const": "mission.change" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-mission.change" } } } }, { "if": { "properties": { "operation": { "const": "task.create" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-task.create" } } } }, { "if": { "properties": { "operation": { "const": "task.change" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-task.change" } } } }, { "if": { "properties": { "operation": { "const": "mission.accept" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-mission.accept" } } } }, { "if": { "properties": { "operation": { "const": "task.accept" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-task.accept" } } } }, { "if": { "properties": { "operation": { "const": "work.read" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-work.read" } } } }, { "if": { "properties": { "operation": { "const": "file.read" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-file.read" } } } }, { "if": { "properties": { "operation": { "const": "file.change" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-file.change" } } } }, { "if": { "properties": { "operation": { "const": "work.propose" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-work.propose" } } } }, { "if": { "properties": { "operation": { "const": "assignment.change" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-assignment.change" } } } }, { "if": { "properties": { "operation": { "const": "result.submit" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-result.submit" } } } }, { "if": { "properties": { "operation": { "const": "registration.manage" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-registration.manage" } } } }, { "if": { "properties": { "operation": { "const": "conversation.read" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-conversation.read" } } } }, { "if": { "properties": { "operation": { "const": "conversation.observe" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-conversation.observe" } } } }, { "if": { "properties": { "operation": { "const": "execution.launch" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-execution.launch" } } } }, { "if": { "properties": { "operation": { "const": "execution.control" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-execution.control" } } } }, { "if": { "properties": { "operation": { "const": "execution.transfer" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-execution.transfer" } } } }, { "if": { "properties": { "operation": { "const": "workspace.retire" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-workspace.retire" } } } }, { "if": { "properties": { "operation": { "const": "workspace.reopen" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-workspace.reopen" } } } }, { "if": { "properties": { "operation": { "const": "message.send" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-message.send" } } } }, { "if": { "properties": { "operation": { "const": "audit.read" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-audit.read" } } } }, { "if": { "properties": { "operation": { "const": "decision.issue" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-decision.issue" } } } }, { "if": { "properties": { "operation": { "const": "session.adopt" } } }, "then": { "properties": { "parameters": { "$ref": "#/$defs/params-session.adopt" } } } } ] }, "params-project.create": { "type": "object", "additionalProperties": false, "required": [ "proposedId", "proposedPayloadRef" ], "properties": { "proposedId": { "$ref": "#/$defs/id" }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-project.change": { "type": "object", "additionalProperties": false, "required": [ "targetRef", "proposedPayloadRef" ], "properties": { "targetRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "project" } } } ] }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-workspace.create": { "type": "object", "additionalProperties": false, "required": [ "proposedId", "proposedPayloadRef" ], "properties": { "proposedId": { "$ref": "#/$defs/id" }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-workspace.change": { "type": "object", "additionalProperties": false, "required": [ "targetRef", "proposedPayloadRef" ], "properties": { "targetRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "workspace" } } } ] }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-mission.create": { "type": "object", "additionalProperties": false, "required": [ "proposedId", "proposedPayloadRef" ], "properties": { "proposedId": { "$ref": "#/$defs/id" }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-mission.change": { "type": "object", "additionalProperties": false, "required": [ "targetRef", "proposedPayloadRef" ], "properties": { "targetRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "mission" } } } ] }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-task.create": { "type": "object", "additionalProperties": false, "required": [ "proposedId", "proposedPayloadRef" ], "properties": { "proposedId": { "$ref": "#/$defs/id" }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-task.change": { "type": "object", "additionalProperties": false, "required": [ "targetRef", "proposedPayloadRef" ], "properties": { "targetRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "task" } } } ] }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-mission.accept": { "type": "object", "additionalProperties": false, "required": [ "targetRef", "decisionRef" ], "properties": { "targetRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "mission" } } } ] }, "decisionRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] } } }, "params-task.accept": { "type": "object", "additionalProperties": false, "required": [ "targetRef", "decisionRef" ], "properties": { "targetRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "task" } } } ] }, "decisionRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] } } }, "params-work.read": { "type": "object", "additionalProperties": false, "required": [ "targetRefs", "cursorId", "limit", "executionIds", "view" ], "properties": { "targetRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "cursorId": { "oneOf": [ { "$ref": "#/$defs/id" }, { "type": "null" } ] }, "limit": { "type": "integer", "minimum": 1, "maximum": 1000 }, "executionIds": { "type": "array", "items": { "$ref": "#/$defs/runtimeId" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "view": { "enum": [ "records", "execution-status", "configuration" ] } }, "allOf": [ { "if": { "properties": { "view": { "const": "records" } } }, "then": { "properties": { "targetRefs": { "minItems": 1 }, "executionIds": { "maxItems": 0 } } }, "else": { "properties": { "targetRefs": { "maxItems": 0 }, "executionIds": { "minItems": 1 } } } } ] }, "params-file.read": { "type": "object", "additionalProperties": false, "required": [ "path", "view", "offsetBytes", "maxBytes" ], "properties": { "path": { "$ref": "#/$defs/pathGrant" }, "view": { "enum": [ "contents", "entries" ] }, "offsetBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "maxBytes": { "type": "integer", "minimum": 1, "maximum": 1048576 } } }, "params-file.change": { "type": "object", "additionalProperties": false, "required": [ "path", "change", "expectedDigest", "contentRef" ], "properties": { "path": { "allOf": [ { "$ref": "#/$defs/pathGrant" }, { "properties": { "path": { "$ref": "#/$defs/relativePath" } } } ] }, "change": { "enum": [ "put", "delete" ] }, "expectedDigest": { "oneOf": [ { "$ref": "#/$defs/digest" }, { "type": "null" } ] }, "contentRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "change": { "const": "put" } } }, "then": { "properties": { "contentRef": { "$ref": "#/$defs/artifactRef" } } }, "else": { "properties": { "contentRef": { "type": "null" }, "expectedDigest": { "$ref": "#/$defs/digest" } } } } ] }, "params-work.propose": { "type": "object", "additionalProperties": false, "required": [ "subjectRefs", "bodyRef" ], "properties": { "subjectRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "bodyRef": { "$ref": "#/$defs/artifactRef" } } }, "params-assignment.change": { "type": "object", "additionalProperties": false, "required": [ "proposedPayloadRef", "currentRef", "proposedId" ], "properties": { "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" }, "currentRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "assignment" } } } ] }, { "type": "null" } ] }, "proposedId": { "$ref": "#/$defs/id" } } }, "params-result.submit": { "type": "object", "additionalProperties": false, "required": [ "assignmentRef", "evidenceRefs" ], "properties": { "assignmentRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "assignment" } } } ] }, "evidenceRefs": { "type": "array", "items": { "$ref": "#/$defs/artifactRef" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true } } }, "params-registration.manage": { "type": "object", "additionalProperties": false, "required": [ "currentRef", "proposedId", "proposedPayloadRef" ], "properties": { "currentRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "registration" } } } ] }, { "type": "null" } ] }, "proposedId": { "$ref": "#/$defs/id" }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-conversation.read": { "type": "object", "additionalProperties": false, "required": [ "sessionRef", "cursorId", "limit" ], "properties": { "sessionRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "session" } } } ] }, "cursorId": { "oneOf": [ { "$ref": "#/$defs/id" }, { "type": "null" } ] }, "limit": { "type": "integer", "minimum": 1, "maximum": 1000 } } }, "params-conversation.observe": { "type": "object", "additionalProperties": false, "required": [ "binding" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" } } }, "params-execution.launch": { "type": "object", "additionalProperties": false, "required": [ "agentId", "mode", "assignmentRefs", "sessionId", "workMode", "replacementBinding", "expectedControlGeneration", "replacementDecisionRef" ], "properties": { "agentId": { "$ref": "#/$defs/id" }, "mode": { "enum": [ "resume", "fresh" ] }, "assignmentRefs": { "type": "array", "items": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "assignment" } } } ] }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "sessionId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] }, "workMode": { "enum": [ "continue", "select", "abandon", "none" ] }, "replacementBinding": { "oneOf": [ { "$ref": "#/$defs/executionBinding" }, { "type": "null" } ] }, "expectedControlGeneration": { "oneOf": [ { "$ref": "#/$defs/revision" }, { "type": "null" } ] }, "replacementDecisionRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "mode": { "const": "fresh" } } }, "then": { "properties": { "sessionId": { "type": "null" } } }, "else": { "properties": { "replacementBinding": { "type": "null" }, "expectedControlGeneration": { "type": "null" }, "replacementDecisionRef": { "type": "null" } } } }, { "if": { "properties": { "workMode": { "enum": [ "select", "abandon" ] } } }, "then": { "properties": { "assignmentRefs": { "minItems": 1 } } }, "else": { "properties": { "assignmentRefs": { "maxItems": 0 } } } }, { "if": { "properties": { "replacementBinding": { "type": "null" } } }, "then": { "properties": { "expectedControlGeneration": { "type": "null" }, "replacementDecisionRef": { "type": "null" } } }, "else": { "properties": { "expectedControlGeneration": { "$ref": "#/$defs/revision" } } } } ] }, "params-execution.control": { "type": "object", "additionalProperties": false, "required": [ "binding", "connectionId" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "connectionId": { "$ref": "#/$defs/runtimeId" } } }, "params-execution.transfer": { "type": "object", "additionalProperties": false, "required": [ "binding", "fromConnectionId", "toConnectionId", "expectedControlGeneration" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "fromConnectionId": { "$ref": "#/$defs/runtimeId" }, "toConnectionId": { "$ref": "#/$defs/runtimeId" }, "expectedControlGeneration": { "$ref": "#/$defs/revision" } } }, "params-workspace.retire": { "type": "object", "additionalProperties": false, "required": [ "workspaceRef", "decisionRef" ], "properties": { "workspaceRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "workspace" } } } ] }, "decisionRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] } } }, "params-workspace.reopen": { "type": "object", "additionalProperties": false, "required": [ "workspaceRef", "decisionRef" ], "properties": { "workspaceRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "workspace" } } } ] }, "decisionRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] } } }, "params-message.send": { "type": "object", "additionalProperties": false, "required": [ "recipient", "messageKind", "bodyRef", "subjectRefs", "expiresAt", "replyToMessageId" ], "properties": { "recipient": { "$ref": "#/$defs/recipient" }, "messageKind": { "enum": [ "work-notice", "conversation", "execution-result", "approval" ] }, "bodyRef": { "$ref": "#/$defs/artifactRef" }, "subjectRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "expiresAt": { "$ref": "#/$defs/time" }, "replyToMessageId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "messageKind": { "enum": [ "execution-result", "approval" ] } } }, "then": { "properties": { "recipient": { "properties": { "routing": { "const": "exact-execution" } } }, "subjectRefs": { "minItems": 1 } } } } ] }, "params-audit.read": { "type": "object", "additionalProperties": false, "required": [ "artifactRefs" ], "properties": { "artifactRefs": { "type": "array", "items": { "$ref": "#/$defs/artifactRef" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true } } }, "params-decision.issue": { "type": "object", "additionalProperties": false, "required": [ "proposedId", "proposedPayloadRef" ], "properties": { "proposedId": { "$ref": "#/$defs/id" }, "proposedPayloadRef": { "$ref": "#/$defs/artifactRef" } } }, "params-session.adopt": { "type": "object", "additionalProperties": false, "required": [ "agentId", "legacySnapshotRef", "decisionRef" ], "properties": { "agentId": { "$ref": "#/$defs/id" }, "legacySnapshotRef": { "$ref": "#/$defs/artifactRef" }, "decisionRef": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] } } }, "process-observationRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "binding", "backend", "containerId", "imageDigest", "processGroupRef", "state" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "backend": { "const": "docker" }, "containerId": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "imageDigest": { "$ref": "#/$defs/digest" }, "processGroupRef": { "$ref": "#/$defs/id" }, "state": { "enum": [ "created", "running", "exited", "absent", "unknown" ] } } }, "runtime-process-observation": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "process-observation" }, "payload": { "$ref": "#/$defs/process-observationRuntimePayload" } } } ] }, "termination-proofRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "binding", "processRef", "observerId", "processGroupEmpty", "observationRefs", "proofMode", "admissionFenced", "startAdmitted" ], "properties": { "binding": { "$ref": "#/$defs/executionBinding" }, "processRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] }, "observerId": { "$ref": "#/$defs/id" }, "processGroupEmpty": { "const": true }, "observationRefs": { "type": "array", "items": { "$ref": "#/$defs/artifactRef" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "proofMode": { "enum": [ "stopped", "never-started" ] }, "admissionFenced": { "const": true }, "startAdmitted": { "type": "boolean" } }, "allOf": [ { "if": { "properties": { "proofMode": { "const": "stopped" } } }, "then": { "properties": { "processRef": { "$ref": "#/$defs/artifactRef" } } }, "else": { "properties": { "startAdmitted": { "const": false } } } } ] }, "runtime-termination-proof": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "termination-proof" }, "payload": { "$ref": "#/$defs/termination-proofRuntimePayload" } } } ] }, "delegation-basisRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "grantee", "scope", "operations", "existingScopeRefs", "newProjectIds", "newWorkspaceIds", "parentDecisionRef", "expiresAt", "maxUses", "ceilingRefs" ], "properties": { "grantee": { "$ref": "#/$defs/actor" }, "scope": { "$ref": "#/$defs/scope" }, "operations": { "type": "array", "items": { "$ref": "#/$defs/operation" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "existingScopeRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "newProjectIds": { "type": "array", "items": { "$ref": "#/$defs/id" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "newWorkspaceIds": { "type": "array", "items": { "$ref": "#/$defs/id" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "parentDecisionRef": { "oneOf": [ { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] }, { "type": "null" } ] }, "expiresAt": { "oneOf": [ { "$ref": "#/$defs/time" }, { "type": "null" } ] }, "maxUses": { "type": "integer", "minimum": 1, "maximum": 1000000 }, "ceilingRefs": { "type": "array", "items": { "$ref": "#/$defs/registryRef" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true } } }, "runtime-delegation-basis": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "delegation-basis" }, "payload": { "$ref": "#/$defs/delegation-basisRuntimePayload" } } } ] }, "decision-basisRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "decisionKind", "subjectRefs", "criteriaIds", "authorActors", "reviewer", "reviewedEvidenceRefs", "rationaleRef", "priorDecisionRefs", "requestId", "requestDigest", "binding" ], "properties": { "decisionKind": { "enum": [ "plan-approval", "assignment-change", "acceptance", "owner-checkpoint", "reconciliation" ] }, "subjectRefs": { "type": "array", "items": { "$ref": "#/$defs/recordRef" }, "minItems": 1, "maxItems": 1024, "uniqueItems": true }, "criteriaIds": { "type": "array", "items": { "$ref": "#/$defs/id" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "authorActors": { "type": "array", "items": { "$ref": "#/$defs/actor" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "reviewer": { "oneOf": [ { "$ref": "#/$defs/actor" }, { "type": "null" } ] }, "reviewedEvidenceRefs": { "type": "array", "items": { "$ref": "#/$defs/artifactRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "rationaleRef": { "$ref": "#/$defs/artifactRef" }, "priorDecisionRefs": { "type": "array", "items": { "allOf": [ { "$ref": "#/$defs/recordRef" }, { "properties": { "kind": { "const": "decision" } } } ] }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "requestId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] }, "requestDigest": { "oneOf": [ { "$ref": "#/$defs/digest" }, { "type": "null" } ] }, "binding": { "oneOf": [ { "$ref": "#/$defs/executionBinding" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "decisionKind": { "const": "acceptance" } } }, "then": { "properties": { "criteriaIds": { "minItems": 1 }, "authorActors": { "minItems": 1 }, "reviewer": { "$ref": "#/$defs/actor" }, "reviewedEvidenceRefs": { "minItems": 1 } } } }, { "if": { "properties": { "requestId": { "type": "null" } } }, "then": { "properties": { "requestDigest": { "type": "null" } } }, "else": { "properties": { "requestDigest": { "$ref": "#/$defs/digest" } } } } ] }, "runtime-decision-basis": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "decision-basis" }, "payload": { "$ref": "#/$defs/decision-basisRuntimePayload" } } } ] }, "controlResponse": { "type": "object", "additionalProperties": false, "required": [ "responseVersion", "requestId", "outcome", "reasonCode", "receiptRef", "executionId", "dataRef" ], "properties": { "responseVersion": { "const": 1 }, "requestId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] }, "outcome": { "enum": [ "succeeded", "accepted", "already-active", "refused", "unknown" ] }, "reasonCode": { "enum": [ "allowed", "invalid-request", "not-authorized", "stale-revision", "missing-state", "already-active", "control-conflict", "retired", "unsupported-capability", "audit-unavailable", "unknown-effects", "unsafe-replacement", "request-id-conflict", "expired" ] }, "receiptRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] }, "executionId": { "oneOf": [ { "$ref": "#/$defs/runtimeId" }, { "type": "null" } ] }, "dataRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] } }, "allOf": [ { "if": { "properties": { "outcome": { "enum": [ "succeeded", "accepted" ] } } }, "then": { "properties": { "requestId": { "$ref": "#/$defs/runtimeId" }, "reasonCode": { "const": "allowed" }, "receiptRef": { "$ref": "#/$defs/artifactRef" } } } }, { "if": { "properties": { "outcome": { "const": "already-active" } } }, "then": { "properties": { "requestId": { "$ref": "#/$defs/runtimeId" }, "reasonCode": { "const": "already-active" }, "receiptRef": { "$ref": "#/$defs/artifactRef" }, "executionId": { "$ref": "#/$defs/runtimeId" } } } }, { "if": { "properties": { "outcome": { "const": "refused" } } }, "then": { "properties": { "reasonCode": { "not": { "enum": [ "allowed", "already-active" ] } }, "dataRef": { "type": "null" }, "executionId": { "type": "null" } } } }, { "if": { "properties": { "outcome": { "const": "unknown" } } }, "then": { "properties": { "reasonCode": { "enum": [ "unknown-effects", "audit-unavailable" ] }, "dataRef": { "type": "null" } } } }, { "if": { "properties": { "requestId": { "type": "null" } } }, "then": { "properties": { "outcome": { "const": "refused" }, "reasonCode": { "const": "invalid-request" } } } } ] }, "command-resultRuntimePayload": { "type": "object", "additionalProperties": false, "required": [ "commandId", "binding", "outcomeEventId", "stdoutRef", "stderrRef", "outputRefs", "outputTruncated" ], "properties": { "commandId": { "$ref": "#/$defs/runtimeId" }, "binding": { "$ref": "#/$defs/executionBinding" }, "outcomeEventId": { "$ref": "#/$defs/runtimeId" }, "stdoutRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] }, "stderrRef": { "oneOf": [ { "$ref": "#/$defs/artifactRef" }, { "type": "null" } ] }, "outputRefs": { "type": "array", "items": { "$ref": "#/$defs/artifactRef" }, "minItems": 0, "maxItems": 1024, "uniqueItems": true }, "outputTruncated": { "type": "boolean" } } }, "runtime-command-result": { "allOf": [ { "$ref": "#/$defs/runtimeEnvelope" }, { "properties": { "kind": { "const": "command-result" }, "payload": { "$ref": "#/$defs/command-resultRuntimePayload" } } } ] } } }