archctx 0.7.2 → 0.8.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.7.2",
3
+ "version": "0.8.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": ">=22.22 <26"
24
24
  },
25
25
  "dependencies": {
26
- "@colbymchenry/codegraph": "1.6.1",
26
+ "@colbymchenry/codegraph": "1.6.2",
27
27
  "@node-rs/jieba": "^2.0.1",
28
28
  "koffi": "3.1.6"
29
29
  }
@@ -0,0 +1,218 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archctx.repoharness.com/schemas/repo/refactor-decision.schema.json",
4
+ "title": "RefactorDecision",
5
+ "description": "The latest human decision for one refactor recommendation generation, stored at .archcontext/refactor-decisions/<recommendationId>.json (ADR-0046). Identity that needs the core hashers (recommendationId from fingerprint and regressesFrom, the namespace-scoped subject selector) is checked by the runtime reader.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "namespace",
11
+ "recommendationId",
12
+ "fingerprint",
13
+ "fingerprintSchemaVersion",
14
+ "category",
15
+ "kind",
16
+ "subject",
17
+ "affectedNodeIds",
18
+ "affectedNodeCount",
19
+ "regressesFrom",
20
+ "status",
21
+ "observationMetrics",
22
+ "reason",
23
+ "actor",
24
+ "decidedAt",
25
+ "provenance"
26
+ ],
27
+ "properties": {
28
+ "schemaVersion": {
29
+ "const": "archcontext.refactor-decision/v1"
30
+ },
31
+ "namespace": {
32
+ "type": "string",
33
+ "pattern": "^[a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)+$"
34
+ },
35
+ "recommendationId": {
36
+ "type": "string",
37
+ "pattern": "^recommendation\\.[a-f0-9]{16}$"
38
+ },
39
+ "fingerprint": {
40
+ "type": "string",
41
+ "pattern": "^sha256:[a-f0-9]{64}$"
42
+ },
43
+ "fingerprintSchemaVersion": {
44
+ "const": "archcontext.recommendation-fingerprint/v3"
45
+ },
46
+ "category": {
47
+ "type": "string",
48
+ "enum": [
49
+ "refactor_proposal",
50
+ "structural_observation"
51
+ ]
52
+ },
53
+ "kind": {
54
+ "anyOf": [
55
+ {
56
+ "type": "null"
57
+ },
58
+ {
59
+ "type": "string",
60
+ "enum": [
61
+ "cycle",
62
+ "direction-violation",
63
+ "evidence-gap",
64
+ "ownership-ambiguous",
65
+ "residual-cycle",
66
+ "undeclared-footprint",
67
+ "unowned-paths"
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ "subject": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": [
76
+ "selectorKind",
77
+ "stableKey",
78
+ "subjectSelectorId"
79
+ ],
80
+ "properties": {
81
+ "selectorKind": {
82
+ "type": "string",
83
+ "enum": [
84
+ "node",
85
+ "repository"
86
+ ]
87
+ },
88
+ "stableKey": {
89
+ "type": "string",
90
+ "minLength": 1,
91
+ "maxLength": 512,
92
+ "pattern": "^\\S(?:[^\\u0000-\\u001f\\u007f]*\\S)?$"
93
+ },
94
+ "subjectSelectorId": {
95
+ "type": "string",
96
+ "pattern": "^subject\\.(node|repository)\\.[a-f0-9]{16}$"
97
+ }
98
+ }
99
+ },
100
+ "affectedNodeIds": {
101
+ "type": "array",
102
+ "maxItems": 32,
103
+ "uniqueItems": true,
104
+ "items": {
105
+ "type": "string",
106
+ "minLength": 1
107
+ }
108
+ },
109
+ "affectedNodeCount": {
110
+ "type": "integer",
111
+ "minimum": 0
112
+ },
113
+ "regressesFrom": {
114
+ "anyOf": [
115
+ {
116
+ "type": "null"
117
+ },
118
+ {
119
+ "type": "string",
120
+ "pattern": "^recommendation\\.[a-f0-9]{16}$"
121
+ }
122
+ ]
123
+ },
124
+ "status": {
125
+ "type": "string",
126
+ "enum": [
127
+ "acknowledged",
128
+ "accepted",
129
+ "deferred",
130
+ "rejected",
131
+ "resolved",
132
+ "waived"
133
+ ]
134
+ },
135
+ "observationMetrics": {
136
+ "anyOf": [
137
+ {
138
+ "type": "null"
139
+ },
140
+ {
141
+ "type": "object",
142
+ "additionalProperties": {
143
+ "anyOf": [
144
+ {
145
+ "type": "null"
146
+ },
147
+ {
148
+ "type": "number"
149
+ }
150
+ ]
151
+ }
152
+ }
153
+ ]
154
+ },
155
+ "reason": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "maxLength": 1024,
159
+ "pattern": "^\\S(?:[^\\u0000-\\u001f\\u007f]*\\S)?$"
160
+ },
161
+ "actor": {
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "required": [
165
+ "kind",
166
+ "id"
167
+ ],
168
+ "properties": {
169
+ "kind": {
170
+ "type": "string",
171
+ "enum": [
172
+ "cli",
173
+ "daemon",
174
+ "developer",
175
+ "hook",
176
+ "mcp",
177
+ "migration",
178
+ "subagent",
179
+ "system"
180
+ ]
181
+ },
182
+ "id": {
183
+ "type": "string",
184
+ "minLength": 1,
185
+ "maxLength": 128,
186
+ "pattern": "^\\S(?:[^\\u0000-\\u001f\\u007f]*\\S)?$"
187
+ }
188
+ }
189
+ },
190
+ "decidedAt": {
191
+ "type": "string",
192
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?(Z|[+-]\\d{2}:\\d{2})$"
193
+ },
194
+ "provenance": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": [
198
+ "headSha",
199
+ "assessmentDigest",
200
+ "baselineSnapshotDigest"
201
+ ],
202
+ "properties": {
203
+ "headSha": {
204
+ "type": "string",
205
+ "pattern": "^[a-f0-9]{40}$"
206
+ },
207
+ "assessmentDigest": {
208
+ "type": "string",
209
+ "pattern": "^sha256:[a-f0-9]{64}$"
210
+ },
211
+ "baselineSnapshotDigest": {
212
+ "type": "string",
213
+ "pattern": "^sha256:[a-f0-9]{64}$"
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
@@ -31,7 +31,7 @@
31
31
  "additionalProperties": false,
32
32
  "required": ["architectureDocs", "agentContext"],
33
33
  "properties": {
34
- "architectureDocs": { "const": "archcontext.docs-renderer/v5" },
34
+ "architectureDocs": { "const": "archcontext.docs-renderer/v6" },
35
35
  "agentContext": { "const": "archcontext.agent-context-renderer/v1" }
36
36
  }
37
37
  },
@@ -43,7 +43,7 @@
43
43
  "type": "string",
44
44
  "pattern": "^[a-z0-9]+(-[a-z0-9]+)*-v[0-9]+$",
45
45
  "description": "One feature flag: a lowercase kebab-case name that ends in a version suffix (-v1, -v2, ...). The pattern is open, so a validator built from this schema accepts flags that a later archctx adds. A consumer must ignore a flag it does not know. examples lists the flags this schema version knows.",
46
- "examples": ["architecture-change-capabilities-v1", "architecture-docs-renderer-v2", "architecture-refresh-signal-v1", "capability-dependencies-v1", "changeset-entity-operations-v1", "changeset-ownership-delta-v1", "code-facts-unavailable-error-v1", "docs-anchors-v1", "flow-selector-check-v1", "module-statistics-v1", "projection-apply-readback-v1", "projection-apply-receipt-v1", "projection-apply-recovery-v1", "projection-apply-replay-v1", "projection-check-freshness-v1", "projection-manifest-contract-v2", "projection-observed-major-change-acceptance-v1", "projection-orphan-review-v1", "projection-preview-v1", "projection-prior-committed-applies-v1", "projection-protocol-v2", "recommendation-scan-decision-v1", "recommendation-v3", "refactor-assessment-v1", "refactor-observation-evidence-v1", "refactor-resolution-v1", "refactor-scan-limits-v1", "refactor-scan-untracked-count-v1"]
46
+ "examples": ["architecture-change-capabilities-v1", "architecture-debt-v1", "architecture-docs-renderer-v2", "architecture-refresh-signal-v1", "capability-dependencies-declared-v1", "capability-dependencies-v1", "changeset-entity-operations-v1", "changeset-ownership-delta-v1", "code-facts-unavailable-error-v1", "docs-anchors-v1", "flow-selector-check-v1", "module-statistics-v1", "native-context-export-v1", "projection-apply-readback-v1", "projection-apply-receipt-v1", "projection-apply-recovery-v1", "projection-apply-replay-restore-v1", "projection-apply-replay-v1", "projection-architecture-debt-v1", "projection-capability-isolation-v1", "projection-change-classification-v1", "projection-check-freshness-v1", "projection-freshness-v1", "projection-manifest-contract-v3", "projection-observed-major-change-acceptance-v1", "projection-orphan-review-v1", "projection-preview-v1", "projection-prior-committed-applies-v1", "projection-protocol-v2", "projection-snapshot-v1", "recommendation-scan-decision-v1", "recommendation-v3", "refactor-assessment-v1", "refactor-observation-evidence-v1", "refactor-resolution-v1", "refactor-scan-limits-v1", "refactor-scan-untracked-count-v1"]
47
47
  }
48
48
  }
49
49
  }
@@ -0,0 +1,222 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archctx.repoharness.com/schemas/runtime/architecture-debt.schema.json",
4
+ "title": "ArchitectureDebtReportV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "scope",
10
+ "coverage",
11
+ "coverageReasonCodes",
12
+ "checks",
13
+ "items",
14
+ "actionsRequired",
15
+ "digest"
16
+ ],
17
+ "properties": {
18
+ "schemaVersion": {
19
+ "const": "archcontext.architecture-debt/v1"
20
+ },
21
+ "scope": {
22
+ "type": "object",
23
+ "additionalProperties": false,
24
+ "required": [
25
+ "kind",
26
+ "changedPaths",
27
+ "capabilityIds"
28
+ ],
29
+ "properties": {
30
+ "kind": {
31
+ "enum": [
32
+ "repository",
33
+ "changed-paths"
34
+ ]
35
+ },
36
+ "changedPaths": {
37
+ "type": "array",
38
+ "uniqueItems": true,
39
+ "items": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "maxLength": 1024
43
+ }
44
+ },
45
+ "capabilityIds": {
46
+ "type": "array",
47
+ "uniqueItems": true,
48
+ "items": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "maxLength": 1024
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "coverage": {
57
+ "enum": [
58
+ "complete",
59
+ "partial",
60
+ "unknown"
61
+ ]
62
+ },
63
+ "coverageReasonCodes": {
64
+ "type": "array",
65
+ "uniqueItems": true,
66
+ "items": {
67
+ "type": "string",
68
+ "minLength": 1,
69
+ "maxLength": 1024
70
+ }
71
+ },
72
+ "checks": {
73
+ "type": "array",
74
+ "minItems": 5,
75
+ "maxItems": 5,
76
+ "items": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": [
80
+ "check",
81
+ "coverage",
82
+ "reasonCodes"
83
+ ],
84
+ "properties": {
85
+ "check": {
86
+ "enum": [
87
+ "ownership",
88
+ "anchors",
89
+ "dependencies",
90
+ "flows",
91
+ "practices"
92
+ ]
93
+ },
94
+ "coverage": {
95
+ "enum": [
96
+ "complete",
97
+ "partial",
98
+ "unknown"
99
+ ]
100
+ },
101
+ "reasonCodes": {
102
+ "type": "array",
103
+ "uniqueItems": true,
104
+ "items": {
105
+ "type": "string",
106
+ "minLength": 1,
107
+ "maxLength": 1024
108
+ }
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "items": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "id",
120
+ "kind",
121
+ "nodeIds",
122
+ "capabilityIds",
123
+ "paths",
124
+ "reasonCode",
125
+ "action",
126
+ "details"
127
+ ],
128
+ "properties": {
129
+ "id": {
130
+ "type": "string",
131
+ "pattern": "^debt\\.[a-f0-9]{64}$"
132
+ },
133
+ "kind": {
134
+ "enum": [
135
+ "unowned-path",
136
+ "ambiguous-owner",
137
+ "undeclared-dependency",
138
+ "flow-proof-failed",
139
+ "stale-anchor",
140
+ "practice-regression"
141
+ ]
142
+ },
143
+ "nodeIds": {
144
+ "type": "array",
145
+ "uniqueItems": true,
146
+ "items": {
147
+ "type": "string",
148
+ "minLength": 1,
149
+ "maxLength": 1024
150
+ }
151
+ },
152
+ "capabilityIds": {
153
+ "type": "array",
154
+ "uniqueItems": true,
155
+ "items": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "maxLength": 1024
159
+ }
160
+ },
161
+ "paths": {
162
+ "type": "array",
163
+ "uniqueItems": true,
164
+ "items": {
165
+ "type": "string",
166
+ "minLength": 1,
167
+ "maxLength": 1024
168
+ }
169
+ },
170
+ "reasonCode": {
171
+ "type": "string",
172
+ "minLength": 1,
173
+ "maxLength": 1024
174
+ },
175
+ "action": {
176
+ "type": "string",
177
+ "minLength": 1,
178
+ "maxLength": 1024
179
+ },
180
+ "details": {
181
+ "type": "object",
182
+ "maxProperties": 12,
183
+ "additionalProperties": {
184
+ "oneOf": [
185
+ {
186
+ "type": "string",
187
+ "minLength": 1,
188
+ "maxLength": 1024
189
+ },
190
+ {
191
+ "type": "integer"
192
+ },
193
+ {
194
+ "type": "array",
195
+ "uniqueItems": true,
196
+ "items": {
197
+ "type": "string",
198
+ "minLength": 1,
199
+ "maxLength": 1024
200
+ }
201
+ }
202
+ ]
203
+ }
204
+ }
205
+ }
206
+ }
207
+ },
208
+ "actionsRequired": {
209
+ "type": "array",
210
+ "uniqueItems": true,
211
+ "items": {
212
+ "type": "string",
213
+ "minLength": 1,
214
+ "maxLength": 1024
215
+ }
216
+ },
217
+ "digest": {
218
+ "type": "string",
219
+ "pattern": "^sha256:[a-f0-9]{64}$"
220
+ }
221
+ }
222
+ }
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://archcontext.dev/schemas/runtime/capability-dependencies.schema.json",
4
4
  "title": "CapabilityDependenciesV1",
5
- "description": "The data of `archctx deps`: a read-only capability x capability import matrix. Owners come from the parent-chain rule `refactor scan` uses, rolled up to the nearest capability. Call counts are not available in v1.",
5
+ "description": "The data of `archctx deps`: a read-only capability x capability import matrix. Owners come from the parent-chain rule `refactor scan` uses, rolled up to the nearest capability. Each cell says whether a model relation declares it. Call counts are not available in v1. Without code facts that attest to the measured tree, deps refuses with AC_CODE_FACTS_UNAVAILABLE instead of returning this data.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "required": ["schemaVersion", "ownershipRule", "filter", "capabilities", "matrix", "imports", "calls", "edges", "worktree", "privacy"],
@@ -24,13 +24,17 @@
24
24
  "items": {
25
25
  "type": "object",
26
26
  "additionalProperties": false,
27
- "required": ["from", "to", "imports", "calls"],
27
+ "required": ["from", "to", "imports", "calls", "declared", "relationIds"],
28
28
  "properties": {
29
29
  "from": { "type": "string", "minLength": 1 },
30
30
  "to": { "type": "string", "minLength": 1 },
31
31
  "imports": { "type": "integer", "minimum": 1 },
32
- "calls": { "type": "null" }
33
- }
32
+ "calls": { "type": "null" },
33
+ "declared": { "type": "boolean", "description": "A relation of a declaring kind (every kind but deployed-on) runs from a node that rolls up to `from` into a node that rolls up to `to`. A cell with from equal to to is always declared and lists no relation ids." },
34
+ "relationIds": { "type": "array", "uniqueItems": true, "description": "The declaring relation ids, sorted. Non-empty exactly when a cross-capability cell is declared.", "items": { "type": "string", "minLength": 1 } }
35
+ },
36
+ "if": { "properties": { "relationIds": { "minItems": 1 } } },
37
+ "then": { "properties": { "declared": { "const": true } } }
34
38
  }
35
39
  },
36
40
  "imports": {
@@ -38,11 +42,11 @@
38
42
  "additionalProperties": false,
39
43
  "required": ["coverage", "reasonCodes", "truncated", "importNodeCount", "importNodeLimit", "importNodeLimitExceeded", "edgeCount", "unresolvedCount", "unattributed"],
40
44
  "properties": {
41
- "coverage": { "enum": ["complete", "partial", "unknown"] },
45
+ "coverage": { "enum": ["complete", "partial"] },
42
46
  "reasonCodes": {
43
47
  "type": "array",
44
48
  "uniqueItems": true,
45
- "items": { "enum": ["code-facts-import-limit", "code-facts-stale", "code-facts-truncated", "code-facts-unavailable"] }
49
+ "items": { "enum": ["code-facts-import-limit", "code-facts-truncated"] }
46
50
  },
47
51
  "truncated": { "type": "boolean" },
48
52
  "importNodeCount": { "type": ["integer", "null"], "minimum": 0 },
@@ -93,7 +93,8 @@
93
93
  "write_policy",
94
94
  "write_waiver",
95
95
  "render_projection",
96
- "render_agent_context"
96
+ "render_agent_context",
97
+ "write_refactor_decision"
97
98
  ]
98
99
  },
99
100
  "entityId": {
@@ -150,6 +151,28 @@
150
151
  "const": true
151
152
  }
152
153
  }
154
+ },
155
+ {
156
+ "type": "object",
157
+ "additionalProperties": false,
158
+ "description": "Binds one projection-owned file the write set carries forward unchanged; accepted only by render_projection with the exact body hash the render read. Nothing is written; the apply fails unless the file still has that hash immediately before the commit.",
159
+ "required": [
160
+ "path",
161
+ "expectedHash",
162
+ "guard"
163
+ ],
164
+ "properties": {
165
+ "path": {
166
+ "type": "string"
167
+ },
168
+ "expectedHash": {
169
+ "type": "string",
170
+ "pattern": "^sha256:[a-f0-9]{64}$"
171
+ },
172
+ "guard": {
173
+ "const": true
174
+ }
175
+ }
153
176
  }
154
177
  ]
155
178
  }
@@ -41,12 +41,13 @@
41
41
  "byKind": {
42
42
  "type": "object",
43
43
  "additionalProperties": false,
44
- "required": ["line-moved", "line-out-of-range", "missing-path", "missing-symbol"],
44
+ "required": ["line-moved", "line-out-of-range", "missing-path", "missing-symbol", "unknown-selector"],
45
45
  "properties": {
46
46
  "line-moved": { "$ref": "#/$defs/count" },
47
47
  "line-out-of-range": { "$ref": "#/$defs/count" },
48
48
  "missing-path": { "$ref": "#/$defs/count" },
49
- "missing-symbol": { "$ref": "#/$defs/count" }
49
+ "missing-symbol": { "$ref": "#/$defs/count" },
50
+ "unknown-selector": { "$ref": "#/$defs/count" }
50
51
  }
51
52
  }
52
53
  }
@@ -122,7 +123,7 @@
122
123
  "additionalProperties": false,
123
124
  "required": ["kind", "origin", "citation"],
124
125
  "properties": {
125
- "kind": { "enum": ["line-moved", "line-out-of-range", "missing-path", "missing-symbol"] },
126
+ "kind": { "enum": ["line-moved", "line-out-of-range", "missing-path", "missing-symbol", "unknown-selector"] },
126
127
  "origin": { "$ref": "#/$defs/origin" },
127
128
  "citation": { "$ref": "#/$defs/citation" },
128
129
  "lineCount": { "$ref": "#/$defs/count" },
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archctx.repoharness.com/schemas/runtime/hook-debt-checkpoint.schema.json",
4
+ "title": "ArchitectureDebtHookCheckpointV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "debt",
10
+ "hookLog"
11
+ ],
12
+ "properties": {
13
+ "schemaVersion": {
14
+ "const": "archcontext.hook-debt-checkpoint/v1"
15
+ },
16
+ "debt": {
17
+ "$ref": "architecture-debt.schema.json"
18
+ },
19
+ "hookLog": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": [
23
+ "schemaVersion",
24
+ "event",
25
+ "elapsedMs",
26
+ "pathCount",
27
+ "changedPathDigest",
28
+ "reasonCode",
29
+ "failOpen",
30
+ "egress",
31
+ "network"
32
+ ],
33
+ "properties": {
34
+ "schemaVersion": {
35
+ "const": "archcontext.hook-log/v1"
36
+ },
37
+ "event": {
38
+ "type": "string",
39
+ "minLength": 1
40
+ },
41
+ "elapsedMs": {
42
+ "type": "number",
43
+ "minimum": 0
44
+ },
45
+ "pathCount": {
46
+ "type": "integer",
47
+ "minimum": 0
48
+ },
49
+ "changedPathDigest": {
50
+ "type": "string",
51
+ "pattern": "^sha256:[0-9a-f]{64}$"
52
+ },
53
+ "reasonCode": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ },
57
+ "failOpen": {
58
+ "const": false
59
+ },
60
+ "egress": {
61
+ "const": "none"
62
+ },
63
+ "network": {
64
+ "const": "forbidden"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }