@davidahmann/mill 0.1.4

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 (184) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +335 -0
  3. package/dist/audit/repository.d.ts +8 -0
  4. package/dist/audit/repository.d.ts.map +1 -0
  5. package/dist/audit/repository.js +232 -0
  6. package/dist/audit/repository.js.map +1 -0
  7. package/dist/cli-program.d.ts +12 -0
  8. package/dist/cli-program.d.ts.map +1 -0
  9. package/dist/cli-program.js +1020 -0
  10. package/dist/cli-program.js.map +1 -0
  11. package/dist/cli.d.ts +3 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +7 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/config/lock.d.ts +12 -0
  16. package/dist/config/lock.d.ts.map +1 -0
  17. package/dist/config/lock.js +83 -0
  18. package/dist/config/lock.js.map +1 -0
  19. package/dist/contracts/canonical.d.ts +7 -0
  20. package/dist/contracts/canonical.d.ts.map +1 -0
  21. package/dist/contracts/canonical.js +30 -0
  22. package/dist/contracts/canonical.js.map +1 -0
  23. package/dist/contracts/schemas.d.ts +2705 -0
  24. package/dist/contracts/schemas.d.ts.map +1 -0
  25. package/dist/contracts/schemas.js +988 -0
  26. package/dist/contracts/schemas.js.map +1 -0
  27. package/dist/doctor.d.ts +21 -0
  28. package/dist/doctor.d.ts.map +1 -0
  29. package/dist/doctor.js +138 -0
  30. package/dist/doctor.js.map +1 -0
  31. package/dist/errors.d.ts +18 -0
  32. package/dist/errors.d.ts.map +1 -0
  33. package/dist/errors.js +31 -0
  34. package/dist/errors.js.map +1 -0
  35. package/dist/index.d.ts +20 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +20 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/intake/prd.d.ts +14 -0
  40. package/dist/intake/prd.d.ts.map +1 -0
  41. package/dist/intake/prd.js +39 -0
  42. package/dist/intake/prd.js.map +1 -0
  43. package/dist/planning/impact.d.ts +59 -0
  44. package/dist/planning/impact.d.ts.map +1 -0
  45. package/dist/planning/impact.js +400 -0
  46. package/dist/planning/impact.js.map +1 -0
  47. package/dist/planning/specification.d.ts +42 -0
  48. package/dist/planning/specification.d.ts.map +1 -0
  49. package/dist/planning/specification.js +235 -0
  50. package/dist/planning/specification.js.map +1 -0
  51. package/dist/qualification/public-alpha.d.ts +16 -0
  52. package/dist/qualification/public-alpha.d.ts.map +1 -0
  53. package/dist/qualification/public-alpha.js +128 -0
  54. package/dist/qualification/public-alpha.js.map +1 -0
  55. package/dist/recipes/node-typescript-next-web.d.ts +19 -0
  56. package/dist/recipes/node-typescript-next-web.d.ts.map +1 -0
  57. package/dist/recipes/node-typescript-next-web.js +136 -0
  58. package/dist/recipes/node-typescript-next-web.js.map +1 -0
  59. package/dist/repository/integration.d.ts +58 -0
  60. package/dist/repository/integration.d.ts.map +1 -0
  61. package/dist/repository/integration.js +1385 -0
  62. package/dist/repository/integration.js.map +1 -0
  63. package/dist/repository/scan.d.ts +27 -0
  64. package/dist/repository/scan.d.ts.map +1 -0
  65. package/dist/repository/scan.js +388 -0
  66. package/dist/repository/scan.js.map +1 -0
  67. package/dist/result.d.ts +23 -0
  68. package/dist/result.d.ts.map +1 -0
  69. package/dist/result.js +24 -0
  70. package/dist/result.js.map +1 -0
  71. package/dist/runtime/codex.d.ts +28 -0
  72. package/dist/runtime/codex.d.ts.map +1 -0
  73. package/dist/runtime/codex.js +439 -0
  74. package/dist/runtime/codex.js.map +1 -0
  75. package/dist/runtime/context.d.ts +10 -0
  76. package/dist/runtime/context.d.ts.map +1 -0
  77. package/dist/runtime/context.js +151 -0
  78. package/dist/runtime/context.js.map +1 -0
  79. package/dist/runtime/delivery.d.ts +58 -0
  80. package/dist/runtime/delivery.d.ts.map +1 -0
  81. package/dist/runtime/delivery.js +1073 -0
  82. package/dist/runtime/delivery.js.map +1 -0
  83. package/dist/runtime/dependencies.d.ts +19 -0
  84. package/dist/runtime/dependencies.d.ts.map +1 -0
  85. package/dist/runtime/dependencies.js +495 -0
  86. package/dist/runtime/dependencies.js.map +1 -0
  87. package/dist/runtime/github.d.ts +112 -0
  88. package/dist/runtime/github.d.ts.map +1 -0
  89. package/dist/runtime/github.js +510 -0
  90. package/dist/runtime/github.js.map +1 -0
  91. package/dist/runtime/inputs.d.ts +24 -0
  92. package/dist/runtime/inputs.d.ts.map +1 -0
  93. package/dist/runtime/inputs.js +237 -0
  94. package/dist/runtime/inputs.js.map +1 -0
  95. package/dist/runtime/lease.d.ts +11 -0
  96. package/dist/runtime/lease.d.ts.map +1 -0
  97. package/dist/runtime/lease.js +52 -0
  98. package/dist/runtime/lease.js.map +1 -0
  99. package/dist/runtime/lifecycle.d.ts +87 -0
  100. package/dist/runtime/lifecycle.d.ts.map +1 -0
  101. package/dist/runtime/lifecycle.js +1024 -0
  102. package/dist/runtime/lifecycle.js.map +1 -0
  103. package/dist/runtime/process.d.ts +39 -0
  104. package/dist/runtime/process.d.ts.map +1 -0
  105. package/dist/runtime/process.js +304 -0
  106. package/dist/runtime/process.js.map +1 -0
  107. package/dist/runtime/repository.d.ts +36 -0
  108. package/dist/runtime/repository.d.ts.map +1 -0
  109. package/dist/runtime/repository.js +458 -0
  110. package/dist/runtime/repository.js.map +1 -0
  111. package/dist/runtime/state.d.ts +121 -0
  112. package/dist/runtime/state.d.ts.map +1 -0
  113. package/dist/runtime/state.js +1017 -0
  114. package/dist/runtime/state.js.map +1 -0
  115. package/dist/runtime/verifier.d.ts +31 -0
  116. package/dist/runtime/verifier.d.ts.map +1 -0
  117. package/dist/runtime/verifier.js +478 -0
  118. package/dist/runtime/verifier.js.map +1 -0
  119. package/dist/runtime/worker.d.ts +67 -0
  120. package/dist/runtime/worker.d.ts.map +1 -0
  121. package/dist/runtime/worker.js +34 -0
  122. package/dist/runtime/worker.js.map +1 -0
  123. package/dist/security/safe-path.d.ts +3 -0
  124. package/dist/security/safe-path.d.ts.map +1 -0
  125. package/dist/security/safe-path.js +102 -0
  126. package/dist/security/safe-path.js.map +1 -0
  127. package/dist/version.d.ts +4 -0
  128. package/dist/version.d.ts.map +1 -0
  129. package/dist/version.js +4 -0
  130. package/dist/version.js.map +1 -0
  131. package/dist/workflows/founder.d.ts +33 -0
  132. package/dist/workflows/founder.d.ts.map +1 -0
  133. package/dist/workflows/founder.js +422 -0
  134. package/dist/workflows/founder.js.map +1 -0
  135. package/package.json +79 -0
  136. package/recipes/node-typescript-next-web/.github/workflows/ci.yml +34 -0
  137. package/recipes/node-typescript-next-web/.node-version +1 -0
  138. package/recipes/node-typescript-next-web/.tool-versions +1 -0
  139. package/recipes/node-typescript-next-web/AGENTS.md +44 -0
  140. package/recipes/node-typescript-next-web/README.md +16 -0
  141. package/recipes/node-typescript-next-web/WORKFLOW.md +6 -0
  142. package/recipes/node-typescript-next-web/app/api/health/route.ts +5 -0
  143. package/recipes/node-typescript-next-web/app/layout.tsx +19 -0
  144. package/recipes/node-typescript-next-web/app/page.tsx +12 -0
  145. package/recipes/node-typescript-next-web/app/styles.css +21 -0
  146. package/recipes/node-typescript-next-web/docs/development.md +16 -0
  147. package/recipes/node-typescript-next-web/eslint.config.mjs +9 -0
  148. package/recipes/node-typescript-next-web/gitignore.template +5 -0
  149. package/recipes/node-typescript-next-web/next-env.d.ts +7 -0
  150. package/recipes/node-typescript-next-web/next.config.ts +11 -0
  151. package/recipes/node-typescript-next-web/package-lock.json +7540 -0
  152. package/recipes/node-typescript-next-web/package.json +39 -0
  153. package/recipes/node-typescript-next-web/playwright.config.ts +23 -0
  154. package/recipes/node-typescript-next-web/recipe.yaml +71 -0
  155. package/recipes/node-typescript-next-web/scripts/check-package.mjs +3 -0
  156. package/recipes/node-typescript-next-web/src/health.ts +3 -0
  157. package/recipes/node-typescript-next-web/test/browser/home.spec.ts +14 -0
  158. package/recipes/node-typescript-next-web/test/integration/health-route.test.ts +11 -0
  159. package/recipes/node-typescript-next-web/test/unit/health.test.ts +9 -0
  160. package/recipes/node-typescript-next-web/tsconfig.json +33 -0
  161. package/schemas/README.md +64 -0
  162. package/schemas/audit-report.schema.json +59 -0
  163. package/schemas/blueprint.schema.json +34 -0
  164. package/schemas/context-manifest.schema.json +88 -0
  165. package/schemas/delivery-record.schema.json +266 -0
  166. package/schemas/impact-manifest.schema.json +146 -0
  167. package/schemas/managed-repository.schema.json +36 -0
  168. package/schemas/mill-config.schema.json +212 -0
  169. package/schemas/mill-lock.schema.json +96 -0
  170. package/schemas/outcome-plan.schema.json +51 -0
  171. package/schemas/product-contract.schema.json +181 -0
  172. package/schemas/public-alpha-qualification.schema.json +391 -0
  173. package/schemas/recipe-manifest.schema.json +187 -0
  174. package/schemas/release-evidence.schema.json +170 -0
  175. package/schemas/repository-integration-plan.schema.json +156 -0
  176. package/schemas/review-result.schema.json +57 -0
  177. package/schemas/scenario-set.schema.json +84 -0
  178. package/schemas/source-manifest.schema.json +96 -0
  179. package/schemas/specification-proposal.schema.json +406 -0
  180. package/schemas/support-tuple.schema.json +107 -0
  181. package/schemas/task-packet.schema.json +395 -0
  182. package/schemas/validation-evidence.schema.json +125 -0
  183. package/schemas/worker-invocation.schema.json +119 -0
  184. package/schemas/worker-profile.schema.json +53 -0
@@ -0,0 +1,988 @@
1
+ import { z } from "zod";
2
+ const digestSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/u);
3
+ const versionSchema = z.string().min(1);
4
+ const exactSemverSchema = z
5
+ .string()
6
+ .regex(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u, "expected an exact semantic version");
7
+ const stableInvariantIdSchema = z.string().regex(/^INV-[A-Z0-9][A-Z0-9-]*$/u);
8
+ const stableSourceIdSchema = z.string().regex(/^SRC-[A-Z0-9][A-Z0-9-]*$/u);
9
+ const stableDecisionIdSchema = z.string().regex(/^DEC-[A-Z0-9][A-Z0-9-]*$/u);
10
+ const stableOutcomeIdSchema = z.string().regex(/^OUT-[A-Z0-9][A-Z0-9-]*$/u);
11
+ const uniqueNonemptyStringArraySchema = z
12
+ .array(z.string().min(1))
13
+ .min(1)
14
+ .refine((values) => new Set(values).size === values.length, {
15
+ message: "expected unique values",
16
+ })
17
+ .meta({ uniqueItems: true });
18
+ export const sourceManifestSchema = z.strictObject({
19
+ schemaVersion: z.literal("1"),
20
+ trigger: z.enum([
21
+ "bootstrap",
22
+ "adoption_uncertainty",
23
+ "approved_stack_change",
24
+ ]),
25
+ providers: z
26
+ .array(z.strictObject({
27
+ id: z.string().min(1),
28
+ name: z.string().min(1),
29
+ queries: z.array(z.strictObject({
30
+ id: z.string().min(1),
31
+ text: z.string().min(1),
32
+ purpose: z.string().min(1),
33
+ })),
34
+ networkDisclosure: z.string().min(1),
35
+ }))
36
+ .min(1),
37
+ sources: z
38
+ .array(z.strictObject({
39
+ id: stableSourceIdSchema,
40
+ class: z.enum([
41
+ "primary_documentation",
42
+ "official_registry",
43
+ "security_advisory",
44
+ "license",
45
+ "repository",
46
+ "user_evidence",
47
+ "operator_constraint",
48
+ ]),
49
+ uri: z.string().min(1),
50
+ revision: z.string().min(1),
51
+ observedAt: z.iso.datetime(),
52
+ freshness: z.enum(["current", "stale", "unknown"]),
53
+ authority: z.enum(["evidence", "constraint", "approved_decision"]),
54
+ digest: digestSchema.optional(),
55
+ claims: z.array(z.string().min(1)).min(1),
56
+ }))
57
+ .min(1),
58
+ });
59
+ export const invariantSchema = z.strictObject({
60
+ id: stableInvariantIdSchema,
61
+ statement: z.string().min(1),
62
+ owner: z.string().min(1),
63
+ criticality: z.enum(["low", "medium", "high", "critical"]),
64
+ surfaceRefs: z.array(z.string().min(1)).min(1),
65
+ verification: z.strictObject({
66
+ mode: z.enum(["command", "human", "unsupported"]),
67
+ ref: z.string().min(1),
68
+ }),
69
+ sourceRefs: z.array(stableSourceIdSchema).min(1),
70
+ unknowns: z.array(z.string().min(1)),
71
+ });
72
+ export const decisionCardSchema = z.strictObject({
73
+ id: stableDecisionIdSchema,
74
+ kind: z.enum([
75
+ "product",
76
+ "architecture",
77
+ "design",
78
+ "accessibility",
79
+ "research",
80
+ ]),
81
+ question: z.string().min(1),
82
+ decision: z.string().min(1),
83
+ rationale: z.string().min(1),
84
+ sourceRefs: z.array(stableSourceIdSchema).min(1),
85
+ status: z.enum(["proposed", "approved", "rejected"]),
86
+ costlyToReverse: z.boolean(),
87
+ });
88
+ export const managedRepositorySchema = z.strictObject({
89
+ schemaVersion: z.literal("1"),
90
+ id: z.uuid(),
91
+ forgeHost: z.string().min(1),
92
+ owner: z.string().min(1),
93
+ repository: z.string().min(1),
94
+ canonicalBranch: z.string().min(1),
95
+ remoteName: z.string().min(1),
96
+ remoteUrl: z.url(),
97
+ trustCeiling: z.enum(["inspect", "build", "propose"]),
98
+ });
99
+ export const productContractSchema = z.strictObject({
100
+ schemaVersion: z.literal("1"),
101
+ id: z.string().min(1),
102
+ title: z.string().min(1),
103
+ primaryUser: z.string().min(1),
104
+ jobToBeDone: z.string().min(1),
105
+ outcomes: z
106
+ .array(z.strictObject({
107
+ id: stableOutcomeIdSchema,
108
+ statement: z.string().min(1),
109
+ acceptanceIds: uniqueNonemptyStringArraySchema.optional(),
110
+ }))
111
+ .min(1),
112
+ nonGoals: z.array(z.string().min(1)),
113
+ assumptions: z.array(z.string().min(1)),
114
+ unknowns: z.array(z.string().min(1)),
115
+ sourceRefs: z.array(z.string().min(1)).min(1),
116
+ acceptance: z
117
+ .array(z.strictObject({
118
+ id: z.string().min(1),
119
+ kind: z.enum(["functional", "quality", "operational"]),
120
+ statement: z.string().min(1),
121
+ sourceRefs: z.array(stableSourceIdSchema).min(1),
122
+ }))
123
+ .default([]),
124
+ invariants: z.array(invariantSchema).default([]),
125
+ decisions: z.array(decisionCardSchema).default([]),
126
+ });
127
+ export const blueprintSchema = z.strictObject({
128
+ schemaVersion: z.literal("1"),
129
+ id: z.string().min(1),
130
+ productContractDigest: digestSchema,
131
+ recipe: z.string().min(1),
132
+ recipeVersion: versionSchema,
133
+ runtime: z.string().min(1),
134
+ architecture: z.array(z.string().min(1)).min(1),
135
+ risks: z.array(z.string().min(1)),
136
+ });
137
+ export const scenarioSchema = z.strictObject({
138
+ id: z.string().min(1),
139
+ kind: z.enum([
140
+ "normal",
141
+ "exception",
142
+ "degradation",
143
+ "recovery",
144
+ "authority",
145
+ "adversarial",
146
+ ]),
147
+ given: z.array(z.string().min(1)).min(1),
148
+ when: z.array(z.string().min(1)).min(1),
149
+ then: z.array(z.string().min(1)).min(1),
150
+ oracleOwner: z.enum(["repository", "human", "external"]),
151
+ acceptanceRefs: z.array(z.string().min(1)).default([]),
152
+ invariantRefs: z.array(stableInvariantIdSchema).default([]),
153
+ coverage: z.enum(["new_behavior", "preservation", "both"]).default("both"),
154
+ visibility: z
155
+ .enum(["builder_visible", "reviewer_owned", "human_acceptance"])
156
+ .default("builder_visible"),
157
+ executionRef: z.string().min(1).optional(),
158
+ recipeOracle: z.string().min(1).optional(),
159
+ forbidden: z.array(z.string().min(1)).default([]),
160
+ });
161
+ export const scenarioSetSchema = z.strictObject({
162
+ schemaVersion: z.literal("1"),
163
+ productContractDigest: digestSchema,
164
+ scenarios: z.array(scenarioSchema).min(1),
165
+ });
166
+ export const outcomeSchema = z.strictObject({
167
+ id: z.string().min(1),
168
+ title: z.string().min(1),
169
+ acceptance: z.array(z.string().min(1)).min(1),
170
+ acceptanceIds: uniqueNonemptyStringArraySchema.optional(),
171
+ dependsOn: z.array(z.string().min(1)),
172
+ status: z.enum(["proposed", "approved", "ready", "blocked", "closed"]),
173
+ taskRef: z
174
+ .string()
175
+ .regex(/^(?!\/)(?!.*(?:^|\/)\.\.(?:\/|$))[^*?[\]\\]+(?:\/\*\*)?$/u)
176
+ .optional(),
177
+ });
178
+ export const outcomePlanSchema = z.strictObject({
179
+ schemaVersion: z.literal("1"),
180
+ productContractDigest: digestSchema,
181
+ outcomes: z.array(outcomeSchema).min(1),
182
+ });
183
+ const impactExceptionSchema = z.strictObject({
184
+ id: z.string().min(1),
185
+ scopeRefs: z.array(z.string().min(1)).min(1),
186
+ reason: z.string().min(1),
187
+ approvedBy: z.string().min(1),
188
+ approvedAt: z.iso.datetime(),
189
+ expiresAt: z.iso.datetime(),
190
+ });
191
+ export const impactManifestSchema = z.strictObject({
192
+ schemaVersion: z.literal("1"),
193
+ id: z.string().regex(/^[a-z0-9][a-z0-9._-]*$/u),
194
+ productContractDigest: digestSchema,
195
+ outcomeId: stableOutcomeIdSchema,
196
+ riskClass: z.enum(["low", "medium", "high"]),
197
+ acceptanceIds: z.array(z.string().min(1)).min(1),
198
+ affectedInvariantIds: z.array(stableInvariantIdSchema),
199
+ uncertainInvariantIds: z.array(stableInvariantIdSchema),
200
+ surfaces: z
201
+ .array(z.strictObject({
202
+ id: z.string().min(1),
203
+ kind: z.enum([
204
+ "user",
205
+ "system",
206
+ "interface",
207
+ "data",
208
+ "operations",
209
+ "design",
210
+ ]),
211
+ change: z.string().min(1),
212
+ }))
213
+ .min(1),
214
+ scenarioIds: z.array(z.string().min(1)).min(1),
215
+ commandIds: z.array(z.string().min(1)).min(1),
216
+ materialDecisions: z.array(stableDecisionIdSchema),
217
+ unresolved: z.array(z.string().min(1)),
218
+ exceptions: z.array(impactExceptionSchema),
219
+ approval: z
220
+ .strictObject({
221
+ approvedBy: z.string().min(1),
222
+ approvedAt: z.iso.datetime(),
223
+ proposalDigest: digestSchema,
224
+ })
225
+ .nullable(),
226
+ });
227
+ export const specificationProposalSchema = z.strictObject({
228
+ schemaVersion: z.literal("1"),
229
+ prd: z.strictObject({
230
+ path: z.string().min(1),
231
+ digest: digestSchema,
232
+ }),
233
+ sourceManifestDigest: digestSchema,
234
+ productContract: productContractSchema,
235
+ blueprints: z.array(blueprintSchema).length(1),
236
+ scenarioSet: scenarioSetSchema,
237
+ assumptions: z.array(z.strictObject({
238
+ id: z.string().min(1),
239
+ statement: z.string().min(1),
240
+ sourceRefs: z.array(stableSourceIdSchema),
241
+ })),
242
+ contradictions: z.array(z.strictObject({
243
+ id: z.string().min(1),
244
+ statement: z.string().min(1),
245
+ sourceRefs: z.array(stableSourceIdSchema).min(2),
246
+ blocking: z.boolean(),
247
+ })),
248
+ questions: z
249
+ .array(z.strictObject({
250
+ id: z.string().min(1),
251
+ prompt: z.string().min(1),
252
+ recommendedDefault: z.string().min(1),
253
+ reversible: z.boolean(),
254
+ blocking: z.boolean(),
255
+ }))
256
+ .max(2),
257
+ status: z.literal("proposed"),
258
+ });
259
+ const repositoryPathPatternSchema = z
260
+ .string()
261
+ .regex(/^(?!\/)(?!.*(?:^|\/)\.\.(?:\/|$))[^*?[\]\\]+(?:\/\*\*)?$/u);
262
+ const repositoryMountDirectorySchema = z
263
+ .string()
264
+ .regex(/^(?!\.\.?$)(?!.*[,/])[^*?[\]\\]+$/u, "expected a comma-free top-level repository directory");
265
+ const githubReviewPolicySchema = z
266
+ .strictObject({
267
+ mode: z.enum(["local_only", "github_required"]),
268
+ requiredReviewerLogins: z.array(z.string().min(1)),
269
+ })
270
+ .superRefine((policy, context) => {
271
+ if (policy.mode === "github_required" &&
272
+ policy.requiredReviewerLogins.length === 0) {
273
+ context.addIssue({
274
+ code: "custom",
275
+ path: ["requiredReviewerLogins"],
276
+ message: "github_required review policy needs at least one reviewer login",
277
+ });
278
+ }
279
+ })
280
+ .meta({
281
+ allOf: [
282
+ {
283
+ if: {
284
+ properties: { mode: { const: "github_required" } },
285
+ required: ["mode"],
286
+ },
287
+ then: {
288
+ properties: {
289
+ requiredReviewerLogins: { type: "array", minItems: 1 },
290
+ },
291
+ },
292
+ },
293
+ ],
294
+ });
295
+ export const millConfigSchema = z
296
+ .strictObject({
297
+ schemaVersion: z.literal("1"),
298
+ repositoryId: z.uuid(),
299
+ trustCeiling: z.enum(["inspect", "build", "propose"]),
300
+ sensitivePaths: z.array(repositoryPathPatternSchema).default([]),
301
+ verifier: z
302
+ .strictObject({
303
+ image: z.string().regex(/^[^@\s]+@sha256:[a-f0-9]{64}$/u),
304
+ network: z.literal("none"),
305
+ dependencies: z
306
+ .strictObject({
307
+ manager: z.literal("npm"),
308
+ registry: z.literal("https://registry.npmjs.org"),
309
+ targetPath: z.literal("node_modules"),
310
+ lockPaths: z.array(repositoryPathPatternSchema).min(1),
311
+ })
312
+ .optional(),
313
+ })
314
+ .optional(),
315
+ propose: z
316
+ .strictObject({
317
+ forge: z.literal("github"),
318
+ host: z.literal("github.com"),
319
+ owner: z.string().regex(/^[A-Za-z0-9_.-]+$/u),
320
+ repository: z.string().regex(/^[A-Za-z0-9_.-]+$/u),
321
+ repositoryNodeId: z.string().min(1),
322
+ remoteName: z.string().regex(/^[A-Za-z0-9._-]+$/u),
323
+ baseBranch: z.string().regex(/^(?!-)(?!.*\.\.)[^\s~^:?*[\\]+$/u),
324
+ branchPrefix: z.literal("mill/"),
325
+ allowedActors: z.array(z.string().min(1)).min(1),
326
+ allowedMergerLogins: z.array(z.string().min(1)).min(1),
327
+ requiredChecks: z.array(z.string().min(1)),
328
+ reviewPolicy: githubReviewPolicySchema,
329
+ allowedMergeMethods: z
330
+ .array(z.enum(["merge", "linear_tree_preserving"]))
331
+ .min(1),
332
+ approvalTtlSeconds: z.number().int().min(60).max(3600).default(900),
333
+ pollTimeoutSeconds: z.number().int().min(1).max(1800).default(600),
334
+ })
335
+ .optional(),
336
+ commands: z.record(z.string().min(1), z.strictObject({
337
+ argv: z.array(z.string().min(1)).min(1),
338
+ cwd: z.string().min(1),
339
+ controlPaths: z.array(repositoryPathPatternSchema).min(1),
340
+ capability: z.enum(["read", "build", "test", "package"]),
341
+ required: z.boolean().default(true),
342
+ timeoutSeconds: z.number().int().min(1).max(3600).default(600),
343
+ execution: z.enum(["oci", "host"]).default("oci"),
344
+ writablePaths: z.array(repositoryMountDirectorySchema).optional(),
345
+ })),
346
+ })
347
+ .superRefine((value, context) => {
348
+ if (value.trustCeiling === "propose" && value.propose === undefined) {
349
+ context.addIssue({
350
+ code: "custom",
351
+ path: ["propose"],
352
+ message: "propose configuration is required at the propose trust ceiling",
353
+ });
354
+ }
355
+ })
356
+ .meta({
357
+ allOf: [
358
+ {
359
+ if: {
360
+ properties: { trustCeiling: { const: "propose" } },
361
+ required: ["trustCeiling"],
362
+ },
363
+ then: { properties: { propose: true }, required: ["propose"] },
364
+ },
365
+ ],
366
+ });
367
+ const authorityReferenceSchema = z.strictObject({
368
+ path: z.string().min(1),
369
+ digest: digestSchema,
370
+ });
371
+ const humanAttestationSchema = z.strictObject({
372
+ id: z.string().regex(/^ATT-[A-Z0-9][A-Z0-9-]*$/u),
373
+ approvedBy: z.string().min(1),
374
+ approvedAt: z.iso.datetime(),
375
+ expiresAt: z.iso.datetime(),
376
+ claims: z
377
+ .array(z.strictObject({
378
+ kind: z.enum(["acceptance", "invariant", "scenario"]),
379
+ id: z.string().min(1),
380
+ digest: digestSchema,
381
+ }))
382
+ .min(1),
383
+ });
384
+ const evidenceDispositionSchema = z.discriminatedUnion("mode", [
385
+ z.strictObject({
386
+ mode: z.literal("command"),
387
+ commandId: z.string().min(1),
388
+ }),
389
+ z.strictObject({
390
+ mode: z.literal("human"),
391
+ attestationId: z.string().regex(/^ATT-[A-Z0-9][A-Z0-9-]*$/u),
392
+ }),
393
+ z.strictObject({
394
+ mode: z.literal("unsupported"),
395
+ reason: z.string().min(1),
396
+ }),
397
+ ]);
398
+ const taskPacketCommonShape = {
399
+ id: z.string().regex(/^[a-z0-9][a-z0-9._-]*$/u),
400
+ title: z.string().min(1),
401
+ objective: z.string().min(1),
402
+ riskClass: z.enum(["low", "medium", "high"]),
403
+ baseRef: z.string().regex(/^(?!-)[^\s]+$/u),
404
+ contextPaths: z.array(z.string().min(1)).min(1),
405
+ allowedPaths: z.array(repositoryPathPatternSchema).min(1),
406
+ commandIds: z.array(z.string().min(1)).min(1),
407
+ commit: z.strictObject({
408
+ message: z.string().min(1),
409
+ authorName: z.string().min(1),
410
+ authorEmail: z.email(),
411
+ }),
412
+ budget: z.strictObject({
413
+ deadlineSeconds: z.number().int().min(1).max(7200),
414
+ maxOutputBytes: z.number().int().min(1024).max(10_000_000),
415
+ retryCount: z.number().int().min(0).max(1),
416
+ }),
417
+ };
418
+ export const taskPacketV1Schema = z.strictObject({
419
+ schemaVersion: z.literal("1"),
420
+ ...taskPacketCommonShape,
421
+ authority: z.strictObject({
422
+ productContract: authorityReferenceSchema,
423
+ scenarioSet: authorityReferenceSchema,
424
+ policy: authorityReferenceSchema,
425
+ }),
426
+ acceptance: z
427
+ .array(z.strictObject({
428
+ id: z.string().min(1),
429
+ statement: z.string().min(1),
430
+ }))
431
+ .min(1),
432
+ });
433
+ export const taskPacketV2Schema = z.strictObject({
434
+ schemaVersion: z.literal("2"),
435
+ ...taskPacketCommonShape,
436
+ authority: z.strictObject({
437
+ productContract: authorityReferenceSchema,
438
+ scenarioSet: authorityReferenceSchema,
439
+ policy: authorityReferenceSchema,
440
+ impactManifest: authorityReferenceSchema,
441
+ }),
442
+ attestations: z.array(humanAttestationSchema).default([]),
443
+ acceptance: z
444
+ .array(z.strictObject({
445
+ id: z.string().min(1),
446
+ statement: z.string().min(1),
447
+ invariantIds: z.array(stableInvariantIdSchema),
448
+ scenarioIds: z.array(z.string().min(1)),
449
+ coverage: z.enum(["new_behavior", "preservation", "both"]),
450
+ evidence: evidenceDispositionSchema,
451
+ }))
452
+ .min(1),
453
+ });
454
+ export const taskPacketSchema = z.discriminatedUnion("schemaVersion", [
455
+ taskPacketV1Schema,
456
+ taskPacketV2Schema,
457
+ ]);
458
+ export const workerProfileSchema = z.strictObject({
459
+ schemaVersion: z.literal("1"),
460
+ adapter: z.literal("codex-cli"),
461
+ role: z.enum(["planner", "builder", "reviewer"]),
462
+ contractVersion: z.literal("1"),
463
+ harnessVersion: z.string().min(1),
464
+ promptTemplateDigest: digestSchema,
465
+ modelIdentity: z.literal("provider-mutable"),
466
+ approvalPolicy: z.literal("never"),
467
+ sandbox: z.enum(["read-only", "workspace-write"]),
468
+ session: z.literal("ephemeral"),
469
+ hostRules: z.literal("ignored"),
470
+ skillDiscovery: z.literal("disabled"),
471
+ toolDiscovery: z.literal("disabled"),
472
+ networkPosture: z.enum(["unknown", "provider-managed"]),
473
+ capabilities: z.array(z.string().min(1)).min(1),
474
+ outputContract: z.string().min(1),
475
+ });
476
+ export const workerInvocationSchema = z.strictObject({
477
+ schemaVersion: z.literal("1"),
478
+ invocationId: z.uuid(),
479
+ runId: z.uuid(),
480
+ phase: z.enum(["build", "repair", "review"]),
481
+ attempt: z.number().int().positive().max(2),
482
+ taskDigest: digestSchema,
483
+ contextEpoch: digestSchema,
484
+ baseCommit: z.string().regex(/^[a-f0-9]{40}$/u),
485
+ candidateCommit: z
486
+ .string()
487
+ .regex(/^[a-f0-9]{40}$/u)
488
+ .optional(),
489
+ impactManifestDigest: digestSchema.optional(),
490
+ profile: workerProfileSchema,
491
+ profileDigest: digestSchema,
492
+ allowedPaths: z.array(repositoryPathPatternSchema),
493
+ deadlineAt: z.iso.datetime(),
494
+ maxOutputBytes: z.number().int().min(1024).max(10_000_000),
495
+ });
496
+ export const contextManifestSchema = z.strictObject({
497
+ schemaVersion: z.literal("1"),
498
+ taskDigest: digestSchema,
499
+ baseCommit: z.string().regex(/^[a-f0-9]{40}$/u),
500
+ provider: z.literal("openai"),
501
+ adapter: z.literal("codex-cli"),
502
+ authOwner: z.literal("operator"),
503
+ isolation: z.literal("attended-trusted-host"),
504
+ modelIdentity: z.literal("provider-mutable"),
505
+ included: z.array(z.strictObject({ path: z.string().min(1), digest: digestSchema })),
506
+ excludedPatterns: z.array(z.string().min(1)),
507
+ disclosure: z.array(z.string().min(1)),
508
+ contextEpoch: digestSchema.optional(),
509
+ effectiveInstructions: z
510
+ .array(z.strictObject({ path: z.string().min(1), digest: digestSchema }))
511
+ .optional(),
512
+ providerVisibleScope: z
513
+ .strictObject({
514
+ repositoryScope: z.literal("worktree"),
515
+ suppliedPaths: z.array(z.string().min(1)),
516
+ writablePatterns: z.array(repositoryPathPatternSchema),
517
+ observedReads: z.literal("unavailable"),
518
+ })
519
+ .optional(),
520
+ });
521
+ export const reviewResultSchema = z.strictObject({
522
+ schemaVersion: z.literal("1"),
523
+ candidateCommit: z.string().regex(/^[a-f0-9]{40}$/u),
524
+ summary: z.string(),
525
+ findings: z.array(z.strictObject({
526
+ id: z.string().min(1),
527
+ severity: z.enum(["P0", "P1", "P2", "P3"]),
528
+ class: z.enum([
529
+ "correctness",
530
+ "security",
531
+ "data-loss",
532
+ "provenance",
533
+ "compatibility",
534
+ "authority",
535
+ "maintainability",
536
+ "style",
537
+ ]),
538
+ title: z.string().min(1),
539
+ body: z.string().min(1),
540
+ file: z.string().min(1).nullable(),
541
+ line: z.number().int().min(1).nullable(),
542
+ })),
543
+ });
544
+ export const validationEvidenceSchema = z.strictObject({
545
+ schemaVersion: z.literal("1"),
546
+ candidateCommit: z.string().regex(/^[a-f0-9]{40}$/u),
547
+ verifierImage: z.string().regex(/^[^@\s]+@sha256:[a-f0-9]{64}$/u),
548
+ network: z.literal("none"),
549
+ commands: z.array(z.strictObject({
550
+ commandId: z.string().min(1),
551
+ required: z.boolean(),
552
+ status: z.enum(["passed", "failed", "blocked"]),
553
+ exitCode: z.number().int().nullable(),
554
+ durationMs: z.number().int().min(0),
555
+ outputDigest: digestSchema,
556
+ reason: z
557
+ .enum([
558
+ "HOST_EXECUTION_NOT_QUALIFIED",
559
+ "CANCELLED",
560
+ "DEADLINE_EXCEEDED",
561
+ "OUTPUT_BUDGET_EXCEEDED",
562
+ "NONZERO_EXIT",
563
+ ])
564
+ .optional(),
565
+ })),
566
+ semantic: z
567
+ .strictObject({
568
+ impactManifestDigest: digestSchema,
569
+ items: z.array(z.strictObject({
570
+ kind: z.enum(["acceptance", "invariant", "scenario"]),
571
+ id: z.string().min(1),
572
+ coverage: z.enum(["new_behavior", "preservation", "both"]),
573
+ status: z.enum(["passed", "attested", "blocked"]),
574
+ evidenceRefs: z.array(z.string().min(1)),
575
+ reason: z.string().min(1).optional(),
576
+ })),
577
+ newBehaviorPassed: z.boolean(),
578
+ preservationPassed: z.boolean(),
579
+ passed: z.boolean(),
580
+ })
581
+ .optional(),
582
+ passed: z.boolean(),
583
+ });
584
+ const remoteEffectSchema = z.strictObject({
585
+ id: digestSchema,
586
+ kind: z.enum(["push", "pull_request"]),
587
+ candidateCommit: z.string().regex(/^[a-f0-9]{40}$/u),
588
+ status: z.enum([
589
+ "intent",
590
+ "call_started",
591
+ "effect_unknown",
592
+ "retryable_absent",
593
+ "verified",
594
+ "blocked",
595
+ ]),
596
+ attemptCount: z.number().int().min(0).max(2),
597
+ expectedOldCommit: z
598
+ .string()
599
+ .regex(/^[a-f0-9]{40}$/u)
600
+ .nullable(),
601
+ errorCode: z.string().min(1).nullable(),
602
+ updatedAt: z.iso.datetime(),
603
+ });
604
+ export const deliveryRecordSchema = z.strictObject({
605
+ schemaVersion: z.literal("1"),
606
+ runId: z.uuid(),
607
+ deliveryKey: digestSchema,
608
+ proposalDigest: digestSchema,
609
+ approvalExpiresAt: z.iso.datetime(),
610
+ state: z.enum([
611
+ "planned",
612
+ "proposing",
613
+ "effect_unknown",
614
+ "awaiting_ci",
615
+ "awaiting_human",
616
+ "merged",
617
+ "post_merge_verified",
618
+ "closed",
619
+ "cancelled",
620
+ "blocked",
621
+ ]),
622
+ target: z.strictObject({
623
+ forge: z.literal("github"),
624
+ host: z.literal("github.com"),
625
+ owner: z.string().min(1),
626
+ repository: z.string().min(1),
627
+ repositoryNodeId: z.string().min(1),
628
+ cloneUrl: z.url(),
629
+ remoteName: z.string().min(1),
630
+ baseBranch: z.string().min(1),
631
+ actorLogin: z.string().min(1),
632
+ actorId: z.number().int().positive(),
633
+ }),
634
+ branchName: z.string().min(1),
635
+ candidateCommit: z.string().regex(/^[a-f0-9]{40}$/u),
636
+ candidateTree: z.string().regex(/^[a-f0-9]{40}$/u),
637
+ requiredChecks: z.array(z.string().min(1)),
638
+ reviewPolicy: githubReviewPolicySchema,
639
+ allowedMergerLogins: z.array(z.string().min(1)).min(1),
640
+ allowedMergeMethods: z
641
+ .array(z.enum(["merge", "linear_tree_preserving"]))
642
+ .min(1),
643
+ effects: z.array(remoteEffectSchema),
644
+ remoteHeadCommit: z
645
+ .string()
646
+ .regex(/^[a-f0-9]{40}$/u)
647
+ .nullable(),
648
+ pullRequest: z
649
+ .strictObject({
650
+ number: z.number().int().positive(),
651
+ nodeId: z.string().min(1),
652
+ url: z.url(),
653
+ })
654
+ .nullable(),
655
+ observation: z.record(z.string(), z.unknown()).nullable(),
656
+ merge: z
657
+ .strictObject({
658
+ commit: z.string().regex(/^[a-f0-9]{40}$/u),
659
+ tree: z.string().regex(/^[a-f0-9]{40}$/u),
660
+ method: z.enum(["merge", "linear_tree_preserving"]),
661
+ mergedByLogin: z.string().min(1),
662
+ mergedAt: z.iso.datetime(),
663
+ defaultBranchHead: z.string().regex(/^[a-f0-9]{40}$/u),
664
+ })
665
+ .nullable(),
666
+ lastErrorCode: z.string().min(1).nullable(),
667
+ createdAt: z.iso.datetime(),
668
+ updatedAt: z.iso.datetime(),
669
+ });
670
+ export const millLockSchema = z.strictObject({
671
+ schemaVersion: z.literal("1"),
672
+ mill: z.strictObject({
673
+ package: z.literal("@davidahmann/mill"),
674
+ version: exactSemverSchema,
675
+ integrity: digestSchema.optional(),
676
+ }),
677
+ schemaDigests: z.record(z.string().min(1), digestSchema).default({}),
678
+ recipe: z
679
+ .strictObject({
680
+ id: z.string().min(1),
681
+ version: versionSchema,
682
+ digest: digestSchema,
683
+ })
684
+ .optional(),
685
+ integration: z
686
+ .strictObject({
687
+ mode: z.enum(["greenfield", "adoption"]),
688
+ planDigest: digestSchema,
689
+ baseCommit: z
690
+ .string()
691
+ .regex(/^[a-f0-9]{40}$/u)
692
+ .nullable(),
693
+ files: z.array(z.strictObject({
694
+ path: repositoryPathPatternSchema,
695
+ ownership: z.enum(["mill_only", "generated_once", "managed"]),
696
+ templateDigest: digestSchema,
697
+ installedDigest: digestSchema,
698
+ preexistingDigest: digestSchema.nullable(),
699
+ })),
700
+ })
701
+ .optional(),
702
+ });
703
+ export const recipeManifestSchema = z.strictObject({
704
+ schemaVersion: z.literal("1"),
705
+ id: z.literal("node-typescript-next-web"),
706
+ version: exactSemverSchema,
707
+ status: z.enum(["supported", "experimental", "unsupported"]),
708
+ observedAt: z.iso.datetime(),
709
+ runtime: z.strictObject({
710
+ node: exactSemverSchema,
711
+ npm: exactSemverSchema,
712
+ }),
713
+ stack: z.strictObject({
714
+ next: exactSemverSchema,
715
+ react: exactSemverSchema,
716
+ reactDom: exactSemverSchema,
717
+ typescript: exactSemverSchema,
718
+ eslint: exactSemverSchema,
719
+ prettier: exactSemverSchema,
720
+ vitest: exactSemverSchema,
721
+ playwright: exactSemverSchema,
722
+ }),
723
+ verifierImage: z.string().regex(/^[^@\s]+@sha256:[a-f0-9]{64}$/u),
724
+ registry: z.url(),
725
+ licensePolicy: z.strictObject({
726
+ allowed: z.array(z.string().min(1)).min(1),
727
+ reviewedPackages: z.array(z.strictObject({ name: z.string().min(1), license: z.string().min(1) })),
728
+ }),
729
+ commands: z.strictObject({
730
+ required: z.array(z.string().min(1)).min(1),
731
+ native: z.array(z.string().min(1)).min(1),
732
+ }),
733
+ oracles: z
734
+ .array(z.strictObject({
735
+ id: z.string().min(1),
736
+ commandId: z.string().min(1),
737
+ evidencePaths: z.array(repositoryPathPatternSchema).min(1),
738
+ proves: z.array(z.string().min(1)).min(1),
739
+ }))
740
+ .min(1),
741
+ writablePaths: z.array(repositoryMountDirectorySchema),
742
+ sources: z.array(z.url()).min(1),
743
+ });
744
+ const integrationFileSchema = z.strictObject({
745
+ path: repositoryPathPatternSchema,
746
+ ownership: z.enum(["mill_only", "generated_once", "managed"]),
747
+ action: z.enum(["create", "retain_identical"]),
748
+ contentDigest: digestSchema,
749
+ preexistingDigest: digestSchema.nullable(),
750
+ });
751
+ export const repositoryIntegrationPlanSchema = z.strictObject({
752
+ schemaVersion: z.literal("1"),
753
+ planDigest: digestSchema,
754
+ generator: z.strictObject({
755
+ package: z.literal("@davidahmann/mill"),
756
+ version: exactSemverSchema,
757
+ }),
758
+ mode: z.enum(["greenfield", "adoption"]),
759
+ target: z.strictObject({
760
+ directoryName: z.string().min(1),
761
+ canonicalPathDigest: digestSchema,
762
+ baseCommit: z
763
+ .string()
764
+ .regex(/^[a-f0-9]{40}$/u)
765
+ .nullable(),
766
+ scanDigest: digestSchema.nullable(),
767
+ }),
768
+ productProposalDigest: digestSchema,
769
+ productContractDigest: digestSchema,
770
+ recipe: z.strictObject({
771
+ id: z.literal("node-typescript-next-web"),
772
+ version: exactSemverSchema,
773
+ digest: digestSchema,
774
+ status: z.literal("supported"),
775
+ verifierImage: z.string().regex(/^[^@\s]+@sha256:[a-f0-9]{64}$/u),
776
+ }),
777
+ approval: z.strictObject({
778
+ approvedBy: z.string().min(1),
779
+ approvedAt: z.iso.datetime(),
780
+ }),
781
+ files: z.array(integrationFileSchema).min(1),
782
+ commandIds: z.array(z.string().min(1)).min(1),
783
+ networkDisclosure: z.array(z.string().min(1)),
784
+ baseline: z.literal("unverified"),
785
+ });
786
+ export const auditCategorySchema = z.enum([
787
+ "product",
788
+ "code",
789
+ "ux",
790
+ "accessibility",
791
+ "security",
792
+ "dependencies",
793
+ "architecture",
794
+ "operations",
795
+ "release",
796
+ ]);
797
+ export const auditReportSchema = z.strictObject({
798
+ schemaVersion: z.literal("1"),
799
+ candidate: z.strictObject({
800
+ commit: z.string().regex(/^[a-f0-9]{40}$/u),
801
+ tree: z.string().regex(/^[a-f0-9]{40}$/u),
802
+ }),
803
+ generatedAt: z.iso.datetime(),
804
+ status: z.enum(["passed", "blocked"]),
805
+ checks: z
806
+ .array(z.strictObject({
807
+ id: z.string().regex(/^[a-z0-9][a-z0-9._-]*$/u),
808
+ category: auditCategorySchema,
809
+ status: z.enum(["passed", "blocked"]),
810
+ summary: z.string().min(1),
811
+ evidence: z.array(z.string().min(1)).min(1),
812
+ }))
813
+ .min(9),
814
+ });
815
+ const qualificationItemSetSchema = z.strictObject({
816
+ requiredIds: uniqueNonemptyStringArraySchema,
817
+ passedIds: z.array(z.string().min(1)),
818
+ });
819
+ const qualificationStatusSchema = z.enum([
820
+ "passed",
821
+ "failed",
822
+ "blocked",
823
+ "skipped",
824
+ ]);
825
+ export const supportTupleSchema = z.strictObject({
826
+ id: z.string().regex(/^[a-z0-9][a-z0-9._-]*$/u),
827
+ status: z.enum(["experimental", "qualified", "expired"]),
828
+ testedAt: z.iso.datetime(),
829
+ expiresAt: z.iso.datetime(),
830
+ host: z.strictObject({
831
+ os: z.string().min(1),
832
+ architecture: z.string().min(1),
833
+ }),
834
+ runtime: z.strictObject({
835
+ node: exactSemverSchema,
836
+ npm: exactSemverSchema,
837
+ }),
838
+ container: z.strictObject({
839
+ engine: z.string().min(1),
840
+ version: z.string().min(1),
841
+ verifierImage: z.string().regex(/^[^@\s]+@sha256:[a-f0-9]{64}$/u),
842
+ }),
843
+ worker: z.strictObject({
844
+ adapter: z.literal("codex-cli"),
845
+ harnessVersion: z.string().min(1),
846
+ modelIdentity: z.literal("provider-mutable"),
847
+ authMode: z.literal("operator-session"),
848
+ }),
849
+ forge: z.strictObject({
850
+ gitVersion: z.string().min(1),
851
+ ghVersion: z.string().min(1),
852
+ host: z.literal("github.com"),
853
+ }),
854
+ recipe: z.strictObject({
855
+ id: z.literal("node-typescript-next-web"),
856
+ version: exactSemverSchema,
857
+ digest: digestSchema,
858
+ }),
859
+ });
860
+ export const publicAlphaQualificationSchema = z.strictObject({
861
+ schemaVersion: z.literal("1"),
862
+ package: z.strictObject({
863
+ name: z.literal("@davidahmann/mill"),
864
+ version: exactSemverSchema,
865
+ artifactDigest: digestSchema,
866
+ npmIntegrity: z.string().regex(/^sha512-[A-Za-z0-9+/]+={0,2}$/u),
867
+ }),
868
+ supportTuple: supportTupleSchema,
869
+ sequence: z.strictObject({
870
+ steps: z
871
+ .array(z.strictObject({
872
+ id: z.string().regex(/^[a-z0-9][a-z0-9._-]*$/u),
873
+ dependsOn: z.array(z.string().min(1)).max(1),
874
+ baseCommit: z.string().regex(/^[a-f0-9]{40}$/u),
875
+ candidateCommit: z.string().regex(/^[a-f0-9]{40}$/u),
876
+ status: z.enum(["accepted", "rejected", "blocked"]),
877
+ newBehavior: qualificationItemSetSchema,
878
+ preservation: qualificationItemSetSchema,
879
+ scenarioIds: uniqueNonemptyStringArraySchema,
880
+ usage: z.strictObject({
881
+ inputTokens: z.number().int().min(0).nullable(),
882
+ outputTokens: z.number().int().min(0).nullable(),
883
+ currencyCost: z.number().min(0).nullable(),
884
+ source: z.enum([
885
+ "provider-measured",
886
+ "operator-declared",
887
+ "unavailable",
888
+ ]),
889
+ }),
890
+ }))
891
+ .min(5)
892
+ .max(20),
893
+ seededFault: z.strictObject({
894
+ baseCommit: z.string().regex(/^[a-f0-9]{40}$/u),
895
+ candidateCommit: z.string().regex(/^[a-f0-9]{40}$/u),
896
+ status: qualificationStatusSchema,
897
+ rejected: z.boolean(),
898
+ recovered: z.boolean(),
899
+ enteredAcceptedSequence: z.boolean(),
900
+ reason: z.string().min(1),
901
+ }),
902
+ }),
903
+ canaries: z.strictObject({
904
+ packedInstall: qualificationStatusSchema,
905
+ greenfield: qualificationStatusSchema,
906
+ adoption: qualificationStatusSchema,
907
+ downstreamWithoutMill: qualificationStatusSchema,
908
+ recovery: qualificationStatusSchema,
909
+ security: qualificationStatusSchema,
910
+ }),
911
+ auditCandidate: z.strictObject({
912
+ commit: z.string().regex(/^[a-f0-9]{40}$/u),
913
+ tree: z.string().regex(/^[a-f0-9]{40}$/u),
914
+ }),
915
+ audits: z.array(z.strictObject({
916
+ category: auditCategorySchema,
917
+ status: qualificationStatusSchema,
918
+ reportDigest: digestSchema,
919
+ })),
920
+ generatedAt: z.iso.datetime(),
921
+ });
922
+ const releaseArtifactSchema = z.strictObject({
923
+ builder: z.string().min(1),
924
+ filename: z.string().regex(/^[A-Za-z0-9@._+-]+\.tgz$/u),
925
+ sha256: digestSchema,
926
+ npmIntegrity: z.string().regex(/^sha512-[A-Za-z0-9+/]+={0,2}$/u),
927
+ contentsDigest: digestSchema,
928
+ });
929
+ export const releaseEvidenceSchema = z.strictObject({
930
+ schemaVersion: z.literal("1"),
931
+ state: z.enum(["qualified", "published", "verified"]),
932
+ package: z.strictObject({
933
+ name: z.literal("@davidahmann/mill"),
934
+ version: exactSemverSchema,
935
+ tag: z.string().regex(/^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u),
936
+ }),
937
+ source: z.strictObject({
938
+ reviewedCandidateTree: z.string().regex(/^[a-f0-9]{40}$/u),
939
+ resultingMainCommit: z.string().regex(/^[a-f0-9]{40}$/u),
940
+ resultingMainTree: z.string().regex(/^[a-f0-9]{40}$/u),
941
+ tagCommit: z.string().regex(/^[a-f0-9]{40}$/u),
942
+ }),
943
+ builders: z.array(releaseArtifactSchema).length(2),
944
+ selectedArtifact: releaseArtifactSchema,
945
+ qualificationDigest: digestSchema,
946
+ sbomDigest: digestSchema,
947
+ registry: z
948
+ .strictObject({
949
+ tarball: z.url(),
950
+ integrity: z.string().regex(/^sha512-[A-Za-z0-9+/]+={0,2}$/u),
951
+ provenanceVerified: z.boolean(),
952
+ })
953
+ .nullable(),
954
+ githubRelease: z
955
+ .strictObject({
956
+ url: z.url(),
957
+ tag: z.string().min(1),
958
+ artifactDigest: digestSchema,
959
+ })
960
+ .nullable(),
961
+ generatedAt: z.iso.datetime(),
962
+ });
963
+ export const contractSchemas = {
964
+ auditReport: auditReportSchema,
965
+ blueprint: blueprintSchema,
966
+ contextManifest: contextManifestSchema,
967
+ impactManifest: impactManifestSchema,
968
+ managedRepository: managedRepositorySchema,
969
+ millConfig: millConfigSchema,
970
+ millLock: millLockSchema,
971
+ outcomePlan: outcomePlanSchema,
972
+ productContract: productContractSchema,
973
+ recipeManifest: recipeManifestSchema,
974
+ releaseEvidence: releaseEvidenceSchema,
975
+ repositoryIntegrationPlan: repositoryIntegrationPlanSchema,
976
+ reviewResult: reviewResultSchema,
977
+ scenarioSet: scenarioSetSchema,
978
+ sourceManifest: sourceManifestSchema,
979
+ supportTuple: supportTupleSchema,
980
+ specificationProposal: specificationProposalSchema,
981
+ taskPacket: taskPacketSchema,
982
+ validationEvidence: validationEvidenceSchema,
983
+ publicAlphaQualification: publicAlphaQualificationSchema,
984
+ workerInvocation: workerInvocationSchema,
985
+ workerProfile: workerProfileSchema,
986
+ deliveryRecord: deliveryRecordSchema,
987
+ };
988
+ //# sourceMappingURL=schemas.js.map