Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions schemas/BrowserAutomationReceipt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.srcos.ai/v2/BrowserAutomationReceipt.json",
"title": "BrowserAutomationReceipt",
"description": "Receipt for a user-visible, revocable browser automation session with explicit owner, transport, permission scope, policy decision, and evidence references.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"type",
"specVersion",
"sessionRef",
"ownerRef",
"transport",
"permissionScope",
"origin",
"userVisible",
"revocable",
"policyDecisionRef",
"evidenceRefs",
"capturedAt"
],
"properties": {
"id": { "type": "string", "pattern": "^urn:srcos:receipt:browser-automation:" },
"type": { "const": "BrowserAutomationReceipt" },
"specVersion": { "type": "string" },
"sessionRef": { "type": "string", "pattern": "^urn:srcos:session:" },
"ownerRef": { "type": "string" },
"transport": { "type": "string", "enum": ["native_pipe", "cdp", "webdriver", "extension", "accessibility"] },
"permissionScope": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": ["read_dom", "click", "type", "download", "upload", "inspect_network", "inspect_cookies", "use_credentials", "screenshot", "navigate", "read_clipboard", "write_clipboard"]
}
},
"origin": { "type": "string", "enum": ["local", "remote", "workspace"] },
"controlledScope": {
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"windowRef": { "type": ["string", "null"] },
"tabRef": { "type": ["string", "null"] },
"urlOrigin": { "type": ["string", "null"] },
"workspaceRef": { "type": ["string", "null"] }
}
},
"userVisible": { "type": "boolean", "const": true },
"revocable": { "type": "boolean", "const": true },
"revokedAt": { "type": ["string", "null"], "format": "date-time" },
"terminalState": { "type": ["string", "null"], "enum": ["active", "revoked", "completed", "failed", "denied", null] },
"policyDecisionRef": { "type": "string", "pattern": "^urn:srcos:decision:" },
"evidenceRefs": { "type": "array", "items": { "type": "string" } },
"capturedAt": { "type": "string", "format": "date-time" }
}
}
52 changes: 52 additions & 0 deletions schemas/CapabilityLedger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.srcos.ai/v2/CapabilityLedger.json",
"title": "CapabilityLedger",
"description": "Effective capability-state record after reconciling config, UI, runtime, server, plugin, policy, schema, and transport claims.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"type",
"specVersion",
"capabilityRef",
"declaredBy",
"negotiatedBy",
"effectiveState",
"policyDecisionRef",
"evidenceRefs",
"capturedAt"
],
"properties": {
"id": { "type": "string", "pattern": "^urn:srcos:capability-ledger:" },
"type": { "const": "CapabilityLedger" },
"specVersion": { "type": "string" },
"capabilityRef": { "type": "string", "pattern": "^urn:srcos:capability:" },
"declaredBy": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": ["config", "ui", "runtime", "server", "plugin", "policy", "schema", "transport", "user", "agent", "workspace"]
}
},
"negotiatedBy": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": ["config", "ui", "runtime", "server", "plugin", "policy", "schema", "transport", "user", "agent", "workspace"]
}
},
"effectiveState": {
"type": "string",
"enum": ["declared", "requested", "negotiating", "available", "enabled", "degraded", "blocked_by_policy", "unsupported_by_runtime", "unsupported_by_server", "missing_plugin", "missing_schema", "failed"]
},
"stateReason": { "type": ["string", "null"] },
"ownerRefs": { "type": "array", "items": { "type": "string" } },
"conflictRefs": { "type": "array", "items": { "type": "string" } },
"policyDecisionRef": { "type": "string", "pattern": "^urn:srcos:decision:" },
"evidenceRefs": { "type": "array", "items": { "type": "string" } },
"capturedAt": { "type": "string", "format": "date-time" }
}
}
228 changes: 228 additions & 0 deletions schemas/GitWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.srcos.ai/v2/GitWorkspaceState.json",
"title": "GitWorkspaceState",
"description": "Typed terminal/workspace Git-state classification emitted before passive Git discovery or user-requested Git operations, with severity discipline, redacted path evidence, session linkage, and capability-ledger linkage.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"type",
"specVersion",
"sessionRef",
"capabilityLedgerRef",
"workspaceRef",
"state",
"severity",
"operation",
"actionability",
"pathEvidence",
"gitFacts",
"policyDecisionRef",
"evidenceRefs",
"capturedAt"
],
"properties": {
"id": {
"type": "string",
"pattern": "^urn:srcos:git-workspace-state:"
},
"type": {
"const": "GitWorkspaceState"
},
"specVersion": {
"type": "string"
},
"sessionRef": {
"type": "string",
"pattern": "^urn:srcos:session:"
},
"capabilityLedgerRef": {
"type": "string",
"pattern": "^urn:srcos:capability-ledger:"
},
"agentMachineReceiptRef": {
"type": [
"string",
"null"
],
"pattern": "^urn:srcos:agent-machine-receipt:"
},
"workspaceRef": {
"type": "string",
"pattern": "^urn:srcos:workspace:"
},
"state": {
"type": "string",
"enum": [
"not_a_repo",
"repo_root",
"inside_worktree",
"inside_git_dir",
"bare_repo",
"worktree_no_remote",
"detached_head",
"corrupt_repo",
"permission_denied",
"operation_superseded"
]
},
"severity": {
"type": "string",
"enum": [
"debug",
"info",
"warning",
"error"
]
},
"operation": {
"type": "string",
"enum": [
"passive_discovery",
"watcher_refresh",
"user_requested_command",
"agent_requested_command",
"ci_validation"
]
},
"actionability": {
"type": "string",
"enum": [
"none",
"remediation_hint",
"blocked",
"quarantined"
]
},
"pathEvidence": {
"type": "object",
"additionalProperties": false,
"required": [
"pathDigest",
"redaction",
"rawPathStored"
],
"properties": {
"pathDigest": {
"type": "string",
"pattern": "^sha256:[a-fA-F0-9]{64}$"
},
"redactedPathHint": {
"type": [
"string",
"null"
]
},
"redaction": {
"type": "string",
"enum": [
"none",
"user_home_redacted",
"workspace_alias",
"digest_only"
]
},
"rawPathStored": {
"type": "boolean",
"const": false
}
}
},
"gitFacts": {
"type": "object",
"additionalProperties": false,
"required": [
"branch",
"headSha",
"remoteState",
"worktreeRootDigest",
"gitDirDigest"
],
"properties": {
"branch": {
"type": [
"string",
"null"
]
},
"headSha": {
"type": [
"string",
"null"
],
"pattern": "^[a-fA-F0-9]{7,40}$"
},
"remoteState": {
"type": "string",
"enum": [
"available",
"missing",
"not_applicable",
"error",
"unknown"
]
},
"worktreeRootDigest": {
"type": [
"string",
"null"
],
"pattern": "^sha256:[a-fA-F0-9]{64}$"
},
"gitDirDigest": {
"type": [
"string",
"null"
],
"pattern": "^sha256:[a-fA-F0-9]{64}$"
},
"failureReason": {
"type": [
"string",
"null"
]
},
"commandClass": {
"type": [
"string",
"null"
],
"enum": [
"config",
"rev_parse",
"symbolic_ref",
"for_each_ref",
"status",
"remote",
"watcher",
null
]
}
}
},
"expectedNegativeState": {
"type": "boolean"
},
"causalRefs": {
"type": "array",
"items": {
"type": "string"
}
},
"policyDecisionRef": {
"type": "string",
"pattern": "^urn:srcos:decision:"
},
"evidenceRefs": {
"type": "array",
"items": {
"type": "string"
}
},
"capturedAt": {
"type": "string",
"format": "date-time"
}
}
}
54 changes: 54 additions & 0 deletions schemas/OrphanEventReceipt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.srcos.ai/v2/OrphanEventReceipt.json",
"title": "OrphanEventReceipt",
"description": "Receipt for lifecycle events that could not initially attach to a known session DAG node and were recovered or quarantined with evidence.",
"type": "object",
"additionalProperties": false,
"required": ["id", "type", "specVersion", "eventRef", "eventClass", "observedAt", "sessionResolution", "ttl", "policyDecisionRef", "evidenceRefs", "capturedAt"],
"properties": {
"id": { "type": "string", "pattern": "^urn:srcos:receipt:orphan-event:" },
"type": { "const": "OrphanEventReceipt" },
"specVersion": { "type": "string" },
"eventRef": { "type": "string", "pattern": "^urn:srcos:event:" },
"eventClass": { "type": "string", "enum": ["agent_lifecycle", "runtime_lifecycle", "browser_automation", "terminal_workspace", "plugin", "transport", "unknown"] },
"observedAt": { "type": "string", "format": "date-time" },
"rawEventDigest": { "type": "string", "pattern": "^sha256:[a-fA-F0-9]{64}$" },
"sessionResolution": {
"type": "object",
"additionalProperties": false,
"required": ["state", "candidateSessionRefs", "recoveredSessionRef", "recoveredDagNodeRef", "reconciledAt", "quarantinedAt"],
"properties": {
"state": { "type": "string", "enum": ["queued", "recovered", "quarantined", "discarded_duplicate"] },
"candidateSessionRefs": { "type": "array", "items": { "type": "string", "pattern": "^urn:srcos:session:" } },
"recoveredSessionRef": { "type": ["string", "null"], "pattern": "^urn:srcos:session:" },
"recoveredDagNodeRef": { "type": ["string", "null"], "pattern": "^urn:srcos:session-dag-node:" },
"reconciledAt": { "type": ["string", "null"], "format": "date-time" },
"quarantinedAt": { "type": ["string", "null"], "format": "date-time" }
}
},
"ttl": {
"type": "object",
"additionalProperties": false,
"required": ["expiresAt", "expired"],
"properties": {
"expiresAt": { "type": "string", "format": "date-time" },
"expired": { "type": "boolean" }
}
},
"correlationKeys": {
"type": "object",
"additionalProperties": false,
"properties": {
"conversationId": { "type": ["string", "null"] },
"parentId": { "type": ["string", "null"] },
"workspaceRef": { "type": ["string", "null"], "pattern": "^urn:srcos:workspace:" },
"taskRef": { "type": ["string", "null"] }
}
},
"causalRefs": { "type": "array", "items": { "type": "string" } },
"policyDecisionRef": { "type": "string", "pattern": "^urn:srcos:decision:" },
"evidenceRefs": { "type": "array", "items": { "type": "string" } },
"capturedAt": { "type": "string", "format": "date-time" }
}
}