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,172 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/refactor-verify-v2.schema.json",
4
+ "title": "RefactorVerifyV2",
5
+ "description": "v2 Stage 5 attested resolution verification output for `archctx verify <id> --json` (#643).",
6
+ "additionalProperties": false,
7
+ "type": "object",
8
+ "required": [
9
+ "schemaVersion",
10
+ "recommendationId",
11
+ "headSha",
12
+ "snapshotDigest",
13
+ "disposition",
14
+ "resolutionDigest",
15
+ "killListChecks",
16
+ "metricChecks",
17
+ "blockingReasons"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": {
21
+ "const": "archcontext.refactor-verify/v2"
22
+ },
23
+ "recommendationId": {
24
+ "pattern": "^recommendation\\.[a-f0-9]{16}$",
25
+ "type": "string"
26
+ },
27
+ "headSha": {
28
+ "pattern": "^[a-f0-9]{40}$",
29
+ "type": "string"
30
+ },
31
+ "snapshotDigest": {
32
+ "pattern": "^sha256:[a-f0-9]{64}$",
33
+ "type": "string"
34
+ },
35
+ "disposition": {
36
+ "type": "string",
37
+ "enum": [
38
+ "resolved",
39
+ "partially_resolved",
40
+ "unresolved",
41
+ "regressed",
42
+ "stale"
43
+ ]
44
+ },
45
+ "resolutionDigest": {
46
+ "pattern": "^sha256:[a-f0-9]{64}$",
47
+ "type": "string"
48
+ },
49
+ "killListChecks": {
50
+ "type": "array",
51
+ "items": {
52
+ "additionalProperties": false,
53
+ "type": "object",
54
+ "required": [
55
+ "kind",
56
+ "target",
57
+ "required",
58
+ "status"
59
+ ],
60
+ "properties": {
61
+ "kind": {
62
+ "type": "string",
63
+ "enum": [
64
+ "path",
65
+ "relation",
66
+ "symbol"
67
+ ]
68
+ },
69
+ "target": {
70
+ "minLength": 1,
71
+ "type": "string"
72
+ },
73
+ "required": {
74
+ "type": "boolean"
75
+ },
76
+ "status": {
77
+ "type": "string",
78
+ "enum": [
79
+ "removed",
80
+ "still-present",
81
+ "uncheckable"
82
+ ]
83
+ }
84
+ }
85
+ }
86
+ },
87
+ "metricChecks": {
88
+ "type": "array",
89
+ "items": {
90
+ "additionalProperties": false,
91
+ "type": "object",
92
+ "required": [
93
+ "metric",
94
+ "before",
95
+ "after",
96
+ "satisfied"
97
+ ],
98
+ "properties": {
99
+ "metric": {
100
+ "minLength": 1,
101
+ "type": "string"
102
+ },
103
+ "before": {
104
+ "anyOf": [
105
+ {
106
+ "type": "number"
107
+ },
108
+ {
109
+ "type": "null"
110
+ }
111
+ ]
112
+ },
113
+ "after": {
114
+ "anyOf": [
115
+ {
116
+ "type": "number"
117
+ },
118
+ {
119
+ "type": "null"
120
+ }
121
+ ]
122
+ },
123
+ "satisfied": {
124
+ "type": "boolean"
125
+ }
126
+ }
127
+ }
128
+ },
129
+ "blockingReasons": {
130
+ "uniqueItems": true,
131
+ "type": "array",
132
+ "items": {
133
+ "minLength": 1,
134
+ "maxLength": 1024,
135
+ "type": "string"
136
+ }
137
+ },
138
+ "historicalReceipt": {
139
+ "additionalProperties": false,
140
+ "type": "object",
141
+ "required": [
142
+ "status",
143
+ "headSha",
144
+ "resolutionDigest"
145
+ ],
146
+ "properties": {
147
+ "status": {
148
+ "type": "string",
149
+ "enum": [
150
+ "acknowledged",
151
+ "accepted",
152
+ "deferred",
153
+ "rejected",
154
+ "resolved",
155
+ "waived"
156
+ ]
157
+ },
158
+ "headSha": {
159
+ "pattern": "^[a-f0-9]{40}$",
160
+ "type": "string"
161
+ },
162
+ "resolutionDigest": {
163
+ "pattern": "^sha256:[a-f0-9]{64}$",
164
+ "type": [
165
+ "string",
166
+ "null"
167
+ ]
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/resolve-path.schema.json",
4
+ "title": "ResolvePathsBatchResultV1",
5
+ "description": "Batch ownership resolution output for `archctx resolve --paths-from`.",
6
+ "additionalProperties": false,
7
+ "type": "object",
8
+ "required": [
9
+ "results"
10
+ ],
11
+ "properties": {
12
+ "results": {
13
+ "type": "array",
14
+ "items": {
15
+ "additionalProperties": false,
16
+ "type": "object",
17
+ "required": [
18
+ "path",
19
+ "matched",
20
+ "ambiguous",
21
+ "owningCapabilityId"
22
+ ],
23
+ "properties": {
24
+ "path": {
25
+ "minLength": 1,
26
+ "type": "string"
27
+ },
28
+ "matched": {
29
+ "type": "boolean"
30
+ },
31
+ "ambiguous": {
32
+ "type": "boolean"
33
+ },
34
+ "owningCapabilityId": {
35
+ "minLength": 1,
36
+ "type": [
37
+ "string",
38
+ "null"
39
+ ]
40
+ },
41
+ "stableId": {
42
+ "minLength": 1,
43
+ "type": "string"
44
+ },
45
+ "kind": {
46
+ "minLength": 1,
47
+ "type": "string"
48
+ },
49
+ "name": {
50
+ "type": "string"
51
+ },
52
+ "source": {
53
+ "type": "object"
54
+ },
55
+ "extensions": {
56
+ "type": "object"
57
+ },
58
+ "candidates": {
59
+ "type": "array",
60
+ "items": {
61
+ "minLength": 1,
62
+ "type": "string"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }