archctx-contracts 0.6.3 → 0.7.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 (29) hide show
  1. package/fixtures/invalid/recommendation-v3-structural-before-evidence.json +59 -0
  2. package/fixtures/valid/archctx-capabilities.json +3 -3
  3. package/fixtures/valid/product-version-manifest.json +6 -6
  4. package/fixtures/valid/projection-manifest.json +175 -0
  5. package/fixtures/valid/projection-result.json +5 -5
  6. package/fixtures/valid/recommendation-v3.json +69 -0
  7. package/fixtures/valid/runtime-recommendation-show.json +312 -0
  8. package/fixtures/valid/runtime-refactor-scan.json +542 -0
  9. package/package.json +1 -1
  10. package/schemas/runtime/archctx-capabilities.schema.json +7 -2
  11. package/schemas/runtime/architecture-refresh-signal.schema.json +27 -0
  12. package/schemas/runtime/changeset.schema.json +42 -16
  13. package/schemas/runtime/projection-apply-readback.schema.json +351 -10
  14. package/schemas/runtime/projection-apply-recovery.schema.json +24 -3
  15. package/schemas/runtime/projection-manifest.schema.json +491 -0
  16. package/schemas/runtime/projection-request.schema.json +11 -2
  17. package/schemas/runtime/projection-result.schema.json +108 -8
  18. package/schemas/runtime/recommendation-v3.schema.json +1166 -0
  19. package/schemas/runtime/runtime-recommendation-show.schema.json +2449 -0
  20. package/schemas/runtime/runtime-refactor-scan.schema.json +2489 -0
  21. package/schemas/runtime/structural-observation-payload.schema.json +578 -0
  22. package/src/index.ts +1 -0
  23. package/src/ledger.ts +26 -10
  24. package/src/product-version.ts +2 -2
  25. package/src/projection-manifest.ts +346 -0
  26. package/src/projection.ts +338 -6
  27. package/src/refactor.ts +268 -1
  28. package/src/schema.ts +20 -4
  29. package/src/validator.ts +87 -15
@@ -0,0 +1,542 @@
1
+ {
2
+ "schemaVersion": "archcontext.runtime-refactor-scan/v1",
3
+ "repository": {
4
+ "repositoryId": "repo.537182127c5f2134",
5
+ "storageRepositoryId": "repo.03ba73c90cbf6a7e"
6
+ },
7
+ "worktree": {
8
+ "workspaceId": "ws.537182127c5f2134",
9
+ "storageWorkspaceId": "ws.537182127c5f2134",
10
+ "branch": "main",
11
+ "headSha": "728b42479d7ab7a2d401ea44af26cdac64912f0f",
12
+ "worktreeDigest": "sha256:96cbb5ccf708d8b7c56c2633e8937311338957998b7154879461706460d4c467"
13
+ },
14
+ "requestId": "refactor_request.d514edefd58b7a9e",
15
+ "request": {
16
+ "schemaVersion": "archcontext.refactor-request/v1",
17
+ "scope": {
18
+ "kind": "repository"
19
+ }
20
+ },
21
+ "trackedFileCount": 9,
22
+ "snapshot": {
23
+ "schemaVersion": "archcontext.module-statistics/v1",
24
+ "repository": {
25
+ "repositoryId": "repo.537182127c5f2134",
26
+ "storageRepositoryId": "repo.03ba73c90cbf6a7e"
27
+ },
28
+ "worktree": {
29
+ "workspaceId": "ws.537182127c5f2134",
30
+ "storageWorkspaceId": "ws.537182127c5f2134",
31
+ "branch": "main",
32
+ "headSha": "728b42479d7ab7a2d401ea44af26cdac64912f0f",
33
+ "worktreeDigest": "sha256:96cbb5ccf708d8b7c56c2633e8937311338957998b7154879461706460d4c467"
34
+ },
35
+ "modelDigest": "sha256:54ed020e2f65d0649b215df9251332d5a288746a687d9d7a654b9700dfd995a7",
36
+ "codeFacts": {
37
+ "provider": "codegraph",
38
+ "version": "",
39
+ "binaryDigest": "",
40
+ "indexedWorktreeDigest": null,
41
+ "coverage": "unknown",
42
+ "truncated": true,
43
+ "edgeLimit": 5000,
44
+ "reasonCodes": [
45
+ "caller-coverage-unknown",
46
+ "code-facts-missing",
47
+ "code-facts-truncated",
48
+ "node-footprint-undeclared"
49
+ ]
50
+ },
51
+ "modules": [
52
+ {
53
+ "nodeId": "capability.architecture.context",
54
+ "nodeDigest": "sha256:47f48ff9115682aeb1cce33a01ecac47ef79935a7e9a10a4577d7e7c8582c3f0",
55
+ "parentNodeId": null,
56
+ "footprintDeclared": false,
57
+ "footprint": null,
58
+ "surfaces": {
59
+ "declaredEntrypoints": [],
60
+ "observedEntrypoints": [],
61
+ "lifecycleOwners": [],
62
+ "datastoreSubjects": []
63
+ },
64
+ "dependencyGraph": null,
65
+ "tests": {
66
+ "testFileCount": null,
67
+ "observedTestEdges": null,
68
+ "callerCoverage": null,
69
+ "coverageStatus": "unknown"
70
+ },
71
+ "uncertainty": {
72
+ "unresolvedImports": 0,
73
+ "dynamicInvocation": "unknown",
74
+ "ambiguousOwnership": false
75
+ },
76
+ "moduleDigest": "sha256:7c539afac512c4aed0d7408f4b1945c51ddb79e24a017732c2a2a5cd5f52481e"
77
+ },
78
+ {
79
+ "nodeId": "module.dump",
80
+ "nodeDigest": "sha256:8f77a427f093506f0ff5197dd0129f6888c1653c0ccc65e3981d587e102a882b",
81
+ "parentNodeId": null,
82
+ "footprintDeclared": true,
83
+ "footprint": {
84
+ "fileCount": 1,
85
+ "lineCount": 1,
86
+ "sourceFilesDigest": "sha256:5f2ceccfe01dc55c63a1b0e5bf2ce51676e8f2805499e0c8519d59fdc8e265c4",
87
+ "includePatterns": [
88
+ "src/**"
89
+ ],
90
+ "excludePatterns": []
91
+ },
92
+ "surfaces": {
93
+ "declaredEntrypoints": [],
94
+ "observedEntrypoints": [],
95
+ "lifecycleOwners": [],
96
+ "datastoreSubjects": []
97
+ },
98
+ "dependencyGraph": null,
99
+ "tests": {
100
+ "testFileCount": null,
101
+ "observedTestEdges": null,
102
+ "callerCoverage": null,
103
+ "coverageStatus": "unknown"
104
+ },
105
+ "uncertainty": {
106
+ "unresolvedImports": 0,
107
+ "dynamicInvocation": "unknown",
108
+ "ambiguousOwnership": false
109
+ },
110
+ "moduleDigest": "sha256:32d887790fe89e1415d1cb0e68557509e025b4026184ad8a463f4d886a3de182"
111
+ }
112
+ ],
113
+ "repositorySummary": {
114
+ "moduleCount": 2,
115
+ "undeclaredFootprintNodeCount": 1,
116
+ "ownedFileCount": 1,
117
+ "unownedFileCount": 0,
118
+ "multiplyOwnedFileCount": 0,
119
+ "crossModuleEdgeCount": 0,
120
+ "crossModuleCycleCount": 0,
121
+ "stronglyConnectedComponentCount": 0,
122
+ "unresolvedImportCount": 0,
123
+ "dynamicInvocationRiskCount": 2
124
+ },
125
+ "createdAt": "2026-10-11T04:21:31.000Z",
126
+ "snapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
127
+ },
128
+ "assessment": {
129
+ "schemaVersion": "archcontext.refactor-assessment/v1",
130
+ "requestId": "refactor_request.d514edefd58b7a9e",
131
+ "statisticsSnapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e",
132
+ "modelDigest": "sha256:54ed020e2f65d0649b215df9251332d5a288746a687d9d7a654b9700dfd995a7",
133
+ "codeFactsDigest": "sha256:1044803e55c9413cc85b58a5d5ec995b311d1ee50cc476f80b7f7babf3ad4662",
134
+ "requestedScope": {
135
+ "kind": "repository"
136
+ },
137
+ "proposalDigest": null,
138
+ "observations": [
139
+ {
140
+ "kind": "evidence-gap",
141
+ "subjectSelectorId": "repository:repo.537182127c5f2134",
142
+ "metrics": {
143
+ "unresolvedImportCount": 0,
144
+ "edgeLimit": 5000
145
+ },
146
+ "evidence": {
147
+ "kind": "evidence-gap",
148
+ "coverage": "unknown",
149
+ "reasonCodes": [
150
+ "caller-coverage-unknown",
151
+ "code-facts-missing",
152
+ "code-facts-truncated",
153
+ "node-footprint-undeclared"
154
+ ],
155
+ "unresolvedImports": [],
156
+ "totalCount": 0,
157
+ "truncated": false
158
+ },
159
+ "signalIds": [
160
+ "signal.evidence-gap.262e0ca20828366e"
161
+ ]
162
+ },
163
+ {
164
+ "kind": "undeclared-footprint",
165
+ "subjectSelectorId": "capability.architecture.context",
166
+ "metrics": {},
167
+ "evidence": {
168
+ "kind": "undeclared-footprint",
169
+ "paths": [],
170
+ "totalCount": 0,
171
+ "truncated": false
172
+ },
173
+ "signalIds": [
174
+ "signal.undeclared-footprint.bc66b760c4329111"
175
+ ]
176
+ }
177
+ ],
178
+ "scale": null,
179
+ "scaleReasonCodes": [],
180
+ "affectedNodeIds": [],
181
+ "majorChangeReasons": [],
182
+ "pressure": {
183
+ "level": "low",
184
+ "score": 10,
185
+ "signalIds": [
186
+ "signal.evidence-gap.262e0ca20828366e",
187
+ "signal.undeclared-footprint.bc66b760c4329111"
188
+ ]
189
+ },
190
+ "confidence": {
191
+ "level": "low",
192
+ "callerCoverage": null,
193
+ "testsObserved": null,
194
+ "rollbackObserved": null,
195
+ "unresolvedEvidence": [
196
+ "coverage:unknown"
197
+ ]
198
+ },
199
+ "createdAt": "2026-10-11T04:21:31.000Z",
200
+ "assessmentDigest": "sha256:308510d9a08558453b9644d33fe24a73f4579832c448602b24c5053bdc4aa5ca"
201
+ },
202
+ "proposedRecommendations": [
203
+ {
204
+ "schemaVersion": "archcontext.recommendation/v3",
205
+ "recommendationId": "recommendation.c8c842b3d8529388",
206
+ "runId": "recommendation_run.9d3423295f1a45e6",
207
+ "fingerprint": "sha256:27b2fed8524041b6003797081dbf77355d7fccfa54327becf00ecaef0728db2a",
208
+ "subject": "capability.architecture.context",
209
+ "status": "open",
210
+ "confidence": "low",
211
+ "enforcement": "advisory",
212
+ "risk": "medium",
213
+ "uncertainty": "high",
214
+ "evidenceBindingIds": [
215
+ "binding.7577455e29083b0b"
216
+ ],
217
+ "explanation": [
218
+ "capability.architecture.context declares no source.include footprint, so none of its files or imports are measured.",
219
+ "It declares no entrypoint paths either."
220
+ ],
221
+ "authoredBy": {
222
+ "kind": "daemon",
223
+ "id": "archctxd",
224
+ "source": "daemon"
225
+ },
226
+ "subjectSelectorId": "subject.node.d4eae75fb5b5121f",
227
+ "relations": {},
228
+ "createdAt": "2026-10-11T04:21:31.000Z",
229
+ "updatedAt": "2026-10-11T04:21:31.000Z",
230
+ "category": "structural_observation",
231
+ "payload": {
232
+ "assessmentDigest": "sha256:308510d9a08558453b9644d33fe24a73f4579832c448602b24c5053bdc4aa5ca",
233
+ "kind": "undeclared-footprint",
234
+ "affectedNodeIds": [
235
+ "capability.architecture.context"
236
+ ],
237
+ "baselineSnapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e",
238
+ "derivedOutcomes": [
239
+ {
240
+ "metric": "module.footprintDeclared",
241
+ "subjectSelectorId": "subject.node.d4eae75fb5b5121f",
242
+ "nodeId": "capability.architecture.context",
243
+ "operator": "present",
244
+ "value": null,
245
+ "required": true,
246
+ "outcomeId": "outcome.58946c9d4f0f41c1"
247
+ }
248
+ ],
249
+ "metrics": {},
250
+ "signalIds": [
251
+ "signal.undeclared-footprint.bc66b760c4329111"
252
+ ],
253
+ "evidence": {
254
+ "kind": "undeclared-footprint",
255
+ "paths": [],
256
+ "totalCount": 0,
257
+ "truncated": false
258
+ }
259
+ },
260
+ "extensions": {
261
+ "assessmentDigest": "sha256:308510d9a08558453b9644d33fe24a73f4579832c448602b24c5053bdc4aa5ca",
262
+ "baselineSnapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e",
263
+ "riskSignals": [
264
+ "ownership-change"
265
+ ],
266
+ "uncertaintySignals": [
267
+ "low-coverage"
268
+ ],
269
+ "score": 23
270
+ }
271
+ },
272
+ {
273
+ "schemaVersion": "archcontext.recommendation/v3",
274
+ "recommendationId": "recommendation.22feb92677c752aa",
275
+ "runId": "recommendation_run.9d3423295f1a45e6",
276
+ "fingerprint": "sha256:d84b7558a783350a40ee16260cce07b4caed1270b8984f774329fa980f91b0a9",
277
+ "subject": "repository:repo.537182127c5f2134",
278
+ "status": "open",
279
+ "confidence": "low",
280
+ "enforcement": "advisory",
281
+ "risk": "low",
282
+ "uncertainty": "high",
283
+ "evidenceBindingIds": [
284
+ "binding.3bc9dc35b8c72768"
285
+ ],
286
+ "explanation": [
287
+ "Code facts coverage is unknown (caller-coverage-unknown, code-facts-missing, code-facts-truncated, node-footprint-undeclared), so structural metrics are incomplete."
288
+ ],
289
+ "authoredBy": {
290
+ "kind": "daemon",
291
+ "id": "archctxd",
292
+ "source": "daemon"
293
+ },
294
+ "subjectSelectorId": "subject.repository.525bab1b3e65c960",
295
+ "relations": {},
296
+ "createdAt": "2026-10-11T04:21:31.000Z",
297
+ "updatedAt": "2026-10-11T04:21:31.000Z",
298
+ "category": "structural_observation",
299
+ "payload": {
300
+ "assessmentDigest": "sha256:308510d9a08558453b9644d33fe24a73f4579832c448602b24c5053bdc4aa5ca",
301
+ "kind": "evidence-gap",
302
+ "affectedNodeIds": [],
303
+ "baselineSnapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e",
304
+ "derivedOutcomes": [
305
+ {
306
+ "metric": "repositorySummary.unresolvedImportCount",
307
+ "subjectSelectorId": "subject.repository.525bab1b3e65c960",
308
+ "nodeId": null,
309
+ "operator": "absent",
310
+ "value": null,
311
+ "required": true,
312
+ "outcomeId": "outcome.8ad0edda6755e289"
313
+ }
314
+ ],
315
+ "metrics": {
316
+ "unresolvedImportCount": 0,
317
+ "edgeLimit": 5000
318
+ },
319
+ "signalIds": [
320
+ "signal.evidence-gap.262e0ca20828366e"
321
+ ],
322
+ "evidence": {
323
+ "kind": "evidence-gap",
324
+ "coverage": "unknown",
325
+ "reasonCodes": [
326
+ "caller-coverage-unknown",
327
+ "code-facts-missing",
328
+ "code-facts-truncated",
329
+ "node-footprint-undeclared"
330
+ ],
331
+ "unresolvedImports": [],
332
+ "totalCount": 0,
333
+ "truncated": false
334
+ }
335
+ },
336
+ "extensions": {
337
+ "assessmentDigest": "sha256:308510d9a08558453b9644d33fe24a73f4579832c448602b24c5053bdc4aa5ca",
338
+ "baselineSnapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e",
339
+ "riskSignals": [],
340
+ "uncertaintySignals": [
341
+ "low-coverage"
342
+ ],
343
+ "score": 13
344
+ }
345
+ }
346
+ ],
347
+ "evidenceItems": [
348
+ {
349
+ "schemaVersion": "archcontext.evidence-item/v2",
350
+ "evidenceId": "evidence.module_statistics_snapshot.35796bb112cab526",
351
+ "kind": "module-statistics-snapshot",
352
+ "strength": "observed",
353
+ "polarity": "positive",
354
+ "origin": "runtime-daemon",
355
+ "subject": "repository:repo.537182127c5f2134",
356
+ "selector": {
357
+ "kind": "snapshot",
358
+ "id": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
359
+ },
360
+ "summary": "Module statistics baseline for 2 declared module(s).",
361
+ "coverage": {
362
+ "level": "unknown",
363
+ "scope": "module-statistics-snapshot"
364
+ },
365
+ "supports": [
366
+ "recommendation"
367
+ ],
368
+ "provenance": {
369
+ "producer": "recommendation-engine",
370
+ "command": "archctx refactor record",
371
+ "inputDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
372
+ },
373
+ "createdAt": "2026-10-11T04:21:31.000Z",
374
+ "digest": "sha256:5ee758961ef4ea532ef72359f46e2d06fa528d70bab6bd19cd59dbfca8acd3fc",
375
+ "extensions": {
376
+ "moduleStatisticsSnapshot": {
377
+ "schemaVersion": "archcontext.module-statistics/v1",
378
+ "repository": {
379
+ "repositoryId": "repo.537182127c5f2134",
380
+ "storageRepositoryId": "repo.03ba73c90cbf6a7e"
381
+ },
382
+ "worktree": {
383
+ "workspaceId": "ws.537182127c5f2134",
384
+ "storageWorkspaceId": "ws.537182127c5f2134",
385
+ "branch": "main",
386
+ "headSha": "728b42479d7ab7a2d401ea44af26cdac64912f0f",
387
+ "worktreeDigest": "sha256:96cbb5ccf708d8b7c56c2633e8937311338957998b7154879461706460d4c467"
388
+ },
389
+ "modelDigest": "sha256:54ed020e2f65d0649b215df9251332d5a288746a687d9d7a654b9700dfd995a7",
390
+ "codeFacts": {
391
+ "provider": "codegraph",
392
+ "version": "",
393
+ "binaryDigest": "",
394
+ "indexedWorktreeDigest": null,
395
+ "coverage": "unknown",
396
+ "truncated": true,
397
+ "edgeLimit": 5000,
398
+ "reasonCodes": [
399
+ "caller-coverage-unknown",
400
+ "code-facts-missing",
401
+ "code-facts-truncated",
402
+ "node-footprint-undeclared"
403
+ ]
404
+ },
405
+ "modules": [
406
+ {
407
+ "nodeId": "capability.architecture.context",
408
+ "nodeDigest": "sha256:47f48ff9115682aeb1cce33a01ecac47ef79935a7e9a10a4577d7e7c8582c3f0",
409
+ "parentNodeId": null,
410
+ "footprintDeclared": false,
411
+ "footprint": null,
412
+ "surfaces": {
413
+ "declaredEntrypoints": [],
414
+ "observedEntrypoints": [],
415
+ "lifecycleOwners": [],
416
+ "datastoreSubjects": []
417
+ },
418
+ "dependencyGraph": null,
419
+ "tests": {
420
+ "testFileCount": null,
421
+ "observedTestEdges": null,
422
+ "callerCoverage": null,
423
+ "coverageStatus": "unknown"
424
+ },
425
+ "uncertainty": {
426
+ "unresolvedImports": 0,
427
+ "dynamicInvocation": "unknown",
428
+ "ambiguousOwnership": false
429
+ },
430
+ "moduleDigest": "sha256:7c539afac512c4aed0d7408f4b1945c51ddb79e24a017732c2a2a5cd5f52481e"
431
+ },
432
+ {
433
+ "nodeId": "module.dump",
434
+ "nodeDigest": "sha256:8f77a427f093506f0ff5197dd0129f6888c1653c0ccc65e3981d587e102a882b",
435
+ "parentNodeId": null,
436
+ "footprintDeclared": true,
437
+ "footprint": {
438
+ "fileCount": 1,
439
+ "lineCount": 1,
440
+ "sourceFilesDigest": "sha256:5f2ceccfe01dc55c63a1b0e5bf2ce51676e8f2805499e0c8519d59fdc8e265c4",
441
+ "includePatterns": [
442
+ "src/**"
443
+ ],
444
+ "excludePatterns": []
445
+ },
446
+ "surfaces": {
447
+ "declaredEntrypoints": [],
448
+ "observedEntrypoints": [],
449
+ "lifecycleOwners": [],
450
+ "datastoreSubjects": []
451
+ },
452
+ "dependencyGraph": null,
453
+ "tests": {
454
+ "testFileCount": null,
455
+ "observedTestEdges": null,
456
+ "callerCoverage": null,
457
+ "coverageStatus": "unknown"
458
+ },
459
+ "uncertainty": {
460
+ "unresolvedImports": 0,
461
+ "dynamicInvocation": "unknown",
462
+ "ambiguousOwnership": false
463
+ },
464
+ "moduleDigest": "sha256:32d887790fe89e1415d1cb0e68557509e025b4026184ad8a463f4d886a3de182"
465
+ }
466
+ ],
467
+ "repositorySummary": {
468
+ "moduleCount": 2,
469
+ "undeclaredFootprintNodeCount": 1,
470
+ "ownedFileCount": 1,
471
+ "unownedFileCount": 0,
472
+ "multiplyOwnedFileCount": 0,
473
+ "crossModuleEdgeCount": 0,
474
+ "crossModuleCycleCount": 0,
475
+ "stronglyConnectedComponentCount": 0,
476
+ "unresolvedImportCount": 0,
477
+ "dynamicInvocationRiskCount": 2
478
+ },
479
+ "createdAt": "2026-10-11T04:21:31.000Z",
480
+ "snapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
481
+ }
482
+ }
483
+ }
484
+ ],
485
+ "evidenceBindings": [
486
+ {
487
+ "schemaVersion": "archcontext.evidence-binding/v1",
488
+ "bindingId": "binding.7577455e29083b0b",
489
+ "evidenceId": "evidence.module_statistics_snapshot.35796bb112cab526",
490
+ "target": {
491
+ "kind": "recommendation",
492
+ "id": "recommendation.c8c842b3d8529388"
493
+ },
494
+ "bindingReason": "deterministic-check",
495
+ "authorityEffect": "context-only",
496
+ "createdAt": "2026-10-11T04:21:31.000Z",
497
+ "provenance": {
498
+ "producer": "recommendation-engine",
499
+ "command": "archctx refactor record",
500
+ "inputDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
501
+ }
502
+ },
503
+ {
504
+ "schemaVersion": "archcontext.evidence-binding/v1",
505
+ "bindingId": "binding.3bc9dc35b8c72768",
506
+ "evidenceId": "evidence.module_statistics_snapshot.35796bb112cab526",
507
+ "target": {
508
+ "kind": "recommendation",
509
+ "id": "recommendation.22feb92677c752aa"
510
+ },
511
+ "bindingReason": "deterministic-check",
512
+ "authorityEffect": "context-only",
513
+ "createdAt": "2026-10-11T04:21:31.000Z",
514
+ "provenance": {
515
+ "producer": "recommendation-engine",
516
+ "command": "archctx refactor record",
517
+ "inputDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
518
+ }
519
+ }
520
+ ],
521
+ "suppressed": [],
522
+ "recording": {
523
+ "recordable": true,
524
+ "reasonCode": null,
525
+ "measuredBytes": 11039,
526
+ "limitBytes": 262144
527
+ },
528
+ "limits": {
529
+ "evidenceSampleLimit": 20,
530
+ "maxEvidenceSampleLimit": 20,
531
+ "maxRecommendationsPerRun": 25,
532
+ "candidateCount": 2,
533
+ "omittedCandidateCount": 0
534
+ },
535
+ "recordCommand": "archctx refactor record --assessment-digest sha256:308510d9a08558453b9644d33fe24a73f4579832c448602b24c5053bdc4aa5ca --expected-worktree-digest sha256:96cbb5ccf708d8b7c56c2633e8937311338957998b7154879461706460d4c467",
536
+ "privacy": {
537
+ "writes": "none",
538
+ "rawSourcePersisted": false,
539
+ "rawDiffPersisted": false,
540
+ "promptPersisted": false
541
+ }
542
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archctx-contracts",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "additionalProperties": false,
32
32
  "required": ["architectureDocs", "agentContext"],
33
33
  "properties": {
34
- "architectureDocs": { "const": "archcontext.docs-renderer/v4" },
34
+ "architectureDocs": { "const": "archcontext.docs-renderer/v5" },
35
35
  "agentContext": { "const": "archcontext.agent-context-renderer/v1" }
36
36
  }
37
37
  },
@@ -39,7 +39,12 @@
39
39
  "type": "array",
40
40
  "minItems": 3,
41
41
  "uniqueItems": true,
42
- "items": { "enum": ["architecture-docs-renderer-v2", "architecture-refresh-signal-v1", "module-statistics-v1", "projection-apply-readback-v1", "projection-apply-receipt-v1", "projection-apply-recovery-v1", "projection-prior-committed-applies-v1", "projection-protocol-v2", "recommendation-v3", "refactor-assessment-v1", "refactor-resolution-v1"] }
42
+ "items": {
43
+ "type": "string",
44
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*-v[0-9]+$",
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", "changeset-entity-operations-v1", "code-facts-unavailable-error-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"]
47
+ }
43
48
  }
44
49
  }
45
50
  }
@@ -40,6 +40,12 @@
40
40
  "uniqueItems": true,
41
41
  "items": { "type": "string", "minLength": 1 }
42
42
  },
43
+ "capabilities": {
44
+ "type": "array",
45
+ "minItems": 1,
46
+ "description": "The observed per-capability breakdown of this signal, sorted by capabilityId (enforced by architectureRefreshSignalInvariantIssues). Part of the signal identity; signals committed before it existed lack it.",
47
+ "items": { "$ref": "#/$defs/capabilityChange" }
48
+ },
43
49
  "refreshTargets": {
44
50
  "type": "array",
45
51
  "minItems": 1,
@@ -59,6 +65,27 @@
59
65
  ],
60
66
  "$defs": {
61
67
  "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
68
+ "capabilityChange": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["capabilityId", "reasonCodes", "changedFacets", "proofStatusBefore", "proofStatusAfter"],
72
+ "properties": {
73
+ "capabilityId": { "type": "string", "minLength": 1 },
74
+ "reasonCodes": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/reasonCode" } },
75
+ "changedFacets": { "type": "array", "uniqueItems": true, "items": { "enum": ["constraints", "entrypoints", "interfaces", "lifecycle", "names", "ownership", "placement", "relations", "responsibilities", "riskBoundaries"] } },
76
+ "proofStatusBefore": { "anyOf": [{ "type": "null" }, { "$ref": "#/$defs/proofStatus" }] },
77
+ "proofStatusAfter": { "anyOf": [{ "type": "null" }, { "$ref": "#/$defs/proofStatus" }] }
78
+ }
79
+ },
80
+ "proofStatus": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "required": ["p1", "p2"],
84
+ "properties": {
85
+ "p1": { "enum": ["proven", "unprovable"] },
86
+ "p2": { "enum": ["not-applicable", "proven", "unprovable"] }
87
+ }
88
+ },
62
89
  "reasonCode": {
63
90
  "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
91
  },