clinkx 1.1.0 → 1.1.2

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 (162) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/README.md +210 -177
  3. package/clinkx-workflows/dist/architecture-comparison/admission.d.ts +5 -0
  4. package/clinkx-workflows/dist/architecture-comparison/admission.js +50 -0
  5. package/clinkx-workflows/dist/architecture-comparison/admission.js.map +1 -0
  6. package/clinkx-workflows/dist/architecture-comparison/contract.d.ts +995 -0
  7. package/clinkx-workflows/dist/architecture-comparison/contract.js +149 -0
  8. package/clinkx-workflows/dist/architecture-comparison/contract.js.map +1 -0
  9. package/clinkx-workflows/dist/architecture-comparison/runtime.d.ts +29 -0
  10. package/clinkx-workflows/dist/architecture-comparison/runtime.js +387 -0
  11. package/clinkx-workflows/dist/architecture-comparison/runtime.js.map +1 -0
  12. package/clinkx-workflows/dist/contained-file.js +1 -1
  13. package/clinkx-workflows/dist/contained-file.js.map +1 -1
  14. package/clinkx-workflows/dist/council-execution-policy.d.ts +4 -2
  15. package/clinkx-workflows/dist/council-execution-policy.js +5 -1
  16. package/clinkx-workflows/dist/council-execution-policy.js.map +1 -1
  17. package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +72 -72
  18. package/clinkx-workflows/dist/dashboard/contracts.d.ts +1564 -122
  19. package/clinkx-workflows/dist/dashboard/contracts.js +4 -0
  20. package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -1
  21. package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +12 -12
  22. package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.d.ts +8 -8
  23. package/clinkx-workflows/dist/dashboard/scanner.d.ts +3 -0
  24. package/clinkx-workflows/dist/dashboard/scanner.js +27 -0
  25. package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -1
  26. package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +48 -48
  27. package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +2 -0
  28. package/clinkx-workflows/dist/dashboard/session-log-redaction.js +4 -0
  29. package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -1
  30. package/clinkx-workflows/dist/dashboard/verified-repair-contract.d.ts +191 -0
  31. package/clinkx-workflows/dist/dashboard/verified-repair-contract.js +28 -0
  32. package/clinkx-workflows/dist/dashboard/verified-repair-contract.js.map +1 -0
  33. package/clinkx-workflows/dist/dashboard-ui/assets/index-BdpmbPps.js +115 -0
  34. package/clinkx-workflows/dist/dashboard-ui/assets/style-Im5i1iAs.css +1 -0
  35. package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
  36. package/clinkx-workflows/dist/engine.d.ts +6 -0
  37. package/clinkx-workflows/dist/engine.js +78 -7
  38. package/clinkx-workflows/dist/engine.js.map +1 -1
  39. package/clinkx-workflows/dist/index.d.ts +3 -0
  40. package/clinkx-workflows/dist/index.js +3 -2
  41. package/clinkx-workflows/dist/index.js.map +1 -1
  42. package/clinkx-workflows/dist/reducers/index.d.ts +9 -1
  43. package/clinkx-workflows/dist/reducers/index.js +22 -0
  44. package/clinkx-workflows/dist/reducers/index.js.map +1 -1
  45. package/clinkx-workflows/dist/state.js +17 -7
  46. package/clinkx-workflows/dist/state.js.map +1 -1
  47. package/clinkx-workflows/dist/validators/architecture-comparison.d.ts +2 -0
  48. package/clinkx-workflows/dist/validators/architecture-comparison.js +12 -0
  49. package/clinkx-workflows/dist/validators/architecture-comparison.js.map +1 -0
  50. package/clinkx-workflows/dist/validators/index.js +4 -0
  51. package/clinkx-workflows/dist/validators/index.js.map +1 -1
  52. package/clinkx-workflows/dist/validators/verified-repair.d.ts +2 -0
  53. package/clinkx-workflows/dist/validators/verified-repair.js +12 -0
  54. package/clinkx-workflows/dist/validators/verified-repair.js.map +1 -0
  55. package/clinkx-workflows/dist/verification-proof.d.ts +254 -0
  56. package/clinkx-workflows/dist/verification-proof.js +195 -0
  57. package/clinkx-workflows/dist/verification-proof.js.map +1 -0
  58. package/clinkx-workflows/dist/verified-repair/admission.d.ts +72 -0
  59. package/clinkx-workflows/dist/verified-repair/admission.js +63 -0
  60. package/clinkx-workflows/dist/verified-repair/admission.js.map +1 -0
  61. package/clinkx-workflows/dist/verified-repair/contract.d.ts +1910 -0
  62. package/clinkx-workflows/dist/verified-repair/contract.js +127 -0
  63. package/clinkx-workflows/dist/verified-repair/contract.js.map +1 -0
  64. package/clinkx-workflows/dist/verified-repair/host.d.ts +32 -0
  65. package/clinkx-workflows/dist/verified-repair/host.js +2 -0
  66. package/clinkx-workflows/dist/verified-repair/host.js.map +1 -0
  67. package/clinkx-workflows/dist/verified-repair/prompts.d.ts +12 -0
  68. package/clinkx-workflows/dist/verified-repair/prompts.js +58 -0
  69. package/clinkx-workflows/dist/verified-repair/prompts.js.map +1 -0
  70. package/clinkx-workflows/dist/verified-repair/result.d.ts +16 -0
  71. package/clinkx-workflows/dist/verified-repair/result.js +102 -0
  72. package/clinkx-workflows/dist/verified-repair/result.js.map +1 -0
  73. package/clinkx-workflows/dist/verified-repair/runtime.d.ts +28 -0
  74. package/clinkx-workflows/dist/verified-repair/runtime.js +186 -0
  75. package/clinkx-workflows/dist/verified-repair/runtime.js.map +1 -0
  76. package/clinkx-workflows/dist/workflow-tools.d.ts +3 -0
  77. package/clinkx-workflows/dist/workflow-tools.js +148 -14
  78. package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
  79. package/clinkx-workflows/dist/workflow-verification-contract.d.ts +539 -0
  80. package/clinkx-workflows/dist/workflow-verification-contract.js +52 -0
  81. package/clinkx-workflows/dist/workflow-verification-contract.js.map +1 -0
  82. package/clinkx-workflows/dist/workflow-verification.d.ts +15 -0
  83. package/clinkx-workflows/dist/workflow-verification.js +218 -0
  84. package/clinkx-workflows/dist/workflow-verification.js.map +1 -0
  85. package/clinkx-workflows/templates/architecture-comparison/candidate.txt +29 -0
  86. package/clinkx-workflows/templates/architecture-comparison/judge.txt +31 -0
  87. package/clinkx-workflows/templates/verified-repair/investigate.txt +20 -0
  88. package/clinkx-workflows/templates/verified-repair/repair.txt +11 -0
  89. package/clinkx-workflows/templates/verified-repair/review.txt +18 -0
  90. package/clinkx-workflows/workflows/architecture-comparison.yaml +133 -0
  91. package/clinkx-workflows/workflows/verified-repair.yaml +104 -0
  92. package/dist/allowed-roots.js +4 -1
  93. package/dist/allowed-roots.js.map +1 -1
  94. package/dist/codex/app-server-client.d.ts +1 -0
  95. package/dist/codex/app-server-client.js +3 -2
  96. package/dist/codex/app-server-client.js.map +1 -1
  97. package/dist/context-builder/diagnostics.d.ts +1 -0
  98. package/dist/context-builder/diagnostics.js +1 -1
  99. package/dist/context-builder/diagnostics.js.map +1 -1
  100. package/dist/context-builder/discovery.d.ts +18 -1
  101. package/dist/context-builder/discovery.js +69 -1
  102. package/dist/context-builder/discovery.js.map +1 -1
  103. package/dist/context-builder/handler.js +8 -1
  104. package/dist/context-builder/handler.js.map +1 -1
  105. package/dist/context-builder/lifecycle-contract.d.ts +24 -24
  106. package/dist/context-builder/refine-handler.js +16 -1
  107. package/dist/context-builder/refine-handler.js.map +1 -1
  108. package/dist/context-builder/secrets.d.ts +11 -0
  109. package/dist/context-builder/secrets.js +81 -1
  110. package/dist/context-builder/secrets.js.map +1 -1
  111. package/dist/context-builder/versions.d.ts +5 -2
  112. package/dist/context-builder/versions.js +5 -2
  113. package/dist/context-builder/versions.js.map +1 -1
  114. package/dist/dashboard-cli.js +10 -3
  115. package/dist/dashboard-cli.js.map +1 -1
  116. package/dist/dashboard-gateway/main.js +8 -3
  117. package/dist/dashboard-gateway/main.js.map +1 -1
  118. package/dist/index.d.ts +2 -0
  119. package/dist/index.js +8 -2
  120. package/dist/index.js.map +1 -1
  121. package/dist/project-verification/contract.d.ts +537 -0
  122. package/dist/project-verification/contract.js +40 -0
  123. package/dist/project-verification/contract.js.map +1 -0
  124. package/dist/project-verification/files.d.ts +23 -0
  125. package/dist/project-verification/files.js +80 -0
  126. package/dist/project-verification/files.js.map +1 -0
  127. package/dist/project-verification/process.d.ts +7 -0
  128. package/dist/project-verification/process.js +115 -0
  129. package/dist/project-verification/process.js.map +1 -0
  130. package/dist/project-verification/runner.d.ts +35 -0
  131. package/dist/project-verification/runner.js +185 -0
  132. package/dist/project-verification/runner.js.map +1 -0
  133. package/dist/project-verification/service.d.ts +37 -0
  134. package/dist/project-verification/service.js +151 -0
  135. package/dist/project-verification/service.js.map +1 -0
  136. package/dist/provider-doctor.d.ts +22 -0
  137. package/dist/provider-doctor.js +22 -0
  138. package/dist/provider-doctor.js.map +1 -0
  139. package/dist/server.js +29 -1
  140. package/dist/server.js.map +1 -1
  141. package/dist/verification-tools.d.ts +90 -0
  142. package/dist/verification-tools.js +120 -0
  143. package/dist/verification-tools.js.map +1 -0
  144. package/dist/verified-repair/files.d.ts +22 -0
  145. package/dist/verified-repair/files.js +114 -0
  146. package/dist/verified-repair/files.js.map +1 -0
  147. package/dist/verified-repair/host.d.ts +14 -0
  148. package/dist/verified-repair/host.js +612 -0
  149. package/dist/verified-repair/host.js.map +1 -0
  150. package/docs/configuration.md +493 -0
  151. package/docs/engineering-recipes.md +415 -0
  152. package/docs/security.md +293 -0
  153. package/docs/verification/README.md +59 -0
  154. package/docs/verification/dashboard-real-disk.md +436 -0
  155. package/docs/verification/project-checks.example.json +14 -0
  156. package/docs/verification/project-checks.md +444 -0
  157. package/docs/verification/workflow-handoff.md +113 -0
  158. package/package.json +13 -6
  159. package/scripts/provider-doctor-core.mjs +364 -0
  160. package/scripts/provider-doctor-probe.mjs +34 -0
  161. package/clinkx-workflows/dist/dashboard-ui/assets/index-JPHQVtn9.js +0 -106
  162. package/clinkx-workflows/dist/dashboard-ui/assets/style-DOMHk-j6.css +0 -1
@@ -0,0 +1,539 @@
1
+ import { z } from "zod";
2
+ export declare const WORKFLOW_VERIFICATION_VERSION = "clinkx-workflow-verification-v1";
3
+ export declare const MAX_WORKFLOW_VERIFICATIONS = 16;
4
+ export declare const MAX_WORKFLOW_VERIFICATION_BYTES: number;
5
+ export declare const MAX_WORKFLOW_VERIFICATION_HISTORY_BYTES: number;
6
+ export declare const WorkflowVerificationBindingSchema: z.ZodObject<{
7
+ run_id: z.ZodString;
8
+ generation: z.ZodString;
9
+ started_at: z.ZodString;
10
+ workflow_sha256: z.ZodString;
11
+ inputs_sha256: z.ZodString;
12
+ }, "strict", z.ZodTypeAny, {
13
+ started_at: string;
14
+ run_id: string;
15
+ generation: string;
16
+ workflow_sha256: string;
17
+ inputs_sha256: string;
18
+ }, {
19
+ started_at: string;
20
+ run_id: string;
21
+ generation: string;
22
+ workflow_sha256: string;
23
+ inputs_sha256: string;
24
+ }>;
25
+ export declare const WorkflowVerificationRecordSchema: z.ZodEffects<z.ZodObject<{
26
+ schema_version: z.ZodLiteral<"clinkx-workflow-verification-v1">;
27
+ inspection_id: z.ZodString;
28
+ inspected_at: z.ZodString;
29
+ binding: z.ZodObject<{
30
+ run_id: z.ZodString;
31
+ generation: z.ZodString;
32
+ started_at: z.ZodString;
33
+ workflow_sha256: z.ZodString;
34
+ inputs_sha256: z.ZodString;
35
+ }, "strict", z.ZodTypeAny, {
36
+ started_at: string;
37
+ run_id: string;
38
+ generation: string;
39
+ workflow_sha256: string;
40
+ inputs_sha256: string;
41
+ }, {
42
+ started_at: string;
43
+ run_id: string;
44
+ generation: string;
45
+ workflow_sha256: string;
46
+ inputs_sha256: string;
47
+ }>;
48
+ expectations_sha256: z.ZodString;
49
+ identity: z.ZodNullable<z.ZodObject<{
50
+ source_sha256: z.ZodString;
51
+ build_sha256: z.ZodString;
52
+ procedure_sha256: z.ZodString;
53
+ boundary: z.ZodEnum<["workflow-handoff-fixture", "project-command-v1"]>;
54
+ }, "strict", z.ZodTypeAny, {
55
+ source_sha256: string;
56
+ build_sha256: string;
57
+ procedure_sha256: string;
58
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
59
+ }, {
60
+ source_sha256: string;
61
+ build_sha256: string;
62
+ procedure_sha256: string;
63
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
64
+ }>>;
65
+ required_checks: z.ZodNullable<z.ZodNumber>;
66
+ evidence_directory: z.ZodEffects<z.ZodString, string, string>;
67
+ coverage: z.ZodObject<{
68
+ status: z.ZodEnum<["complete", "incomplete", "inapplicable", "failed"]>;
69
+ checks: z.ZodArray<z.ZodObject<{
70
+ check_id: z.ZodString;
71
+ status: z.ZodEnum<["complete", "incomplete", "inapplicable", "failed"]>;
72
+ reasons: z.ZodArray<z.ZodObject<{
73
+ code: z.ZodString;
74
+ check_id: z.ZodString;
75
+ }, "strict", z.ZodTypeAny, {
76
+ code: string;
77
+ check_id: string;
78
+ }, {
79
+ code: string;
80
+ check_id: string;
81
+ }>, "many">;
82
+ }, "strict", z.ZodTypeAny, {
83
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
84
+ check_id: string;
85
+ reasons: {
86
+ code: string;
87
+ check_id: string;
88
+ }[];
89
+ }, {
90
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
91
+ check_id: string;
92
+ reasons: {
93
+ code: string;
94
+ check_id: string;
95
+ }[];
96
+ }>, "many">;
97
+ reasons: z.ZodArray<z.ZodObject<{
98
+ code: z.ZodString;
99
+ check_id: z.ZodString;
100
+ }, "strict", z.ZodTypeAny, {
101
+ code: string;
102
+ check_id: string;
103
+ }, {
104
+ code: string;
105
+ check_id: string;
106
+ }>, "many">;
107
+ }, "strict", z.ZodTypeAny, {
108
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
109
+ checks: {
110
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
111
+ check_id: string;
112
+ reasons: {
113
+ code: string;
114
+ check_id: string;
115
+ }[];
116
+ }[];
117
+ reasons: {
118
+ code: string;
119
+ check_id: string;
120
+ }[];
121
+ }, {
122
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
123
+ checks: {
124
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
125
+ check_id: string;
126
+ reasons: {
127
+ code: string;
128
+ check_id: string;
129
+ }[];
130
+ }[];
131
+ reasons: {
132
+ code: string;
133
+ check_id: string;
134
+ }[];
135
+ }>;
136
+ scope: z.ZodLiteral<"inspected_at">;
137
+ owner_acceptance: z.ZodLiteral<"not_recorded">;
138
+ }, "strict", z.ZodTypeAny, {
139
+ schema_version: "clinkx-workflow-verification-v1";
140
+ coverage: {
141
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
142
+ checks: {
143
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
144
+ check_id: string;
145
+ reasons: {
146
+ code: string;
147
+ check_id: string;
148
+ }[];
149
+ }[];
150
+ reasons: {
151
+ code: string;
152
+ check_id: string;
153
+ }[];
154
+ };
155
+ binding: {
156
+ started_at: string;
157
+ run_id: string;
158
+ generation: string;
159
+ workflow_sha256: string;
160
+ inputs_sha256: string;
161
+ };
162
+ owner_acceptance: "not_recorded";
163
+ evidence_directory: string;
164
+ expectations_sha256: string;
165
+ scope: "inspected_at";
166
+ identity: {
167
+ source_sha256: string;
168
+ build_sha256: string;
169
+ procedure_sha256: string;
170
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
171
+ } | null;
172
+ inspection_id: string;
173
+ inspected_at: string;
174
+ required_checks: number | null;
175
+ }, {
176
+ schema_version: "clinkx-workflow-verification-v1";
177
+ coverage: {
178
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
179
+ checks: {
180
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
181
+ check_id: string;
182
+ reasons: {
183
+ code: string;
184
+ check_id: string;
185
+ }[];
186
+ }[];
187
+ reasons: {
188
+ code: string;
189
+ check_id: string;
190
+ }[];
191
+ };
192
+ binding: {
193
+ started_at: string;
194
+ run_id: string;
195
+ generation: string;
196
+ workflow_sha256: string;
197
+ inputs_sha256: string;
198
+ };
199
+ owner_acceptance: "not_recorded";
200
+ evidence_directory: string;
201
+ expectations_sha256: string;
202
+ scope: "inspected_at";
203
+ identity: {
204
+ source_sha256: string;
205
+ build_sha256: string;
206
+ procedure_sha256: string;
207
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
208
+ } | null;
209
+ inspection_id: string;
210
+ inspected_at: string;
211
+ required_checks: number | null;
212
+ }>, {
213
+ schema_version: "clinkx-workflow-verification-v1";
214
+ coverage: {
215
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
216
+ checks: {
217
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
218
+ check_id: string;
219
+ reasons: {
220
+ code: string;
221
+ check_id: string;
222
+ }[];
223
+ }[];
224
+ reasons: {
225
+ code: string;
226
+ check_id: string;
227
+ }[];
228
+ };
229
+ binding: {
230
+ started_at: string;
231
+ run_id: string;
232
+ generation: string;
233
+ workflow_sha256: string;
234
+ inputs_sha256: string;
235
+ };
236
+ owner_acceptance: "not_recorded";
237
+ evidence_directory: string;
238
+ expectations_sha256: string;
239
+ scope: "inspected_at";
240
+ identity: {
241
+ source_sha256: string;
242
+ build_sha256: string;
243
+ procedure_sha256: string;
244
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
245
+ } | null;
246
+ inspection_id: string;
247
+ inspected_at: string;
248
+ required_checks: number | null;
249
+ }, {
250
+ schema_version: "clinkx-workflow-verification-v1";
251
+ coverage: {
252
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
253
+ checks: {
254
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
255
+ check_id: string;
256
+ reasons: {
257
+ code: string;
258
+ check_id: string;
259
+ }[];
260
+ }[];
261
+ reasons: {
262
+ code: string;
263
+ check_id: string;
264
+ }[];
265
+ };
266
+ binding: {
267
+ started_at: string;
268
+ run_id: string;
269
+ generation: string;
270
+ workflow_sha256: string;
271
+ inputs_sha256: string;
272
+ };
273
+ owner_acceptance: "not_recorded";
274
+ evidence_directory: string;
275
+ expectations_sha256: string;
276
+ scope: "inspected_at";
277
+ identity: {
278
+ source_sha256: string;
279
+ build_sha256: string;
280
+ procedure_sha256: string;
281
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
282
+ } | null;
283
+ inspection_id: string;
284
+ inspected_at: string;
285
+ required_checks: number | null;
286
+ }>;
287
+ export type WorkflowVerificationRecord = z.infer<typeof WorkflowVerificationRecordSchema>;
288
+ export declare const WorkflowVerificationProjectionSchema: z.ZodObject<{
289
+ schema_version: z.ZodLiteral<"clinkx-workflow-verification-v1">;
290
+ availability: z.ZodEnum<["unrecorded", "available", "unavailable"]>;
291
+ reason: z.ZodOptional<z.ZodEnum<["invalid_record", "identity_mismatch", "too_many_records", "unreadable"]>>;
292
+ inspections: z.ZodArray<z.ZodObject<{
293
+ inspection_id: z.ZodString;
294
+ inspected_at: z.ZodString;
295
+ expectations_sha256: z.ZodString;
296
+ identity: z.ZodNullable<z.ZodObject<{
297
+ source_sha256: z.ZodString;
298
+ build_sha256: z.ZodString;
299
+ procedure_sha256: z.ZodString;
300
+ boundary: z.ZodEnum<["workflow-handoff-fixture", "project-command-v1"]>;
301
+ }, "strict", z.ZodTypeAny, {
302
+ source_sha256: string;
303
+ build_sha256: string;
304
+ procedure_sha256: string;
305
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
306
+ }, {
307
+ source_sha256: string;
308
+ build_sha256: string;
309
+ procedure_sha256: string;
310
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
311
+ }>>;
312
+ required_checks: z.ZodNullable<z.ZodNumber>;
313
+ coverage: z.ZodObject<{
314
+ status: z.ZodEnum<["complete", "incomplete", "inapplicable", "failed"]>;
315
+ checks: z.ZodArray<z.ZodObject<{
316
+ check_id: z.ZodString;
317
+ status: z.ZodEnum<["complete", "incomplete", "inapplicable", "failed"]>;
318
+ reasons: z.ZodArray<z.ZodObject<{
319
+ code: z.ZodString;
320
+ check_id: z.ZodString;
321
+ }, "strict", z.ZodTypeAny, {
322
+ code: string;
323
+ check_id: string;
324
+ }, {
325
+ code: string;
326
+ check_id: string;
327
+ }>, "many">;
328
+ }, "strict", z.ZodTypeAny, {
329
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
330
+ check_id: string;
331
+ reasons: {
332
+ code: string;
333
+ check_id: string;
334
+ }[];
335
+ }, {
336
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
337
+ check_id: string;
338
+ reasons: {
339
+ code: string;
340
+ check_id: string;
341
+ }[];
342
+ }>, "many">;
343
+ reasons: z.ZodArray<z.ZodObject<{
344
+ code: z.ZodString;
345
+ check_id: z.ZodString;
346
+ }, "strict", z.ZodTypeAny, {
347
+ code: string;
348
+ check_id: string;
349
+ }, {
350
+ code: string;
351
+ check_id: string;
352
+ }>, "many">;
353
+ }, "strict", z.ZodTypeAny, {
354
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
355
+ checks: {
356
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
357
+ check_id: string;
358
+ reasons: {
359
+ code: string;
360
+ check_id: string;
361
+ }[];
362
+ }[];
363
+ reasons: {
364
+ code: string;
365
+ check_id: string;
366
+ }[];
367
+ }, {
368
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
369
+ checks: {
370
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
371
+ check_id: string;
372
+ reasons: {
373
+ code: string;
374
+ check_id: string;
375
+ }[];
376
+ }[];
377
+ reasons: {
378
+ code: string;
379
+ check_id: string;
380
+ }[];
381
+ }>;
382
+ retention: z.ZodEnum<["unknown", "outside_mount", "present", "missing", "unavailable"]>;
383
+ evidence_ref: z.ZodObject<{
384
+ kind: z.ZodLiteral<"expectations_sha256">;
385
+ sha256: z.ZodString;
386
+ }, "strict", z.ZodTypeAny, {
387
+ sha256: string;
388
+ kind: "expectations_sha256";
389
+ }, {
390
+ sha256: string;
391
+ kind: "expectations_sha256";
392
+ }>;
393
+ scope: z.ZodLiteral<"inspected_at">;
394
+ owner_acceptance: z.ZodLiteral<"not_recorded">;
395
+ }, "strict", z.ZodTypeAny, {
396
+ coverage: {
397
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
398
+ checks: {
399
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
400
+ check_id: string;
401
+ reasons: {
402
+ code: string;
403
+ check_id: string;
404
+ }[];
405
+ }[];
406
+ reasons: {
407
+ code: string;
408
+ check_id: string;
409
+ }[];
410
+ };
411
+ owner_acceptance: "not_recorded";
412
+ expectations_sha256: string;
413
+ scope: "inspected_at";
414
+ identity: {
415
+ source_sha256: string;
416
+ build_sha256: string;
417
+ procedure_sha256: string;
418
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
419
+ } | null;
420
+ inspection_id: string;
421
+ inspected_at: string;
422
+ required_checks: number | null;
423
+ retention: "unknown" | "missing" | "unavailable" | "outside_mount" | "present";
424
+ evidence_ref: {
425
+ sha256: string;
426
+ kind: "expectations_sha256";
427
+ };
428
+ }, {
429
+ coverage: {
430
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
431
+ checks: {
432
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
433
+ check_id: string;
434
+ reasons: {
435
+ code: string;
436
+ check_id: string;
437
+ }[];
438
+ }[];
439
+ reasons: {
440
+ code: string;
441
+ check_id: string;
442
+ }[];
443
+ };
444
+ owner_acceptance: "not_recorded";
445
+ expectations_sha256: string;
446
+ scope: "inspected_at";
447
+ identity: {
448
+ source_sha256: string;
449
+ build_sha256: string;
450
+ procedure_sha256: string;
451
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
452
+ } | null;
453
+ inspection_id: string;
454
+ inspected_at: string;
455
+ required_checks: number | null;
456
+ retention: "unknown" | "missing" | "unavailable" | "outside_mount" | "present";
457
+ evidence_ref: {
458
+ sha256: string;
459
+ kind: "expectations_sha256";
460
+ };
461
+ }>, "many">;
462
+ }, "strict", z.ZodTypeAny, {
463
+ schema_version: "clinkx-workflow-verification-v1";
464
+ availability: "available" | "unavailable" | "unrecorded";
465
+ inspections: {
466
+ coverage: {
467
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
468
+ checks: {
469
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
470
+ check_id: string;
471
+ reasons: {
472
+ code: string;
473
+ check_id: string;
474
+ }[];
475
+ }[];
476
+ reasons: {
477
+ code: string;
478
+ check_id: string;
479
+ }[];
480
+ };
481
+ owner_acceptance: "not_recorded";
482
+ expectations_sha256: string;
483
+ scope: "inspected_at";
484
+ identity: {
485
+ source_sha256: string;
486
+ build_sha256: string;
487
+ procedure_sha256: string;
488
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
489
+ } | null;
490
+ inspection_id: string;
491
+ inspected_at: string;
492
+ required_checks: number | null;
493
+ retention: "unknown" | "missing" | "unavailable" | "outside_mount" | "present";
494
+ evidence_ref: {
495
+ sha256: string;
496
+ kind: "expectations_sha256";
497
+ };
498
+ }[];
499
+ reason?: "unreadable" | "identity_mismatch" | "invalid_record" | "too_many_records" | undefined;
500
+ }, {
501
+ schema_version: "clinkx-workflow-verification-v1";
502
+ availability: "available" | "unavailable" | "unrecorded";
503
+ inspections: {
504
+ coverage: {
505
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
506
+ checks: {
507
+ status: "failed" | "complete" | "incomplete" | "inapplicable";
508
+ check_id: string;
509
+ reasons: {
510
+ code: string;
511
+ check_id: string;
512
+ }[];
513
+ }[];
514
+ reasons: {
515
+ code: string;
516
+ check_id: string;
517
+ }[];
518
+ };
519
+ owner_acceptance: "not_recorded";
520
+ expectations_sha256: string;
521
+ scope: "inspected_at";
522
+ identity: {
523
+ source_sha256: string;
524
+ build_sha256: string;
525
+ procedure_sha256: string;
526
+ boundary: "workflow-handoff-fixture" | "project-command-v1";
527
+ } | null;
528
+ inspection_id: string;
529
+ inspected_at: string;
530
+ required_checks: number | null;
531
+ retention: "unknown" | "missing" | "unavailable" | "outside_mount" | "present";
532
+ evidence_ref: {
533
+ sha256: string;
534
+ kind: "expectations_sha256";
535
+ };
536
+ }[];
537
+ reason?: "unreadable" | "identity_mismatch" | "invalid_record" | "too_many_records" | undefined;
538
+ }>;
539
+ export type WorkflowVerificationProjection = z.infer<typeof WorkflowVerificationProjectionSchema>;
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import { VerificationIdentitySchema } from "./verification-proof.js";
3
+ export const WORKFLOW_VERIFICATION_VERSION = "clinkx-workflow-verification-v1";
4
+ export const MAX_WORKFLOW_VERIFICATIONS = 16;
5
+ export const MAX_WORKFLOW_VERIFICATION_BYTES = 128 * 1024;
6
+ export const MAX_WORKFLOW_VERIFICATION_HISTORY_BYTES = 160 * 1024;
7
+ const Digest = z.string().regex(/^[a-f0-9]{64}$/);
8
+ const Status = z.enum(["complete", "incomplete", "inapplicable", "failed"]);
9
+ const Reason = z.object({ code: z.string().regex(/^[a-z0-9_]{1,128}$/), check_id: z.string().max(128) }).strict();
10
+ const Coverage = z.object({
11
+ status: Status,
12
+ checks: z.array(z.object({ check_id: z.string().min(1).max(128), status: Status,
13
+ reasons: z.array(Reason).max(1000) }).strict()).max(100),
14
+ reasons: z.array(Reason).max(1000),
15
+ }).strict();
16
+ export const WorkflowVerificationBindingSchema = z.object({ run_id: z.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
17
+ generation: z.string().regex(/^[A-Za-z0-9_-]{43}$/), started_at: z.string().datetime(),
18
+ workflow_sha256: Digest, inputs_sha256: Digest }).strict();
19
+ export const WorkflowVerificationRecordSchema = z.object({
20
+ schema_version: z.literal(WORKFLOW_VERIFICATION_VERSION),
21
+ inspection_id: z.string().uuid(), inspected_at: z.string().datetime(),
22
+ binding: WorkflowVerificationBindingSchema, expectations_sha256: Digest,
23
+ identity: VerificationIdentitySchema.nullable(),
24
+ required_checks: z.number().int().min(1).max(100).nullable(),
25
+ evidence_directory: z.string().min(1).max(4096).refine((value) => value.startsWith("/") && !value.includes("\0")),
26
+ coverage: Coverage,
27
+ scope: z.literal("inspected_at"), owner_acceptance: z.literal("not_recorded"),
28
+ }).strict().superRefine((record, context) => {
29
+ if ((record.identity === null) !== (record.required_checks === null))
30
+ context.addIssue({ code: z.ZodIssueCode.custom, message: "identity and required coverage must both be authenticated or unknown" });
31
+ if (new Set(record.coverage.checks.map((check) => check.check_id)).size !== record.coverage.checks.length)
32
+ context.addIssue({ code: z.ZodIssueCode.custom, message: "duplicate required check" });
33
+ if (record.coverage.status === "complete" && (record.identity === null || record.required_checks !== record.coverage.checks.length
34
+ || record.coverage.reasons.length !== 0 || record.coverage.checks.some((check) => check.status !== "complete" || check.reasons.length !== 0))) {
35
+ context.addIssue({ code: z.ZodIssueCode.custom, message: "complete coverage requires authenticated, complete required checks" });
36
+ }
37
+ });
38
+ const Retention = z.enum(["unknown", "outside_mount", "present", "missing", "unavailable"]);
39
+ export const WorkflowVerificationProjectionSchema = z.object({
40
+ schema_version: z.literal(WORKFLOW_VERIFICATION_VERSION),
41
+ availability: z.enum(["unrecorded", "available", "unavailable"]),
42
+ reason: z.enum(["invalid_record", "identity_mismatch", "too_many_records", "unreadable"]).optional(),
43
+ inspections: z.array(z.object({
44
+ inspection_id: z.string().uuid(), inspected_at: z.string().datetime(),
45
+ expectations_sha256: Digest, identity: VerificationIdentitySchema.nullable(),
46
+ required_checks: z.number().int().min(1).max(100).nullable(),
47
+ coverage: Coverage, retention: Retention,
48
+ evidence_ref: z.object({ kind: z.literal("expectations_sha256"), sha256: Digest }).strict(),
49
+ scope: z.literal("inspected_at"), owner_acceptance: z.literal("not_recorded"),
50
+ }).strict()).max(MAX_WORKFLOW_VERIFICATIONS),
51
+ }).strict();
52
+ //# sourceMappingURL=workflow-verification-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-verification-contract.js","sourceRoot":"","sources":["../src/workflow-verification-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,CAAC,MAAM,6BAA6B,GAAG,iCAAiC,CAAC;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,GAAG,IAAI,CAAC;AAC1D,MAAM,CAAC,MAAM,uCAAuC,GAAG,GAAG,G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,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAChE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpG,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACrE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,0BAA0B,CAAC,QAAQ,EAAE;QAC5E,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;QAC5D,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS;QACxC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAC3F,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;KAC9E,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC;CAC7C,CAAC,CAAC,MAAM,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type WorkflowVerificationProjection } from "./workflow-verification-contract.js";
2
+ export * from "./workflow-verification-contract.js";
3
+ export declare function attachWorkflowVerification(input: {
4
+ runsRoot: string;
5
+ runId: string;
6
+ requestId: string;
7
+ pin: string;
8
+ evidence: string;
9
+ coverage: unknown;
10
+ identity: unknown | null;
11
+ requiredChecks: number | null;
12
+ signal?: AbortSignal;
13
+ }): Promise<WorkflowVerificationProjection>;
14
+ /** Historical inspection only: current source applicability and acceptance are never inferred. */
15
+ export declare function readWorkflowVerification(runsRoot: string, runId: string, retentionRoots?: readonly string[]): Promise<WorkflowVerificationProjection>;