archctx-contracts 0.17.1 → 0.18.1

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 (112) hide show
  1. package/fixtures/valid/archctx-capabilities.json +2 -2
  2. package/fixtures/valid/product-version-manifest.json +4 -10
  3. package/package.json +4 -1
  4. package/schemas/repo/refactor-decision.schema.json +307 -37
  5. package/schemas/runtime/archctx-capabilities.schema.json +144 -20
  6. package/schemas/runtime/architecture-debt-delta.schema.json +58 -19
  7. package/schemas/runtime/architecture-debt.schema.json +42 -42
  8. package/schemas/runtime/architecture-event.schema.json +1 -1
  9. package/schemas/runtime/architecture-history.schema.json +354 -0
  10. package/schemas/runtime/capability-dependencies.schema.json +266 -59
  11. package/schemas/runtime/cli-check.schema.json +209 -0
  12. package/schemas/runtime/cli-help.schema.json +28 -0
  13. package/schemas/runtime/dependency-constraint-evaluation.schema.json +67 -68
  14. package/schemas/runtime/docs-anchors.schema.json +262 -67
  15. package/schemas/runtime/doctor-code-facts.schema.json +49 -0
  16. package/schemas/runtime/evidence-binding.schema.json +1 -1
  17. package/schemas/runtime/flow-selector-check.schema.json +179 -46
  18. package/schemas/runtime/hook-debt-checkpoint.schema.json +12 -12
  19. package/schemas/runtime/index-seed.schema.json +56 -0
  20. package/schemas/runtime/path-context.schema.json +120 -0
  21. package/schemas/runtime/product-version-manifest.schema.json +142 -54
  22. package/schemas/runtime/projection-slice.schema.json +34 -34
  23. package/schemas/runtime/recommendation-v3.schema.json +372 -1
  24. package/schemas/runtime/ref-impact-batch-request.schema.json +20 -7
  25. package/schemas/runtime/ref-impact-batch.schema.json +83 -13
  26. package/schemas/runtime/ref-impact.schema.json +68 -61
  27. package/schemas/runtime/refactor-scan-v2.schema.json +1392 -0
  28. package/schemas/runtime/refactor-simulate.schema.json +553 -0
  29. package/schemas/runtime/refactor-verify-v2.schema.json +172 -0
  30. package/schemas/runtime/resolve-path.schema.json +69 -0
  31. package/schemas/runtime/runtime-recommendation-show.schema.json +531 -2
  32. package/schemas/runtime/runtime-refactor-scan.schema.json +498 -2
  33. package/schemas/runtime/runtime-verify.schema.json +274 -56
  34. package/schemas/runtime/state-machine-check.schema.json +357 -89
  35. package/schemas/runtime/structural-observation-payload.schema.json +372 -1
  36. package/schemas/runtime/sync-check.schema.json +77 -0
  37. package/src/architecture-debt.ts +125 -38
  38. package/src/architecture-history.ts +168 -42
  39. package/src/architecture.ts +100 -0
  40. package/src/cli-read.ts +228 -0
  41. package/src/docs-anchors.ts +105 -50
  42. package/src/explorer-occurrence-ports.ts +175 -0
  43. package/src/explorer-query-ports.ts +270 -0
  44. package/src/failure.ts +4 -0
  45. package/src/index-seed.ts +42 -0
  46. package/src/index.ts +5 -0
  47. package/src/ledger-records.ts +262 -0
  48. package/src/ledger.ts +27 -566
  49. package/src/ownership-dependencies.ts +115 -5
  50. package/src/ports.ts +6 -541
  51. package/src/product-version.ts +74 -55
  52. package/src/projection-apply-types.ts +216 -0
  53. package/src/projection-apply-validators.ts +355 -0
  54. package/src/projection-capabilities.ts +181 -0
  55. package/src/projection-constants.ts +317 -0
  56. package/src/projection-manifest-types.ts +298 -0
  57. package/src/projection-manifest.ts +12 -299
  58. package/src/projection-recovery-validators.ts +229 -0
  59. package/src/projection-request-validators.ts +326 -0
  60. package/src/projection-types.ts +365 -0
  61. package/src/projection-validation-helpers.ts +15 -0
  62. package/src/projection.ts +7 -1689
  63. package/src/ref-impact.ts +225 -33
  64. package/src/refactor-constants.ts +213 -0
  65. package/src/refactor-decision-validators.ts +351 -0
  66. package/src/refactor-evidence-types.ts +286 -0
  67. package/src/refactor-observation-validators.ts +359 -0
  68. package/src/refactor-resolution-validators.ts +229 -0
  69. package/src/refactor-snapshot-validators.ts +368 -0
  70. package/src/refactor-types.ts +270 -0
  71. package/src/refactor-v2.ts +554 -0
  72. package/src/refactor-validation-helpers.ts +199 -0
  73. package/src/refactor.ts +7 -1849
  74. package/src/review-guards.ts +3 -23
  75. package/src/runtime-verify.ts +87 -0
  76. package/src/schema-kit.ts +187 -0
  77. package/src/schema-registry.ts +73 -0
  78. package/src/schema.ts +15 -4
  79. package/src/state-machine-schemas.ts +192 -0
  80. package/src/state-machine-types.ts +188 -0
  81. package/src/state-machine.ts +9 -189
  82. package/fixtures/boundary/agent-job-expired.json +0 -33
  83. package/fixtures/invalid/adapter-fidelity-reverse-sync.json +0 -9
  84. package/fixtures/invalid/agent-job-direct-mutation.json +0 -32
  85. package/fixtures/invalid/cloud-egress-envelope-private-field.json +0 -12
  86. package/fixtures/invalid/investigation-report-direct-mutation.json +0 -38
  87. package/fixtures/invalid/investigation-report-missing-proposed-delta.json +0 -19
  88. package/fixtures/invalid/notification-event-code-field.json +0 -11
  89. package/fixtures/valid/adapter-fidelity.json +0 -9
  90. package/fixtures/valid/agent-job.json +0 -33
  91. package/fixtures/valid/architecture-candidate-delta-policy.json +0 -45
  92. package/fixtures/valid/architecture-candidate-delta.json +0 -188
  93. package/fixtures/valid/chatgpt-ga-tool.json +0 -9
  94. package/fixtures/valid/cloud-egress-envelope.json +0 -11
  95. package/fixtures/valid/entitlement.json +0 -12
  96. package/fixtures/valid/investigation-report.json +0 -38
  97. package/fixtures/valid/likec4-mapping.json +0 -14
  98. package/fixtures/valid/notification-event.json +0 -10
  99. package/fixtures/valid/notification-provider.json +0 -12
  100. package/fixtures/valid/structurizr-mapping.json +0 -15
  101. package/schemas/cloud/cloud-egress-envelope.schema.json +0 -19
  102. package/schemas/cloud/entitlement.schema.json +0 -24
  103. package/schemas/integrations/adapter-fidelity.schema.json +0 -21
  104. package/schemas/integrations/chatgpt-ga-tool.schema.json +0 -25
  105. package/schemas/integrations/likec4-mapping.schema.json +0 -32
  106. package/schemas/integrations/structurizr-mapping.schema.json +0 -33
  107. package/schemas/runtime/agent-job.schema.json +0 -63
  108. package/schemas/runtime/architecture-candidate-delta-policy.schema.json +0 -129
  109. package/schemas/runtime/architecture-candidate-delta.schema.json +0 -386
  110. package/schemas/runtime/investigation-report.schema.json +0 -119
  111. package/schemas/runtime/notification-event.schema.json +0 -18
  112. package/schemas/runtime/notification-provider.schema.json +0 -26
@@ -0,0 +1,354 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/architecture-history.schema.json",
4
+ "title": "ArchitectureHistory",
5
+ "additionalProperties": false,
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "head",
10
+ "total",
11
+ "offset",
12
+ "limit",
13
+ "milestones"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "const": "archcontext.architecture-history/v1"
18
+ },
19
+ "head": {
20
+ "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$",
21
+ "type": "string"
22
+ },
23
+ "total": {
24
+ "minimum": 0,
25
+ "type": "integer"
26
+ },
27
+ "offset": {
28
+ "minimum": 0,
29
+ "type": "integer"
30
+ },
31
+ "limit": {
32
+ "minimum": 0,
33
+ "maximum": 1000,
34
+ "type": "integer"
35
+ },
36
+ "milestones": {
37
+ "type": "array",
38
+ "items": {
39
+ "oneOf": [
40
+ {
41
+ "additionalProperties": false,
42
+ "type": "object",
43
+ "required": [
44
+ "rev",
45
+ "date",
46
+ "subject",
47
+ "nodes",
48
+ "edges",
49
+ "delta"
50
+ ],
51
+ "properties": {
52
+ "rev": {
53
+ "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$",
54
+ "type": "string"
55
+ },
56
+ "date": {
57
+ "type": "string"
58
+ },
59
+ "subject": {
60
+ "type": "string"
61
+ },
62
+ "nodes": {
63
+ "type": "array",
64
+ "items": {
65
+ "additionalProperties": false,
66
+ "type": "object",
67
+ "required": [
68
+ "id",
69
+ "name",
70
+ "domain"
71
+ ],
72
+ "properties": {
73
+ "id": {
74
+ "type": "string"
75
+ },
76
+ "name": {
77
+ "type": "string"
78
+ },
79
+ "domain": {
80
+ "oneOf": [
81
+ {
82
+ "type": "string"
83
+ },
84
+ {
85
+ "type": "null"
86
+ }
87
+ ]
88
+ }
89
+ }
90
+ }
91
+ },
92
+ "edges": {
93
+ "type": "array",
94
+ "items": {
95
+ "additionalProperties": false,
96
+ "type": "object",
97
+ "required": [
98
+ "source",
99
+ "target"
100
+ ],
101
+ "properties": {
102
+ "source": {
103
+ "type": "string"
104
+ },
105
+ "target": {
106
+ "type": "string"
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "delta": {
112
+ "additionalProperties": false,
113
+ "type": "object",
114
+ "required": [
115
+ "baseRev",
116
+ "added",
117
+ "removed",
118
+ "renamed",
119
+ "edgesChanged"
120
+ ],
121
+ "properties": {
122
+ "baseRev": {
123
+ "oneOf": [
124
+ {
125
+ "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$",
126
+ "type": "string"
127
+ },
128
+ {
129
+ "type": "null"
130
+ }
131
+ ]
132
+ },
133
+ "added": {
134
+ "type": "array",
135
+ "items": {
136
+ "additionalProperties": false,
137
+ "type": "object",
138
+ "required": [
139
+ "id",
140
+ "kind",
141
+ "capability"
142
+ ],
143
+ "properties": {
144
+ "id": {
145
+ "type": "string"
146
+ },
147
+ "kind": {
148
+ "enum": [
149
+ "capability",
150
+ "module",
151
+ "component"
152
+ ]
153
+ },
154
+ "capability": {
155
+ "oneOf": [
156
+ {
157
+ "type": "string"
158
+ },
159
+ {
160
+ "type": "null"
161
+ }
162
+ ]
163
+ }
164
+ }
165
+ }
166
+ },
167
+ "removed": {
168
+ "type": "array",
169
+ "items": {
170
+ "additionalProperties": false,
171
+ "type": "object",
172
+ "required": [
173
+ "id",
174
+ "kind",
175
+ "capability"
176
+ ],
177
+ "properties": {
178
+ "id": {
179
+ "type": "string"
180
+ },
181
+ "kind": {
182
+ "enum": [
183
+ "capability",
184
+ "module",
185
+ "component"
186
+ ]
187
+ },
188
+ "capability": {
189
+ "oneOf": [
190
+ {
191
+ "type": "string"
192
+ },
193
+ {
194
+ "type": "null"
195
+ }
196
+ ]
197
+ }
198
+ }
199
+ }
200
+ },
201
+ "renamed": {
202
+ "type": "array",
203
+ "items": {
204
+ "additionalProperties": false,
205
+ "type": "object",
206
+ "required": [
207
+ "id",
208
+ "kind",
209
+ "capability",
210
+ "from",
211
+ "to"
212
+ ],
213
+ "properties": {
214
+ "id": {
215
+ "type": "string"
216
+ },
217
+ "kind": {
218
+ "enum": [
219
+ "capability",
220
+ "module",
221
+ "component"
222
+ ]
223
+ },
224
+ "capability": {
225
+ "oneOf": [
226
+ {
227
+ "type": "string"
228
+ },
229
+ {
230
+ "type": "null"
231
+ }
232
+ ]
233
+ },
234
+ "from": {
235
+ "type": "string"
236
+ },
237
+ "to": {
238
+ "type": "string"
239
+ }
240
+ }
241
+ }
242
+ },
243
+ "edgesChanged": {
244
+ "additionalProperties": false,
245
+ "type": "object",
246
+ "required": [
247
+ "added",
248
+ "removed"
249
+ ],
250
+ "properties": {
251
+ "added": {
252
+ "type": "array",
253
+ "items": {
254
+ "additionalProperties": false,
255
+ "type": "object",
256
+ "required": [
257
+ "source",
258
+ "target"
259
+ ],
260
+ "properties": {
261
+ "source": {
262
+ "type": "string"
263
+ },
264
+ "target": {
265
+ "type": "string"
266
+ }
267
+ }
268
+ }
269
+ },
270
+ "removed": {
271
+ "type": "array",
272
+ "items": {
273
+ "additionalProperties": false,
274
+ "type": "object",
275
+ "required": [
276
+ "source",
277
+ "target"
278
+ ],
279
+ "properties": {
280
+ "source": {
281
+ "type": "string"
282
+ },
283
+ "target": {
284
+ "type": "string"
285
+ }
286
+ }
287
+ }
288
+ }
289
+ }
290
+ }
291
+ }
292
+ }
293
+ }
294
+ },
295
+ {
296
+ "additionalProperties": false,
297
+ "type": "object",
298
+ "required": [
299
+ "rev",
300
+ "date",
301
+ "subject",
302
+ "nodes",
303
+ "edges",
304
+ "delta",
305
+ "error"
306
+ ],
307
+ "properties": {
308
+ "rev": {
309
+ "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$",
310
+ "type": "string"
311
+ },
312
+ "date": {
313
+ "type": "string"
314
+ },
315
+ "subject": {
316
+ "type": "string"
317
+ },
318
+ "nodes": {
319
+ "type": "null"
320
+ },
321
+ "edges": {
322
+ "type": "null"
323
+ },
324
+ "delta": {
325
+ "type": "null"
326
+ },
327
+ "error": {
328
+ "additionalProperties": false,
329
+ "type": "object",
330
+ "required": [
331
+ "code"
332
+ ],
333
+ "properties": {
334
+ "code": {
335
+ "enum": [
336
+ "history-model-layout-unsupported",
337
+ "history-model-missing",
338
+ "history-model-invalid",
339
+ "history-model-too-large"
340
+ ]
341
+ },
342
+ "path": {
343
+ "minLength": 1,
344
+ "type": "string"
345
+ }
346
+ }
347
+ }
348
+ }
349
+ }
350
+ ]
351
+ }
352
+ }
353
+ }
354
+ }