Skip to content

Commit 8b74bbf

Browse files
committed
schemas: add DeltaSurface (delta) schema
1 parent 405709a commit 8b74bbf

1 file changed

Lines changed: 105 additions & 0 deletions

File tree

schemas/DeltaSurface.json

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.srcos.ai/v2/DeltaSurface.json",
4+
"title": "DeltaSurface",
5+
"description": "A signed diff between two TruthSurfaces. Records drift metrics + gate results + recommendation. This is an interoperability artifact and should reference existing evidence/provenance objects, not duplicate them.",
6+
"type": "object",
7+
"additionalProperties": false,
8+
"required": ["id", "type", "specVersion", "fromRef", "toRef", "createdAt", "merkleRoot", "signature", "gate"],
9+
"properties": {
10+
"id": {
11+
"type": "string",
12+
"pattern": "^urn:srcos:delta-surface:",
13+
"description": "Stable URN identifier. Pattern: urn:srcos:delta-surface:<local-id>"
14+
},
15+
"type": {
16+
"const": "DeltaSurface",
17+
"description": "Discriminator constant — always \"DeltaSurface\"."
18+
},
19+
"specVersion": {
20+
"type": "string",
21+
"description": "Spec version of this document (e.g., \"2.0.0\")."
22+
},
23+
"createdAt": {
24+
"type": "string",
25+
"format": "date-time",
26+
"description": "ISO 8601 timestamp when this delta surface was produced."
27+
},
28+
"merkleRoot": {
29+
"type": "string",
30+
"minLength": 1,
31+
"description": "Merkle root over referenced artifacts (format is producer-defined; commonly sha256:<hex>)."
32+
},
33+
"signer": {
34+
"type": "string",
35+
"description": "Logical signer identity (key or service name)."
36+
},
37+
"signature": {
38+
"type": "string",
39+
"minLength": 1,
40+
"description": "Cryptographic signature over the canonicalized delta payload."
41+
},
42+
43+
"fromRef": {
44+
"type": "string",
45+
"pattern": "^urn:srcos:truth-surface:",
46+
"description": "URN of the prior TruthSurface."
47+
},
48+
"toRef": {
49+
"type": "string",
50+
"pattern": "^urn:srcos:truth-surface:",
51+
"description": "URN of the new TruthSurface."
52+
},
53+
54+
"metrics": {
55+
"type": "object",
56+
"additionalProperties": false,
57+
"description": "Optional drift metrics. Keep metrics stable and documented to avoid metric sprawl.",
58+
"properties": {
59+
"semantic": {
60+
"type": "object",
61+
"additionalProperties": true,
62+
"description": "Semantic drift summary (topic/anchor/glossary drift)."
63+
},
64+
"runtime": {
65+
"type": "object",
66+
"additionalProperties": true,
67+
"description": "Runtime drift summary (process/thread/namespace posture changes)."
68+
},
69+
"governance": {
70+
"type": "object",
71+
"additionalProperties": true,
72+
"description": "Governance drift summary (approvals, obligations, policy pack changes)."
73+
}
74+
}
75+
},
76+
77+
"gate": {
78+
"type": "object",
79+
"additionalProperties": false,
80+
"description": "Gate evaluation result block (reuse the posture expressed in the default policy pack).",
81+
"required": ["status"],
82+
"properties": {
83+
"status": {
84+
"type": "string",
85+
"enum": ["permit", "deny", "needs_more_evidence"],
86+
"description": "Overall gate outcome."
87+
},
88+
"riskScore": { "type": "integer", "minimum": 0 },
89+
"riskThreshold": { "type": "integer", "minimum": 0 },
90+
"humanApprovalRequired": { "type": "boolean" },
91+
"humanApproved": { "type": "boolean" },
92+
"evidenceRequired": { "type": "array", "items": { "type": "string" } },
93+
"evidencePresent": { "type": "array", "items": { "type": "string" } },
94+
"evidenceMissing": { "type": "array", "items": { "type": "string" } },
95+
"reasons": { "type": "array", "items": { "type": "string" } }
96+
}
97+
},
98+
99+
"refs": {
100+
"type": "object",
101+
"additionalProperties": true,
102+
"description": "Pointers to evidence bundles, policy decisions, and Cairn anchors relevant to this delta."
103+
}
104+
}
105+
}

0 commit comments

Comments
 (0)