archctx 0.2.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archctx",
3
- "version": "0.2.3",
3
+ "version": "0.4.0",
4
4
  "description": "Local architecture context CLI for agentic coding workflows.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "node": ">=24 <26"
24
24
  },
25
25
  "dependencies": {
26
- "@colbymchenry/codegraph": "1.4.0",
26
+ "@colbymchenry/codegraph": "1.5.0",
27
27
  "@node-rs/jieba": "^2.0.1"
28
28
  }
29
29
  }
@@ -0,0 +1,97 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archctx.repoharness.com/schemas/repo/architecture-flow.schema.json",
4
+ "title": "ArchitectureFlowV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "id", "capabilityId", "name", "applicability"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.flow/v1" },
10
+ "id": { "type": "string", "pattern": "^flow\\.[a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)*$" },
11
+ "capabilityId": { "type": "string", "pattern": "^capability\\.[a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)*$" },
12
+ "name": { "type": "string", "minLength": 1 },
13
+ "applicability": { "type": "string", "enum": ["required", "not-applicable"] },
14
+ "rationale": { "type": "string", "minLength": 1 },
15
+ "participants": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "items": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["id", "nodeId"],
22
+ "properties": {
23
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)*$" },
24
+ "nodeId": { "type": "string", "minLength": 1 }
25
+ }
26
+ }
27
+ },
28
+ "steps": {
29
+ "type": "array",
30
+ "minItems": 1,
31
+ "items": { "$ref": "#/$defs/step" }
32
+ },
33
+ "outcomes": {
34
+ "type": "array",
35
+ "minItems": 2,
36
+ "items": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["id", "kind", "label", "steps", "terminal"],
40
+ "properties": {
41
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)*$" },
42
+ "kind": { "type": "string", "enum": ["success", "error"] },
43
+ "label": { "type": "string", "minLength": 1 },
44
+ "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/step" } },
45
+ "terminal": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["participant", "label"],
49
+ "properties": {
50
+ "participant": { "type": "string", "minLength": 1 },
51
+ "label": { "type": "string", "minLength": 1 }
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "allOf": [
57
+ { "contains": { "type": "object", "properties": { "kind": { "const": "success" } }, "required": ["kind"] }, "minContains": 1 },
58
+ { "contains": { "type": "object", "properties": { "kind": { "const": "error" } }, "required": ["kind"] }, "minContains": 1 }
59
+ ]
60
+ }
61
+ },
62
+ "$defs": {
63
+ "evidenceSelector": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": ["entrypointId", "sourceSymbol", "sinkId"],
67
+ "properties": {
68
+ "entrypointId": { "type": "string", "minLength": 1 },
69
+ "sourceSymbol": { "type": "string", "minLength": 1 },
70
+ "sinkId": { "type": "string", "minLength": 1 }
71
+ }
72
+ },
73
+ "step": {
74
+ "type": "object",
75
+ "additionalProperties": false,
76
+ "required": ["id", "from", "to", "label", "evidence"],
77
+ "properties": {
78
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)*$" },
79
+ "from": { "type": "string", "minLength": 1 },
80
+ "to": { "type": "string", "minLength": 1 },
81
+ "label": { "type": "string", "minLength": 1 },
82
+ "evidence": { "$ref": "#/$defs/evidenceSelector" }
83
+ }
84
+ }
85
+ },
86
+ "oneOf": [
87
+ {
88
+ "properties": { "applicability": { "const": "required" } },
89
+ "required": ["participants", "steps", "outcomes"]
90
+ },
91
+ {
92
+ "properties": { "applicability": { "const": "not-applicable" } },
93
+ "required": ["rationale"],
94
+ "not": { "anyOf": [{ "required": ["participants"] }, { "required": ["steps"] }, { "required": ["outcomes"] }] }
95
+ }
96
+ ]
97
+ }
@@ -6,7 +6,7 @@
6
6
  "additionalProperties": false,
7
7
  "required": ["schemaVersion", "id", "kind", "name", "status", "summary"],
8
8
  "properties": {
9
- "schemaVersion": { "const": "archcontext.node/v1" },
9
+ "schemaVersion": { "const": "archcontext.node/v2" },
10
10
  "id": { "type": "string", "pattern": "^([a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)*::)?[a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)+$" },
11
11
  "kind": {
12
12
  "type": "string",
@@ -23,7 +23,44 @@
23
23
  "properties": {
24
24
  "include": { "type": "array", "items": { "type": "string" } },
25
25
  "exclude": { "type": "array", "items": { "type": "string" } },
26
- "entrypoints": { "type": "array", "items": { "type": "string" } }
26
+ "entrypoints": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["id", "path", "symbols"],
32
+ "properties": {
33
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)+$" },
34
+ "path": { "type": "string", "minLength": 1 },
35
+ "symbols": {
36
+ "type": "array",
37
+ "minItems": 1,
38
+ "items": {
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["name", "sinks"],
42
+ "properties": {
43
+ "name": { "type": "string", "minLength": 1 },
44
+ "sinks": {
45
+ "type": "array",
46
+ "minItems": 1,
47
+ "items": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["id", "path", "symbol"],
51
+ "properties": {
52
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)+$" },
53
+ "path": { "type": "string", "minLength": 1 },
54
+ "symbol": { "type": "string", "minLength": 1 }
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
27
64
  }
28
65
  },
29
66
  "ownership": {
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/archctx-capabilities.schema.json",
4
+ "title": "ArchctxCapabilitiesV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "package", "protocols", "renderers", "features"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.capabilities/v1" },
10
+ "package": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["name", "version"],
14
+ "properties": {
15
+ "name": { "const": "archctx" },
16
+ "version": { "type": "string", "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$" }
17
+ }
18
+ },
19
+ "protocols": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["projectionRequest", "projectionResult", "architectureRefreshSignal"],
23
+ "properties": {
24
+ "projectionRequest": { "const": "archcontext.projection-request/v1" },
25
+ "projectionResult": { "const": "archcontext.projection-result/v1" },
26
+ "architectureRefreshSignal": { "const": "archcontext.architecture-refresh-signal/v1" }
27
+ }
28
+ },
29
+ "renderers": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["architectureDocs", "agentContext"],
33
+ "properties": {
34
+ "architectureDocs": { "const": "archcontext.docs-renderer/v2" },
35
+ "agentContext": { "const": "archcontext.agent-context-renderer/v1" }
36
+ }
37
+ },
38
+ "features": {
39
+ "type": "array",
40
+ "minItems": 3,
41
+ "uniqueItems": true,
42
+ "items": { "enum": ["architecture-docs-renderer-v2", "architecture-refresh-signal-v1", "projection-protocol-v1"] }
43
+ }
44
+ }
45
+ }
@@ -5,11 +5,25 @@
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "required": ["schemaVersion", "eventId", "eventType", "payloadVersion", "repository", "worktree", "baseDigest", "resultingDigest", "headSha", "actor", "source", "timestamp", "idempotencyKey", "provenance", "payload"],
8
+ "oneOf": [
9
+ {
10
+ "properties": {
11
+ "payloadVersion": { "const": "archcontext.architecture-evidence-lifecycle/v2" },
12
+ "payload": { "required": ["evidenceOperations"] }
13
+ }
14
+ },
15
+ {
16
+ "properties": {
17
+ "payloadVersion": { "pattern": "^(?!archcontext\\.architecture-evidence-lifecycle/v2$).+" },
18
+ "payload": { "not": { "required": ["evidenceOperations"] } }
19
+ }
20
+ }
21
+ ],
8
22
  "properties": {
9
23
  "schemaVersion": { "const": "archcontext.architecture-event/v1" },
10
24
  "eventId": { "type": "string", "pattern": "^arch_event\\.[a-zA-Z0-9_-]+$" },
11
25
  "eventType": { "type": "string" },
12
- "payloadVersion": { "type": "string", "pattern": "^v[0-9]+$" },
26
+ "payloadVersion": { "type": "string", "pattern": "^(v[0-9]+|archcontext\\.[a-z0-9.-]+/v[0-9]+)$" },
13
27
  "repository": {
14
28
  "type": "object",
15
29
  "additionalProperties": false,
@@ -66,11 +80,167 @@
66
80
  "subjectIds": { "type": "array", "items": { "type": "string" } },
67
81
  "summary": { "type": "string" },
68
82
  "changesDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
69
- "metadata": { "type": "object", "additionalProperties": true }
83
+ "metadata": { "type": "object", "additionalProperties": true },
84
+ "evidenceOperations": {
85
+ "type": "array",
86
+ "items": {
87
+ "oneOf": [
88
+ {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": ["target", "action", "evidenceId", "value"],
92
+ "properties": {
93
+ "target": { "const": "item" },
94
+ "action": { "const": "create" },
95
+ "evidenceId": { "type": "string", "minLength": 1 },
96
+ "value": { "$ref": "#/$defs/evidenceItem" }
97
+ }
98
+ },
99
+ {
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "required": ["target", "action", "evidenceId", "previousDigest", "value"],
103
+ "properties": {
104
+ "target": { "const": "item" },
105
+ "action": { "const": "update" },
106
+ "evidenceId": { "type": "string", "minLength": 1 },
107
+ "previousDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
108
+ "value": { "$ref": "#/$defs/evidenceItem" }
109
+ }
110
+ },
111
+ {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": ["target", "action", "evidenceId", "previousDigest", "reasonCode"],
115
+ "properties": {
116
+ "target": { "const": "item" },
117
+ "action": { "const": "remove" },
118
+ "evidenceId": { "type": "string", "minLength": 1 },
119
+ "previousDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
120
+ "reasonCode": { "type": "string", "minLength": 1 }
121
+ }
122
+ },
123
+ {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": ["target", "action", "bindingId", "value"],
127
+ "properties": {
128
+ "target": { "const": "binding" },
129
+ "action": { "const": "create" },
130
+ "bindingId": { "type": "string", "minLength": 1 },
131
+ "value": { "$ref": "#/$defs/evidenceBinding" }
132
+ }
133
+ },
134
+ {
135
+ "type": "object",
136
+ "additionalProperties": false,
137
+ "required": ["target", "action", "bindingId", "previousDigest", "value"],
138
+ "properties": {
139
+ "target": { "const": "binding" },
140
+ "action": { "const": "update" },
141
+ "bindingId": { "type": "string", "minLength": 1 },
142
+ "previousDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
143
+ "value": { "$ref": "#/$defs/evidenceBinding" }
144
+ }
145
+ },
146
+ {
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": ["target", "action", "bindingId", "previousDigest", "reasonCode"],
150
+ "properties": {
151
+ "target": { "const": "binding" },
152
+ "action": { "const": "remove" },
153
+ "bindingId": { "type": "string", "minLength": 1 },
154
+ "previousDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
155
+ "reasonCode": { "type": "string", "minLength": 1 }
156
+ }
157
+ }
158
+ ]
159
+ }
160
+ }
70
161
  }
71
162
  },
72
163
  "previousEventHash": { "type": ["string", "null"], "pattern": "^sha256:[a-f0-9]{64}$" },
73
164
  "eventHash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
74
165
  "extensions": { "type": "object", "additionalProperties": true }
166
+ },
167
+ "$defs": {
168
+ "provenance": {
169
+ "type": "object",
170
+ "additionalProperties": false,
171
+ "required": ["producer", "command", "inputDigest"],
172
+ "properties": {
173
+ "producer": { "type": "string", "minLength": 1 },
174
+ "command": { "type": "string", "minLength": 1 },
175
+ "inputDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
176
+ "traceDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
177
+ }
178
+ },
179
+ "evidenceItem": {
180
+ "type": "object",
181
+ "additionalProperties": false,
182
+ "required": ["schemaVersion", "evidenceId", "kind", "strength", "polarity", "origin", "subject", "selector", "summary", "coverage", "supports", "provenance", "createdAt", "digest"],
183
+ "properties": {
184
+ "schemaVersion": { "const": "archcontext.evidence-item/v2" },
185
+ "evidenceId": { "type": "string", "pattern": "^evidence\\.[a-zA-Z0-9_.-]+$" },
186
+ "kind": { "type": "string", "minLength": 1 },
187
+ "strength": { "enum": ["heuristic", "declared", "observed", "verified"] },
188
+ "polarity": { "enum": ["positive", "absence", "declaration"] },
189
+ "origin": { "enum": ["codegraph", "model-store-yaml", "checkpoint", "runtime-daemon", "user", "subagent", "external-doc"] },
190
+ "subject": { "type": "string", "minLength": 1 },
191
+ "selector": {
192
+ "type": "object",
193
+ "additionalProperties": false,
194
+ "required": ["kind", "id"],
195
+ "properties": {
196
+ "kind": { "enum": ["repository", "path", "symbol", "relation", "constraint", "practice", "event", "snapshot"] },
197
+ "id": { "type": "string", "minLength": 1 },
198
+ "path": { "type": "string" },
199
+ "symbolId": { "type": "string" },
200
+ "startLine": { "type": "integer", "minimum": 1 },
201
+ "endLine": { "type": "integer", "minimum": 1 }
202
+ }
203
+ },
204
+ "summary": { "type": "string" },
205
+ "coverage": {
206
+ "type": "object",
207
+ "additionalProperties": false,
208
+ "required": ["level", "scope"],
209
+ "properties": {
210
+ "level": { "enum": ["complete", "partial", "unknown"] },
211
+ "scope": { "type": "string" }
212
+ }
213
+ },
214
+ "supports": { "type": "array", "items": { "enum": ["recommendation", "checkpoint", "complete"] } },
215
+ "provenance": { "$ref": "#/$defs/provenance" },
216
+ "createdAt": { "type": "string" },
217
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
218
+ "extensions": { "type": "object", "additionalProperties": true }
219
+ }
220
+ },
221
+ "evidenceBinding": {
222
+ "type": "object",
223
+ "additionalProperties": false,
224
+ "required": ["schemaVersion", "bindingId", "evidenceId", "target", "bindingReason", "authorityEffect", "createdAt", "provenance"],
225
+ "properties": {
226
+ "schemaVersion": { "const": "archcontext.evidence-binding/v1" },
227
+ "bindingId": { "type": "string", "pattern": "^binding\\.[a-zA-Z0-9_.-]+$" },
228
+ "evidenceId": { "type": "string", "pattern": "^evidence\\.[a-zA-Z0-9_.-]+$" },
229
+ "target": {
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "required": ["kind", "id"],
233
+ "properties": {
234
+ "kind": { "enum": ["entity", "relation", "constraint", "recommendation", "practice", "event", "snapshot", "subject", "candidate-delta"] },
235
+ "id": { "type": "string", "minLength": 1 }
236
+ }
237
+ },
238
+ "bindingReason": { "enum": ["direct-selector", "predicate-subject", "change-cursor", "human-attestation", "deterministic-check", "subagent-proposal"] },
239
+ "authorityEffect": { "enum": ["context-only", "ranking", "checkpoint-eligible", "complete-eligible"] },
240
+ "createdAt": { "type": "string" },
241
+ "provenance": { "$ref": "#/$defs/provenance" },
242
+ "extensions": { "type": "object", "additionalProperties": true }
243
+ }
244
+ }
75
245
  }
76
246
  }
@@ -0,0 +1,88 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/architecture-refresh-signal.schema.json",
4
+ "title": "ArchitectureRefreshSignalV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "signalId", "idempotencyKey", "mode", "repository", "worktree", "cause", "reasonCodes", "affectedNodeIds", "refreshTargets", "baseDigests", "resultingDigests", "projectionReceiptDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.architecture-refresh-signal/v1" },
10
+ "signalId": { "$ref": "#/$defs/digest" },
11
+ "idempotencyKey": { "$ref": "#/$defs/digest" },
12
+ "mode": { "enum": ["human-action-required", "refresh-required"] },
13
+ "repository": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["repositoryId"],
17
+ "properties": { "repositoryId": { "type": "string", "minLength": 1 } }
18
+ },
19
+ "worktree": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["workspaceId", "headSha", "worktreeDigest"],
23
+ "properties": {
24
+ "workspaceId": { "type": "string", "minLength": 1 },
25
+ "headSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
26
+ "worktreeDigest": { "$ref": "#/$defs/digest" }
27
+ }
28
+ },
29
+ "cause": { "enum": ["accepted-semantic-delta", "unresolved-major-candidate", "verified-flow-proof-delta"] },
30
+ "acceptedChange": { "$ref": "#/$defs/acceptedChange" },
31
+ "reasonCodes": {
32
+ "type": "array",
33
+ "minItems": 1,
34
+ "uniqueItems": true,
35
+ "items": { "$ref": "#/$defs/reasonCode" }
36
+ },
37
+ "affectedNodeIds": {
38
+ "type": "array",
39
+ "minItems": 1,
40
+ "uniqueItems": true,
41
+ "items": { "type": "string", "minLength": 1 }
42
+ },
43
+ "refreshTargets": {
44
+ "type": "array",
45
+ "minItems": 1,
46
+ "uniqueItems": true,
47
+ "items": { "enum": ["architecture-contract-context", "architecture-readiness", "architecture-request-index", "capability-context", "capability-index"] }
48
+ },
49
+ "baseDigests": { "$ref": "#/$defs/digestSet" },
50
+ "resultingDigests": { "$ref": "#/$defs/digestSet" },
51
+ "projectionReceiptDigest": { "$ref": "#/$defs/digest" }
52
+ },
53
+ "allOf": [
54
+ {
55
+ "if": { "properties": { "cause": { "const": "unresolved-major-candidate" } }, "required": ["cause"] },
56
+ "then": { "properties": { "mode": { "const": "human-action-required" } }, "not": { "required": ["acceptedChange"] } },
57
+ "else": { "properties": { "mode": { "const": "refresh-required" } }, "required": ["acceptedChange"] }
58
+ }
59
+ ],
60
+ "$defs": {
61
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
62
+ "reasonCode": {
63
+ "enum": ["constraint-changed", "entrypoint-changed", "interface-changed", "lifecycle-changed", "node-added", "node-moved", "node-removed", "node-renamed", "ownership-changed", "relation-changed", "responsibility-changed", "risk-boundary-changed", "verified-flow-proof-changed"]
64
+ },
65
+ "acceptedChange": {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": ["changeSetId", "eventId", "reasonCodes", "affectedNodeIds"],
69
+ "properties": {
70
+ "changeSetId": { "type": "string", "minLength": 1 },
71
+ "eventId": { "type": "string", "minLength": 1 },
72
+ "reasonCodes": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/reasonCode" } },
73
+ "affectedNodeIds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }
74
+ }
75
+ },
76
+ "digestSet": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": ["modelDigest", "sourceTreeDigest", "flowProofDigest", "projectionDigest"],
80
+ "properties": {
81
+ "modelDigest": { "$ref": "#/$defs/digest" },
82
+ "sourceTreeDigest": { "$ref": "#/$defs/digest" },
83
+ "flowProofDigest": { "$ref": "#/$defs/digest" },
84
+ "projectionDigest": { "$ref": "#/$defs/digest" }
85
+ }
86
+ }
87
+ }
88
+ }
@@ -4,9 +4,9 @@
4
4
  "title": "ArchitectureSnapshot",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["schemaVersion", "snapshotId", "repository", "worktree", "sourceMode", "eventCursor", "graphDigest", "projectionDigest", "entityCount", "relationCount", "constraintCount", "inputDigests", "createdAt"],
7
+ "required": ["schemaVersion", "snapshotId", "repository", "worktree", "sourceMode", "eventCursor", "graphDigest", "evidenceDigest", "stateDigest", "state", "projectionDigest", "entityCount", "relationCount", "constraintCount", "inputDigests", "createdAt"],
8
8
  "properties": {
9
- "schemaVersion": { "const": "archcontext.architecture-snapshot/v1" },
9
+ "schemaVersion": { "const": "archcontext.architecture-snapshot/v2" },
10
10
  "snapshotId": { "type": "string", "pattern": "^arch_snapshot\\.[a-zA-Z0-9_-]+$" },
11
11
  "repository": {
12
12
  "type": "object",
@@ -29,17 +29,50 @@
29
29
  "worktreeDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
30
30
  }
31
31
  },
32
- "sourceMode": { "enum": ["yaml", "dual", "ledger-shadow", "ledger-authoritative"] },
32
+ "sourceMode": { "enum": ["yaml", "dual", "dual-compare", "ledger-shadow", "ledger", "ledger-authoritative"] },
33
33
  "eventCursor": {
34
34
  "type": "object",
35
35
  "additionalProperties": false,
36
- "required": ["lastEventId", "lastEventHash"],
36
+ "required": ["eventCount", "lastEventSequence", "lastEventId", "lastEventHash"],
37
37
  "properties": {
38
+ "eventCount": { "type": "integer", "minimum": 1 },
39
+ "lastEventSequence": { "type": "integer", "minimum": 1 },
38
40
  "lastEventId": { "type": "string", "pattern": "^arch_event\\.[a-zA-Z0-9_-]+$" },
39
41
  "lastEventHash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
40
42
  }
41
43
  },
42
44
  "graphDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
45
+ "evidenceDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
46
+ "stateDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
47
+ "state": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["graph", "evidence"],
51
+ "properties": {
52
+ "graph": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["entities", "relations", "constraints"],
56
+ "properties": {
57
+ "entities": { "type": "array", "items": { "type": "object" } },
58
+ "relations": { "type": "array", "items": { "type": "object" } },
59
+ "constraints": { "type": "array", "items": { "type": "object" } }
60
+ }
61
+ },
62
+ "evidence": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "required": ["schemaVersion", "evidenceItems", "evidenceBindings", "tombstones", "stateDigest"],
66
+ "properties": {
67
+ "schemaVersion": { "const": "archcontext.evidence-state-at-cursor/v1" },
68
+ "evidenceItems": { "type": "array", "items": { "type": "object" } },
69
+ "evidenceBindings": { "type": "array", "items": { "type": "object" } },
70
+ "tombstones": { "type": "array", "items": { "type": "object" } },
71
+ "stateDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
72
+ }
73
+ }
74
+ }
75
+ },
43
76
  "projectionDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
44
77
  "entityCount": { "type": "integer", "minimum": 0 },
45
78
  "relationCount": { "type": "integer", "minimum": 0 },
@@ -36,7 +36,7 @@
36
36
  "additionalProperties": true,
37
37
  "required": ["op", "expectedHash"],
38
38
  "properties": {
39
- "op": { "type": "string", "enum": ["create_entity", "update_entity_fields", "delete_entity", "write_policy", "write_waiver", "render_projection"] },
39
+ "op": { "type": "string", "enum": ["create_entity", "update_entity_fields", "delete_entity", "write_policy", "write_waiver", "render_projection", "render_agent_context"] },
40
40
  "entityId": { "type": "string" },
41
41
  "path": { "type": "string" },
42
42
  "expectedHash": { "type": "string" },
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archctx.repoharness.com/schemas/runtime/explorer-delta-query.schema.json",
4
+ "title": "ExplorerDeltaQueryV2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "base", "head"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.explorer-delta-query/v2" },
10
+ "base": { "$ref": "#/$defs/ref" },
11
+ "head": { "$ref": "#/$defs/ref" }
12
+ },
13
+ "$defs": {
14
+ "ref": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["eventId", "projectionDigest"],
18
+ "properties": {
19
+ "eventId": { "type": "string", "minLength": 1 },
20
+ "projectionDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
21
+ }
22
+ }
23
+ }
24
+ }