archctx-contracts 0.17.0 → 0.18.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.
Files changed (119) hide show
  1. package/fixtures/invalid/projection-result-applied-incomplete-coverage.json +3 -3
  2. package/fixtures/valid/archctx-capabilities.json +2 -2
  3. package/fixtures/valid/flow-selector-check.json +1 -1
  4. package/fixtures/valid/product-version-manifest.json +5 -11
  5. package/fixtures/valid/projection-manifest.json +1 -1
  6. package/fixtures/valid/projection-result.json +3 -3
  7. package/package.json +4 -1
  8. package/schemas/repo/refactor-decision.schema.json +283 -37
  9. package/schemas/runtime/archctx-capabilities.schema.json +144 -20
  10. package/schemas/runtime/architecture-debt-delta.schema.json +58 -19
  11. package/schemas/runtime/architecture-debt.schema.json +42 -42
  12. package/schemas/runtime/architecture-event.schema.json +1 -1
  13. package/schemas/runtime/architecture-history.schema.json +354 -0
  14. package/schemas/runtime/capability-dependencies.schema.json +266 -59
  15. package/schemas/runtime/cli-check.schema.json +197 -0
  16. package/schemas/runtime/cli-help.schema.json +28 -0
  17. package/schemas/runtime/dependency-constraint-evaluation.schema.json +67 -68
  18. package/schemas/runtime/docs-anchors.schema.json +250 -67
  19. package/schemas/runtime/doctor-code-facts.schema.json +49 -0
  20. package/schemas/runtime/evidence-binding.schema.json +1 -1
  21. package/schemas/runtime/flow-selector-check.schema.json +179 -46
  22. package/schemas/runtime/hook-debt-checkpoint.schema.json +12 -12
  23. package/schemas/runtime/index-seed.schema.json +56 -0
  24. package/schemas/runtime/path-context.schema.json +108 -0
  25. package/schemas/runtime/product-version-manifest.schema.json +142 -54
  26. package/schemas/runtime/projection-apply-readback.schema.json +2 -2
  27. package/schemas/runtime/projection-apply-recovery.schema.json +1 -1
  28. package/schemas/runtime/projection-result.schema.json +1 -1
  29. package/schemas/runtime/projection-slice.schema.json +34 -34
  30. package/schemas/runtime/recommendation-v3.schema.json +372 -1
  31. package/schemas/runtime/ref-impact-batch-request.schema.json +20 -7
  32. package/schemas/runtime/ref-impact-batch.schema.json +83 -13
  33. package/schemas/runtime/ref-impact.schema.json +68 -61
  34. package/schemas/runtime/refactor-scan-v2.schema.json +434 -0
  35. package/schemas/runtime/refactor-simulate.schema.json +505 -0
  36. package/schemas/runtime/refactor-verify-v2.schema.json +172 -0
  37. package/schemas/runtime/resolve-path.schema.json +69 -0
  38. package/schemas/runtime/runtime-recommendation-show.schema.json +531 -2
  39. package/schemas/runtime/runtime-refactor-scan.schema.json +498 -2
  40. package/schemas/runtime/runtime-verify.schema.json +274 -56
  41. package/schemas/runtime/state-machine-check.schema.json +357 -89
  42. package/schemas/runtime/structural-observation-payload.schema.json +372 -1
  43. package/schemas/runtime/sync-check.schema.json +65 -0
  44. package/src/architecture-debt.ts +125 -38
  45. package/src/architecture-history.ts +168 -42
  46. package/src/architecture.ts +100 -0
  47. package/src/cli-read.ts +228 -0
  48. package/src/docs-anchors.ts +105 -50
  49. package/src/explorer-occurrence-ports.ts +175 -0
  50. package/src/explorer-query-ports.ts +270 -0
  51. package/src/failure.ts +3 -0
  52. package/src/index-seed.ts +42 -0
  53. package/src/index.ts +5 -0
  54. package/src/ledger-records.ts +262 -0
  55. package/src/ledger.ts +27 -566
  56. package/src/ownership-dependencies.ts +115 -5
  57. package/src/ports.ts +12 -543
  58. package/src/product-version.ts +75 -56
  59. package/src/projection-apply-types.ts +216 -0
  60. package/src/projection-apply-validators.ts +355 -0
  61. package/src/projection-capabilities.ts +181 -0
  62. package/src/projection-constants.ts +317 -0
  63. package/src/projection-manifest-types.ts +298 -0
  64. package/src/projection-manifest.ts +12 -299
  65. package/src/projection-recovery-validators.ts +229 -0
  66. package/src/projection-request-validators.ts +326 -0
  67. package/src/projection-types.ts +365 -0
  68. package/src/projection-validation-helpers.ts +15 -0
  69. package/src/projection.ts +7 -1689
  70. package/src/ref-impact.ts +225 -33
  71. package/src/refactor-constants.ts +213 -0
  72. package/src/refactor-decision-validators.ts +350 -0
  73. package/src/refactor-evidence-types.ts +286 -0
  74. package/src/refactor-observation-validators.ts +359 -0
  75. package/src/refactor-resolution-validators.ts +229 -0
  76. package/src/refactor-snapshot-validators.ts +368 -0
  77. package/src/refactor-types.ts +270 -0
  78. package/src/refactor-v2.ts +389 -0
  79. package/src/refactor-validation-helpers.ts +195 -0
  80. package/src/refactor.ts +7 -1849
  81. package/src/review-guards.ts +3 -23
  82. package/src/runtime-verify.ts +87 -0
  83. package/src/schema-kit.ts +183 -0
  84. package/src/schema-registry.ts +73 -0
  85. package/src/schema.ts +0 -4
  86. package/src/state-machine-schemas.ts +192 -0
  87. package/src/state-machine-types.ts +188 -0
  88. package/src/state-machine.ts +9 -189
  89. package/fixtures/boundary/agent-job-expired.json +0 -33
  90. package/fixtures/invalid/adapter-fidelity-reverse-sync.json +0 -9
  91. package/fixtures/invalid/agent-job-direct-mutation.json +0 -32
  92. package/fixtures/invalid/cloud-egress-envelope-private-field.json +0 -12
  93. package/fixtures/invalid/investigation-report-direct-mutation.json +0 -38
  94. package/fixtures/invalid/investigation-report-missing-proposed-delta.json +0 -19
  95. package/fixtures/invalid/notification-event-code-field.json +0 -11
  96. package/fixtures/valid/adapter-fidelity.json +0 -9
  97. package/fixtures/valid/agent-job.json +0 -33
  98. package/fixtures/valid/architecture-candidate-delta-policy.json +0 -45
  99. package/fixtures/valid/architecture-candidate-delta.json +0 -188
  100. package/fixtures/valid/chatgpt-ga-tool.json +0 -9
  101. package/fixtures/valid/cloud-egress-envelope.json +0 -11
  102. package/fixtures/valid/entitlement.json +0 -12
  103. package/fixtures/valid/investigation-report.json +0 -38
  104. package/fixtures/valid/likec4-mapping.json +0 -14
  105. package/fixtures/valid/notification-event.json +0 -10
  106. package/fixtures/valid/notification-provider.json +0 -12
  107. package/fixtures/valid/structurizr-mapping.json +0 -15
  108. package/schemas/cloud/cloud-egress-envelope.schema.json +0 -19
  109. package/schemas/cloud/entitlement.schema.json +0 -24
  110. package/schemas/integrations/adapter-fidelity.schema.json +0 -21
  111. package/schemas/integrations/chatgpt-ga-tool.schema.json +0 -25
  112. package/schemas/integrations/likec4-mapping.schema.json +0 -32
  113. package/schemas/integrations/structurizr-mapping.schema.json +0 -33
  114. package/schemas/runtime/agent-job.schema.json +0 -63
  115. package/schemas/runtime/architecture-candidate-delta-policy.schema.json +0 -129
  116. package/schemas/runtime/architecture-candidate-delta.schema.json +0 -386
  117. package/schemas/runtime/investigation-report.schema.json +0 -119
  118. package/schemas/runtime/notification-event.schema.json +0 -18
  119. package/schemas/runtime/notification-provider.schema.json +0 -26
@@ -3,8 +3,31 @@
3
3
  "$id": "https://archcontext.dev/schemas/runtime/dependency-constraint-evaluation.schema.json",
4
4
  "title": "DependencyConstraintEvaluationV1",
5
5
  "description": "The data of `archctx constraints check`: a read-only evaluation of the model's dependency constraints against observed import edges. `warnings` is added by the constraints-check command from the declaration reader, so it is not part of the evaluator's own type. Without code facts that attest to the measured tree, the evaluation still answers, but `coverage` is not `complete` and the import observations are dropped rather than reported as facts about some other tree.",
6
- "type": "object",
7
6
  "additionalProperties": false,
7
+ "allOf": [
8
+ {
9
+ "description": "The layer edges are an observation, so they exist only for a settled verdict over complete coverage.",
10
+ "if": {
11
+ "required": [
12
+ "layerEdges"
13
+ ]
14
+ },
15
+ "then": {
16
+ "properties": {
17
+ "status": {
18
+ "enum": [
19
+ "pass",
20
+ "violated"
21
+ ]
22
+ },
23
+ "coverage": {
24
+ "const": "complete"
25
+ }
26
+ }
27
+ }
28
+ }
29
+ ],
30
+ "type": "object",
8
31
  "required": [
9
32
  "schemaVersion",
10
33
  "status",
@@ -29,17 +52,17 @@
29
52
  ]
30
53
  },
31
54
  "coverage": {
55
+ "description": "`complete` only when an index attested to the evaluated worktree and was not truncated.",
32
56
  "enum": [
33
57
  "complete",
34
58
  "partial",
35
59
  "unknown"
36
- ],
37
- "description": "`complete` only when an index attested to the evaluated worktree and was not truncated."
60
+ ]
38
61
  },
39
62
  "reasonCodes": {
40
- "type": "array",
41
63
  "uniqueItems": true,
42
64
  "description": "Why a result is not a complete observation, sorted.",
65
+ "type": "array",
43
66
  "items": {
44
67
  "enum": [
45
68
  "code-facts-import-limit",
@@ -54,46 +77,46 @@
54
77
  }
55
78
  },
56
79
  "constraintIds": {
57
- "type": "array",
58
80
  "description": "The constraints this evaluation covered, in declaration order.",
81
+ "type": "array",
59
82
  "items": {
60
- "type": "string",
61
- "minLength": 1
83
+ "minLength": 1,
84
+ "type": "string"
62
85
  }
63
86
  },
64
87
  "importEdgeCount": {
65
- "type": "integer",
66
88
  "minimum": 0,
67
- "description": "Import observations the evaluation read; zero when the index did not attest to this tree."
89
+ "description": "Import observations the evaluation read; zero when the index did not attest to this tree.",
90
+ "type": "integer"
68
91
  },
69
92
  "unresolvedImports": {
70
- "type": "array",
71
93
  "description": "Repository-local specifiers from constrained files that resolved to no file.",
94
+ "type": "array",
72
95
  "items": {
73
- "type": "object",
74
96
  "additionalProperties": false,
97
+ "type": "object",
75
98
  "required": [
76
99
  "from",
77
100
  "specifier"
78
101
  ],
79
102
  "properties": {
80
103
  "from": {
81
- "type": "string",
82
- "minLength": 1
104
+ "minLength": 1,
105
+ "type": "string"
83
106
  },
84
107
  "specifier": {
85
- "type": "string",
86
- "minLength": 1
108
+ "minLength": 1,
109
+ "type": "string"
87
110
  }
88
111
  }
89
112
  }
90
113
  },
91
114
  "violations": {
92
- "type": "array",
93
115
  "description": "One record per (constraint, from path, to path), sorted by those keys.",
116
+ "type": "array",
94
117
  "items": {
95
- "type": "object",
96
118
  "additionalProperties": false,
119
+ "type": "object",
97
120
  "required": [
98
121
  "constraintId",
99
122
  "fromPath",
@@ -104,32 +127,32 @@
104
127
  ],
105
128
  "properties": {
106
129
  "constraintId": {
107
- "type": "string",
108
- "minLength": 1
130
+ "minLength": 1,
131
+ "type": "string"
109
132
  },
110
133
  "fromPath": {
111
- "type": "string",
112
- "minLength": 1
134
+ "minLength": 1,
135
+ "type": "string"
113
136
  },
114
137
  "toPath": {
115
- "type": "string",
116
- "minLength": 1
138
+ "minLength": 1,
139
+ "type": "string"
117
140
  },
118
141
  "fromNode": {
119
- "type": "string",
120
- "minLength": 1
142
+ "minLength": 1,
143
+ "type": "string"
121
144
  },
122
145
  "toNode": {
123
- "type": "string",
124
- "minLength": 1
146
+ "minLength": 1,
147
+ "type": "string"
125
148
  },
126
149
  "fromLayer": {
127
- "type": "string",
128
- "minLength": 1
150
+ "minLength": 1,
151
+ "type": "string"
129
152
  },
130
153
  "toLayer": {
131
- "type": "string",
132
- "minLength": 1
154
+ "minLength": 1,
155
+ "type": "string"
133
156
  },
134
157
  "severity": {
135
158
  "enum": [
@@ -141,11 +164,11 @@
141
164
  }
142
165
  },
143
166
  "layerEdges": {
144
- "type": "array",
145
167
  "description": "Resolved imports between two layers of one `layer-direction` constraint. An import counts only when every owner of each endpoint carries one shared layer listed in the rule. Present only with a `layer-direction` constraint, `status` `pass` or `violated`, and `coverage` `complete`; otherwise absent. When present it may be an empty list, and it is sorted by `(constraintId, fromLayer, toLayer)`.",
168
+ "type": "array",
146
169
  "items": {
147
- "type": "object",
148
170
  "additionalProperties": false,
171
+ "type": "object",
149
172
  "required": [
150
173
  "constraintId",
151
174
  "fromLayer",
@@ -154,55 +177,31 @@
154
177
  ],
155
178
  "properties": {
156
179
  "constraintId": {
157
- "type": "string",
158
- "minLength": 1
180
+ "minLength": 1,
181
+ "type": "string"
159
182
  },
160
183
  "fromLayer": {
161
- "type": "string",
162
- "minLength": 1
184
+ "minLength": 1,
185
+ "type": "string"
163
186
  },
164
187
  "toLayer": {
165
- "type": "string",
166
- "minLength": 1
188
+ "minLength": 1,
189
+ "type": "string"
167
190
  },
168
191
  "imports": {
169
- "type": "integer",
170
192
  "minimum": 1,
171
- "description": "Import edges, so two specifiers from one file to the same target count twice."
193
+ "type": "integer"
172
194
  }
173
195
  }
174
196
  }
175
197
  },
176
198
  "warnings": {
177
- "type": "array",
178
199
  "description": "Declaration-reader warnings, such as an unsupported rule. Every unevaluated constraint type produces one, because a validated constraint is not proof that its rule was evaluated.",
200
+ "type": "array",
179
201
  "items": {
180
- "type": "string",
181
- "minLength": 1
182
- }
183
- }
184
- },
185
- "allOf": [
186
- {
187
- "description": "The layer edges are an observation, so they exist only for a settled verdict over complete coverage.",
188
- "if": {
189
- "required": [
190
- "layerEdges"
191
- ]
192
- },
193
- "then": {
194
- "properties": {
195
- "status": {
196
- "enum": [
197
- "pass",
198
- "violated"
199
- ]
200
- },
201
- "coverage": {
202
- "const": "complete"
203
- }
204
- }
202
+ "minLength": 1,
203
+ "type": "string"
205
204
  }
206
205
  }
207
- ]
206
+ }
208
207
  }
@@ -3,51 +3,113 @@
3
3
  "$id": "https://archcontext.dev/schemas/runtime/docs-anchors.schema.json",
4
4
  "title": "DocsAnchorsReportV1",
5
5
  "description": "Read-only result of `archctx docs anchors`: stale citations in human-owned module document regions and node prose. A signal, not a gate.",
6
- "type": "object",
7
6
  "additionalProperties": false,
8
- "required": ["schemaVersion", "profile", "codeGraph", "summary", "nodes"],
7
+ "type": "object",
8
+ "required": [
9
+ "schemaVersion",
10
+ "profile",
11
+ "codeGraph",
12
+ "summary",
13
+ "nodes"
14
+ ],
9
15
  "properties": {
10
- "schemaVersion": { "const": "archcontext.docs-anchors/v1" },
11
- "profile": { "enum": ["default", "repo-harness/v1"] },
16
+ "schemaVersion": {
17
+ "const": "archcontext.docs-anchors/v1"
18
+ },
19
+ "profile": {
20
+ "enum": [
21
+ "default",
22
+ "repo-harness/v1"
23
+ ]
24
+ },
12
25
  "codeGraph": {
13
26
  "oneOf": [
14
27
  {
15
- "type": "object",
16
28
  "additionalProperties": false,
17
- "required": ["availability"],
18
- "properties": { "availability": { "const": "ready" } }
29
+ "type": "object",
30
+ "required": [
31
+ "availability"
32
+ ],
33
+ "properties": {
34
+ "availability": {
35
+ "const": "ready"
36
+ }
37
+ }
19
38
  },
20
39
  {
21
- "type": "object",
22
40
  "additionalProperties": false,
23
- "required": ["availability", "reasonCode"],
41
+ "type": "object",
42
+ "required": [
43
+ "availability",
44
+ "reasonCode"
45
+ ],
24
46
  "properties": {
25
- "availability": { "const": "unavailable" },
26
- "reasonCode": { "enum": ["index-missing", "index-open-failed"] }
47
+ "availability": {
48
+ "const": "unavailable"
49
+ },
50
+ "reasonCode": {
51
+ "enum": [
52
+ "index-missing",
53
+ "index-open-failed"
54
+ ]
55
+ }
27
56
  }
28
57
  }
29
58
  ]
30
59
  },
31
60
  "summary": {
32
- "type": "object",
33
61
  "additionalProperties": false,
34
- "required": ["nodes", "documents", "citations", "findings", "unchecked", "byKind"],
62
+ "type": "object",
63
+ "required": [
64
+ "nodes",
65
+ "documents",
66
+ "citations",
67
+ "findings",
68
+ "unchecked",
69
+ "byKind"
70
+ ],
35
71
  "properties": {
36
- "nodes": { "$ref": "#/$defs/count" },
37
- "documents": { "$ref": "#/$defs/count" },
38
- "citations": { "$ref": "#/$defs/count" },
39
- "findings": { "$ref": "#/$defs/count" },
40
- "unchecked": { "$ref": "#/$defs/count" },
72
+ "nodes": {
73
+ "$ref": "#/$defs/count"
74
+ },
75
+ "documents": {
76
+ "$ref": "#/$defs/count"
77
+ },
78
+ "citations": {
79
+ "$ref": "#/$defs/count"
80
+ },
81
+ "findings": {
82
+ "$ref": "#/$defs/count"
83
+ },
84
+ "unchecked": {
85
+ "$ref": "#/$defs/count"
86
+ },
41
87
  "byKind": {
42
- "type": "object",
43
88
  "additionalProperties": false,
44
- "required": ["line-moved", "line-out-of-range", "missing-path", "missing-symbol", "unknown-selector"],
89
+ "type": "object",
90
+ "required": [
91
+ "line-moved",
92
+ "line-out-of-range",
93
+ "missing-path",
94
+ "missing-symbol",
95
+ "unknown-selector"
96
+ ],
45
97
  "properties": {
46
- "line-moved": { "$ref": "#/$defs/count" },
47
- "line-out-of-range": { "$ref": "#/$defs/count" },
48
- "missing-path": { "$ref": "#/$defs/count" },
49
- "missing-symbol": { "$ref": "#/$defs/count" },
50
- "unknown-selector": { "$ref": "#/$defs/count" }
98
+ "line-moved": {
99
+ "$ref": "#/$defs/count"
100
+ },
101
+ "line-out-of-range": {
102
+ "$ref": "#/$defs/count"
103
+ },
104
+ "missing-path": {
105
+ "$ref": "#/$defs/count"
106
+ },
107
+ "missing-symbol": {
108
+ "$ref": "#/$defs/count"
109
+ },
110
+ "unknown-selector": {
111
+ "$ref": "#/$defs/count"
112
+ }
51
113
  }
52
114
  }
53
115
  }
@@ -55,89 +117,210 @@
55
117
  "nodes": {
56
118
  "type": "array",
57
119
  "items": {
58
- "type": "object",
59
120
  "additionalProperties": false,
60
- "required": ["nodeId", "citationCount", "findings", "unchecked"],
121
+ "type": "object",
122
+ "required": [
123
+ "nodeId",
124
+ "citationCount",
125
+ "findings",
126
+ "unchecked"
127
+ ],
61
128
  "properties": {
62
- "nodeId": { "type": "string", "minLength": 1 },
63
- "documentPath": { "$ref": "#/$defs/repoPath" },
64
- "citationCount": { "type": "integer", "minimum": 1 },
65
- "findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } },
66
- "unchecked": { "type": "array", "items": { "$ref": "#/$defs/unchecked" } }
129
+ "nodeId": {
130
+ "minLength": 1,
131
+ "type": "string"
132
+ },
133
+ "documentPath": {
134
+ "$ref": "#/$defs/repoPath"
135
+ },
136
+ "citationCount": {
137
+ "minimum": 1,
138
+ "type": "integer"
139
+ },
140
+ "findings": {
141
+ "type": "array",
142
+ "items": {
143
+ "$ref": "#/$defs/finding"
144
+ }
145
+ },
146
+ "unchecked": {
147
+ "type": "array",
148
+ "items": {
149
+ "$ref": "#/$defs/unchecked"
150
+ }
151
+ }
67
152
  }
68
153
  }
69
154
  }
70
155
  },
71
156
  "$defs": {
72
- "count": { "type": "integer", "minimum": 0 },
73
- "line": { "type": "integer", "minimum": 1 },
157
+ "count": {
158
+ "minimum": 0,
159
+ "type": "integer"
160
+ },
161
+ "line": {
162
+ "minimum": 1,
163
+ "type": "integer"
164
+ },
74
165
  "repoPath": {
75
166
  "type": "string",
76
167
  "minLength": 1,
77
- "not": { "anyOf": [{ "pattern": "^/" }, { "pattern": "\\\\" }, { "pattern": "(^|/)\\.\\.(/|$)" }] }
168
+ "not": {
169
+ "anyOf": [
170
+ {
171
+ "pattern": "^/"
172
+ },
173
+ {
174
+ "pattern": "\\\\"
175
+ },
176
+ {
177
+ "pattern": "(^|/)\\.\\.(/|$)"
178
+ }
179
+ ]
180
+ }
78
181
  },
79
182
  "origin": {
80
183
  "oneOf": [
81
184
  {
82
- "type": "object",
83
185
  "additionalProperties": false,
84
- "required": ["kind", "path", "line"],
186
+ "type": "object",
187
+ "required": [
188
+ "kind",
189
+ "path",
190
+ "line"
191
+ ],
85
192
  "properties": {
86
- "kind": { "const": "document" },
87
- "path": { "$ref": "#/$defs/repoPath" },
88
- "line": { "$ref": "#/$defs/line" }
193
+ "kind": {
194
+ "const": "document"
195
+ },
196
+ "path": {
197
+ "$ref": "#/$defs/repoPath"
198
+ },
199
+ "line": {
200
+ "$ref": "#/$defs/line"
201
+ }
89
202
  }
90
203
  },
91
204
  {
92
- "type": "object",
93
205
  "additionalProperties": false,
94
- "required": ["kind"],
95
- "properties": { "kind": { "const": "node-summary" } }
206
+ "type": "object",
207
+ "required": [
208
+ "kind"
209
+ ],
210
+ "properties": {
211
+ "kind": {
212
+ "const": "node-summary"
213
+ }
214
+ }
96
215
  },
97
216
  {
98
- "type": "object",
99
217
  "additionalProperties": false,
100
- "required": ["kind", "index"],
218
+ "type": "object",
219
+ "required": [
220
+ "kind",
221
+ "index"
222
+ ],
101
223
  "properties": {
102
- "kind": { "const": "node-responsibility" },
103
- "index": { "type": "integer", "minimum": 0 }
224
+ "kind": {
225
+ "const": "node-responsibility"
226
+ },
227
+ "index": {
228
+ "minimum": 0,
229
+ "type": "integer"
230
+ }
104
231
  }
105
232
  }
106
233
  ]
107
234
  },
108
235
  "citation": {
109
- "type": "object",
110
236
  "additionalProperties": false,
111
- "required": ["text"],
237
+ "type": "object",
238
+ "required": [
239
+ "text"
240
+ ],
112
241
  "properties": {
113
- "text": { "type": "string", "minLength": 1 },
114
- "path": { "type": "string", "minLength": 1 },
115
- "resolvedPath": { "$ref": "#/$defs/repoPath" },
116
- "line": { "$ref": "#/$defs/line" },
117
- "endLine": { "$ref": "#/$defs/line" },
118
- "symbol": { "type": "string", "minLength": 1 }
242
+ "text": {
243
+ "minLength": 1,
244
+ "type": "string"
245
+ },
246
+ "path": {
247
+ "minLength": 1,
248
+ "type": "string"
249
+ },
250
+ "resolvedPath": {
251
+ "$ref": "#/$defs/repoPath"
252
+ },
253
+ "line": {
254
+ "$ref": "#/$defs/line"
255
+ },
256
+ "endLine": {
257
+ "$ref": "#/$defs/line"
258
+ },
259
+ "symbol": {
260
+ "minLength": 1,
261
+ "type": "string"
262
+ }
119
263
  }
120
264
  },
121
265
  "finding": {
122
- "type": "object",
123
266
  "additionalProperties": false,
124
- "required": ["kind", "origin", "citation"],
267
+ "type": "object",
268
+ "required": [
269
+ "kind",
270
+ "origin",
271
+ "citation"
272
+ ],
125
273
  "properties": {
126
- "kind": { "enum": ["line-moved", "line-out-of-range", "missing-path", "missing-symbol", "unknown-selector"] },
127
- "origin": { "$ref": "#/$defs/origin" },
128
- "citation": { "$ref": "#/$defs/citation" },
129
- "lineCount": { "$ref": "#/$defs/count" },
130
- "currentLines": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/line" } }
274
+ "kind": {
275
+ "enum": [
276
+ "line-moved",
277
+ "line-out-of-range",
278
+ "missing-path",
279
+ "missing-symbol",
280
+ "unknown-selector"
281
+ ]
282
+ },
283
+ "origin": {
284
+ "$ref": "#/$defs/origin"
285
+ },
286
+ "citation": {
287
+ "$ref": "#/$defs/citation"
288
+ },
289
+ "lineCount": {
290
+ "$ref": "#/$defs/count"
291
+ },
292
+ "currentLines": {
293
+ "minItems": 1,
294
+ "uniqueItems": true,
295
+ "type": "array",
296
+ "items": {
297
+ "$ref": "#/$defs/line"
298
+ }
299
+ }
131
300
  }
132
301
  },
133
302
  "unchecked": {
134
- "type": "object",
135
303
  "additionalProperties": false,
136
- "required": ["reasonCode", "origin", "citation"],
304
+ "type": "object",
305
+ "required": [
306
+ "reasonCode",
307
+ "origin",
308
+ "citation"
309
+ ],
137
310
  "properties": {
138
- "reasonCode": { "enum": ["codegraph-unavailable", "language-unsupported", "path-ambiguous"] },
139
- "origin": { "$ref": "#/$defs/origin" },
140
- "citation": { "$ref": "#/$defs/citation" }
311
+ "reasonCode": {
312
+ "enum": [
313
+ "codegraph-unavailable",
314
+ "language-unsupported",
315
+ "path-ambiguous"
316
+ ]
317
+ },
318
+ "origin": {
319
+ "$ref": "#/$defs/origin"
320
+ },
321
+ "citation": {
322
+ "$ref": "#/$defs/citation"
323
+ }
141
324
  }
142
325
  }
143
326
  }
@@ -0,0 +1,49 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/doctor-code-facts.schema.json",
4
+ "title": "DoctorCodeFactsV1",
5
+ "description": "Machine-readable CodeGraph readiness report returned in `archctx doctor --json` and capability diagnostics.",
6
+ "additionalProperties": false,
7
+ "type": "object",
8
+ "required": [
9
+ "state",
10
+ "codeGraphVersion",
11
+ "issues"
12
+ ],
13
+ "properties": {
14
+ "state": {
15
+ "type": "string",
16
+ "enum": [
17
+ "ready",
18
+ "not-ready",
19
+ "index-missing",
20
+ "unavailable"
21
+ ]
22
+ },
23
+ "codeGraphVersion": {
24
+ "minLength": 1,
25
+ "type": "string"
26
+ },
27
+ "issues": {
28
+ "type": "array",
29
+ "items": {
30
+ "additionalProperties": false,
31
+ "type": "object",
32
+ "required": [
33
+ "code",
34
+ "message"
35
+ ],
36
+ "properties": {
37
+ "code": {
38
+ "minLength": 1,
39
+ "type": "string"
40
+ },
41
+ "message": {
42
+ "minLength": 1,
43
+ "type": "string"
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }