archctx-contracts 0.6.2 → 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,312 @@
1
+ {
2
+ "schemaVersion": "archcontext.runtime-recommendation-show/v1",
3
+ "recommendationId": "recommendation.c8c842b3d8529388",
4
+ "source": "ledger",
5
+ "status": "deferred",
6
+ "recommendation": {
7
+ "schemaVersion": "archcontext.recommendation/v3",
8
+ "recommendationId": "recommendation.c8c842b3d8529388",
9
+ "runId": "recommendation_run.207822edf39557d3",
10
+ "fingerprint": "sha256:27b2fed8524041b6003797081dbf77355d7fccfa54327becf00ecaef0728db2a",
11
+ "subject": "capability.architecture.context",
12
+ "status": "deferred",
13
+ "confidence": "low",
14
+ "enforcement": "advisory",
15
+ "risk": "medium",
16
+ "uncertainty": "high",
17
+ "evidenceBindingIds": [
18
+ "binding.7577455e29083b0b"
19
+ ],
20
+ "explanation": [
21
+ "capability.architecture.context declares no source.include footprint, so none of its files or imports are measured.",
22
+ "It declares no entrypoint paths either."
23
+ ],
24
+ "authoredBy": {
25
+ "kind": "daemon",
26
+ "id": "archctxd",
27
+ "source": "daemon"
28
+ },
29
+ "subjectSelectorId": "subject.node.d4eae75fb5b5121f",
30
+ "relations": {},
31
+ "createdAt": "2026-12-31T23:59:59.000Z",
32
+ "updatedAt": "2026-12-31T23:59:59.000Z",
33
+ "category": "structural_observation",
34
+ "payload": {
35
+ "assessmentDigest": "sha256:308510d9a08558453b9644d33fe24a73f4579832c448602b24c5053bdc4aa5ca",
36
+ "kind": "undeclared-footprint",
37
+ "affectedNodeIds": [
38
+ "capability.architecture.context"
39
+ ],
40
+ "baselineSnapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e",
41
+ "derivedOutcomes": [
42
+ {
43
+ "metric": "module.footprintDeclared",
44
+ "subjectSelectorId": "subject.node.d4eae75fb5b5121f",
45
+ "nodeId": "capability.architecture.context",
46
+ "operator": "present",
47
+ "value": null,
48
+ "required": true,
49
+ "outcomeId": "outcome.58946c9d4f0f41c1"
50
+ }
51
+ ],
52
+ "metrics": {},
53
+ "signalIds": [
54
+ "signal.undeclared-footprint.bc66b760c4329111"
55
+ ],
56
+ "evidence": {
57
+ "kind": "undeclared-footprint",
58
+ "paths": [],
59
+ "totalCount": 0,
60
+ "truncated": false
61
+ }
62
+ },
63
+ "extensions": {
64
+ "assessmentDigest": "sha256:308510d9a08558453b9644d33fe24a73f4579832c448602b24c5053bdc4aa5ca",
65
+ "baselineSnapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e",
66
+ "riskSignals": [
67
+ "ownership-change"
68
+ ],
69
+ "uncertaintySignals": [
70
+ "low-coverage"
71
+ ],
72
+ "score": 23,
73
+ "lifecycle": {
74
+ "previousStatus": "open",
75
+ "status": "deferred",
76
+ "action": "defer",
77
+ "actor": "developer",
78
+ "reason": "later",
79
+ "transitionedAt": "2026-12-31T23:59:59.000Z"
80
+ }
81
+ }
82
+ },
83
+ "evidence": {
84
+ "items": [
85
+ {
86
+ "schemaVersion": "archcontext.evidence-item/v2",
87
+ "evidenceId": "evidence.module_statistics_snapshot.35796bb112cab526",
88
+ "kind": "module-statistics-snapshot",
89
+ "strength": "observed",
90
+ "polarity": "positive",
91
+ "origin": "runtime-daemon",
92
+ "subject": "repository:repo.537182127c5f2134",
93
+ "selector": {
94
+ "kind": "snapshot",
95
+ "id": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
96
+ },
97
+ "summary": "Module statistics baseline for 2 declared module(s).",
98
+ "coverage": {
99
+ "level": "unknown",
100
+ "scope": "module-statistics-snapshot"
101
+ },
102
+ "supports": [
103
+ "recommendation"
104
+ ],
105
+ "provenance": {
106
+ "producer": "recommendation-engine",
107
+ "command": "archctx refactor record",
108
+ "inputDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
109
+ },
110
+ "createdAt": "2026-10-11T04:21:31.000Z",
111
+ "digest": "sha256:5ee758961ef4ea532ef72359f46e2d06fa528d70bab6bd19cd59dbfca8acd3fc",
112
+ "extensions": {
113
+ "moduleStatisticsSnapshot": {
114
+ "schemaVersion": "archcontext.module-statistics/v1",
115
+ "repository": {
116
+ "repositoryId": "repo.537182127c5f2134",
117
+ "storageRepositoryId": "repo.03ba73c90cbf6a7e"
118
+ },
119
+ "worktree": {
120
+ "workspaceId": "ws.537182127c5f2134",
121
+ "storageWorkspaceId": "ws.537182127c5f2134",
122
+ "branch": "main",
123
+ "headSha": "728b42479d7ab7a2d401ea44af26cdac64912f0f",
124
+ "worktreeDigest": "sha256:96cbb5ccf708d8b7c56c2633e8937311338957998b7154879461706460d4c467"
125
+ },
126
+ "modelDigest": "sha256:54ed020e2f65d0649b215df9251332d5a288746a687d9d7a654b9700dfd995a7",
127
+ "codeFacts": {
128
+ "provider": "codegraph",
129
+ "version": "",
130
+ "binaryDigest": "",
131
+ "indexedWorktreeDigest": null,
132
+ "coverage": "unknown",
133
+ "truncated": true,
134
+ "edgeLimit": 5000,
135
+ "reasonCodes": [
136
+ "caller-coverage-unknown",
137
+ "code-facts-missing",
138
+ "code-facts-truncated",
139
+ "node-footprint-undeclared"
140
+ ]
141
+ },
142
+ "modules": [
143
+ {
144
+ "nodeId": "capability.architecture.context",
145
+ "nodeDigest": "sha256:47f48ff9115682aeb1cce33a01ecac47ef79935a7e9a10a4577d7e7c8582c3f0",
146
+ "parentNodeId": null,
147
+ "footprintDeclared": false,
148
+ "footprint": null,
149
+ "surfaces": {
150
+ "declaredEntrypoints": [],
151
+ "observedEntrypoints": [],
152
+ "lifecycleOwners": [],
153
+ "datastoreSubjects": []
154
+ },
155
+ "dependencyGraph": null,
156
+ "tests": {
157
+ "testFileCount": null,
158
+ "observedTestEdges": null,
159
+ "callerCoverage": null,
160
+ "coverageStatus": "unknown"
161
+ },
162
+ "uncertainty": {
163
+ "unresolvedImports": 0,
164
+ "dynamicInvocation": "unknown",
165
+ "ambiguousOwnership": false
166
+ },
167
+ "moduleDigest": "sha256:7c539afac512c4aed0d7408f4b1945c51ddb79e24a017732c2a2a5cd5f52481e"
168
+ },
169
+ {
170
+ "nodeId": "module.dump",
171
+ "nodeDigest": "sha256:8f77a427f093506f0ff5197dd0129f6888c1653c0ccc65e3981d587e102a882b",
172
+ "parentNodeId": null,
173
+ "footprintDeclared": true,
174
+ "footprint": {
175
+ "fileCount": 1,
176
+ "lineCount": 1,
177
+ "sourceFilesDigest": "sha256:5f2ceccfe01dc55c63a1b0e5bf2ce51676e8f2805499e0c8519d59fdc8e265c4",
178
+ "includePatterns": [
179
+ "src/**"
180
+ ],
181
+ "excludePatterns": []
182
+ },
183
+ "surfaces": {
184
+ "declaredEntrypoints": [],
185
+ "observedEntrypoints": [],
186
+ "lifecycleOwners": [],
187
+ "datastoreSubjects": []
188
+ },
189
+ "dependencyGraph": null,
190
+ "tests": {
191
+ "testFileCount": null,
192
+ "observedTestEdges": null,
193
+ "callerCoverage": null,
194
+ "coverageStatus": "unknown"
195
+ },
196
+ "uncertainty": {
197
+ "unresolvedImports": 0,
198
+ "dynamicInvocation": "unknown",
199
+ "ambiguousOwnership": false
200
+ },
201
+ "moduleDigest": "sha256:32d887790fe89e1415d1cb0e68557509e025b4026184ad8a463f4d886a3de182"
202
+ }
203
+ ],
204
+ "repositorySummary": {
205
+ "moduleCount": 2,
206
+ "undeclaredFootprintNodeCount": 1,
207
+ "ownedFileCount": 1,
208
+ "unownedFileCount": 0,
209
+ "multiplyOwnedFileCount": 0,
210
+ "crossModuleEdgeCount": 0,
211
+ "crossModuleCycleCount": 0,
212
+ "stronglyConnectedComponentCount": 0,
213
+ "unresolvedImportCount": 0,
214
+ "dynamicInvocationRiskCount": 2
215
+ },
216
+ "createdAt": "2026-10-11T04:21:31.000Z",
217
+ "snapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
218
+ }
219
+ }
220
+ }
221
+ ],
222
+ "bindings": [
223
+ {
224
+ "schemaVersion": "archcontext.evidence-binding/v1",
225
+ "bindingId": "binding.7577455e29083b0b",
226
+ "evidenceId": "evidence.module_statistics_snapshot.35796bb112cab526",
227
+ "target": {
228
+ "kind": "recommendation",
229
+ "id": "recommendation.c8c842b3d8529388"
230
+ },
231
+ "bindingReason": "deterministic-check",
232
+ "authorityEffect": "context-only",
233
+ "createdAt": "2026-12-31T23:59:59.000Z",
234
+ "provenance": {
235
+ "producer": "recommendation-engine",
236
+ "command": "archctx refactor record",
237
+ "inputDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
238
+ }
239
+ }
240
+ ]
241
+ },
242
+ "baseline": {
243
+ "status": "measured",
244
+ "snapshotDigest": "sha256:35796bb112cab526dfe31a9ad84bc9df5d28b6a9ef4154d7d3c2d7d3a7753f7e"
245
+ },
246
+ "affectedModules": [
247
+ {
248
+ "nodeId": "capability.architecture.context",
249
+ "nodeDigest": "sha256:47f48ff9115682aeb1cce33a01ecac47ef79935a7e9a10a4577d7e7c8582c3f0",
250
+ "parentNodeId": null,
251
+ "footprintDeclared": false,
252
+ "footprint": null,
253
+ "surfaces": {
254
+ "declaredEntrypoints": [],
255
+ "observedEntrypoints": [],
256
+ "lifecycleOwners": [],
257
+ "datastoreSubjects": []
258
+ },
259
+ "dependencyGraph": null,
260
+ "tests": {
261
+ "testFileCount": null,
262
+ "observedTestEdges": null,
263
+ "callerCoverage": null,
264
+ "coverageStatus": "unknown"
265
+ },
266
+ "uncertainty": {
267
+ "unresolvedImports": 0,
268
+ "dynamicInvocation": "unknown",
269
+ "ambiguousOwnership": false
270
+ },
271
+ "moduleDigest": "sha256:7c539afac512c4aed0d7408f4b1945c51ddb79e24a017732c2a2a5cd5f52481e"
272
+ }
273
+ ],
274
+ "decisions": [
275
+ {
276
+ "schemaVersion": "archcontext.recommendation-feedback/v1",
277
+ "feedbackId": "recommendation_feedback.11e6209a830eae96",
278
+ "recommendationId": "recommendation.c8c842b3d8529388",
279
+ "runId": "recommendation_run.207822edf39557d3",
280
+ "action": "defer",
281
+ "previousStatus": "open",
282
+ "nextStatus": "deferred",
283
+ "actor": {
284
+ "kind": "cli",
285
+ "id": "developer",
286
+ "source": "cli"
287
+ },
288
+ "reason": "later",
289
+ "explicit": true,
290
+ "implicitAcceptance": false,
291
+ "repository": {
292
+ "repositoryId": "repo.537182127c5f2134",
293
+ "storageRepositoryId": "repo.03ba73c90cbf6a7e"
294
+ },
295
+ "worktree": {
296
+ "workspaceId": "ws.537182127c5f2134",
297
+ "storageWorkspaceId": "ws.537182127c5f2134",
298
+ "branch": "main",
299
+ "headSha": "728b42479d7ab7a2d401ea44af26cdac64912f0f",
300
+ "worktreeDigest": "sha256:96cbb5ccf708d8b7c56c2633e8937311338957998b7154879461706460d4c467"
301
+ },
302
+ "createdAt": "2026-12-31T23:59:59.000Z"
303
+ }
304
+ ],
305
+ "worktree": null,
306
+ "privacy": {
307
+ "writes": "none",
308
+ "rawSourcePersisted": false,
309
+ "rawDiffPersisted": false,
310
+ "promptPersisted": false
311
+ }
312
+ }