archctx 0.2.3 → 0.3.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.3.0",
4
4
  "description": "Local architecture context CLI for agentic coding workflows.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -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
  }
@@ -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 },
@@ -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
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archctx.repoharness.com/schemas/runtime/explorer-projection-delta.schema.json",
4
+ "title": "ExplorerProjectionDeltaV2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "base", "head", "factChanges", "evidenceChanges", "projectionChanges", "counts", "deltaDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.explorer-projection-delta/v2" },
10
+ "base": { "$ref": "#/$defs/cursor" },
11
+ "head": { "$ref": "#/$defs/cursor" },
12
+ "factChanges": { "type": "array", "items": { "allOf": [{ "$ref": "#/$defs/change" }, { "properties": { "deltaClass": { "const": "architecture-fact" } } }] } },
13
+ "evidenceChanges": { "type": "array", "items": { "allOf": [{ "$ref": "#/$defs/change" }, { "properties": { "deltaClass": { "const": "evidence" } } }] } },
14
+ "projectionChanges": { "type": "array", "items": { "allOf": [{ "$ref": "#/$defs/change" }, { "properties": { "deltaClass": { "const": "projection" } } }] } },
15
+ "counts": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["architecture-fact", "evidence", "projection"],
19
+ "properties": {
20
+ "architecture-fact": { "type": "integer", "minimum": 0 },
21
+ "evidence": { "type": "integer", "minimum": 0 },
22
+ "projection": { "type": "integer", "minimum": 0 }
23
+ }
24
+ },
25
+ "deltaDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
26
+ },
27
+ "$defs": {
28
+ "repository": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["repositoryId", "storageRepositoryId"],
32
+ "properties": {
33
+ "repositoryId": { "type": "string" },
34
+ "storageRepositoryId": { "type": "string" }
35
+ }
36
+ },
37
+ "worktree": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": ["workspaceId", "storageWorkspaceId", "branch", "headSha", "worktreeDigest"],
41
+ "properties": {
42
+ "workspaceId": { "type": "string" },
43
+ "storageWorkspaceId": { "type": "string" },
44
+ "branch": { "type": "string" },
45
+ "headSha": { "type": "string" },
46
+ "worktreeDigest": { "type": "string" }
47
+ }
48
+ },
49
+ "cursor": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["schemaVersion", "repository", "worktree", "eventSequence", "eventId", "eventHash", "graphDigest", "evidenceStateDigest", "projectionDigest", "inputManifestDigest"],
53
+ "properties": {
54
+ "schemaVersion": { "const": "archcontext.authority-cursor/v1" },
55
+ "repository": { "$ref": "#/$defs/repository" },
56
+ "worktree": { "$ref": "#/$defs/worktree" },
57
+ "eventSequence": { "type": "integer", "minimum": 1 },
58
+ "eventId": { "type": "string", "minLength": 1 },
59
+ "eventHash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
60
+ "graphDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
61
+ "evidenceStateDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
62
+ "projectionDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
63
+ "inputManifestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
64
+ }
65
+ },
66
+ "change": {
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": ["deltaClass", "subjectId", "change", "fields"],
70
+ "properties": {
71
+ "deltaClass": { "enum": ["architecture-fact", "evidence", "projection"] },
72
+ "subjectId": { "type": "string" },
73
+ "change": { "enum": ["added", "removed", "changed"] },
74
+ "fields": { "type": "array", "items": { "type": "string" } },
75
+ "verificationTransition": { "type": "object" }
76
+ }
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archctx.repoharness.com/schemas/runtime/explorer-projection-query-v2.schema.json",
4
+ "title": "ExplorerProjectionQueryV2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "viewId", "depth", "budget"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.explorer-projection-query/v2" },
10
+ "viewId": { "enum": ["system-map", "task-impact", "drift-pressure", "data-flow", "external-integrations"] },
11
+ "semanticLevel": { "enum": ["overview", "context", "detail"] },
12
+ "taskSessionId": { "type": "string", "minLength": 1 },
13
+ "expectedCursor": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["headSha", "worktreeDigest", "graphDigest"],
17
+ "properties": {
18
+ "headSha": { "type": "string" },
19
+ "worktreeDigest": { "type": "string" },
20
+ "graphDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
21
+ "observedFactsDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
22
+ }
23
+ },
24
+ "focus": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "required": ["subjectId"],
28
+ "properties": { "subjectId": { "type": "string" } }
29
+ },
30
+ "expandedOccurrenceIds": { "type": "array", "items": { "type": "string" } },
31
+ "depth": { "type": "integer", "minimum": 0, "maximum": 2 },
32
+ "budget": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["maxNodes", "maxRelations"],
36
+ "properties": {
37
+ "maxNodes": { "type": "integer", "minimum": 1, "maximum": 1000 },
38
+ "maxRelations": { "type": "integer", "minimum": 0, "maximum": 5000 }
39
+ }
40
+ }
41
+ }
42
+ }