@patronage/software-factory 1.0.0-alpha.3 → 1.0.0-alpha.30

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.
package/dist/schemas.d.ts CHANGED
@@ -1,131 +1,8 @@
1
1
  import { z } from "zod";
2
-
3
- //#region src/demand-waiver.d.ts
4
- /**
5
- * A demand that was in force, was NOT met, and was waived by the operator.
6
- *
7
- * `unmetReasons` is required and non-empty: every reason the demand refused is
8
- * carried through verbatim. There is no field on this record that could say
9
- * "satisfied", and no code path constructs one without a refusal to carry.
10
- */
11
- interface WaivedDemand {
12
- demand: string;
13
- operator: string;
14
- rationale: string;
15
- recordedAt: string;
16
- session?: string;
17
- /** The demand's refusals at evaluation time, preserved verbatim. */
18
- unmetReasons: string[];
19
- }
20
- declare const waivedDemandSchema: z.ZodType<WaivedDemand>;
21
- //#endregion
22
- //#region src/blocked-reasons.d.ts
23
- /**
24
- * The wire bound on one `detail`. A blocked proof carries one short sentence
25
- * per demand, never a transcript: HQ's ingest cap is 256 KB and this field
26
- * must stay far under it even when a candidate blocks on every gate at once.
27
- */
28
- declare const BLOCKED_REASON_DETAIL_MAX = 280;
29
- /**
30
- * The wire bound on how many demands one proof may name. Well past any real
31
- * candidate (there are a dozen fixed demands plus the profile's checks and the
32
- * live human blockers) and, with the detail bound, keeps the whole field two
33
- * orders of magnitude under the ingest cap. Bounded here rather than trimmed
34
- * downstream: HQ rejects an over-long list loudly instead of storing a quietly
35
- * truncated one.
36
- */
37
- declare const BLOCKED_REASONS_MAX = 100;
38
- declare const blockedReasonSchema: z.ZodObject<{
39
- code: z.ZodString;
40
- detail: z.ZodString;
41
- }, z.core.$strip>;
42
- declare const blockedReasonsSchema: z.ZodArray<z.ZodObject<{
43
- code: z.ZodString;
44
- detail: z.ZodString;
45
- }, z.core.$strip>>;
46
- type BlockedReason = z.infer<typeof blockedReasonSchema>;
47
- //#endregion
48
- //#region src/boundary-review-proof.d.ts
49
- declare const boundaryReviewProofBaseSchema: z.ZodObject<{
50
- boundary: z.ZodString;
51
- coveredSet: z.ZodArray<z.ZodObject<{
52
- headSha: z.ZodOptional<z.ZodString>;
53
- issue: z.ZodOptional<z.ZodNumber>;
54
- mergedSha: z.ZodOptional<z.ZodString>;
55
- pr: z.ZodNumber;
56
- state: z.ZodEnum<{
57
- merged: "merged";
58
- open: "open";
59
- }>;
60
- wave: z.ZodOptional<z.ZodString>;
61
- }, z.core.$loose>>;
62
- dispositions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
63
- findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
64
- blockingAfterCap: z.ZodOptional<z.ZodBoolean>;
65
- category: z.ZodOptional<z.ZodString>;
66
- disposition: z.ZodOptional<z.ZodString>;
67
- title: z.ZodString;
68
- }, z.core.$loose>>>;
69
- kind: z.ZodLiteral<"boundary-review-proof">;
70
- manifestHash: z.ZodObject<{
71
- algo: z.ZodLiteral<"sha256">;
72
- scope: z.ZodOptional<z.ZodString>;
73
- value: z.ZodString;
74
- }, z.core.$loose>;
75
- outcome: z.ZodEnum<{
76
- pass: "pass";
77
- fail: "fail";
78
- }>;
79
- producer: z.ZodString;
80
- rung: z.ZodEnum<{
81
- "independent-model": "independent-model";
82
- oracle: "oracle";
83
- human: "human";
84
- }>;
85
- schemaVersion: z.ZodLiteral<1>;
86
- sessionId: z.ZodOptional<z.ZodString>;
87
- specHash: z.ZodOptional<z.ZodObject<{
88
- algo: z.ZodLiteral<"sha256">;
89
- scope: z.ZodOptional<z.ZodString>;
90
- value: z.ZodString;
91
- }, z.core.$loose>>;
92
- }, z.core.$loose>;
93
- type BoundaryReviewProof = z.infer<typeof boundaryReviewProofBaseSchema>;
94
- //#endregion
95
- //#region src/follow-up.d.ts
96
- interface FollowUpAction {
97
- /**
98
- * Machine-safe argv-style array for the obvious next action, e.g.
99
- * ["gh","pr","merge","513","--squash"]. Same shape and field name that
100
- * `factory:delegate --print` emits, so an orchestrating agent can spawn the
101
- * next command without reconstructing a shell string. argv[0] is the
102
- * executable; the rest are literal, already-split arguments.
103
- */
104
- argv: string[];
105
- /**
106
- * Human-readable rendering of {@link argv} for logs and operators. Additive
107
- * to argv, never a substitute for it — argv is the source of truth.
108
- */
109
- command: string;
110
- }
111
- //#endregion
112
- //#region src/diff-classification.d.ts
113
- declare const DIFF_CLASSIFICATIONS: readonly ["docs/process-only", "trivial", "non-trivial"];
114
- type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
115
- //#endregion
116
- //#region src/pr-verify-mode.d.ts
117
- /**
118
- * The verification mode `pr:verify` resolved for a run.
119
- *
120
- * Canonically declared here rather than inside `pr-readiness/` so that modules
121
- * on either side of that boundary — the readiness proof shape and the durable
122
- * check-run payload — can name the same union without importing each other.
123
- */
124
- type ResolvedPrVerifyMode = "docs-only" | "trivial" | "full";
125
- //#endregion
126
2
  //#region src/packages/review-prompt-sections/schema.d.ts
127
3
  declare const reviewPromptSectionSchema: z.ZodObject<{
128
4
  provenance: z.ZodEnum<{
5
+ "coding-standards": "coding-standards";
129
6
  "prior-review-ledger": "prior-review-ledger";
130
7
  "issue-review-focus": "issue-review-focus";
131
8
  }>;
@@ -133,6 +10,33 @@ declare const reviewPromptSectionSchema: z.ZodObject<{
133
10
  text: z.ZodString;
134
11
  }, z.core.$strict>;
135
12
  type ReviewPromptSection = z.infer<typeof reviewPromptSectionSchema>;
13
+ type ReviewPromptSectionProvenance = ReviewPromptSection["provenance"];
14
+ declare const reviewPromptSectionsSchema: z.ZodArray<z.ZodObject<{
15
+ provenance: z.ZodEnum<{
16
+ "coding-standards": "coding-standards";
17
+ "prior-review-ledger": "prior-review-ledger";
18
+ "issue-review-focus": "issue-review-focus";
19
+ }>;
20
+ source: z.ZodString;
21
+ text: z.ZodString;
22
+ }, z.core.$strict>>;
23
+ //#endregion
24
+ //#region src/policy-resolution.d.ts
25
+ /** How a gate resolved the review policy it evaluated a candidate under. */
26
+ declare const policyResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
27
+ basePolicyDigest: z.ZodString;
28
+ baseRefName: z.ZodString;
29
+ candidatePolicyDigest: z.ZodString;
30
+ effectiveDigest: z.ZodString;
31
+ policyBaseSha: z.ZodString;
32
+ reviewPolicyChanged: z.ZodBoolean;
33
+ status: z.ZodLiteral<"authoritative">;
34
+ }, z.core.$strict>, z.ZodObject<{
35
+ baseRefName: z.ZodString;
36
+ reason: z.ZodString;
37
+ status: z.ZodLiteral<"unresolved">;
38
+ }, z.core.$strict>], "status">;
39
+ type PolicyResolution = z.infer<typeof policyResolutionSchema>;
136
40
  //#endregion
137
41
  //#region src/review-ladder-policy.d.ts
138
42
  type ReviewFindingCategory = "correctness" | "safety" | "coordination" | "maintainability" | "unknown";
@@ -190,6 +94,7 @@ interface ReviewLadderCycle {
190
94
  headSha: string;
191
95
  patchId: string;
192
96
  };
97
+ historical?: true;
193
98
  model?: string;
194
99
  correlatedRerun?: boolean;
195
100
  session?: LadderSessionAttribution;
@@ -241,100 +146,274 @@ interface PrReviewProof {
241
146
  changedFiles: string[];
242
147
  cleanedPaths: string[];
243
148
  ladder?: PrReviewLadderState;
149
+ /**
150
+ * The policy identity this review run resolved its demanded kinds under
151
+ * (#922 Slice B). Optional: a run that could not reach the authority records
152
+ * the refusal instead, and `pr:ready` decides what an unresolved or
153
+ * disagreeing identity means for admission.
154
+ */
155
+ policyResolution?: PolicyResolution;
244
156
  reviewRequirement?: {
245
- reason: "no-applicable-mode";
157
+ reason: "no-applicable-mode" | "faithful-merge";
246
158
  status: "not-required";
247
159
  };
248
160
  reviews: PrReviewResult[];
249
161
  }
250
162
  //#endregion
251
- //#region src/pr-readiness/readiness-ledger.d.ts
252
- declare const readinessRepairSchema: z.ZodObject<{
253
- action: z.ZodString;
254
- code: z.ZodEnum<{
255
- "undraft-pr": "undraft-pr";
256
- "await-post-undraft-checks": "await-post-undraft-checks";
257
- }>;
258
- command: z.ZodString;
163
+ //#region src/demand-waiver.d.ts
164
+ /**
165
+ * A demand that was in force, was NOT met, and was waived by the operator.
166
+ *
167
+ * `unmetReasons` is required and non-empty: every reason the demand refused is
168
+ * carried through verbatim. There is no field on this record that could say
169
+ * "satisfied", and no code path constructs one without a refusal to carry.
170
+ */
171
+ interface WaivedDemand {
172
+ demand: string;
173
+ operator: string;
174
+ rationale: string;
175
+ recordedAt: string;
176
+ session?: string;
177
+ /** The demand's refusals at evaluation time, preserved verbatim. */
178
+ unmetReasons: string[];
179
+ }
180
+ declare const waivedDemandSchema: z.ZodType<WaivedDemand>;
181
+ //#endregion
182
+ //#region src/blocked-reasons.d.ts
183
+ /**
184
+ * The wire bound on one `detail`. A blocked proof carries one short sentence
185
+ * per demand, never a transcript: HQ's ingest cap is 256 KB and this field
186
+ * must stay far under it even when a candidate blocks on every gate at once.
187
+ */
188
+ declare const BLOCKED_REASON_DETAIL_MAX = 280;
189
+ /**
190
+ * The wire bound on how many demands one proof may name. Well past any real
191
+ * candidate (there are a dozen fixed demands plus the profile's checks and the
192
+ * live human blockers) and, with the detail bound, keeps the whole field two
193
+ * orders of magnitude under the ingest cap. Bounded here rather than trimmed
194
+ * downstream: HQ rejects an over-long list loudly instead of storing a quietly
195
+ * truncated one.
196
+ */
197
+ declare const BLOCKED_REASONS_MAX = 100;
198
+ declare const blockedReasonSchema: z.ZodObject<{
199
+ code: z.ZodString;
200
+ detail: z.ZodString;
259
201
  }, z.core.$strip>;
260
- declare const managedReadinessLedgerSchema: z.ZodObject<{
261
- baseSha: z.ZodString;
262
- blockingReasons: z.ZodArray<z.ZodString>;
263
- classification: z.ZodEnum<{
264
- "docs/process-only": "docs/process-only";
265
- trivial: "trivial";
266
- "non-trivial": "non-trivial";
267
- }>;
268
- externalChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
269
- checkType: z.ZodEnum<{
270
- review: "review";
271
- verify: "verify";
272
- }>;
273
- inScope: z.ZodBoolean;
274
- name: z.ZodString;
275
- reason: z.ZodOptional<z.ZodString>;
276
- scope: z.ZodOptional<z.ZodObject<{
277
- classifications: z.ZodArray<z.ZodEnum<{
278
- "docs/process-only": "docs/process-only";
279
- trivial: "trivial";
280
- "non-trivial": "non-trivial";
281
- }>>;
282
- }, z.core.$strict>>;
283
- scopeReason: z.ZodString;
284
- status: z.ZodEnum<{
285
- satisfied: "satisfied";
286
- unmet: "unmet";
287
- "out-of-scope": "out-of-scope";
288
- }>;
289
- }, z.core.$strip>>>;
290
- github: z.ZodObject<{
291
- draft: z.ZodBoolean;
292
- mergeStateStatus: z.ZodString;
293
- mergeable: z.ZodString;
294
- requiredChecks: z.ZodEnum<{
295
- unknown: "unknown";
296
- passed: "passed";
297
- failed: "failed";
298
- pending: "pending";
299
- none: "none";
300
- }>;
301
- reviewDecision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
302
- unresolvedReviewThreads: z.ZodNumber;
303
- }, z.core.$strip>;
304
- headSha: z.ZodString;
305
- mergeBaseSha: z.ZodOptional<z.ZodString>;
306
- patchId: z.ZodString;
307
- pr: z.ZodNumber;
308
- repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
309
- action: z.ZodString;
310
- code: z.ZodEnum<{
311
- "undraft-pr": "undraft-pr";
312
- "await-post-undraft-checks": "await-post-undraft-checks";
202
+ declare const blockedReasonsSchema: z.ZodArray<z.ZodObject<{
203
+ code: z.ZodString;
204
+ detail: z.ZodString;
205
+ }, z.core.$strip>>;
206
+ type BlockedReason = z.infer<typeof blockedReasonSchema>;
207
+ //#endregion
208
+ //#region src/boundary-review-proof.d.ts
209
+ declare const boundaryReviewProofBaseSchema: z.ZodObject<{
210
+ boundary: z.ZodString;
211
+ coveredSet: z.ZodArray<z.ZodObject<{
212
+ headSha: z.ZodOptional<z.ZodString>;
213
+ issue: z.ZodOptional<z.ZodNumber>;
214
+ mergedSha: z.ZodOptional<z.ZodString>;
215
+ pr: z.ZodNumber;
216
+ state: z.ZodEnum<{
217
+ merged: "merged";
218
+ open: "open";
313
219
  }>;
314
- command: z.ZodString;
315
- }, z.core.$strip>>>;
316
- reviewCycleState: z.ZodOptional<z.ZodObject<{
317
- autoBlockingFindings: z.ZodNumber;
318
- countsBySeverity: z.ZodObject<{
319
- critical: z.ZodNumber;
320
- high: z.ZodNumber;
321
- low: z.ZodNumber;
220
+ wave: z.ZodOptional<z.ZodString>;
221
+ }, z.core.$loose>>;
222
+ dispositions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
223
+ findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
224
+ blockingAfterCap: z.ZodOptional<z.ZodBoolean>;
225
+ category: z.ZodOptional<z.ZodString>;
226
+ disposition: z.ZodOptional<z.ZodString>;
227
+ title: z.ZodString;
228
+ }, z.core.$loose>>>;
229
+ kind: z.ZodLiteral<"boundary-review-proof">;
230
+ manifestHash: z.ZodObject<{
231
+ algo: z.ZodLiteral<"sha256">;
232
+ scope: z.ZodOptional<z.ZodString>;
233
+ value: z.ZodString;
234
+ }, z.core.$loose>;
235
+ outcome: z.ZodEnum<{
236
+ pass: "pass";
237
+ fail: "fail";
238
+ }>;
239
+ producer: z.ZodString;
240
+ rung: z.ZodEnum<{
241
+ "independent-model": "independent-model";
242
+ oracle: "oracle";
243
+ human: "human";
244
+ }>;
245
+ schemaVersion: z.ZodLiteral<1>;
246
+ sessionId: z.ZodOptional<z.ZodString>;
247
+ specHash: z.ZodOptional<z.ZodObject<{
248
+ algo: z.ZodLiteral<"sha256">;
249
+ scope: z.ZodOptional<z.ZodString>;
250
+ value: z.ZodString;
251
+ }, z.core.$loose>>;
252
+ }, z.core.$loose>;
253
+ type BoundaryReviewProof = z.infer<typeof boundaryReviewProofBaseSchema>;
254
+ //#endregion
255
+ //#region src/catch-up-recognition-record.d.ts
256
+ interface CatchUpRecognition {
257
+ /** The ref the candidate targets, as the recognizing command resolved it. */
258
+ baseRef: string;
259
+ /** The live target tip at recognition time; the head's first parent. */
260
+ baseTipSha: string;
261
+ /** The head's second parent: the admitted base-side content merged in. */
262
+ mergedParentSha: string;
263
+ /**
264
+ * The tree `git merge-tree --write-tree` produced for the two parents. It
265
+ * equals the head's own tree; that equality is the faithfulness proof.
266
+ */
267
+ mergedTreeSha: string;
268
+ /** The ref that proves the second parent is admitted content. */
269
+ upstreamRef: string;
270
+ }
271
+ //#endregion
272
+ //#region src/diff-classification.d.ts
273
+ declare const DIFF_CLASSIFICATIONS: readonly ["docs/process-only", "trivial", "non-trivial"];
274
+ type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
275
+ //#endregion
276
+ //#region src/impact-stamp.d.ts
277
+ /**
278
+ * The recorded stamp. `targets` satisfies the completeness invariant: every
279
+ * target the profile declares is present, each with its exact basis — never
280
+ * silently absent. `basis: "conservative"` means an unmodelled or unprovable
281
+ * input widened every target to full impact.
282
+ */
283
+ declare const impactStampSchema: z.ZodObject<{
284
+ basis: z.ZodEnum<{
285
+ "target-scoped": "target-scoped";
286
+ conservative: "conservative";
287
+ }>;
288
+ inertPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
289
+ reasons: z.ZodArray<z.ZodString>;
290
+ stampVersion: z.ZodLiteral<4>;
291
+ targets: z.ZodArray<z.ZodObject<{
292
+ basis: z.ZodString;
293
+ impact: z.ZodEnum<{
294
+ affected: "affected";
295
+ "not-affected": "not-affected";
296
+ }>;
297
+ name: z.ZodString;
298
+ subscribedPaths: z.ZodArray<z.ZodString>;
299
+ }, z.core.$strip>>;
300
+ unsubscribedPaths: z.ZodArray<z.ZodString>;
301
+ }, z.core.$strip>;
302
+ type ImpactStamp = z.infer<typeof impactStampSchema>;
303
+ //#endregion
304
+ //#region src/follow-up.d.ts
305
+ interface FollowUpAction {
306
+ /**
307
+ * Machine-safe argv-style array for the obvious next action, e.g.
308
+ * ["gh","pr","merge","513","--squash"]. Same shape and field name that
309
+ * `factory:delegate --print` emits, so an orchestrating agent can spawn the
310
+ * next command without reconstructing a shell string. argv[0] is the
311
+ * executable; the rest are literal, already-split arguments.
312
+ */
313
+ argv: string[];
314
+ /**
315
+ * Human-readable rendering of {@link argv} for logs and operators. Additive
316
+ * to argv, never a substitute for it — argv is the source of truth.
317
+ */
318
+ command: string;
319
+ }
320
+ //#endregion
321
+ //#region src/pr-verify-mode.d.ts
322
+ /**
323
+ * The verification mode `pr:verify` resolved for a run.
324
+ *
325
+ * Canonically declared here rather than inside `pr-readiness/` so that modules
326
+ * on either side of that boundary — the readiness proof shape and the durable
327
+ * check-run payload — can name the same union without importing each other.
328
+ */
329
+ type ResolvedPrVerifyMode = "docs-only" | "trivial" | "full";
330
+ //#endregion
331
+ //#region src/pr-readiness/readiness-ledger.d.ts
332
+ declare const readinessRepairSchema: z.ZodObject<{
333
+ action: z.ZodString;
334
+ code: z.ZodEnum<{
335
+ "undraft-pr": "undraft-pr";
336
+ "await-post-undraft-checks": "await-post-undraft-checks";
337
+ }>;
338
+ command: z.ZodString;
339
+ }, z.core.$strip>;
340
+ declare const managedReadinessLedgerSchema: z.ZodObject<{
341
+ baseSha: z.ZodString;
342
+ blockingReasons: z.ZodArray<z.ZodString>;
343
+ classification: z.ZodEnum<{
344
+ "docs/process-only": "docs/process-only";
345
+ trivial: "trivial";
346
+ "non-trivial": "non-trivial";
347
+ }>;
348
+ externalChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
349
+ checkType: z.ZodEnum<{
350
+ review: "review";
351
+ verify: "verify";
352
+ }>;
353
+ name: z.ZodString;
354
+ reason: z.ZodOptional<z.ZodString>;
355
+ scope: z.ZodOptional<z.ZodObject<{
356
+ classifications: z.ZodArray<z.ZodEnum<{
357
+ "docs/process-only": "docs/process-only";
358
+ trivial: "trivial";
359
+ "non-trivial": "non-trivial";
360
+ }>>;
361
+ }, z.core.$strict>>;
362
+ scopeReason: z.ZodString;
363
+ status: z.ZodEnum<{
364
+ satisfied: "satisfied";
365
+ unmet: "unmet";
366
+ "out-of-scope": "out-of-scope";
367
+ }>;
368
+ }, z.core.$strip>>>;
369
+ github: z.ZodObject<{
370
+ draft: z.ZodBoolean;
371
+ mergeStateStatus: z.ZodString;
372
+ mergeable: z.ZodString;
373
+ requiredChecks: z.ZodEnum<{
374
+ unknown: "unknown";
375
+ passed: "passed";
376
+ failed: "failed";
377
+ pending: "pending";
378
+ none: "none";
379
+ }>;
380
+ reviewDecision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
381
+ unresolvedReviewThreads: z.ZodNumber;
382
+ }, z.core.$strip>;
383
+ headSha: z.ZodString;
384
+ mergeBaseSha: z.ZodOptional<z.ZodString>;
385
+ patchId: z.ZodString;
386
+ pr: z.ZodNumber;
387
+ repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
388
+ action: z.ZodString;
389
+ code: z.ZodEnum<{
390
+ "undraft-pr": "undraft-pr";
391
+ "await-post-undraft-checks": "await-post-undraft-checks";
392
+ }>;
393
+ command: z.ZodString;
394
+ }, z.core.$strip>>>;
395
+ reviewCycleState: z.ZodOptional<z.ZodObject<{
396
+ autoBlockingFindings: z.ZodNumber;
397
+ countsBySeverity: z.ZodObject<{
398
+ critical: z.ZodNumber;
399
+ high: z.ZodNumber;
400
+ low: z.ZodNumber;
322
401
  medium: z.ZodNumber;
323
402
  unknown: z.ZodNumber;
324
403
  }, z.core.$strip>;
325
404
  highestBlockingSeverity: z.ZodOptional<z.ZodEnum<{
326
405
  unknown: "unknown";
406
+ critical: "critical";
407
+ high: "high";
327
408
  low: "low";
328
409
  medium: "medium";
329
- high: "high";
330
- critical: "critical";
331
410
  }>>;
332
411
  highestOpenSeverity: z.ZodOptional<z.ZodEnum<{
333
412
  unknown: "unknown";
413
+ critical: "critical";
414
+ high: "high";
334
415
  low: "low";
335
416
  medium: "medium";
336
- high: "high";
337
- critical: "critical";
338
417
  }>>;
339
418
  maxReviewCycles: z.ZodOptional<z.ZodNumber>;
340
419
  nonBlockingFindings: z.ZodNumber;
@@ -378,8 +457,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
378
457
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
379
458
  reviewedPatchId: z.ZodOptional<z.ZodString>;
380
459
  status: z.ZodEnum<{
381
- "not-required": "not-required";
382
460
  blocked: "blocked";
461
+ "not-required": "not-required";
383
462
  current: "current";
384
463
  stale: "stale";
385
464
  missing: "missing";
@@ -390,183 +469,111 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
390
469
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
391
470
  reviewedPatchId: z.ZodOptional<z.ZodString>;
392
471
  status: z.ZodEnum<{
393
- "not-required": "not-required";
394
472
  blocked: "blocked";
473
+ "not-required": "not-required";
395
474
  current: "current";
396
475
  stale: "stale";
397
476
  missing: "missing";
398
477
  }>;
399
478
  }, z.core.$strip>>;
400
479
  }, z.core.$strip>;
401
- schemaVersion: z.ZodLiteral<1>;
402
- verification: z.ZodObject<{
480
+ schemaVersion: z.ZodLiteral<2>;
481
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
403
482
  command: z.ZodLiteral<"patronage-factory pr:verify">;
404
- docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
405
- docsOnlyVerifiedHeadSha: z.ZodOptional<z.ZodString>;
406
- prVerify: z.ZodEnum<{
407
- passed: "passed";
408
- stale: "stale";
409
- missing: "missing";
410
- }>;
411
- trivialDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
412
- trivialVerifiedHeadSha: z.ZodOptional<z.ZodString>;
483
+ prVerify: z.ZodLiteral<"missing">;
484
+ }, z.core.$strict>, z.ZodObject<{
485
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
486
+ prVerify: z.ZodLiteral<"stale">;
487
+ verifiedHeadSha: z.ZodString;
488
+ }, z.core.$strict>, z.ZodObject<{
489
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
490
+ prVerify: z.ZodLiteral<"passed-via-head">;
491
+ verifiedHeadSha: z.ZodString;
492
+ }, z.core.$strict>, z.ZodObject<{
493
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
494
+ docsOnlyVerifiedHeadSha: z.ZodString;
495
+ prVerify: z.ZodLiteral<"docs-only-delta">;
413
496
  verifiedHeadSha: z.ZodOptional<z.ZodString>;
414
- }, z.core.$strip>;
497
+ }, z.core.$strict>, z.ZodObject<{
498
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
499
+ prVerify: z.ZodLiteral<"trivial-delta">;
500
+ trivialVerifiedHeadSha: z.ZodString;
501
+ verifiedHeadSha: z.ZodOptional<z.ZodString>;
502
+ }, z.core.$strict>], "prVerify">;
415
503
  }, z.core.$strip>;
416
504
  type ReadinessRepair = z.infer<typeof readinessRepairSchema>;
417
505
  type ReadinessStatus = "ready" | "blocked";
418
506
  type ManagedReadinessLedger = z.infer<typeof managedReadinessLedgerSchema>;
419
507
  //#endregion
420
- //#region src/pr-ready.d.ts
421
- interface PrReadyProof {
422
- schemaVersion: 3;
423
- /**
424
- * What GitHub actually did when this run armed native auto-merge (#477).
425
- * Present exactly when a ready wave authorizes machine merge and arming ran;
426
- * read back from the PR rather than inferred from the invocation, because `gh pr merge
427
- * --auto` arms, merges, or does nothing with the same exit code and the same
428
- * empty output. `not-armed` means the candidate is admitted but nothing will
429
- * merge it, and `followUp` carries the re-dispatch.
430
- */
431
- arming?: {
432
- detail?: string;
433
- headSha: string;
434
- outcome: "armed" | "merged" | "not-armed";
435
- };
436
- /**
437
- * Why this run blocked, one entry per refusing demand (#391): `code` is the
438
- * demand key from the resolver's vocabulary, `detail` the one-sentence
439
- * refusal. Same refusals as `blockingReasons`, in the same order — the
440
- * analyzable projection of a flat string list, so a wall of blocked proofs
441
- * on one PR can be counted by cause. Absent when nothing blocked.
442
- */
443
- blockedReasons?: BlockedReason[];
444
- blockingReasons: string[];
445
- humanBlockingReasons: string[];
446
- command: "patronage-factory pr:ready";
508
+ //#region src/pr-verify-proof-contract.d.ts
509
+ /**
510
+ * The pr:verify proof versions a reader accepts: the current one only (#920
511
+ * item 1). #917 narrowed the pr:ready reader the same way. A pr:verify proof
512
+ * is per-candidate and short-lived — it is rewritten on every head — so no
513
+ * stored v1–v3 proof can outlive the release that drops it. Pre-1.0 posture
514
+ * applies: one current contract, no compat reader. A consumer on an older
515
+ * factory must adopt this release before HQ ingests its pr:verify proofs.
516
+ */
517
+ declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [4];
518
+ type PrVerifySchemaVersion = (typeof SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS)[number];
519
+ interface PrVerifyCommandResult {
520
+ command: string;
521
+ description: string;
447
522
  /**
448
- * Machine-safe arg array for the obvious next action (#523): when `ready`
449
- * but arming did not take effect, a `pr:ready` re-dispatch (idempotent on
450
- * an unchanged head); otherwise the `gh pr ready` undraft repair or the
451
- * `pr:verify` re-run that the blocking reasons name (re-verify the head,
452
- * then re-run pr:ready). Same `argv` shape `factory:delegate --print`
453
- * emits. Optional and purely additive.
523
+ * Epic #550 wave 3 (#430): the profile's declared impact target for this
524
+ * command, recorded from v4 on. It is the proof's own command→target
525
+ * mapping: a `notRequiredCommands` entry must name the target recorded HERE
526
+ * for the same command, so a withholding cannot point at whichever released
527
+ * target happens to be convenient. Absent for a command the profile does
528
+ * not scope.
454
529
  */
455
- followUp?: FollowUpAction;
530
+ impactTarget?: string;
531
+ name: string;
532
+ scope: "docs-only" | "trivial" | "full";
533
+ }
534
+ /**
535
+ * One failing test a verification command reported (#1035).
536
+ *
537
+ * The proof keeps the failing test's IDENTITY and its failure CLASS, and
538
+ * nothing else. That is enough to decide retry-or-fix — a `timeout` under
539
+ * machine load is a flake, an `assertion` is a real break — without rerunning
540
+ * the aggregate to read a title off the console.
541
+ *
542
+ * It deliberately keeps no raw output tail and no error message body. This
543
+ * payload is transmitted to HQ ingest, and arbitrary command output can carry
544
+ * secrets (an echoed environment, a connection string inside a stack frame). A
545
+ * file path, a test title, and a closed `kind` enum cannot. The cost is the
546
+ * assertion diff and the stack frames: they help you FIX a failure, and the
547
+ * operator still reads them from the run's own console output.
548
+ */
549
+ interface PrVerifyTestFailure {
550
+ /** The test file the reporter named, as the reporter wrote it. */
551
+ file: string;
456
552
  /**
457
- * `ledger.headSha` is the evaluated head SHA: the GitHub `pr.headRefOid`
458
- * captured at evaluation time (not a local git read), recorded explicitly
459
- * so merge-time identity checks are a pure comparison against the live
460
- * pushed HEAD, not a re-derivation. See the ledger schema.
553
+ * The failure class. `timeout` is the test-timeout error vitest raises at
554
+ * its own ceiling; `assertion` is a failed expectation; `error` is every
555
+ * other thrown failure.
461
556
  */
462
- ledger: ManagedReadinessLedger;
557
+ kind: "assertion" | "error" | "timeout";
558
+ /** The full test title, suite names included, as the reporter wrote it. */
559
+ title: string;
560
+ }
561
+ interface PrVerifyExecutedCommand {
562
+ command: string;
563
+ counts?: {
564
+ testFiles?: number;
565
+ tests?: number;
566
+ };
567
+ durationMs: number;
568
+ exitCode: number;
463
569
  /**
464
- * Actionable facts that did not block (#477): a settling merge-freeze
465
- * generation that permitted readiness and any authorized arming with a
466
- * notice, an admitted-but-unscheduled false boundary wave, and how each
467
- * waived demand reads to a human. Absent when there are none.
570
+ * The failing tests this command reported (#1035). Present only when the
571
+ * command produced parseable failures, so a passing command's record is
572
+ * byte-identical to the one it wrote before this field existed.
468
573
  */
469
- notices?: string[];
470
- /** Committed profile blob evaluated by readiness. Required for merge. */
471
- profileBlobSha?: string;
472
- /** Checkout-relative committed profile path evaluated by readiness. */
473
- profilePath?: string;
474
- repairs: ReadinessRepair[];
475
- /** Trusted checkout repository used for all GitHub reads and writes. */
476
- repository?: string;
477
- status: ReadinessStatus;
478
- /**
479
- * Demands that were in force, were NOT met, and were waived by the operator
480
- * (#354, moved here from the merge-time proof by #477). Each entry carries
481
- * the demand's refusals verbatim, so a waived demand can never read as a met
482
- * one; readiness proceeds on the recorded operator act, not on evidence.
483
- */
484
- waivedDemands?: WaivedDemand[];
485
- }
486
- //#endregion
487
- //#region src/impact-stamp.d.ts
488
- /**
489
- * The recorded stamp. `targets` satisfies the completeness invariant: every
490
- * target the profile declares is present, each with its exact basis — never
491
- * silently absent. `basis: "conservative"` means an unmodelled or unprovable
492
- * input widened every target to full impact.
493
- */
494
- declare const impactStampSchema: z.ZodObject<{
495
- basis: z.ZodEnum<{
496
- "target-scoped": "target-scoped";
497
- conservative: "conservative";
498
- }>;
499
- reasons: z.ZodArray<z.ZodString>;
500
- stampVersion: z.ZodLiteral<2>;
501
- targets: z.ZodArray<z.ZodObject<{
502
- basis: z.ZodString;
503
- impact: z.ZodEnum<{
504
- affected: "affected";
505
- "not-affected": "not-affected";
506
- }>;
507
- name: z.ZodString;
508
- }, z.core.$strip>>;
509
- }, z.core.$strip>;
510
- type ImpactStamp = z.infer<typeof impactStampSchema>;
511
- //#endregion
512
- //#region src/pr-readiness/external-evidence.d.ts
513
- declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
514
- check: z.ZodString;
515
- checkType: z.ZodEnum<{
516
- review: "review";
517
- verify: "verify";
518
- }>;
519
- findingsPointer: z.ZodOptional<z.ZodString>;
520
- headSha: z.ZodString;
521
- mergeBaseSha: z.ZodString;
522
- model: z.ZodOptional<z.ZodString>;
523
- outcome: z.ZodEnum<{
524
- pass: "pass";
525
- fail: "fail";
526
- }>;
527
- patchId: z.ZodString;
528
- policyVersion: z.ZodOptional<z.ZodString>;
529
- producer: z.ZodString;
530
- requestId: z.ZodOptional<z.ZodString>;
531
- rung: z.ZodOptional<z.ZodEnum<{
532
- "independent-model": "independent-model";
533
- oracle: "oracle";
534
- human: "human";
535
- }>>;
536
- schemaVersion: z.ZodLiteral<1>;
537
- sessionId: z.ZodOptional<z.ZodString>;
538
- timestamp: z.ZodOptional<z.ZodISODateTime>;
539
- }, z.core.$loose>;
540
- type EvidenceEnvelope = z.infer<typeof evidenceEnvelopeBaseSchema>;
541
- //#endregion
542
- //#region src/pr-readiness/verification-proof.d.ts
543
- declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS$1: readonly [1, 2, 3, 4];
544
- type PrVerifySchemaVersion = (typeof SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS$1)[number];
545
- interface PrVerifyCommandResult {
546
- command: string;
547
- description: string;
548
- /**
549
- * Epic #550 wave 3 (#430): the profile's declared impact target for this
550
- * command, recorded from v4 on. It is the proof's own command→target
551
- * mapping: a `notRequiredCommands` entry must name the target recorded HERE
552
- * for the same command, so a withholding cannot point at whichever released
553
- * target happens to be convenient. Absent for a command the profile does
554
- * not scope, and for v1–v3 proofs, which predate the field.
555
- */
556
- impactTarget?: string;
557
- name: string;
558
- scope: "always" | "docs-only" | "trivial" | "full";
559
- }
560
- interface PrVerifyExecutedCommand {
561
- command: string;
562
- counts?: {
563
- testFiles?: number;
564
- tests?: number;
565
- };
566
- durationMs: number;
567
- exitCode: number;
574
+ failures?: PrVerifyTestFailure[];
568
575
  name: string;
569
- scope: "always" | "docs-only" | "trivial" | "full";
576
+ scope: "docs-only" | "trivial" | "full";
570
577
  }
571
578
  /**
572
579
  * Epic #550 wave 3 (#430): a verification command the impact stamp proved this
@@ -583,9 +590,18 @@ interface PrVerifyNotRequiredCommand {
583
590
  impactTarget: string;
584
591
  name: string;
585
592
  }
593
+ /**
594
+ * Epic #758 (#762): a consumer package a stamp-scoped selection skipped, and
595
+ * why. Bound to the proof's stamp identity — refused when the proof records no
596
+ * stamp. The factory does not write this list; consumers do.
597
+ */
598
+ interface PrVerifyNotDemandedRecord {
599
+ basis: string;
600
+ name: string;
601
+ }
586
602
  interface PrVerifyProof {
587
603
  schemaVersion: PrVerifySchemaVersion;
588
- authoringSession?: string;
604
+ authoringSession: string;
589
605
  base: string;
590
606
  baselineFullProofs?: {
591
607
  base: string;
@@ -595,6 +611,7 @@ interface PrVerifyProof {
595
611
  projectKey: string;
596
612
  repository: string;
597
613
  }[];
614
+ catchUpRecognition?: CatchUpRecognition;
598
615
  changedFiles: string[];
599
616
  classification: DiffClassification;
600
617
  classificationReasons: string[];
@@ -606,724 +623,28 @@ interface PrVerifyProof {
606
623
  impactStamp?: ImpactStamp;
607
624
  mode: ResolvedPrVerifyMode;
608
625
  mergeBaseSha?: string;
626
+ notDemandedRecords?: PrVerifyNotDemandedRecord[];
609
627
  notRequiredCommands?: PrVerifyNotRequiredCommand[];
610
628
  outcome?: "aborted" | "passed";
611
629
  patchId?: string;
612
- profilePath: string;
613
- projectKey: string;
614
- repository: string;
615
- startedAt: string;
616
- verificationCommands: PrVerifyCommandResult[];
617
- }
618
- //#endregion
619
- //#region src/closeout-artifact.d.ts
620
- /** Current writer plus retained reader versions accepted at ingest. */
621
- declare const SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS: readonly [3, 4];
622
- /** Strict, bounded runtime transport contract emitted by factory:closeout. */
623
- declare const closeoutArtifactSchema: z.ZodObject<{
624
- boundaryThermo: z.ZodObject<{
625
- owner: z.ZodString;
626
- runs: z.ZodNumber;
627
- waived: z.ZodBoolean;
628
- waiverRationale: z.ZodOptional<z.ZodString>;
629
- }, z.core.$strict>;
630
- budget: z.ZodObject<{
631
- note: z.ZodString;
632
- tier: z.ZodLiteral<"overseer">;
633
- }, z.core.$strict> | z.ZodObject<{
634
- interiorSourcesConsumed: z.ZodNumber;
635
- note: z.ZodString;
636
- scoping: z.ZodOptional<z.ZodObject<{
637
- epic: z.ZodString;
638
- issueFilter: z.ZodOptional<z.ZodNumber>;
639
- prFilter: z.ZodOptional<z.ZodNumber>;
640
- repo: z.ZodString;
641
- scopedByEpicIssueSet: z.ZodBoolean;
642
- window: z.ZodObject<{
643
- from: z.ZodString;
644
- to: z.ZodString;
645
- }, z.core.$strict>;
646
- }, z.core.$strict>>;
647
- tier: z.ZodLiteral<"overseer">;
648
- }, z.core.$strict>;
649
- couldNotSee: z.ZodArray<z.ZodObject<{
650
- id: z.ZodString;
651
- note: z.ZodString;
652
- reason: z.ZodOptional<z.ZodString>;
653
- }, z.core.$strict>>;
654
- epic: z.ZodString;
655
- generatedAt: z.ZodISODateTime;
656
- ledgerRows: z.ZodArray<z.ZodObject<{
657
- detail: z.ZodOptional<z.ZodString>;
658
- epic: z.ZodString;
659
- generatedAt: z.ZodISODateTime;
660
- key: z.ZodString;
661
- landingSpot: z.ZodOptional<z.ZodEnum<{
662
- CLI: "CLI";
663
- profile: "profile";
664
- skill: "skill";
665
- ADR: "ADR";
666
- }>>;
667
- repo: z.ZodString;
668
- rowType: z.ZodEnum<{
669
- metric: "metric";
670
- lesson: "lesson";
671
- blindspot: "blindspot";
672
- }>;
673
- schemaVersion: z.ZodLiteral<3 | 4>;
674
- source: z.ZodString;
675
- unit: z.ZodOptional<z.ZodString>;
676
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
677
- }, z.core.$strict>>;
678
- lessons: z.ZodArray<z.ZodObject<{
679
- id: z.ZodString;
680
- landingSpot: z.ZodEnum<{
681
- CLI: "CLI";
682
- profile: "profile";
683
- skill: "skill";
684
- ADR: "ADR";
685
- }>;
686
- lesson: z.ZodString;
687
- rationale: z.ZodOptional<z.ZodString>;
688
- source: z.ZodOptional<z.ZodObject<{
689
- detail: z.ZodString;
690
- kind: z.ZodLiteral<"boundary-thermo-attestation">;
691
- }, z.core.$strict>>;
692
- }, z.core.$strict> | z.ZodObject<{
693
- id: z.ZodString;
694
- landingSpot: z.ZodEnum<{
695
- CLI: "CLI";
696
- profile: "profile";
697
- skill: "skill";
698
- ADR: "ADR";
699
- }>;
700
- lesson: z.ZodString;
701
- rationale: z.ZodOptional<z.ZodString>;
702
- source: z.ZodOptional<z.ZodObject<{
703
- detail: z.ZodString;
704
- kind: z.ZodEnum<{
705
- "boundary-thermo-attestation": "boundary-thermo-attestation";
706
- "interior-telemetry": "interior-telemetry";
707
- }>;
708
- }, z.core.$strict>>;
709
- }, z.core.$strict>>;
710
- metrics: z.ZodArray<z.ZodObject<{
711
- label: z.ZodString;
712
- metric: z.ZodString;
713
- source: z.ZodObject<{
714
- detail: z.ZodString;
715
- kind: z.ZodLiteral<"boundary-thermo-attestation">;
716
- }, z.core.$strict>;
717
- unit: z.ZodEnum<{
718
- boolean: "boolean";
719
- text: "text";
720
- count: "count";
721
- }>;
722
- value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
723
- }, z.core.$strict> | z.ZodObject<{
724
- label: z.ZodString;
725
- metric: z.ZodString;
726
- source: z.ZodObject<{
727
- detail: z.ZodString;
728
- kind: z.ZodEnum<{
729
- "boundary-thermo-attestation": "boundary-thermo-attestation";
730
- "interior-telemetry": "interior-telemetry";
731
- }>;
732
- }, z.core.$strict>;
733
- unit: z.ZodEnum<{
734
- boolean: "boolean";
735
- text: "text";
736
- count: "count";
737
- tokens: "tokens";
738
- usd: "usd";
739
- ratio: "ratio";
740
- }>;
741
- value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
742
- }, z.core.$strict>>;
743
- repo: z.ZodString;
744
- schemaVersion: z.ZodLiteral<3 | 4>;
745
- }, z.core.$strict>;
746
- /** Reader-only compatibility for closeout artifacts written before #554. */
747
- declare const legacyCloseoutArtifactSchema: z.ZodObject<{
748
- boundaryThermo: z.ZodObject<{
749
- owner: z.ZodString;
750
- runs: z.ZodNumber;
751
- waived: z.ZodBoolean;
752
- waiverRationale: z.ZodOptional<z.ZodString>;
753
- }, z.core.$strict>;
754
- budget: z.ZodObject<{
755
- note: z.ZodString;
756
- tier: z.ZodLiteral<"overseer">;
757
- }, z.core.$strict> | z.ZodObject<{
758
- interiorSourcesConsumed: z.ZodNumber;
759
- note: z.ZodString;
760
- scoping: z.ZodOptional<z.ZodObject<{
761
- epic: z.ZodString;
762
- issueFilter: z.ZodOptional<z.ZodNumber>;
763
- prFilter: z.ZodOptional<z.ZodNumber>;
764
- repo: z.ZodString;
765
- scopedByEpicIssueSet: z.ZodBoolean;
766
- window: z.ZodObject<{
767
- from: z.ZodString;
768
- to: z.ZodString;
769
- }, z.core.$strict>;
770
- }, z.core.$strict>>;
771
- tier: z.ZodLiteral<"overseer">;
772
- }, z.core.$strict>;
773
- couldNotSee: z.ZodArray<z.ZodObject<{
774
- id: z.ZodString;
775
- note: z.ZodString;
776
- reason: z.ZodOptional<z.ZodString>;
777
- }, z.core.$strict>>;
778
- epic: z.ZodString;
779
- generatedAt: z.ZodISODateTime;
780
- ledgerRows: z.ZodArray<z.ZodObject<{
781
- detail: z.ZodOptional<z.ZodString>;
782
- epic: z.ZodString;
783
- generatedAt: z.ZodISODateTime;
784
- key: z.ZodString;
785
- landingSpot: z.ZodOptional<z.ZodEnum<{
786
- CLI: "CLI";
787
- profile: "profile";
788
- skill: "skill";
789
- ADR: "ADR";
790
- }>>;
791
- repo: z.ZodString;
792
- rowType: z.ZodEnum<{
793
- metric: "metric";
794
- lesson: "lesson";
795
- blindspot: "blindspot";
796
- }>;
797
- schemaVersion: z.ZodLiteral<3 | 4>;
798
- source: z.ZodString;
799
- unit: z.ZodOptional<z.ZodString>;
800
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
801
- }, z.core.$strict>>;
802
- lessons: z.ZodArray<z.ZodObject<{
803
- id: z.ZodString;
804
- landingSpot: z.ZodEnum<{
805
- CLI: "CLI";
806
- profile: "profile";
807
- skill: "skill";
808
- ADR: "ADR";
809
- }>;
810
- lesson: z.ZodString;
811
- rationale: z.ZodOptional<z.ZodString>;
812
- source: z.ZodOptional<z.ZodObject<{
813
- detail: z.ZodString;
814
- kind: z.ZodLiteral<"boundary-thermo-attestation">;
815
- }, z.core.$strict>>;
816
- }, z.core.$strict> | z.ZodObject<{
817
- id: z.ZodString;
818
- landingSpot: z.ZodEnum<{
819
- CLI: "CLI";
820
- profile: "profile";
821
- skill: "skill";
822
- ADR: "ADR";
823
- }>;
824
- lesson: z.ZodString;
825
- rationale: z.ZodOptional<z.ZodString>;
826
- source: z.ZodOptional<z.ZodObject<{
827
- detail: z.ZodString;
828
- kind: z.ZodEnum<{
829
- "boundary-thermo-attestation": "boundary-thermo-attestation";
830
- "interior-telemetry": "interior-telemetry";
831
- }>;
832
- }, z.core.$strict>>;
833
- }, z.core.$strict>>;
834
- metrics: z.ZodArray<z.ZodObject<{
835
- label: z.ZodString;
836
- metric: z.ZodString;
837
- source: z.ZodObject<{
838
- detail: z.ZodString;
839
- kind: z.ZodLiteral<"boundary-thermo-attestation">;
840
- }, z.core.$strict>;
841
- unit: z.ZodEnum<{
842
- boolean: "boolean";
843
- text: "text";
844
- count: "count";
845
- }>;
846
- value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
847
- }, z.core.$strict> | z.ZodObject<{
848
- label: z.ZodString;
849
- metric: z.ZodString;
850
- source: z.ZodObject<{
851
- detail: z.ZodString;
852
- kind: z.ZodEnum<{
853
- "boundary-thermo-attestation": "boundary-thermo-attestation";
854
- "interior-telemetry": "interior-telemetry";
855
- }>;
856
- }, z.core.$strict>;
857
- unit: z.ZodEnum<{
858
- boolean: "boolean";
859
- text: "text";
860
- count: "count";
861
- tokens: "tokens";
862
- usd: "usd";
863
- ratio: "ratio";
864
- }>;
865
- value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
866
- }, z.core.$strict>>;
867
- repo: z.ZodString;
868
- schemaVersion: z.ZodLiteral<3 | 4>;
869
- }, z.core.$strict>;
870
- /** Accept current output and retained v3 artifacts when reading or replaying. */
871
- declare const closeoutArtifactReadSchema: z.ZodUnion<readonly [z.ZodObject<{
872
- boundaryThermo: z.ZodObject<{
873
- owner: z.ZodString;
874
- runs: z.ZodNumber;
875
- waived: z.ZodBoolean;
876
- waiverRationale: z.ZodOptional<z.ZodString>;
877
- }, z.core.$strict>;
878
- budget: z.ZodObject<{
879
- note: z.ZodString;
880
- tier: z.ZodLiteral<"overseer">;
881
- }, z.core.$strict> | z.ZodObject<{
882
- interiorSourcesConsumed: z.ZodNumber;
883
- note: z.ZodString;
884
- scoping: z.ZodOptional<z.ZodObject<{
885
- epic: z.ZodString;
886
- issueFilter: z.ZodOptional<z.ZodNumber>;
887
- prFilter: z.ZodOptional<z.ZodNumber>;
888
- repo: z.ZodString;
889
- scopedByEpicIssueSet: z.ZodBoolean;
890
- window: z.ZodObject<{
891
- from: z.ZodString;
892
- to: z.ZodString;
893
- }, z.core.$strict>;
894
- }, z.core.$strict>>;
895
- tier: z.ZodLiteral<"overseer">;
896
- }, z.core.$strict>;
897
- couldNotSee: z.ZodArray<z.ZodObject<{
898
- id: z.ZodString;
899
- note: z.ZodString;
900
- reason: z.ZodOptional<z.ZodString>;
901
- }, z.core.$strict>>;
902
- epic: z.ZodString;
903
- generatedAt: z.ZodISODateTime;
904
- ledgerRows: z.ZodArray<z.ZodObject<{
905
- detail: z.ZodOptional<z.ZodString>;
906
- epic: z.ZodString;
907
- generatedAt: z.ZodISODateTime;
908
- key: z.ZodString;
909
- landingSpot: z.ZodOptional<z.ZodEnum<{
910
- CLI: "CLI";
911
- profile: "profile";
912
- skill: "skill";
913
- ADR: "ADR";
914
- }>>;
915
- repo: z.ZodString;
916
- rowType: z.ZodEnum<{
917
- metric: "metric";
918
- lesson: "lesson";
919
- blindspot: "blindspot";
920
- }>;
921
- schemaVersion: z.ZodLiteral<3 | 4>;
922
- source: z.ZodString;
923
- unit: z.ZodOptional<z.ZodString>;
924
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
925
- }, z.core.$strict>>;
926
- lessons: z.ZodArray<z.ZodObject<{
927
- id: z.ZodString;
928
- landingSpot: z.ZodEnum<{
929
- CLI: "CLI";
930
- profile: "profile";
931
- skill: "skill";
932
- ADR: "ADR";
933
- }>;
934
- lesson: z.ZodString;
935
- rationale: z.ZodOptional<z.ZodString>;
936
- source: z.ZodOptional<z.ZodObject<{
937
- detail: z.ZodString;
938
- kind: z.ZodLiteral<"boundary-thermo-attestation">;
939
- }, z.core.$strict>>;
940
- }, z.core.$strict> | z.ZodObject<{
941
- id: z.ZodString;
942
- landingSpot: z.ZodEnum<{
943
- CLI: "CLI";
944
- profile: "profile";
945
- skill: "skill";
946
- ADR: "ADR";
947
- }>;
948
- lesson: z.ZodString;
949
- rationale: z.ZodOptional<z.ZodString>;
950
- source: z.ZodOptional<z.ZodObject<{
951
- detail: z.ZodString;
952
- kind: z.ZodEnum<{
953
- "boundary-thermo-attestation": "boundary-thermo-attestation";
954
- "interior-telemetry": "interior-telemetry";
955
- }>;
956
- }, z.core.$strict>>;
957
- }, z.core.$strict>>;
958
- metrics: z.ZodArray<z.ZodObject<{
959
- label: z.ZodString;
960
- metric: z.ZodString;
961
- source: z.ZodObject<{
962
- detail: z.ZodString;
963
- kind: z.ZodLiteral<"boundary-thermo-attestation">;
964
- }, z.core.$strict>;
965
- unit: z.ZodEnum<{
966
- boolean: "boolean";
967
- text: "text";
968
- count: "count";
969
- }>;
970
- value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
971
- }, z.core.$strict> | z.ZodObject<{
972
- label: z.ZodString;
973
- metric: z.ZodString;
974
- source: z.ZodObject<{
975
- detail: z.ZodString;
976
- kind: z.ZodEnum<{
977
- "boundary-thermo-attestation": "boundary-thermo-attestation";
978
- "interior-telemetry": "interior-telemetry";
979
- }>;
980
- }, z.core.$strict>;
981
- unit: z.ZodEnum<{
982
- boolean: "boolean";
983
- text: "text";
984
- count: "count";
985
- tokens: "tokens";
986
- usd: "usd";
987
- ratio: "ratio";
988
- }>;
989
- value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
990
- }, z.core.$strict>>;
991
- repo: z.ZodString;
992
- schemaVersion: z.ZodLiteral<3 | 4>;
993
- }, z.core.$strict>, z.ZodObject<{
994
- boundaryThermo: z.ZodObject<{
995
- owner: z.ZodString;
996
- runs: z.ZodNumber;
997
- waived: z.ZodBoolean;
998
- waiverRationale: z.ZodOptional<z.ZodString>;
999
- }, z.core.$strict>;
1000
- budget: z.ZodObject<{
1001
- note: z.ZodString;
1002
- tier: z.ZodLiteral<"overseer">;
1003
- }, z.core.$strict> | z.ZodObject<{
1004
- interiorSourcesConsumed: z.ZodNumber;
1005
- note: z.ZodString;
1006
- scoping: z.ZodOptional<z.ZodObject<{
1007
- epic: z.ZodString;
1008
- issueFilter: z.ZodOptional<z.ZodNumber>;
1009
- prFilter: z.ZodOptional<z.ZodNumber>;
1010
- repo: z.ZodString;
1011
- scopedByEpicIssueSet: z.ZodBoolean;
1012
- window: z.ZodObject<{
1013
- from: z.ZodString;
1014
- to: z.ZodString;
1015
- }, z.core.$strict>;
1016
- }, z.core.$strict>>;
1017
- tier: z.ZodLiteral<"overseer">;
1018
- }, z.core.$strict>;
1019
- couldNotSee: z.ZodArray<z.ZodObject<{
1020
- id: z.ZodString;
1021
- note: z.ZodString;
1022
- reason: z.ZodOptional<z.ZodString>;
1023
- }, z.core.$strict>>;
1024
- epic: z.ZodString;
1025
- generatedAt: z.ZodISODateTime;
1026
- ledgerRows: z.ZodArray<z.ZodObject<{
1027
- detail: z.ZodOptional<z.ZodString>;
1028
- epic: z.ZodString;
1029
- generatedAt: z.ZodISODateTime;
1030
- key: z.ZodString;
1031
- landingSpot: z.ZodOptional<z.ZodEnum<{
1032
- CLI: "CLI";
1033
- profile: "profile";
1034
- skill: "skill";
1035
- ADR: "ADR";
1036
- }>>;
1037
- repo: z.ZodString;
1038
- rowType: z.ZodEnum<{
1039
- metric: "metric";
1040
- lesson: "lesson";
1041
- blindspot: "blindspot";
1042
- }>;
1043
- schemaVersion: z.ZodLiteral<3 | 4>;
1044
- source: z.ZodString;
1045
- unit: z.ZodOptional<z.ZodString>;
1046
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
1047
- }, z.core.$strict>>;
1048
- lessons: z.ZodArray<z.ZodObject<{
1049
- id: z.ZodString;
1050
- landingSpot: z.ZodEnum<{
1051
- CLI: "CLI";
1052
- profile: "profile";
1053
- skill: "skill";
1054
- ADR: "ADR";
1055
- }>;
1056
- lesson: z.ZodString;
1057
- rationale: z.ZodOptional<z.ZodString>;
1058
- source: z.ZodOptional<z.ZodObject<{
1059
- detail: z.ZodString;
1060
- kind: z.ZodLiteral<"boundary-thermo-attestation">;
1061
- }, z.core.$strict>>;
1062
- }, z.core.$strict> | z.ZodObject<{
1063
- id: z.ZodString;
1064
- landingSpot: z.ZodEnum<{
1065
- CLI: "CLI";
1066
- profile: "profile";
1067
- skill: "skill";
1068
- ADR: "ADR";
1069
- }>;
1070
- lesson: z.ZodString;
1071
- rationale: z.ZodOptional<z.ZodString>;
1072
- source: z.ZodOptional<z.ZodObject<{
1073
- detail: z.ZodString;
1074
- kind: z.ZodEnum<{
1075
- "boundary-thermo-attestation": "boundary-thermo-attestation";
1076
- "interior-telemetry": "interior-telemetry";
1077
- }>;
1078
- }, z.core.$strict>>;
1079
- }, z.core.$strict>>;
1080
- metrics: z.ZodArray<z.ZodObject<{
1081
- label: z.ZodString;
1082
- metric: z.ZodString;
1083
- source: z.ZodObject<{
1084
- detail: z.ZodString;
1085
- kind: z.ZodLiteral<"boundary-thermo-attestation">;
1086
- }, z.core.$strict>;
1087
- unit: z.ZodEnum<{
1088
- boolean: "boolean";
1089
- text: "text";
1090
- count: "count";
1091
- }>;
1092
- value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
1093
- }, z.core.$strict> | z.ZodObject<{
1094
- label: z.ZodString;
1095
- metric: z.ZodString;
1096
- source: z.ZodObject<{
1097
- detail: z.ZodString;
1098
- kind: z.ZodEnum<{
1099
- "boundary-thermo-attestation": "boundary-thermo-attestation";
1100
- "interior-telemetry": "interior-telemetry";
1101
- }>;
1102
- }, z.core.$strict>;
1103
- unit: z.ZodEnum<{
1104
- boolean: "boolean";
1105
- text: "text";
1106
- count: "count";
1107
- tokens: "tokens";
1108
- usd: "usd";
1109
- ratio: "ratio";
1110
- }>;
1111
- value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
1112
- }, z.core.$strict>>;
1113
- repo: z.ZodString;
1114
- schemaVersion: z.ZodLiteral<3 | 4>;
1115
- }, z.core.$strict>]>;
1116
- type CloseoutArtifact = z.infer<typeof closeoutArtifactSchema>;
1117
- type HistoricalCloseoutArtifact = z.infer<typeof legacyCloseoutArtifactSchema>;
1118
- //#endregion
1119
- //#region src/retro-envelope.d.ts
1120
- /**
1121
- * Versioned retro envelope schema (epic #27 wave 2, issue #34).
1122
- *
1123
- * One envelope per lane, built at `factory:closeout` and delivered through the
1124
- * typed gate-sink as the `retro-envelope` ingest kind. Re-derived in TypeScript
1125
- * from the `spike/telemetry-layer2` S5 scratch schema (reference-only, never
1126
- * merged). This module is the single source of truth for the v1 wire shape
1127
- * and its bounds ({@link RETRO_ENVELOPE_WIRE_BOUNDS}) — producer and consumer
1128
- * alike. HQ imports these exports directly from the Worker-safe
1129
- * `@patronage/software-factory/schemas` subpath
1130
- * (`software-factory-hq/src/contracts/retro-schemas.ts`) instead of
1131
- * maintaining a parallel hand-written copy, so there is exactly one wire
1132
- * contract and no drift-detection machinery is needed (issue #350; formerly
1133
- * a hand-written twin plus a 767-line parity test, #46).
1134
- *
1135
- * DESIGN INVARIANT: cross-family token sums must be UNREPRESENTABLE.
1136
- *
1137
- * The two model families use different tokenizers, prices, and accounting
1138
- * conventions, so any token total that spans Claude and GPT is a lie:
1139
- *
1140
- * 1. There is no combined/total token field anywhere in the envelope.
1141
- * 2. `tokenFamilies` is strict — its only keys are `claude` and `gpt`; data
1142
- * cannot smuggle in a third "all"/"combined" slot.
1143
- * 3. The family BLOCKS are structurally different shapes with DIFFERENT keys
1144
- * (claude is a single flat block keyed on freshInput/cacheReadInput/
1145
- * cacheCreationInput; gpt is `{ roles: [...] }`). The exclusive input-tier
1146
- * COUNTS share no key name across families. The residual names shared
1147
- * between the claude block and a gpt ROLE entry are pinned to exactly
1148
- * {costUsd, model, output} (PR #32 advisory): `costUsd` is deliberate —
1149
- * USD is the one cross-family summable unit (rule 4); `model` is an
1150
- * unsummable label; `output` is the same name at DIFFERENT depths (lane
1151
- * block vs per-role entry), frozen by a tripwire test in
1152
- * `retro-envelope.test.ts` so the overlap cannot grow. Renaming `output`
1153
- * is a schemaVersion-2 wire change, deliberately not spent in v1.
1154
- * 4. Cost is per-family USD and nullable. Combined totals are allowed in USD
1155
- * only, and only as a projection-time sum of per-family USD.
1156
- *
1157
- * Field names also encode the S2/S3 reader lessons: Claude `freshInput` alone
1158
- * is not prompt size (true input context = freshInput + cacheReadInput +
1159
- * cacheCreationInput, requestId-deduped), and codex `inputInclusiveOfCache`
1160
- * already includes `cachedInput`, so `freshInputDerived` (inclusive − cached)
1161
- * is the only value safe to feed a per-token pricer.
1162
- *
1163
- * COMPLETENESS POSTURE: harvest may have no usable native log for a lane, so
1164
- * `tokenFamilies` may legitimately be absent. The closeout build gate demands
1165
- * a valid envelope, not available telemetry. A families-absent envelope keeps
1166
- * its operator-visible data gaps and is a replayable advisory HQ event, so it
1167
- * never substitutes unavailable usage with zero. The wire shape (field names,
1168
- * types, structure) stays byte-parity with HQ v1.
1169
- */
1170
- declare const RETRO_ENVELOPE_SCHEMA_VERSION = 1;
1171
- /**
1172
- * v1 wire bounds — the single source the schemas below are built from and the
1173
- * builder's sanitization seam clamps to (`retro-envelope-builder.ts` imports
1174
- * these; it keeps no bound constants of its own). HQ imports this module
1175
- * directly (issue #350), so there is one set of bounds, not a second copy to
1176
- * keep in sync.
1177
- */
1178
- declare const RETRO_ENVELOPE_WIRE_BOUNDS: {
1179
- /** archiveRef pointer (key/URL) max characters. */readonly archiveRefMaxChars: 2048; /** refs.branch max characters (git ref length ceiling). */
1180
- readonly branchMaxChars: 255; /** gates[] wire cap — the builder keeps the most recent records. */
1181
- readonly gatesMax: 500; /** gpt roles[] cap (delegated roles per lane). */
1182
- readonly gptRolesMax: 20; /** Cap for list fields: joinKeys id arrays, phases, dataGaps. */
1183
- readonly listMax: 100; /** Bounded name fields: agentRunId, gate, phase name, refs, join-key ids. */
1184
- readonly nameMaxChars: 200; /** Short identifier fields: repo name/owner, model, role. */
1185
- readonly shortMaxChars: 100; /** Free-text fields: dataGaps entries, outcome.verdict. */
1186
- readonly textMaxChars: 500;
1187
- };
1188
- declare const retroEnvelopeV1Schema: z.ZodObject<{
1189
- agentRunId: z.ZodString;
1190
- archiveRef: z.ZodOptional<z.ZodString>;
1191
- cycles: z.ZodObject<{
1192
- gateRunsToFirstGreen: z.ZodNumber;
1193
- reviewerFixRounds: z.ZodNumber;
1194
- thermoFixRounds: z.ZodNumber;
1195
- }, z.core.$strict>;
1196
- dataGaps: z.ZodDefault<z.ZodArray<z.ZodString>>;
1197
- gates: z.ZodArray<z.ZodObject<{
1198
- cycle: z.ZodNumber;
1199
- duration: z.ZodNumber;
1200
- gate: z.ZodString;
1201
- outcome: z.ZodEnum<{
1202
- pass: "pass";
1203
- fail: "fail";
1204
- skip: "skip";
1205
- }>;
1206
- startedAt: z.ZodISODateTime;
1207
- }, z.core.$strict>>;
1208
- generatedAt: z.ZodISODateTime;
1209
- interventions: z.ZodObject<{
1210
- count: z.ZodNumber;
1211
- }, z.core.$strict>;
1212
- joinKeys: z.ZodObject<{
1213
- claudeSessionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
1214
- codexThreadIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
1215
- }, z.core.$strict>;
1216
- kind: z.ZodLiteral<"retro-envelope">;
1217
- outcome: z.ZodOptional<z.ZodObject<{
1218
- status: z.ZodEnum<{
1219
- fail: "fail";
1220
- success: "success";
1221
- blocked: "blocked";
1222
- "ship-with-followups": "ship-with-followups";
1223
- }>;
1224
- verdict: z.ZodOptional<z.ZodString>;
1225
- }, z.core.$strict>>;
1226
- phases: z.ZodArray<z.ZodObject<{
1227
- at: z.ZodISODateTime;
1228
- deltaSec: z.ZodOptional<z.ZodNumber>;
1229
- name: z.ZodString;
1230
- }, z.core.$strict>>;
1231
- refs: z.ZodObject<{
1232
- branch: z.ZodOptional<z.ZodString>;
1233
- epic: z.ZodOptional<z.ZodString>;
1234
- headSha: z.ZodOptional<z.ZodString>;
1235
- issue: z.ZodOptional<z.ZodString>;
1236
- prNumber: z.ZodOptional<z.ZodNumber>;
1237
- }, z.core.$strict>;
1238
- repo: z.ZodObject<{
1239
- name: z.ZodString;
1240
- owner: z.ZodString;
1241
- }, z.core.$strict>;
1242
- schemaVersion: z.ZodLiteral<1>;
1243
- tokenFamilies: z.ZodObject<{
1244
- claude: z.ZodOptional<z.ZodObject<{
1245
- cacheCreationInput: z.ZodNumber;
1246
- cacheReadInput: z.ZodNumber;
1247
- costUsd: z.ZodNullable<z.ZodNumber>;
1248
- family: z.ZodLiteral<"claude">;
1249
- freshInput: z.ZodNumber;
1250
- model: z.ZodString;
1251
- output: z.ZodNumber;
1252
- requests: z.ZodNumber;
1253
- }, z.core.$strict>>;
1254
- gpt: z.ZodOptional<z.ZodObject<{
1255
- family: z.ZodLiteral<"gpt">;
1256
- roles: z.ZodArray<z.ZodObject<{
1257
- cachedInput: z.ZodNumber;
1258
- costUsd: z.ZodNullable<z.ZodNumber>;
1259
- freshInputDerived: z.ZodNumber;
1260
- inputInclusiveOfCache: z.ZodNumber;
1261
- model: z.ZodString;
1262
- output: z.ZodNumber;
1263
- reasoningOutput: z.ZodNumber;
1264
- role: z.ZodString;
1265
- threadId: z.ZodOptional<z.ZodString>;
1266
- }, z.core.$strict>>;
1267
- }, z.core.$strict>>;
1268
- }, z.core.$strict>;
1269
- wallClock: z.ZodObject<{
1270
- endTs: z.ZodISODateTime;
1271
- startTs: z.ZodISODateTime;
1272
- totalSec: z.ZodNumber;
1273
- }, z.core.$strict>;
1274
- }, z.core.$strict>;
1275
- type RetroEnvelope = z.infer<typeof retroEnvelopeV1Schema>;
1276
- /**
1277
- * Versioned payload validators, keyed by schema major. Unknown majors never
1278
- * reach these — {@link parseRetroEnvelope} returns them raw and marked
1279
- * degraded, mirroring HQ's ingest skew posture (stored raw, never dropped).
1280
- */
1281
- declare const RETRO_ENVELOPE_VALIDATORS: Record<number, z.ZodType<RetroEnvelope, unknown>>;
1282
- declare const SUPPORTED_RETRO_ENVELOPE_SCHEMA_VERSIONS: readonly number[];
1283
- type ParsedRetroEnvelope = {
1284
- disposition: "trusted";
1285
- envelope: RetroEnvelope;
1286
- schemaVersion: number;
1287
- } | {
1288
- disposition: "degraded";
1289
- raw: unknown;
1290
- schemaVersion: number | undefined;
1291
- };
1292
- /** Epic anchor for an envelope: refs.epic, else refs.issue, else the PR. */
1293
- declare const retroEpicReference: (refs: RetroEnvelope["refs"]) => string | undefined;
1294
- //#endregion
1295
- //#region src/schemas.d.ts
1296
- declare const EVIDENCE_ENVELOPE_SCHEMA_VERSION = 1;
1297
- declare const evidenceEnvelopeSchema: z.ZodObject<{
1298
- check: z.ZodString;
1299
- checkType: z.ZodEnum<{
1300
- review: "review";
1301
- verify: "verify";
1302
- }>;
1303
- findingsPointer: z.ZodOptional<z.ZodString>;
1304
- headSha: z.ZodString;
1305
- mergeBaseSha: z.ZodString;
1306
- model: z.ZodOptional<z.ZodString>;
1307
- outcome: z.ZodEnum<{
1308
- pass: "pass";
1309
- fail: "fail";
1310
- }>;
1311
- patchId: z.ZodString;
1312
- policyVersion: z.ZodOptional<z.ZodString>;
1313
- producer: z.ZodString;
1314
- requestId: z.ZodOptional<z.ZodString>;
1315
- rung: z.ZodOptional<z.ZodEnum<{
1316
- "independent-model": "independent-model";
1317
- oracle: "oracle";
1318
- human: "human";
1319
- }>>;
1320
- schemaVersion: z.ZodLiteral<1>;
1321
- sessionId: z.ZodOptional<z.ZodString>;
1322
- timestamp: z.ZodOptional<z.ZodISODateTime>;
1323
- }, z.core.$loose>;
1324
- declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [1, 2, 3, 4];
630
+ /**
631
+ * The review policy identity this verification run resolved (#922 Slice B).
632
+ *
633
+ * Verification demands no review mode of its own. It records the identity so
634
+ * `pr:ready` can see whether the stage that produced this proof judged the
635
+ * candidate under the same policy readiness resolves. Optional, and normally
636
+ * `unresolved` on the first run of a branch: a candidate is verified before
637
+ * it has a pull request, and there is no authority to read without one.
638
+ */
639
+ policyResolution?: PolicyResolution;
640
+ profilePath: string;
641
+ projectKey: string;
642
+ repository: string;
643
+ startedAt: string;
644
+ verificationCommands: PrVerifyCommandResult[];
645
+ }
1325
646
  declare const prVerifyProofSchema: z.ZodObject<{
1326
- authoringSession: z.ZodOptional<z.ZodString>;
647
+ authoringSession: z.ZodString;
1327
648
  base: z.ZodString;
1328
649
  baselineFullProofs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1329
650
  base: z.ZodString;
@@ -1333,6 +654,7 @@ declare const prVerifyProofSchema: z.ZodObject<{
1333
654
  projectKey: z.ZodString;
1334
655
  repository: z.ZodString;
1335
656
  }, z.core.$strip>>>;
657
+ catchUpRecognition: z.ZodOptional<z.ZodType<CatchUpRecognition, unknown, z.core.$ZodTypeInternals<CatchUpRecognition, unknown>>>;
1336
658
  changedFiles: z.ZodArray<z.ZodString>;
1337
659
  classification: z.ZodEnum<{
1338
660
  "docs/process-only": "docs/process-only";
@@ -1351,10 +673,18 @@ declare const prVerifyProofSchema: z.ZodObject<{
1351
673
  }, z.core.$strip>>;
1352
674
  durationMs: z.ZodNumber;
1353
675
  exitCode: z.ZodNumber;
676
+ failures: z.ZodOptional<z.ZodArray<z.ZodObject<{
677
+ file: z.ZodString;
678
+ kind: z.ZodEnum<{
679
+ error: "error";
680
+ assertion: "assertion";
681
+ timeout: "timeout";
682
+ }>;
683
+ title: z.ZodString;
684
+ }, z.core.$strip>>>;
1354
685
  name: z.ZodString;
1355
686
  scope: z.ZodEnum<{
1356
687
  trivial: "trivial";
1357
- always: "always";
1358
688
  "docs-only": "docs-only";
1359
689
  full: "full";
1360
690
  }>;
@@ -1365,8 +695,9 @@ declare const prVerifyProofSchema: z.ZodObject<{
1365
695
  "target-scoped": "target-scoped";
1366
696
  conservative: "conservative";
1367
697
  }>;
698
+ inertPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
1368
699
  reasons: z.ZodArray<z.ZodString>;
1369
- stampVersion: z.ZodLiteral<2>;
700
+ stampVersion: z.ZodLiteral<4>;
1370
701
  targets: z.ZodArray<z.ZodObject<{
1371
702
  basis: z.ZodString;
1372
703
  impact: z.ZodEnum<{
@@ -1374,7 +705,9 @@ declare const prVerifyProofSchema: z.ZodObject<{
1374
705
  "not-affected": "not-affected";
1375
706
  }>;
1376
707
  name: z.ZodString;
708
+ subscribedPaths: z.ZodArray<z.ZodString>;
1377
709
  }, z.core.$strip>>;
710
+ unsubscribedPaths: z.ZodArray<z.ZodString>;
1378
711
  }, z.core.$strip>>;
1379
712
  mergeBaseSha: z.ZodOptional<z.ZodString>;
1380
713
  mode: z.ZodEnum<{
@@ -1382,20 +715,37 @@ declare const prVerifyProofSchema: z.ZodObject<{
1382
715
  "docs-only": "docs-only";
1383
716
  full: "full";
1384
717
  }>;
718
+ notDemandedRecords: z.ZodOptional<z.ZodArray<z.ZodObject<{
719
+ basis: z.ZodString;
720
+ name: z.ZodString;
721
+ }, z.core.$strip>>>;
1385
722
  notRequiredCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
1386
723
  basis: z.ZodString;
1387
724
  impactTarget: z.ZodString;
1388
725
  name: z.ZodString;
1389
726
  }, z.core.$strip>>>;
1390
727
  outcome: z.ZodOptional<z.ZodEnum<{
1391
- aborted: "aborted";
1392
728
  passed: "passed";
729
+ aborted: "aborted";
1393
730
  }>>;
1394
731
  patchId: z.ZodOptional<z.ZodString>;
732
+ policyResolution: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
733
+ basePolicyDigest: z.ZodString;
734
+ baseRefName: z.ZodString;
735
+ candidatePolicyDigest: z.ZodString;
736
+ effectiveDigest: z.ZodString;
737
+ policyBaseSha: z.ZodString;
738
+ reviewPolicyChanged: z.ZodBoolean;
739
+ status: z.ZodLiteral<"authoritative">;
740
+ }, z.core.$strict>, z.ZodObject<{
741
+ baseRefName: z.ZodString;
742
+ reason: z.ZodString;
743
+ status: z.ZodLiteral<"unresolved">;
744
+ }, z.core.$strict>], "status">>;
1395
745
  profilePath: z.ZodString;
1396
746
  projectKey: z.ZodString;
1397
747
  repository: z.ZodString;
1398
- schemaVersion: z.ZodNumber & z.ZodType<1 | 2 | 3 | 4, number, z.core.$ZodTypeInternals<1 | 2 | 3 | 4, number>>;
748
+ schemaVersion: z.ZodLiteral<4>;
1399
749
  startedAt: z.ZodISODateTime;
1400
750
  verificationCommands: z.ZodArray<z.ZodObject<{
1401
751
  command: z.ZodString;
@@ -1404,138 +754,195 @@ declare const prVerifyProofSchema: z.ZodObject<{
1404
754
  name: z.ZodString;
1405
755
  scope: z.ZodEnum<{
1406
756
  trivial: "trivial";
1407
- always: "always";
1408
757
  "docs-only": "docs-only";
1409
758
  full: "full";
1410
759
  }>;
1411
760
  }, z.core.$strip>>;
1412
761
  }, z.core.$strip>;
1413
- declare const PR_REVIEW_SCHEMA_VERSION = 2;
1414
- declare const prReviewProofSchema: z.ZodObject<{
1415
- base: z.ZodString;
1416
- changedFiles: z.ZodArray<z.ZodString>;
1417
- cleanedPaths: z.ZodArray<z.ZodString>;
1418
- findingProvenanceVersion: z.ZodLiteral<1>;
762
+ //#endregion
763
+ //#region src/pr-ready.d.ts
764
+ interface PrReadyProof {
765
+ schemaVersion: 3;
766
+ /**
767
+ * What GitHub actually did when this run armed native auto-merge (#477).
768
+ * Present exactly when a ready wave authorizes machine merge and arming ran;
769
+ * read back from the PR rather than inferred from the invocation, because `gh pr merge
770
+ * --auto` arms, merges, or does nothing with the same exit code and the same
771
+ * empty output. `not-armed` means the candidate is admitted but nothing will
772
+ * merge it, and `followUp` carries the re-dispatch.
773
+ */
774
+ arming?: {
775
+ detail?: string;
776
+ headSha: string;
777
+ outcome: "armed" | "merged" | "not-armed";
778
+ };
779
+ /**
780
+ * The authoring session readiness resolved for the review-independence
781
+ * cross-check (#1037). Recorded so the branded check can print it beside the
782
+ * review session, model, and producer the ledger already carries — the four
783
+ * identities a human weighs at merge time. Additive and optional: proofs
784
+ * written before it carry no field, so no schema version moves.
785
+ */
786
+ authoringSession?: string;
787
+ /**
788
+ * Why this run blocked, one entry per refusing demand (#391): `code` is the
789
+ * demand key from the resolver's vocabulary, `detail` the one-sentence
790
+ * refusal. Same refusals as `blockingReasons`, in the same order — the
791
+ * analyzable projection of a flat string list, so a wall of blocked proofs
792
+ * on one PR can be counted by cause. Absent when nothing blocked.
793
+ */
794
+ blockedReasons?: BlockedReason[];
795
+ blockingReasons: string[];
796
+ humanBlockingReasons: string[];
797
+ command: "patronage-factory pr:ready";
798
+ /**
799
+ * Machine-safe arg array for the obvious next action (#523): when `ready`
800
+ * but arming did not take effect, a `pr:ready` re-dispatch (idempotent on
801
+ * an unchanged head); otherwise the `gh pr ready` undraft repair or the
802
+ * `pr:verify` re-run that the blocking reasons name (re-verify the head,
803
+ * then re-run pr:ready). Same `argv` shape `factory:delegate --print`
804
+ * emits. Optional and purely additive.
805
+ */
806
+ followUp?: FollowUpAction;
807
+ /**
808
+ * `ledger.headSha` is the evaluated head SHA: the GitHub `pr.headRefOid`
809
+ * captured at evaluation time (not a local git read), recorded explicitly
810
+ * so merge-time identity checks are a pure comparison against the live
811
+ * pushed HEAD, not a re-derivation. See the ledger schema.
812
+ */
813
+ ledger: ManagedReadinessLedger;
814
+ /**
815
+ * Actionable facts that did not block (#477): a settling merge-freeze
816
+ * generation that permitted readiness and any authorized arming with a
817
+ * notice, an admitted-but-unscheduled false boundary wave, and how each
818
+ * waived demand reads to a human. Absent when there are none.
819
+ */
820
+ notices?: string[];
821
+ /**
822
+ * The policy identity readiness resolved review demand under (#922): the
823
+ * base ref, its live tip, and the digests of the base, candidate, and merged
824
+ * review policies. Optional on the wire and additive — this is a new record
825
+ * on an unchanged contract, so no schema version moves.
826
+ */
827
+ policyResolution?: PolicyResolution;
828
+ /** Committed profile blob evaluated by readiness. Required for merge. */
829
+ profileBlobSha?: string;
830
+ /** Checkout-relative committed profile path evaluated by readiness. */
831
+ profilePath?: string;
832
+ repairs: ReadinessRepair[];
833
+ /** Trusted checkout repository used for all GitHub reads and writes. */
834
+ repository?: string;
835
+ status: ReadinessStatus;
836
+ /**
837
+ * Demands that were in force, were NOT met, and were waived by the operator
838
+ * (#354, moved here from the merge-time proof by #477). Each entry carries
839
+ * the demand's refusals verbatim, so a waived demand can never read as a met
840
+ * one; readiness proceeds on the recorded operator act, not on evidence.
841
+ */
842
+ waivedDemands?: WaivedDemand[];
843
+ }
844
+ //#endregion
845
+ //#region src/pr-readiness/external-evidence.d.ts
846
+ declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
847
+ check: z.ZodString;
848
+ checkType: z.ZodEnum<{
849
+ review: "review";
850
+ verify: "verify";
851
+ }>;
852
+ findingsPointer: z.ZodOptional<z.ZodString>;
1419
853
  headSha: z.ZodString;
1420
- ladder: z.ZodOptional<z.ZodObject<{
1421
- cycles: z.ZodArray<z.ZodObject<{
1422
- dispositions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1423
- disposition: z.ZodEnum<{
1424
- "fixed-in-thread": "fixed-in-thread";
1425
- "follow-up-filed": "follow-up-filed";
1426
- waived: "waived";
1427
- }>;
1428
- finding: z.ZodObject<{
1429
- file: z.ZodOptional<z.ZodString>;
1430
- title: z.ZodString;
1431
- }, z.core.$strip>;
1432
- reference: z.ZodOptional<z.ZodString>;
1433
- }, z.core.$loose>>>;
1434
- findings: z.ZodArray<z.ZodObject<{
1435
- citedSpan: z.ZodOptional<z.ZodString>;
1436
- file: z.ZodOptional<z.ZodString>;
1437
- prescribedAction: z.ZodOptional<z.ZodString>;
1438
- supersedes: z.ZodOptional<z.ZodObject<{
1439
- file: z.ZodOptional<z.ZodString>;
1440
- title: z.ZodString;
1441
- }, z.core.$strip>>;
1442
- title: z.ZodString;
1443
- }, z.core.$loose>>;
1444
- }, z.core.$loose>>;
1445
- }, z.core.$strip>>;
1446
- maxReviewCycles: z.ZodOptional<z.ZodNumber>;
854
+ mergeBaseSha: z.ZodString;
855
+ model: z.ZodOptional<z.ZodString>;
856
+ outcome: z.ZodEnum<{
857
+ pass: "pass";
858
+ fail: "fail";
859
+ }>;
1447
860
  patchId: z.ZodString;
1448
- reviewCycle: z.ZodOptional<z.ZodNumber>;
1449
- reviewRequirement: z.ZodOptional<z.ZodObject<{
1450
- reason: z.ZodEnum<{
1451
- "no-applicable-mode": "no-applicable-mode";
1452
- }>;
1453
- status: z.ZodLiteral<"not-required">;
861
+ policyVersion: z.ZodOptional<z.ZodString>;
862
+ producer: z.ZodString;
863
+ requestId: z.ZodOptional<z.ZodString>;
864
+ rung: z.ZodOptional<z.ZodEnum<{
865
+ "independent-model": "independent-model";
866
+ oracle: "oracle";
867
+ human: "human";
868
+ }>>;
869
+ schemaVersion: z.ZodLiteral<1>;
870
+ sessionId: z.ZodOptional<z.ZodString>;
871
+ timestamp: z.ZodOptional<z.ZodISODateTime>;
872
+ }, z.core.$loose>;
873
+ type EvidenceEnvelope = z.infer<typeof evidenceEnvelopeBaseSchema>;
874
+ //#endregion
875
+ //#region src/pr-readiness/review-proof.d.ts
876
+ declare const PR_REVIEW_SCHEMA_VERSION = 2;
877
+ declare const prReviewFindingSchema: z.ZodType<PrReviewFinding>;
878
+ declare const prReviewResultSchema: z.ZodType<PrReviewResult>;
879
+ declare const prReviewProofSchema: z.ZodType<PrReviewProof>;
880
+ //#endregion
881
+ //#region src/closeout-artifact.d.ts
882
+ /** Artifact versions accepted at ingest. */
883
+ declare const SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS: readonly [5];
884
+ /** Strict, bounded runtime transport contract emitted by factory:closeout. */
885
+ declare const closeoutArtifactSchema: z.ZodObject<{
886
+ budget: z.ZodObject<{
887
+ note: z.ZodString;
888
+ tier: z.ZodLiteral<"overseer">;
889
+ }, z.core.$strict>;
890
+ couldNotSee: z.ZodArray<z.ZodObject<{
891
+ id: z.ZodString;
892
+ note: z.ZodString;
893
+ reason: z.ZodOptional<z.ZodString>;
1454
894
  }, z.core.$strict>>;
1455
- reviews: z.ZodArray<z.ZodObject<{
1456
- command: z.ZodOptional<z.ZodString>;
1457
- durationMs: z.ZodNumber;
1458
- endedAt: z.ZodString;
1459
- exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1460
- findings: z.ZodArray<z.ZodObject<{
1461
- blockingAfterCap: z.ZodOptional<z.ZodBoolean>;
1462
- body: z.ZodString;
1463
- category: z.ZodOptional<z.ZodEnum<{
1464
- unknown: "unknown";
1465
- correctness: "correctness";
1466
- safety: "safety";
1467
- coordination: "coordination";
1468
- maintainability: "maintainability";
1469
- }>>;
1470
- citedSpan: z.ZodOptional<z.ZodString>;
1471
- file: z.ZodOptional<z.ZodString>;
1472
- line: z.ZodOptional<z.ZodNumber>;
1473
- prescribedAction: z.ZodOptional<z.ZodString>;
1474
- priority: z.ZodOptional<z.ZodString>;
1475
- protocolFinding: z.ZodOptional<z.ZodLiteral<true>>;
1476
- supersedes: z.ZodOptional<z.ZodObject<{
1477
- file: z.ZodOptional<z.ZodString>;
1478
- title: z.ZodString;
1479
- }, z.core.$strip>>;
1480
- title: z.ZodString;
1481
- }, z.core.$strip>>;
1482
- issuesFlagged: z.ZodNumber;
1483
- kind: z.ZodEnum<{
1484
- correctness: "correctness";
1485
- security: "security";
1486
- }>;
1487
- model: z.ZodOptional<z.ZodString>;
1488
- outcome: z.ZodEnum<{
1489
- error: "error";
1490
- passed: "passed";
1491
- failed: "failed";
895
+ epic: z.ZodString;
896
+ generatedAt: z.ZodISODateTime;
897
+ metrics: z.ZodArray<z.ZodObject<{
898
+ label: z.ZodString;
899
+ metric: z.ZodString;
900
+ source: z.ZodObject<{
901
+ detail: z.ZodString;
902
+ kind: z.ZodLiteral<"token-harvest">;
903
+ }, z.core.$strict>;
904
+ unit: z.ZodEnum<{
905
+ boolean: "boolean";
906
+ count: "count";
907
+ text: "text";
908
+ tokens: "tokens";
909
+ usd: "usd";
1492
910
  }>;
1493
- producer: z.ZodOptional<z.ZodString>;
1494
- promptSections: z.ZodOptional<z.ZodArray<z.ZodObject<{
1495
- provenance: z.ZodEnum<{
1496
- "prior-review-ledger": "prior-review-ledger";
1497
- "issue-review-focus": "issue-review-focus";
1498
- }>;
1499
- source: z.ZodString;
1500
- text: z.ZodString;
1501
- }, z.core.$strict>>>;
1502
- rung: z.ZodOptional<z.ZodEnum<{
1503
- "independent-model": "independent-model";
1504
- oracle: "oracle";
1505
- human: "human";
1506
- }>>;
1507
- sessionId: z.ZodOptional<z.ZodString>;
1508
- stageResolution: z.ZodOptional<z.ZodObject<{
1509
- effort: z.ZodOptional<z.ZodEnum<{
1510
- low: "low";
1511
- medium: "medium";
1512
- high: "high";
1513
- xhigh: "xhigh";
1514
- }>>;
1515
- engine: z.ZodString;
1516
- layerSource: z.ZodEnum<{
1517
- cli: "cli";
1518
- operatorSessionGlobal: "operatorSessionGlobal";
1519
- operatorSessionKind: "operatorSessionKind";
1520
- profilePin: "profilePin";
1521
- stageConfig: "stageConfig";
1522
- userConfig: "userConfig";
1523
- }>;
1524
- model: z.ZodString;
1525
- rung: z.ZodOptional<z.ZodEnum<{
1526
- oracle: "oracle";
1527
- independentModel: "independentModel";
1528
- }>>;
1529
- }, z.core.$strip>>;
1530
- startedAt: z.ZodString;
1531
- summary: z.ZodString;
1532
- typedVerdict: z.ZodOptional<z.ZodBoolean>;
1533
- verdictSource: z.ZodOptional<z.ZodEnum<{
1534
- footer: "footer";
1535
- recovered: "recovered";
1536
- }>>;
1537
- }, z.core.$strip>>;
1538
- schemaVersion: z.ZodLiteral<2>;
911
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
912
+ }, z.core.$strict>>;
913
+ repo: z.ZodString;
914
+ schemaVersion: z.ZodLiteral<5>;
915
+ }, z.core.$strict>;
916
+ type CloseoutArtifact = z.infer<typeof closeoutArtifactSchema>;
917
+ //#endregion
918
+ //#region src/schemas.d.ts
919
+ declare const EVIDENCE_ENVELOPE_SCHEMA_VERSION = 1;
920
+ declare const evidenceEnvelopeSchema: z.ZodObject<{
921
+ check: z.ZodString;
922
+ checkType: z.ZodEnum<{
923
+ review: "review";
924
+ verify: "verify";
925
+ }>;
926
+ findingsPointer: z.ZodOptional<z.ZodString>;
927
+ headSha: z.ZodString;
928
+ mergeBaseSha: z.ZodString;
929
+ model: z.ZodOptional<z.ZodString>;
930
+ outcome: z.ZodEnum<{
931
+ pass: "pass";
932
+ fail: "fail";
933
+ }>;
934
+ patchId: z.ZodString;
935
+ policyVersion: z.ZodOptional<z.ZodString>;
936
+ producer: z.ZodString;
937
+ requestId: z.ZodOptional<z.ZodString>;
938
+ rung: z.ZodOptional<z.ZodEnum<{
939
+ "independent-model": "independent-model";
940
+ oracle: "oracle";
941
+ human: "human";
942
+ }>>;
943
+ schemaVersion: z.ZodLiteral<1>;
944
+ sessionId: z.ZodOptional<z.ZodString>;
945
+ timestamp: z.ZodOptional<z.ZodISODateTime>;
1539
946
  }, z.core.$loose>;
1540
947
  declare const BOUNDARY_REVIEW_PROOF_KIND = "boundary-review-proof";
1541
948
  declare const boundaryReviewProofSchema: z.ZodObject<{
@@ -1638,12 +1045,15 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
1638
1045
  type BoundaryCheckProofRecord = z.infer<typeof boundaryCheckProofSchema>;
1639
1046
  declare const PR_READY_SCHEMA_VERSION = 3;
1640
1047
  /**
1641
- * The pr:ready proof versions a reader still accepts. `pr:ready` emits v3 only
1642
- * (#477) — one current contract — but v1 and v2 events were spooled before the
1643
- * bumps and HQ must ingest them without degrading, so the wire schema parses
1644
- * all three.
1048
+ * The pr:ready proof versions a reader accepts: the current one only (#917
1049
+ * item 1). #894 narrowed the nested readiness ledger to `schemaVersion: 2` and
1050
+ * the `prVerify` tagged union, which no v1 or v2 pr:ready proof can satisfy.
1051
+ * Advertising 1 and 2 here therefore promised an acceptance the nested schema
1052
+ * already refused. Pre-1.0 posture applies: one current contract, no compat
1053
+ * reader. An alpha.22 consumer must adopt alpha.23 before HQ ingests its
1054
+ * pr:ready proofs.
1645
1055
  */
1646
- declare const SUPPORTED_PR_READY_SCHEMA_VERSIONS: readonly [1, 2, 3];
1056
+ declare const SUPPORTED_PR_READY_SCHEMA_VERSIONS: readonly [3];
1647
1057
  declare const prReadyProofSchema: z.ZodObject<{
1648
1058
  arming: z.ZodOptional<z.ZodObject<{
1649
1059
  detail: z.ZodOptional<z.ZodString>;
@@ -1654,6 +1064,7 @@ declare const prReadyProofSchema: z.ZodObject<{
1654
1064
  "not-armed": "not-armed";
1655
1065
  }>;
1656
1066
  }, z.core.$strip>>;
1067
+ authoringSession: z.ZodOptional<z.ZodString>;
1657
1068
  blockedReasons: z.ZodOptional<z.ZodArray<z.ZodObject<{
1658
1069
  code: z.ZodString;
1659
1070
  detail: z.ZodString;
@@ -1678,7 +1089,6 @@ declare const prReadyProofSchema: z.ZodObject<{
1678
1089
  review: "review";
1679
1090
  verify: "verify";
1680
1091
  }>;
1681
- inScope: z.ZodBoolean;
1682
1092
  name: z.ZodString;
1683
1093
  reason: z.ZodOptional<z.ZodString>;
1684
1094
  scope: z.ZodOptional<z.ZodObject<{
@@ -1721,8 +1131,8 @@ declare const prReadyProofSchema: z.ZodObject<{
1721
1131
  clearedAt: z.ZodOptional<z.ZodString>;
1722
1132
  sessionId: z.ZodOptional<z.ZodString>;
1723
1133
  source: z.ZodEnum<{
1724
- cli: "cli";
1725
1134
  "check-run": "check-run";
1135
+ cli: "cli";
1726
1136
  }>;
1727
1137
  url: z.ZodString;
1728
1138
  }, z.core.$strip>>>;
@@ -1762,17 +1172,17 @@ declare const prReadyProofSchema: z.ZodObject<{
1762
1172
  }, z.core.$strip>;
1763
1173
  highestBlockingSeverity: z.ZodOptional<z.ZodEnum<{
1764
1174
  unknown: "unknown";
1175
+ critical: "critical";
1176
+ high: "high";
1765
1177
  low: "low";
1766
1178
  medium: "medium";
1767
- high: "high";
1768
- critical: "critical";
1769
1179
  }>>;
1770
1180
  highestOpenSeverity: z.ZodOptional<z.ZodEnum<{
1771
1181
  unknown: "unknown";
1182
+ critical: "critical";
1183
+ high: "high";
1772
1184
  low: "low";
1773
1185
  medium: "medium";
1774
- high: "high";
1775
- critical: "critical";
1776
1186
  }>>;
1777
1187
  maxReviewCycles: z.ZodOptional<z.ZodNumber>;
1778
1188
  nonBlockingFindings: z.ZodNumber;
@@ -1789,7 +1199,6 @@ declare const prReadyProofSchema: z.ZodObject<{
1789
1199
  forcedTransition: z.ZodOptional<z.ZodEnum<{
1790
1200
  "gate-cap-exhausted": "gate-cap-exhausted";
1791
1201
  "interior-cap-reached": "interior-cap-reached";
1792
- "interior-takeover": "interior-takeover";
1793
1202
  }>>;
1794
1203
  nextAction: z.ZodEnum<{
1795
1204
  "run-interior-cycle": "run-interior-cycle";
@@ -1802,93 +1211,10 @@ declare const prReadyProofSchema: z.ZodObject<{
1802
1211
  stage: z.ZodEnum<{
1803
1212
  gate: "gate";
1804
1213
  interior: "interior";
1805
- "interior-takeover": "interior-takeover";
1806
1214
  "interior-complete": "interior-complete";
1807
1215
  }>;
1808
1216
  }, z.core.$strip>>;
1809
- reviewRuns: z.ZodOptional<z.ZodArray<z.ZodObject<{
1810
- command: z.ZodOptional<z.ZodString>;
1811
- durationMs: z.ZodNumber;
1812
- endedAt: z.ZodString;
1813
- exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1814
- findings: z.ZodArray<z.ZodObject<{
1815
- blockingAfterCap: z.ZodOptional<z.ZodBoolean>;
1816
- body: z.ZodString;
1817
- category: z.ZodOptional<z.ZodEnum<{
1818
- unknown: "unknown";
1819
- correctness: "correctness";
1820
- safety: "safety";
1821
- coordination: "coordination";
1822
- maintainability: "maintainability";
1823
- }>>;
1824
- citedSpan: z.ZodOptional<z.ZodString>;
1825
- file: z.ZodOptional<z.ZodString>;
1826
- line: z.ZodOptional<z.ZodNumber>;
1827
- prescribedAction: z.ZodOptional<z.ZodString>;
1828
- priority: z.ZodOptional<z.ZodString>;
1829
- protocolFinding: z.ZodOptional<z.ZodLiteral<true>>;
1830
- supersedes: z.ZodOptional<z.ZodObject<{
1831
- file: z.ZodOptional<z.ZodString>;
1832
- title: z.ZodString;
1833
- }, z.core.$strip>>;
1834
- title: z.ZodString;
1835
- }, z.core.$strip>>;
1836
- issuesFlagged: z.ZodNumber;
1837
- kind: z.ZodEnum<{
1838
- correctness: "correctness";
1839
- security: "security";
1840
- }>;
1841
- model: z.ZodOptional<z.ZodString>;
1842
- outcome: z.ZodEnum<{
1843
- error: "error";
1844
- passed: "passed";
1845
- failed: "failed";
1846
- }>;
1847
- producer: z.ZodOptional<z.ZodString>;
1848
- promptSections: z.ZodOptional<z.ZodArray<z.ZodObject<{
1849
- provenance: z.ZodEnum<{
1850
- "prior-review-ledger": "prior-review-ledger";
1851
- "issue-review-focus": "issue-review-focus";
1852
- }>;
1853
- source: z.ZodString;
1854
- text: z.ZodString;
1855
- }, z.core.$strict>>>;
1856
- rung: z.ZodOptional<z.ZodEnum<{
1857
- "independent-model": "independent-model";
1858
- oracle: "oracle";
1859
- human: "human";
1860
- }>>;
1861
- sessionId: z.ZodOptional<z.ZodString>;
1862
- stageResolution: z.ZodOptional<z.ZodObject<{
1863
- effort: z.ZodOptional<z.ZodEnum<{
1864
- low: "low";
1865
- medium: "medium";
1866
- high: "high";
1867
- xhigh: "xhigh";
1868
- }>>;
1869
- engine: z.ZodString;
1870
- layerSource: z.ZodEnum<{
1871
- cli: "cli";
1872
- operatorSessionGlobal: "operatorSessionGlobal";
1873
- operatorSessionKind: "operatorSessionKind";
1874
- profilePin: "profilePin";
1875
- stageConfig: "stageConfig";
1876
- userConfig: "userConfig";
1877
- }>;
1878
- model: z.ZodString;
1879
- rung: z.ZodOptional<z.ZodEnum<{
1880
- oracle: "oracle";
1881
- independentModel: "independentModel";
1882
- }>>;
1883
- }, z.core.$strip>>;
1884
- startedAt: z.ZodString;
1885
- summary: z.ZodString;
1886
- typedVerdict: z.ZodOptional<z.ZodBoolean>;
1887
- verdictSource: z.ZodOptional<z.ZodEnum<{
1888
- footer: "footer";
1889
- recovered: "recovered";
1890
- }>>;
1891
- }, z.core.$strip>>>;
1217
+ reviewRuns: z.ZodOptional<z.ZodArray<z.ZodType<PrReviewResult, unknown, z.core.$ZodTypeInternals<PrReviewResult, unknown>>>>;
1892
1218
  reviewTerminalState: z.ZodOptional<z.ZodEnum<{
1893
1219
  blocked: "blocked";
1894
1220
  "accepted-with-findings": "accepted-with-findings";
@@ -1896,54 +1222,74 @@ declare const prReadyProofSchema: z.ZodObject<{
1896
1222
  }>>;
1897
1223
  reviews: z.ZodObject<{
1898
1224
  correctness: z.ZodObject<{
1899
- docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1900
1225
  required: z.ZodBoolean;
1901
1226
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1902
1227
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1903
1228
  status: z.ZodEnum<{
1904
- "not-required": "not-required";
1905
1229
  blocked: "blocked";
1230
+ "not-required": "not-required";
1906
1231
  current: "current";
1907
1232
  stale: "stale";
1908
1233
  missing: "missing";
1909
1234
  }>;
1910
- }, z.core.$strip>;
1235
+ }, z.core.$strict>;
1911
1236
  security: z.ZodOptional<z.ZodObject<{
1912
- docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1913
1237
  required: z.ZodBoolean;
1914
1238
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1915
1239
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1916
1240
  status: z.ZodEnum<{
1917
- "not-required": "not-required";
1918
1241
  blocked: "blocked";
1242
+ "not-required": "not-required";
1919
1243
  current: "current";
1920
1244
  stale: "stale";
1921
1245
  missing: "missing";
1922
1246
  }>;
1923
- }, z.core.$strip>>;
1247
+ }, z.core.$strict>>;
1924
1248
  }, z.core.$strip>;
1925
- schemaVersion: z.ZodLiteral<1>;
1249
+ schemaVersion: z.ZodLiteral<2>;
1926
1250
  stackRole: z.ZodOptional<z.ZodEnum<{
1927
1251
  single: "single";
1928
1252
  slice: "slice";
1929
1253
  rollup: "rollup";
1930
1254
  "merge-gate prerequisite": "merge-gate prerequisite";
1931
1255
  }>>;
1932
- verification: z.ZodObject<{
1256
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
1933
1257
  command: z.ZodLiteral<"patronage-factory pr:verify">;
1934
- docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1935
- docsOnlyVerifiedHeadSha: z.ZodOptional<z.ZodString>;
1936
- prVerify: z.ZodEnum<{
1937
- passed: "passed";
1938
- stale: "stale";
1939
- missing: "missing";
1940
- }>;
1941
- trivialDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1942
- trivialVerifiedHeadSha: z.ZodOptional<z.ZodString>;
1258
+ prVerify: z.ZodLiteral<"missing">;
1259
+ }, z.core.$strict>, z.ZodObject<{
1260
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1261
+ prVerify: z.ZodLiteral<"stale">;
1262
+ verifiedHeadSha: z.ZodString;
1263
+ }, z.core.$strict>, z.ZodObject<{
1264
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1265
+ prVerify: z.ZodLiteral<"passed-via-head">;
1266
+ verifiedHeadSha: z.ZodString;
1267
+ }, z.core.$strict>, z.ZodObject<{
1268
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1269
+ docsOnlyVerifiedHeadSha: z.ZodString;
1270
+ prVerify: z.ZodLiteral<"docs-only-delta">;
1943
1271
  verifiedHeadSha: z.ZodOptional<z.ZodString>;
1944
- }, z.core.$strip>;
1272
+ }, z.core.$strict>, z.ZodObject<{
1273
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1274
+ prVerify: z.ZodLiteral<"trivial-delta">;
1275
+ trivialVerifiedHeadSha: z.ZodString;
1276
+ verifiedHeadSha: z.ZodOptional<z.ZodString>;
1277
+ }, z.core.$strict>], "prVerify">;
1945
1278
  }, z.core.$strip>;
1946
1279
  notices: z.ZodOptional<z.ZodArray<z.ZodString>>;
1280
+ policyResolution: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1281
+ basePolicyDigest: z.ZodString;
1282
+ baseRefName: z.ZodString;
1283
+ candidatePolicyDigest: z.ZodString;
1284
+ effectiveDigest: z.ZodString;
1285
+ policyBaseSha: z.ZodString;
1286
+ reviewPolicyChanged: z.ZodBoolean;
1287
+ status: z.ZodLiteral<"authoritative">;
1288
+ }, z.core.$strict>, z.ZodObject<{
1289
+ baseRefName: z.ZodString;
1290
+ reason: z.ZodString;
1291
+ status: z.ZodLiteral<"unresolved">;
1292
+ }, z.core.$strict>], "status">>;
1947
1293
  profileBlobSha: z.ZodOptional<z.ZodString>;
1948
1294
  profilePath: z.ZodOptional<z.ZodString>;
1949
1295
  repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1956,7 +1302,7 @@ declare const prReadyProofSchema: z.ZodObject<{
1956
1302
  command: z.ZodString;
1957
1303
  }, z.core.$strip>>>;
1958
1304
  repository: z.ZodOptional<z.ZodString>;
1959
- schemaVersion: z.ZodNumber & z.ZodType<1 | 2 | 3, number, z.core.$ZodTypeInternals<1 | 2 | 3, number>>;
1305
+ schemaVersion: z.ZodLiteral<3>;
1960
1306
  status: z.ZodEnum<{
1961
1307
  ready: "ready";
1962
1308
  blocked: "blocked";
@@ -1965,4 +1311,4 @@ declare const prReadyProofSchema: z.ZodObject<{
1965
1311
  waivedDemands: z.ZodOptional<z.ZodArray<z.ZodType<WaivedDemand, unknown, z.core.$ZodTypeInternals<WaivedDemand, unknown>>>>;
1966
1312
  }, z.core.$strip>;
1967
1313
  //#endregion
1968
- export { BLOCKED_REASONS_MAX, BLOCKED_REASON_DETAIL_MAX, BOUNDARY_CHECK_SCHEMA_VERSION, BOUNDARY_REVIEW_PROOF_KIND, type BlockedReason, BoundaryCheckProofRecord, type BoundaryReviewProof, type CloseoutArtifact, EVIDENCE_ENVELOPE_SCHEMA_VERSION, type EvidenceEnvelope, type HistoricalCloseoutArtifact, PR_READY_SCHEMA_VERSION, PR_REVIEW_SCHEMA_VERSION, type ParsedRetroEnvelope, type PrReadyProof, type PrReviewProof, type PrVerifyProof, RETRO_ENVELOPE_SCHEMA_VERSION, RETRO_ENVELOPE_VALIDATORS, RETRO_ENVELOPE_WIRE_BOUNDS, type RetroEnvelope, SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS, SUPPORTED_PR_READY_SCHEMA_VERSIONS, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, SUPPORTED_RETRO_ENVELOPE_SCHEMA_VERSIONS, type WaivedDemand, blockedReasonSchema, blockedReasonsSchema, boundaryCheckProofSchema, boundaryReviewProofSchema, closeoutArtifactReadSchema, closeoutArtifactSchema, evidenceEnvelopeSchema, legacyCloseoutArtifactSchema, prReadyProofSchema, prReviewProofSchema, prVerifyProofSchema, retroEnvelopeV1Schema, retroEpicReference, waivedDemandSchema };
1314
+ export { BLOCKED_REASONS_MAX, BLOCKED_REASON_DETAIL_MAX, BOUNDARY_CHECK_SCHEMA_VERSION, BOUNDARY_REVIEW_PROOF_KIND, type BlockedReason, BoundaryCheckProofRecord, type BoundaryReviewProof, type CloseoutArtifact, EVIDENCE_ENVELOPE_SCHEMA_VERSION, type EvidenceEnvelope, PR_READY_SCHEMA_VERSION, PR_REVIEW_SCHEMA_VERSION, type PrReadyProof, type PrReviewProof, type PrVerifyProof, type ReviewPromptSection, type ReviewPromptSectionProvenance, SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS, SUPPORTED_PR_READY_SCHEMA_VERSIONS, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, type WaivedDemand, blockedReasonSchema, blockedReasonsSchema, boundaryCheckProofSchema, boundaryReviewProofSchema, closeoutArtifactSchema, evidenceEnvelopeSchema, prReadyProofSchema, prReviewFindingSchema, prReviewProofSchema, prReviewResultSchema, prVerifyProofSchema, reviewPromptSectionSchema, reviewPromptSectionsSchema, waivedDemandSchema };