@patronage/software-factory 1.0.0-alpha.4 → 1.0.0-alpha.41

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,5 +1,214 @@
1
1
  import { z } from "zod";
2
-
2
+ //#region src/packages/review-prompt-sections/schema.d.ts
3
+ declare const reviewPromptSectionSchema: z.ZodObject<{
4
+ provenance: z.ZodEnum<{
5
+ "coding-standards": "coding-standards";
6
+ "prior-review-ledger": "prior-review-ledger";
7
+ "issue-review-focus": "issue-review-focus";
8
+ }>;
9
+ source: z.ZodString;
10
+ text: z.ZodString;
11
+ }, z.core.$strict>;
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
+ cause: z.ZodOptional<z.ZodEnum<{
37
+ "no-pull-request": "no-pull-request";
38
+ "lookup-failed": "lookup-failed";
39
+ "policy-unreadable": "policy-unreadable";
40
+ }>>;
41
+ reason: z.ZodString;
42
+ status: z.ZodLiteral<"unresolved">;
43
+ }, z.core.$strict>], "status">;
44
+ type PolicyResolution = z.infer<typeof policyResolutionSchema>;
45
+ //#endregion
46
+ //#region src/review-ladder-policy.d.ts
47
+ type ReviewFindingCategory = "correctness" | "safety" | "coordination" | "maintainability" | "unknown";
48
+ interface ReviewFindingAttributes {
49
+ blockingAfterCap?: boolean;
50
+ category?: string;
51
+ citedSpan?: string;
52
+ file?: string;
53
+ prescribedAction?: string;
54
+ priority?: string;
55
+ supersedes?: {
56
+ file?: string;
57
+ title: string;
58
+ };
59
+ title: string;
60
+ }
61
+ //#endregion
62
+ //#region src/review-rungs.d.ts
63
+ declare const EVIDENCE_REVIEW_RUNGS: readonly ["independent-model", "oracle", "human"];
64
+ type EvidenceReviewRung = (typeof EVIDENCE_REVIEW_RUNGS)[number];
65
+ //#endregion
66
+ //#region src/review-ladder-ledger.d.ts
67
+ type LadderCycleStage = "interior" | "gate";
68
+ type LadderFindingReport = ReviewFindingAttributes;
69
+ /** One finding as recorded in one cycle (GLOSSARY.md: finding occurrence). */
70
+ interface ReviewOccurrenceRecord {
71
+ address: string;
72
+ /** The ladder-assigned cycle number the occurrence was recorded in. */
73
+ declaredCycle: number;
74
+ /**
75
+ * The root occurrence this one repeats: exact `findingKey` equality with an
76
+ * earlier occurrence, or the earlier occurrence an explicit `supersedes`
77
+ * names (decision 3), computed once at recording time. Points at the root
78
+ * of the group, never at an intermediate repeat.
79
+ */
80
+ repeatOf?: string;
81
+ }
82
+ declare const POLICY_DECLARATION_RULES: readonly ["cycle-2-severity-floor", "identity-repeat"];
83
+ type PolicyDeclarationRule = (typeof POLICY_DECLARATION_RULES)[number];
84
+ /**
85
+ * A disposition declaration as stored (GLOSSARY.md: disposition declaration):
86
+ * one occurrence, one disposition, the authority that made it and its
87
+ * reference (operator, reviewer) or rule (policy).
88
+ */
89
+ type ReviewDeclarationRecord = {
90
+ authority: "operator" | "reviewer";
91
+ disposition: "fixed-in-thread" | "follow-up-filed" | "waived";
92
+ reference?: string;
93
+ target: string;
94
+ } | {
95
+ authority: "policy";
96
+ disposition: "policy-accepted" | "stale-repeat";
97
+ rule: PolicyDeclarationRule;
98
+ target: string;
99
+ };
100
+ //#endregion
101
+ //#region src/review-recording-schema.d.ts
102
+ interface ReviewRecordedCycleIdentity {
103
+ /**
104
+ * SHA-256 of the proof file bytes this recording was applied to, or
105
+ * `absent` when no proof existed. The compare-and-swap at write time
106
+ * refuses to replace a proof whose bytes no longer digest to this value.
107
+ */
108
+ appliedTo: string;
109
+ base: {
110
+ ref: string;
111
+ sha: string;
112
+ };
113
+ /** SHA-256 of the dispositions file bytes; absent when none was given. */
114
+ dispositionsDigest?: string;
115
+ /** SHA-256 of the findings file bytes; names the retained copy. */
116
+ findingsDigest: string;
117
+ recordingId: string;
118
+ }
119
+ type ReviewCycleRecording = {
120
+ declarations: ReviewDeclarationRecord[]; /** Index-aligned with the cycle's `findings`. */
121
+ occurrences: ReviewOccurrenceRecord[];
122
+ } & ReviewRecordedCycleIdentity;
123
+ //#endregion
124
+ //#region src/review-ladder.d.ts
125
+ interface LadderSessionAttribution {
126
+ orchestrationMode?: "autonomous" | "manual";
127
+ resumedSession?: boolean;
128
+ runtime?: string;
129
+ sessionId?: string;
130
+ }
131
+ interface LadderUsageReport {
132
+ estimatedCostUsd?: number;
133
+ source?: string;
134
+ totalTokens?: number;
135
+ }
136
+ interface ReviewLadderCycle {
137
+ engine?: string;
138
+ findings: LadderFindingReport[];
139
+ identity?: {
140
+ headSha: string;
141
+ patchId: string;
142
+ };
143
+ historical?: true;
144
+ model?: string;
145
+ recording: ReviewCycleRecording;
146
+ session?: LadderSessionAttribution;
147
+ stage: LadderCycleStage;
148
+ usage?: LadderUsageReport;
149
+ }
150
+ //#endregion
151
+ //#region src/pr-readiness/ladder-proof-state.d.ts
152
+ interface PrReviewLadderState {
153
+ cycles: ReviewLadderCycle[];
154
+ }
155
+ //#endregion
156
+ //#region src/pr-readiness/review-proof-types.d.ts
157
+ type PrReviewKind = "correctness" | "security";
158
+ type PrReviewOutcome = "passed" | "failed" | "error";
159
+ //#endregion
160
+ //#region src/pr-readiness/review-proof-shape.d.ts
161
+ interface PrReviewFinding extends ReviewFindingAttributes {
162
+ body: string;
163
+ category?: ReviewFindingCategory;
164
+ line?: number;
165
+ protocolFinding?: true;
166
+ }
167
+ interface PrReviewResult {
168
+ kind: PrReviewKind;
169
+ startedAt: string;
170
+ endedAt: string;
171
+ durationMs: number;
172
+ model?: string;
173
+ producer?: string;
174
+ rung?: EvidenceReviewRung;
175
+ sessionId?: string;
176
+ outcome: PrReviewOutcome;
177
+ issuesFlagged: number;
178
+ summary: string;
179
+ findings: PrReviewFinding[];
180
+ lowerFindings?: (PrReviewFinding & {
181
+ priority: string;
182
+ })[];
183
+ typedVerdict?: boolean;
184
+ verdictSource?: "footer" | "recovered";
185
+ promptSections?: ReviewPromptSection[];
186
+ }
187
+ interface PrReviewProof {
188
+ schemaVersion: 3;
189
+ findingProvenanceVersion: 1;
190
+ base: string;
191
+ headSha: string;
192
+ patchId: string;
193
+ reviewCycle?: number;
194
+ maxReviewCycles?: number;
195
+ changedFiles: string[];
196
+ cleanedPaths: string[];
197
+ ladder?: PrReviewLadderState;
198
+ /**
199
+ * The policy identity this review run resolved its demanded kinds under
200
+ * (#922 Slice B). Optional: a run that could not reach the authority records
201
+ * the refusal instead, and `pr:ready` decides what an unresolved or
202
+ * disagreeing identity means for admission.
203
+ */
204
+ policyResolution?: PolicyResolution;
205
+ reviewRequirement?: {
206
+ reason: "no-applicable-mode" | "faithful-merge";
207
+ status: "not-required";
208
+ };
209
+ reviews: PrReviewResult[];
210
+ }
211
+ //#endregion
3
212
  //#region src/demand-waiver.d.ts
4
213
  /**
5
214
  * A demand that was in force, was NOT met, and was waived by the operator.
@@ -92,6 +301,55 @@ declare const boundaryReviewProofBaseSchema: z.ZodObject<{
92
301
  }, z.core.$loose>;
93
302
  type BoundaryReviewProof = z.infer<typeof boundaryReviewProofBaseSchema>;
94
303
  //#endregion
304
+ //#region src/catch-up-recognition-record.d.ts
305
+ interface CatchUpRecognition {
306
+ /** The ref the candidate targets, as the recognizing command resolved it. */
307
+ baseRef: string;
308
+ /** The live target tip at recognition time; the head's first parent. */
309
+ baseTipSha: string;
310
+ /** The head's second parent: the admitted base-side content merged in. */
311
+ mergedParentSha: string;
312
+ /**
313
+ * The tree `git merge-tree --write-tree` produced for the two parents. It
314
+ * equals the head's own tree; that equality is the faithfulness proof.
315
+ */
316
+ mergedTreeSha: string;
317
+ /** The ref that proves the second parent is admitted content. */
318
+ upstreamRef: string;
319
+ }
320
+ //#endregion
321
+ //#region src/diff-classification.d.ts
322
+ declare const DIFF_CLASSIFICATIONS: readonly ["docs/process-only", "trivial", "non-trivial"];
323
+ type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
324
+ //#endregion
325
+ //#region src/impact-stamp.d.ts
326
+ /**
327
+ * The recorded stamp. `targets` satisfies the completeness invariant: every
328
+ * target the profile declares is present, each with its exact basis — never
329
+ * silently absent. `basis: "conservative"` means an unmodelled or unprovable
330
+ * input widened every target to full impact.
331
+ */
332
+ declare const impactStampSchema: z.ZodObject<{
333
+ basis: z.ZodEnum<{
334
+ "target-scoped": "target-scoped";
335
+ conservative: "conservative";
336
+ }>;
337
+ inertPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
338
+ reasons: z.ZodArray<z.ZodString>;
339
+ stampVersion: z.ZodLiteral<4>;
340
+ targets: z.ZodArray<z.ZodObject<{
341
+ basis: z.ZodString;
342
+ impact: z.ZodEnum<{
343
+ affected: "affected";
344
+ "not-affected": "not-affected";
345
+ }>;
346
+ name: z.ZodString;
347
+ subscribedPaths: z.ZodArray<z.ZodString>;
348
+ }, z.core.$strip>>;
349
+ unsubscribedPaths: z.ZodArray<z.ZodString>;
350
+ }, z.core.$strip>;
351
+ type ImpactStamp = z.infer<typeof impactStampSchema>;
352
+ //#endregion
95
353
  //#region src/follow-up.d.ts
96
354
  interface FollowUpAction {
97
355
  /**
@@ -109,10 +367,6 @@ interface FollowUpAction {
109
367
  command: string;
110
368
  }
111
369
  //#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
370
  //#region src/pr-verify-mode.d.ts
117
371
  /**
118
372
  * The verification mode `pr:verify` resolved for a run.
@@ -123,130 +377,272 @@ type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
123
377
  */
124
378
  type ResolvedPrVerifyMode = "docs-only" | "trivial" | "full";
125
379
  //#endregion
126
- //#region src/packages/review-prompt-sections/schema.d.ts
127
- declare const reviewPromptSectionSchema: z.ZodObject<{
128
- provenance: z.ZodEnum<{
129
- "prior-review-ledger": "prior-review-ledger";
130
- "issue-review-focus": "issue-review-focus";
131
- }>;
132
- source: z.ZodString;
133
- text: z.ZodString;
134
- }, z.core.$strict>;
135
- type ReviewPromptSection = z.infer<typeof reviewPromptSectionSchema>;
136
- //#endregion
137
- //#region src/review-ladder-policy.d.ts
138
- type ReviewFindingCategory = "correctness" | "safety" | "coordination" | "maintainability" | "unknown";
139
- declare const FINDING_DISPOSITIONS: readonly ["open", "fixed-in-thread", "follow-up-filed", "waived", "stale-repeat", "rerun-noise"];
140
- type FindingDisposition = (typeof FINDING_DISPOSITIONS)[number];
141
- interface ReviewFindingAttributes {
142
- blockingAfterCap?: boolean;
143
- category?: string;
144
- citedSpan?: string;
145
- file?: string;
146
- prescribedAction?: string;
147
- priority?: string;
148
- supersedes?: {
149
- file?: string;
150
- title: string;
151
- };
380
+ //#region src/pr-verify-proof-contract.d.ts
381
+ /**
382
+ * The pr:verify proof versions a reader accepts: the current one only (#920
383
+ * item 1). #917 narrowed the pr:ready reader the same way. A pr:verify proof
384
+ * is per-candidate and short-lived — it is rewritten on every head — so no
385
+ * stored v1–v3 proof can outlive the release that drops it. Pre-1.0 posture
386
+ * applies: one current contract, no compat reader. A consumer on an older
387
+ * factory must adopt this release before HQ ingests its pr:verify proofs.
388
+ */
389
+ declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [4];
390
+ type PrVerifySchemaVersion = (typeof SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS)[number];
391
+ interface PrVerifyCommandResult {
392
+ command: string;
393
+ description: string;
394
+ /**
395
+ * Epic #550 wave 3 (#430): the profile's declared impact target for this
396
+ * command, recorded from v4 on. It is the proof's own command→target
397
+ * mapping: a `notRequiredCommands` entry must name the target recorded HERE
398
+ * for the same command, so a withholding cannot point at whichever released
399
+ * target happens to be convenient. Absent for a command the profile does
400
+ * not scope.
401
+ */
402
+ impactTarget?: string;
403
+ name: string;
404
+ scope: "docs-only" | "trivial" | "full";
405
+ }
406
+ /**
407
+ * One failing test a verification command reported (#1035).
408
+ *
409
+ * The proof keeps the failing test's IDENTITY and its failure CLASS, and
410
+ * nothing else. That is enough to decide retry-or-fix — a `timeout` under
411
+ * machine load is a flake, an `assertion` is a real break — without rerunning
412
+ * the aggregate to read a title off the console.
413
+ *
414
+ * It deliberately keeps no raw output tail and no error message body. This
415
+ * payload is transmitted to HQ ingest, and arbitrary command output can carry
416
+ * secrets (an echoed environment, a connection string inside a stack frame). A
417
+ * file path, a test title, and a closed `kind` enum cannot. The cost is the
418
+ * assertion diff and the stack frames: they help you FIX a failure, and the
419
+ * operator still reads them from the run's own console output.
420
+ */
421
+ interface PrVerifyTestFailure {
422
+ /** The test file the reporter named, as the reporter wrote it. */
423
+ file: string;
424
+ /**
425
+ * The failure class. `timeout` is the test-timeout error vitest raises at
426
+ * its own ceiling; `assertion` is a failed expectation; `error` is every
427
+ * other thrown failure.
428
+ */
429
+ kind: "assertion" | "error" | "timeout";
430
+ /** The full test title, suite names included, as the reporter wrote it. */
152
431
  title: string;
153
432
  }
154
- //#endregion
155
- //#region src/review-rungs.d.ts
156
- declare const EVIDENCE_REVIEW_RUNGS: readonly ["independent-model", "oracle", "human"];
157
- type EvidenceReviewRung = (typeof EVIDENCE_REVIEW_RUNGS)[number];
158
- //#endregion
159
- //#region src/review-ladder-ledger.d.ts
160
- type LadderCycleStage = "interior" | "gate";
161
- type LadderFindingReport = ReviewFindingAttributes;
162
- type DeclarableFindingDisposition = Exclude<FindingDisposition, "open" | "stale-repeat" | "rerun-noise">;
163
- interface LadderDispositionDeclaration {
164
- disposition: DeclarableFindingDisposition;
165
- finding: {
166
- file?: string;
167
- title: string;
433
+ interface PrVerifyExecutedCommand {
434
+ command: string;
435
+ counts?: {
436
+ testFiles?: number;
437
+ tests?: number;
168
438
  };
169
- findingReport?: LadderFindingReport;
170
- reference?: string;
171
- }
172
- //#endregion
173
- //#region src/review-ladder.d.ts
174
- interface LadderSessionAttribution {
175
- orchestrationMode?: "autonomous" | "manual";
176
- resumedSession?: boolean;
177
- runtime?: string;
178
- sessionId?: string;
179
- }
180
- interface LadderUsageReport {
181
- estimatedCostUsd?: number;
182
- source?: string;
183
- totalTokens?: number;
439
+ durationMs: number;
440
+ exitCode: number;
441
+ /**
442
+ * The failing tests this command reported (#1035). Present only when the
443
+ * command produced parseable failures, so a passing command's record is
444
+ * byte-identical to the one it wrote before this field existed.
445
+ */
446
+ failures?: PrVerifyTestFailure[];
447
+ name: string;
448
+ scope: "docs-only" | "trivial" | "full";
184
449
  }
185
- interface ReviewLadderCycle {
186
- dispositions?: LadderDispositionDeclaration[];
187
- engine?: string;
188
- findings: LadderFindingReport[];
189
- identity?: {
190
- headSha: string;
191
- patchId: string;
192
- };
193
- model?: string;
194
- correlatedRerun?: boolean;
195
- session?: LadderSessionAttribution;
196
- stage: LadderCycleStage;
197
- usage?: LadderUsageReport;
198
- }
199
- //#endregion
200
- //#region src/pr-readiness/ladder-proof-state.d.ts
201
- interface PrReviewLadderState {
202
- cycles: ReviewLadderCycle[];
203
- }
204
- //#endregion
205
- //#region src/pr-readiness/review-proof-types.d.ts
206
- type PrReviewKind = "correctness" | "security";
207
- type PrReviewOutcome = "passed" | "failed" | "error";
208
- //#endregion
209
- //#region src/pr-readiness/review-proof-shape.d.ts
210
- interface PrReviewFinding extends ReviewFindingAttributes {
211
- body: string;
212
- category?: ReviewFindingCategory;
213
- line?: number;
214
- protocolFinding?: true;
450
+ /**
451
+ * Epic #550 wave 3 (#430): a verification command the impact stamp proved this
452
+ * candidate cannot reach, so the battery did not run it.
453
+ *
454
+ * The completeness invariant lives in the pairing: `verificationCommands`
455
+ * records every command the resolved mode selected, `executedCommands` records
456
+ * what ran, and this list records the rest WITH the stamp's own basis. A
457
+ * withheld stack is therefore never silently absent from the proof — it is
458
+ * present, named, and explained.
459
+ */
460
+ interface PrVerifyNotRequiredCommand {
461
+ basis: string;
462
+ impactTarget: string;
463
+ name: string;
215
464
  }
216
- interface PrReviewResult {
217
- kind: PrReviewKind;
218
- startedAt: string;
219
- endedAt: string;
220
- durationMs: number;
221
- model?: string;
222
- producer?: string;
223
- rung?: EvidenceReviewRung;
224
- sessionId?: string;
225
- outcome: PrReviewOutcome;
226
- issuesFlagged: number;
227
- summary: string;
228
- findings: PrReviewFinding[];
229
- typedVerdict?: boolean;
230
- verdictSource?: "footer" | "recovered";
231
- promptSections?: ReviewPromptSection[];
465
+ /**
466
+ * Epic #758 (#762): a consumer package a stamp-scoped selection skipped, and
467
+ * why. Bound to the proof's stamp identity — refused when the proof records no
468
+ * stamp. The factory does not write this list; consumers do.
469
+ */
470
+ interface PrVerifyNotDemandedRecord {
471
+ basis: string;
472
+ name: string;
232
473
  }
233
- interface PrReviewProof {
234
- schemaVersion: 2;
235
- findingProvenanceVersion: 1;
474
+ interface PrVerifyProof {
475
+ schemaVersion: PrVerifySchemaVersion;
476
+ authoringSession: string;
236
477
  base: string;
237
- headSha: string;
238
- patchId: string;
239
- reviewCycle?: number;
240
- maxReviewCycles?: number;
478
+ /**
479
+ * The commit `base` resolved to when this proof was written (#1132): the
480
+ * live pull request base tip, or the freshly fetched ref. Optional and
481
+ * additive; a proof written before it existed parses unchanged.
482
+ */
483
+ baseSha?: string;
484
+ baselineFullProofs?: {
485
+ base: string;
486
+ changedFiles: string[];
487
+ headSha: string;
488
+ profilePath: string;
489
+ projectKey: string;
490
+ repository: string;
491
+ }[];
492
+ catchUpRecognition?: CatchUpRecognition;
241
493
  changedFiles: string[];
242
- cleanedPaths: string[];
243
- ladder?: PrReviewLadderState;
244
- reviewRequirement?: {
245
- reason: "no-applicable-mode";
246
- status: "not-required";
247
- };
248
- reviews: PrReviewResult[];
494
+ classification: DiffClassification;
495
+ classificationReasons: string[];
496
+ command: "patronage-factory pr:verify";
497
+ durationMs: number;
498
+ endedAt: string;
499
+ executedCommands?: PrVerifyExecutedCommand[];
500
+ headSha: string;
501
+ impactStamp?: ImpactStamp;
502
+ mode: ResolvedPrVerifyMode;
503
+ mergeBaseSha?: string;
504
+ notDemandedRecords?: PrVerifyNotDemandedRecord[];
505
+ notRequiredCommands?: PrVerifyNotRequiredCommand[];
506
+ outcome?: "aborted" | "passed";
507
+ patchId?: string;
508
+ /**
509
+ * The review policy identity this verification run resolved (#922 Slice B).
510
+ *
511
+ * Verification demands no review mode of its own. It records the identity so
512
+ * `pr:ready` can see whether the stage that produced this proof judged the
513
+ * candidate under the same policy readiness resolves. Optional, and normally
514
+ * `unresolved` on the first run of a branch: a candidate is verified before
515
+ * it has a pull request, and there is no authority to read without one.
516
+ */
517
+ policyResolution?: PolicyResolution;
518
+ profilePath: string;
519
+ projectKey: string;
520
+ repository: string;
521
+ startedAt: string;
522
+ verificationCommands: PrVerifyCommandResult[];
249
523
  }
524
+ declare const prVerifyProofSchema: z.ZodObject<{
525
+ authoringSession: z.ZodString;
526
+ base: z.ZodString;
527
+ baseSha: z.ZodOptional<z.ZodString>;
528
+ baselineFullProofs: z.ZodOptional<z.ZodArray<z.ZodObject<{
529
+ base: z.ZodString;
530
+ changedFiles: z.ZodArray<z.ZodString>;
531
+ headSha: z.ZodString;
532
+ profilePath: z.ZodString;
533
+ projectKey: z.ZodString;
534
+ repository: z.ZodString;
535
+ }, z.core.$strip>>>;
536
+ catchUpRecognition: z.ZodOptional<z.ZodType<CatchUpRecognition, unknown, z.core.$ZodTypeInternals<CatchUpRecognition, unknown>>>;
537
+ changedFiles: z.ZodArray<z.ZodString>;
538
+ classification: z.ZodEnum<{
539
+ "docs/process-only": "docs/process-only";
540
+ trivial: "trivial";
541
+ "non-trivial": "non-trivial";
542
+ }>;
543
+ classificationReasons: z.ZodArray<z.ZodString>;
544
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
545
+ durationMs: z.ZodNumber;
546
+ endedAt: z.ZodISODateTime;
547
+ executedCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
548
+ command: z.ZodString;
549
+ counts: z.ZodOptional<z.ZodObject<{
550
+ testFiles: z.ZodOptional<z.ZodNumber>;
551
+ tests: z.ZodOptional<z.ZodNumber>;
552
+ }, z.core.$strip>>;
553
+ durationMs: z.ZodNumber;
554
+ exitCode: z.ZodNumber;
555
+ failures: z.ZodOptional<z.ZodArray<z.ZodObject<{
556
+ file: z.ZodString;
557
+ kind: z.ZodEnum<{
558
+ error: "error";
559
+ assertion: "assertion";
560
+ timeout: "timeout";
561
+ }>;
562
+ title: z.ZodString;
563
+ }, z.core.$strip>>>;
564
+ name: z.ZodString;
565
+ scope: z.ZodEnum<{
566
+ trivial: "trivial";
567
+ "docs-only": "docs-only";
568
+ full: "full";
569
+ }>;
570
+ }, z.core.$strip>>>;
571
+ headSha: z.ZodString;
572
+ impactStamp: z.ZodOptional<z.ZodObject<{
573
+ basis: z.ZodEnum<{
574
+ "target-scoped": "target-scoped";
575
+ conservative: "conservative";
576
+ }>;
577
+ inertPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
578
+ reasons: z.ZodArray<z.ZodString>;
579
+ stampVersion: z.ZodLiteral<4>;
580
+ targets: z.ZodArray<z.ZodObject<{
581
+ basis: z.ZodString;
582
+ impact: z.ZodEnum<{
583
+ affected: "affected";
584
+ "not-affected": "not-affected";
585
+ }>;
586
+ name: z.ZodString;
587
+ subscribedPaths: z.ZodArray<z.ZodString>;
588
+ }, z.core.$strip>>;
589
+ unsubscribedPaths: z.ZodArray<z.ZodString>;
590
+ }, z.core.$strip>>;
591
+ mergeBaseSha: z.ZodOptional<z.ZodString>;
592
+ mode: z.ZodEnum<{
593
+ trivial: "trivial";
594
+ "docs-only": "docs-only";
595
+ full: "full";
596
+ }>;
597
+ notDemandedRecords: z.ZodOptional<z.ZodArray<z.ZodObject<{
598
+ basis: z.ZodString;
599
+ name: z.ZodString;
600
+ }, z.core.$strip>>>;
601
+ notRequiredCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
602
+ basis: z.ZodString;
603
+ impactTarget: z.ZodString;
604
+ name: z.ZodString;
605
+ }, z.core.$strip>>>;
606
+ outcome: z.ZodOptional<z.ZodEnum<{
607
+ passed: "passed";
608
+ aborted: "aborted";
609
+ }>>;
610
+ patchId: z.ZodOptional<z.ZodString>;
611
+ policyResolution: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
612
+ basePolicyDigest: z.ZodString;
613
+ baseRefName: z.ZodString;
614
+ candidatePolicyDigest: z.ZodString;
615
+ effectiveDigest: z.ZodString;
616
+ policyBaseSha: z.ZodString;
617
+ reviewPolicyChanged: z.ZodBoolean;
618
+ status: z.ZodLiteral<"authoritative">;
619
+ }, z.core.$strict>, z.ZodObject<{
620
+ baseRefName: z.ZodString;
621
+ cause: z.ZodOptional<z.ZodEnum<{
622
+ "no-pull-request": "no-pull-request";
623
+ "lookup-failed": "lookup-failed";
624
+ "policy-unreadable": "policy-unreadable";
625
+ }>>;
626
+ reason: z.ZodString;
627
+ status: z.ZodLiteral<"unresolved">;
628
+ }, z.core.$strict>], "status">>;
629
+ profilePath: z.ZodString;
630
+ projectKey: z.ZodString;
631
+ repository: z.ZodString;
632
+ schemaVersion: z.ZodLiteral<4>;
633
+ startedAt: z.ZodISODateTime;
634
+ verificationCommands: z.ZodArray<z.ZodObject<{
635
+ command: z.ZodString;
636
+ description: z.ZodString;
637
+ impactTarget: z.ZodOptional<z.ZodString>;
638
+ name: z.ZodString;
639
+ scope: z.ZodEnum<{
640
+ trivial: "trivial";
641
+ "docs-only": "docs-only";
642
+ full: "full";
643
+ }>;
644
+ }, z.core.$strip>>;
645
+ }, z.core.$strip>;
250
646
  //#endregion
251
647
  //#region src/pr-readiness/readiness-ledger.d.ts
252
648
  declare const readinessRepairSchema: z.ZodObject<{
@@ -270,7 +666,6 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
270
666
  review: "review";
271
667
  verify: "verify";
272
668
  }>;
273
- inScope: z.ZodBoolean;
274
669
  name: z.ZodString;
275
670
  reason: z.ZodOptional<z.ZodString>;
276
671
  scope: z.ZodOptional<z.ZodObject<{
@@ -324,17 +719,17 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
324
719
  }, z.core.$strip>;
325
720
  highestBlockingSeverity: z.ZodOptional<z.ZodEnum<{
326
721
  unknown: "unknown";
722
+ critical: "critical";
723
+ high: "high";
327
724
  low: "low";
328
725
  medium: "medium";
329
- high: "high";
330
- critical: "critical";
331
726
  }>>;
332
727
  highestOpenSeverity: z.ZodOptional<z.ZodEnum<{
333
728
  unknown: "unknown";
729
+ critical: "critical";
730
+ high: "high";
334
731
  low: "low";
335
732
  medium: "medium";
336
- high: "high";
337
- critical: "critical";
338
733
  }>>;
339
734
  maxReviewCycles: z.ZodOptional<z.ZodNumber>;
340
735
  nonBlockingFindings: z.ZodNumber;
@@ -378,8 +773,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
378
773
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
379
774
  reviewedPatchId: z.ZodOptional<z.ZodString>;
380
775
  status: z.ZodEnum<{
381
- "not-required": "not-required";
382
776
  blocked: "blocked";
777
+ "not-required": "not-required";
383
778
  current: "current";
384
779
  stale: "stale";
385
780
  missing: "missing";
@@ -390,28 +785,37 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
390
785
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
391
786
  reviewedPatchId: z.ZodOptional<z.ZodString>;
392
787
  status: z.ZodEnum<{
393
- "not-required": "not-required";
394
788
  blocked: "blocked";
789
+ "not-required": "not-required";
395
790
  current: "current";
396
791
  stale: "stale";
397
792
  missing: "missing";
398
793
  }>;
399
794
  }, z.core.$strip>>;
400
795
  }, z.core.$strip>;
401
- schemaVersion: z.ZodLiteral<1>;
402
- verification: z.ZodObject<{
796
+ schemaVersion: z.ZodLiteral<2>;
797
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
403
798
  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>;
799
+ prVerify: z.ZodLiteral<"missing">;
800
+ }, z.core.$strict>, z.ZodObject<{
801
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
802
+ prVerify: z.ZodLiteral<"stale">;
803
+ verifiedHeadSha: z.ZodString;
804
+ }, z.core.$strict>, z.ZodObject<{
805
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
806
+ prVerify: z.ZodLiteral<"passed-via-head">;
807
+ verifiedHeadSha: z.ZodString;
808
+ }, z.core.$strict>, z.ZodObject<{
809
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
810
+ docsOnlyVerifiedHeadSha: z.ZodString;
811
+ prVerify: z.ZodLiteral<"docs-only-delta">;
413
812
  verifiedHeadSha: z.ZodOptional<z.ZodString>;
414
- }, z.core.$strip>;
813
+ }, z.core.$strict>, z.ZodObject<{
814
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
815
+ prVerify: z.ZodLiteral<"trivial-delta">;
816
+ trivialVerifiedHeadSha: z.ZodString;
817
+ verifiedHeadSha: z.ZodOptional<z.ZodString>;
818
+ }, z.core.$strict>], "prVerify">;
415
819
  }, z.core.$strip>;
416
820
  type ReadinessRepair = z.infer<typeof readinessRepairSchema>;
417
821
  type ReadinessStatus = "ready" | "blocked";
@@ -422,17 +826,28 @@ interface PrReadyProof {
422
826
  schemaVersion: 3;
423
827
  /**
424
828
  * 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.
829
+ * Also reports an already-merged no-op (#1456). Otherwise present exactly
830
+ * when a ready run called the arming module (#1299): not
831
+ * for an `autoMerge: false` wave, and not when a notice names why the run
832
+ * did not arm. Read back from the PR rather than inferred from the
833
+ * invocation, because `gh pr merge --auto` arms, merges, or does nothing
834
+ * with the same exit code and the same empty output. `not-armed` means the
835
+ * candidate is admitted but nothing will merge it, and `followUp` carries
836
+ * the re-dispatch.
430
837
  */
431
838
  arming?: {
432
839
  detail?: string;
433
840
  headSha: string;
434
841
  outcome: "armed" | "merged" | "not-armed";
435
842
  };
843
+ /**
844
+ * The authoring session readiness resolved for the review-independence
845
+ * cross-check (#1037). Recorded so the branded check can print it beside the
846
+ * review session, model, and producer the ledger already carries — the four
847
+ * identities a human weighs at merge time. Additive and optional: proofs
848
+ * written before it carry no field, so no schema version moves.
849
+ */
850
+ authoringSession?: string;
436
851
  /**
437
852
  * Why this run blocked, one entry per refusing demand (#391): `code` is the
438
853
  * demand key from the resolver's vocabulary, `detail` the one-sentence
@@ -467,6 +882,13 @@ interface PrReadyProof {
467
882
  * waived demand reads to a human. Absent when there are none.
468
883
  */
469
884
  notices?: string[];
885
+ /**
886
+ * The policy identity readiness resolved review demand under (#922): the
887
+ * base ref, its live tip, and the digests of the base, candidate, and merged
888
+ * review policies. Optional on the wire and additive — this is a new record
889
+ * on an unchanged contract, so no schema version moves.
890
+ */
891
+ policyResolution?: PolicyResolution;
470
892
  /** Committed profile blob evaluated by readiness. Required for merge. */
471
893
  profileBlobSha?: string;
472
894
  /** Checkout-relative committed profile path evaluated by readiness. */
@@ -484,31 +906,6 @@ interface PrReadyProof {
484
906
  waivedDemands?: WaivedDemand[];
485
907
  }
486
908
  //#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
909
  //#region src/pr-readiness/external-evidence.d.ts
513
910
  declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
514
911
  check: z.ZodString;
@@ -532,489 +929,27 @@ declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
532
929
  "independent-model": "independent-model";
533
930
  oracle: "oracle";
534
931
  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;
568
- name: string;
569
- scope: "always" | "docs-only" | "trivial" | "full";
570
- }
571
- /**
572
- * Epic #550 wave 3 (#430): a verification command the impact stamp proved this
573
- * candidate cannot reach, so the battery did not run it.
574
- *
575
- * The completeness invariant lives in the pairing: `verificationCommands`
576
- * records every command the resolved mode selected, `executedCommands` records
577
- * what ran, and this list records the rest WITH the stamp's own basis. A
578
- * withheld stack is therefore never silently absent from the proof — it is
579
- * present, named, and explained.
580
- */
581
- interface PrVerifyNotRequiredCommand {
582
- basis: string;
583
- impactTarget: string;
584
- name: string;
585
- }
586
- interface PrVerifyProof {
587
- schemaVersion: PrVerifySchemaVersion;
588
- authoringSession?: string;
589
- base: string;
590
- baselineFullProofs?: {
591
- base: string;
592
- changedFiles: string[];
593
- headSha: string;
594
- profilePath: string;
595
- projectKey: string;
596
- repository: string;
597
- }[];
598
- changedFiles: string[];
599
- classification: DiffClassification;
600
- classificationReasons: string[];
601
- command: "patronage-factory pr:verify";
602
- durationMs: number;
603
- endedAt: string;
604
- executedCommands?: PrVerifyExecutedCommand[];
605
- headSha: string;
606
- impactStamp?: ImpactStamp;
607
- mode: ResolvedPrVerifyMode;
608
- mergeBaseSha?: string;
609
- notRequiredCommands?: PrVerifyNotRequiredCommand[];
610
- outcome?: "aborted" | "passed";
611
- 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>;
932
+ }>>;
933
+ schemaVersion: z.ZodLiteral<1>;
934
+ sessionId: z.ZodOptional<z.ZodString>;
935
+ timestamp: z.ZodOptional<z.ZodISODateTime>;
936
+ }, z.core.$loose>;
937
+ type EvidenceEnvelope = z.infer<typeof evidenceEnvelopeBaseSchema>;
938
+ //#endregion
939
+ //#region src/pr-readiness/review-proof.d.ts
940
+ declare const PR_REVIEW_SCHEMA_VERSION = 3;
941
+ declare const prReviewFindingSchema: z.ZodType<PrReviewFinding>;
942
+ declare const prReviewResultSchema: z.ZodType<PrReviewResult>;
943
+ declare const prReviewProofSchema: z.ZodType<PrReviewProof>;
944
+ //#endregion
945
+ //#region src/closeout-artifact.d.ts
946
+ /** Artifact versions accepted at ingest. */
947
+ declare const SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS: readonly [5];
948
+ /** Strict, bounded runtime transport contract emitted by factory:closeout. */
949
+ declare const closeoutArtifactSchema: z.ZodObject<{
1000
950
  budget: z.ZodObject<{
1001
951
  note: z.ZodString;
1002
952
  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
953
  }, z.core.$strict>;
1019
954
  couldNotSee: z.ZodArray<z.ZodObject<{
1020
955
  id: z.ZodString;
@@ -1023,82 +958,12 @@ declare const closeoutArtifactReadSchema: z.ZodUnion<readonly [z.ZodObject<{
1023
958
  }, z.core.$strict>>;
1024
959
  epic: z.ZodString;
1025
960
  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
961
  metrics: z.ZodArray<z.ZodObject<{
1081
962
  label: z.ZodString;
1082
963
  metric: z.ZodString;
1083
964
  source: z.ZodObject<{
1084
965
  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
- }>;
966
+ kind: z.ZodLiteral<"token-harvest">;
1102
967
  }, z.core.$strict>;
1103
968
  unit: z.ZodEnum<{
1104
969
  boolean: "boolean";
@@ -1106,191 +971,35 @@ declare const closeoutArtifactReadSchema: z.ZodUnion<readonly [z.ZodObject<{
1106
971
  count: "count";
1107
972
  tokens: "tokens";
1108
973
  usd: "usd";
1109
- ratio: "ratio";
1110
974
  }>;
1111
975
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
1112
976
  }, z.core.$strict>>;
1113
977
  repo: z.ZodString;
1114
- schemaVersion: z.ZodLiteral<3 | 4>;
1115
- }, z.core.$strict>]>;
978
+ schemaVersion: z.ZodLiteral<5>;
979
+ }, z.core.$strict>;
1116
980
  type CloseoutArtifact = z.infer<typeof closeoutArtifactSchema>;
1117
- type HistoricalCloseoutArtifact = z.infer<typeof legacyCloseoutArtifactSchema>;
1118
981
  //#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<{
982
+ //#region src/gate-timing-record.d.ts
983
+ declare const gateTimingRecordSchema: z.ZodObject<{
1189
984
  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>;
985
+ cycle: z.ZodNumber;
986
+ durationMs: z.ZodNumber;
987
+ gate: z.ZodEnum<{
988
+ "boundary:check": "boundary:check";
989
+ "factory:closeout": "factory:closeout";
990
+ "pr:ready": "pr:ready";
991
+ "pr:review": "pr:review";
992
+ "pr:verify": "pr:verify";
993
+ }>;
994
+ outcome: z.ZodEnum<{
995
+ pass: "pass";
996
+ fail: "fail";
997
+ }>;
1242
998
  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>;
999
+ startOffsetMs: z.ZodNumber;
1000
+ startedAt: z.ZodISODateTime;
1274
1001
  }, 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;
1002
+ type GateTimingRecord = z.infer<typeof gateTimingRecordSchema>;
1294
1003
  //#endregion
1295
1004
  //#region src/schemas.d.ts
1296
1005
  declare const EVIDENCE_ENVELOPE_SCHEMA_VERSION = 1;
@@ -1321,222 +1030,6 @@ declare const evidenceEnvelopeSchema: z.ZodObject<{
1321
1030
  sessionId: z.ZodOptional<z.ZodString>;
1322
1031
  timestamp: z.ZodOptional<z.ZodISODateTime>;
1323
1032
  }, z.core.$loose>;
1324
- declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [1, 2, 3, 4];
1325
- declare const prVerifyProofSchema: z.ZodObject<{
1326
- authoringSession: z.ZodOptional<z.ZodString>;
1327
- base: z.ZodString;
1328
- baselineFullProofs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1329
- base: z.ZodString;
1330
- changedFiles: z.ZodArray<z.ZodString>;
1331
- headSha: z.ZodString;
1332
- profilePath: z.ZodString;
1333
- projectKey: z.ZodString;
1334
- repository: z.ZodString;
1335
- }, z.core.$strip>>>;
1336
- changedFiles: z.ZodArray<z.ZodString>;
1337
- classification: z.ZodEnum<{
1338
- "docs/process-only": "docs/process-only";
1339
- trivial: "trivial";
1340
- "non-trivial": "non-trivial";
1341
- }>;
1342
- classificationReasons: z.ZodArray<z.ZodString>;
1343
- command: z.ZodLiteral<"patronage-factory pr:verify">;
1344
- durationMs: z.ZodNumber;
1345
- endedAt: z.ZodISODateTime;
1346
- executedCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
1347
- command: z.ZodString;
1348
- counts: z.ZodOptional<z.ZodObject<{
1349
- testFiles: z.ZodOptional<z.ZodNumber>;
1350
- tests: z.ZodOptional<z.ZodNumber>;
1351
- }, z.core.$strip>>;
1352
- durationMs: z.ZodNumber;
1353
- exitCode: z.ZodNumber;
1354
- name: z.ZodString;
1355
- scope: z.ZodEnum<{
1356
- trivial: "trivial";
1357
- always: "always";
1358
- "docs-only": "docs-only";
1359
- full: "full";
1360
- }>;
1361
- }, z.core.$strip>>>;
1362
- headSha: z.ZodString;
1363
- impactStamp: z.ZodOptional<z.ZodObject<{
1364
- basis: z.ZodEnum<{
1365
- "target-scoped": "target-scoped";
1366
- conservative: "conservative";
1367
- }>;
1368
- reasons: z.ZodArray<z.ZodString>;
1369
- stampVersion: z.ZodLiteral<2>;
1370
- targets: z.ZodArray<z.ZodObject<{
1371
- basis: z.ZodString;
1372
- impact: z.ZodEnum<{
1373
- affected: "affected";
1374
- "not-affected": "not-affected";
1375
- }>;
1376
- name: z.ZodString;
1377
- }, z.core.$strip>>;
1378
- }, z.core.$strip>>;
1379
- mergeBaseSha: z.ZodOptional<z.ZodString>;
1380
- mode: z.ZodEnum<{
1381
- trivial: "trivial";
1382
- "docs-only": "docs-only";
1383
- full: "full";
1384
- }>;
1385
- notRequiredCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
1386
- basis: z.ZodString;
1387
- impactTarget: z.ZodString;
1388
- name: z.ZodString;
1389
- }, z.core.$strip>>>;
1390
- outcome: z.ZodOptional<z.ZodEnum<{
1391
- aborted: "aborted";
1392
- passed: "passed";
1393
- }>>;
1394
- patchId: z.ZodOptional<z.ZodString>;
1395
- profilePath: z.ZodString;
1396
- projectKey: z.ZodString;
1397
- repository: z.ZodString;
1398
- schemaVersion: z.ZodNumber & z.ZodType<1 | 2 | 3 | 4, number, z.core.$ZodTypeInternals<1 | 2 | 3 | 4, number>>;
1399
- startedAt: z.ZodISODateTime;
1400
- verificationCommands: z.ZodArray<z.ZodObject<{
1401
- command: z.ZodString;
1402
- description: z.ZodString;
1403
- impactTarget: z.ZodOptional<z.ZodString>;
1404
- name: z.ZodString;
1405
- scope: z.ZodEnum<{
1406
- trivial: "trivial";
1407
- always: "always";
1408
- "docs-only": "docs-only";
1409
- full: "full";
1410
- }>;
1411
- }, z.core.$strip>>;
1412
- }, 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>;
1419
- 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>;
1447
- 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">;
1454
- }, 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";
1492
- }>;
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>;
1539
- }, z.core.$loose>;
1540
1033
  declare const BOUNDARY_REVIEW_PROOF_KIND = "boundary-review-proof";
1541
1034
  declare const boundaryReviewProofSchema: z.ZodObject<{
1542
1035
  boundary: z.ZodString;
@@ -1638,12 +1131,15 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
1638
1131
  type BoundaryCheckProofRecord = z.infer<typeof boundaryCheckProofSchema>;
1639
1132
  declare const PR_READY_SCHEMA_VERSION = 3;
1640
1133
  /**
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.
1134
+ * The pr:ready proof versions a reader accepts: the current one only (#917
1135
+ * item 1). #894 narrowed the nested readiness ledger to `schemaVersion: 2` and
1136
+ * the `prVerify` tagged union, which no v1 or v2 pr:ready proof can satisfy.
1137
+ * Advertising 1 and 2 here therefore promised an acceptance the nested schema
1138
+ * already refused. Pre-1.0 posture applies: one current contract, no compat
1139
+ * reader. An alpha.22 consumer must adopt alpha.23 before HQ ingests its
1140
+ * pr:ready proofs.
1645
1141
  */
1646
- declare const SUPPORTED_PR_READY_SCHEMA_VERSIONS: readonly [1, 2, 3];
1142
+ declare const SUPPORTED_PR_READY_SCHEMA_VERSIONS: readonly [3];
1647
1143
  declare const prReadyProofSchema: z.ZodObject<{
1648
1144
  arming: z.ZodOptional<z.ZodObject<{
1649
1145
  detail: z.ZodOptional<z.ZodString>;
@@ -1654,6 +1150,7 @@ declare const prReadyProofSchema: z.ZodObject<{
1654
1150
  "not-armed": "not-armed";
1655
1151
  }>;
1656
1152
  }, z.core.$strip>>;
1153
+ authoringSession: z.ZodOptional<z.ZodString>;
1657
1154
  blockedReasons: z.ZodOptional<z.ZodArray<z.ZodObject<{
1658
1155
  code: z.ZodString;
1659
1156
  detail: z.ZodString;
@@ -1678,7 +1175,6 @@ declare const prReadyProofSchema: z.ZodObject<{
1678
1175
  review: "review";
1679
1176
  verify: "verify";
1680
1177
  }>;
1681
- inScope: z.ZodBoolean;
1682
1178
  name: z.ZodString;
1683
1179
  reason: z.ZodOptional<z.ZodString>;
1684
1180
  scope: z.ZodOptional<z.ZodObject<{
@@ -1695,7 +1191,6 @@ declare const prReadyProofSchema: z.ZodObject<{
1695
1191
  "out-of-scope": "out-of-scope";
1696
1192
  }>;
1697
1193
  }, z.core.$strip>>>;
1698
- finalReviewPoint: z.ZodOptional<z.ZodBoolean>;
1699
1194
  github: z.ZodObject<{
1700
1195
  draft: z.ZodBoolean;
1701
1196
  mergeStateStatus: z.ZodString;
@@ -1710,43 +1205,14 @@ declare const prReadyProofSchema: z.ZodObject<{
1710
1205
  reviewDecision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1711
1206
  unresolvedReviewThreads: z.ZodNumber;
1712
1207
  }, z.core.$strip>;
1713
- handledCommentsProducer: z.ZodOptional<z.ZodObject<{
1714
- identity: z.ZodString;
1715
- mode: z.ZodEnum<{
1716
- app: "app";
1717
- "commit-status": "commit-status";
1718
- }>;
1719
- }, z.core.$strip>>;
1720
- handledHumanComments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1721
- clearedAt: z.ZodOptional<z.ZodString>;
1722
- sessionId: z.ZodOptional<z.ZodString>;
1723
- source: z.ZodEnum<{
1724
- cli: "cli";
1725
- "check-run": "check-run";
1726
- }>;
1727
- url: z.ZodString;
1728
- }, z.core.$strip>>>;
1729
1208
  headSha: z.ZodString;
1730
1209
  mergeBaseSha: z.ZodOptional<z.ZodString>;
1731
1210
  patchId: z.ZodString;
1732
- postReadinessHumanComments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1733
- author: z.ZodString;
1734
- createdAt: z.ZodString;
1735
- summary: z.ZodString;
1736
- url: z.ZodString;
1737
- }, z.core.$strip>>>;
1738
- postReadinessHumanReviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
1739
- author: z.ZodString;
1740
- createdAt: z.ZodString;
1741
- summary: z.ZodString;
1742
- url: z.ZodString;
1743
- }, z.core.$strip>>>;
1744
1211
  pr: z.ZodNumber;
1745
1212
  repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
1746
1213
  action: z.ZodString;
1747
1214
  code: z.ZodEnum<{
1748
1215
  "undraft-pr": "undraft-pr";
1749
- "render-pr-body-sections": "render-pr-body-sections";
1750
1216
  "await-post-undraft-checks": "await-post-undraft-checks";
1751
1217
  }>;
1752
1218
  command: z.ZodString;
@@ -1762,17 +1228,17 @@ declare const prReadyProofSchema: z.ZodObject<{
1762
1228
  }, z.core.$strip>;
1763
1229
  highestBlockingSeverity: z.ZodOptional<z.ZodEnum<{
1764
1230
  unknown: "unknown";
1231
+ critical: "critical";
1232
+ high: "high";
1765
1233
  low: "low";
1766
1234
  medium: "medium";
1767
- high: "high";
1768
- critical: "critical";
1769
1235
  }>>;
1770
1236
  highestOpenSeverity: z.ZodOptional<z.ZodEnum<{
1771
1237
  unknown: "unknown";
1238
+ critical: "critical";
1239
+ high: "high";
1772
1240
  low: "low";
1773
1241
  medium: "medium";
1774
- high: "high";
1775
- critical: "critical";
1776
1242
  }>>;
1777
1243
  maxReviewCycles: z.ZodOptional<z.ZodNumber>;
1778
1244
  nonBlockingFindings: z.ZodNumber;
@@ -1789,7 +1255,6 @@ declare const prReadyProofSchema: z.ZodObject<{
1789
1255
  forcedTransition: z.ZodOptional<z.ZodEnum<{
1790
1256
  "gate-cap-exhausted": "gate-cap-exhausted";
1791
1257
  "interior-cap-reached": "interior-cap-reached";
1792
- "interior-takeover": "interior-takeover";
1793
1258
  }>>;
1794
1259
  nextAction: z.ZodEnum<{
1795
1260
  "run-interior-cycle": "run-interior-cycle";
@@ -1802,93 +1267,10 @@ declare const prReadyProofSchema: z.ZodObject<{
1802
1267
  stage: z.ZodEnum<{
1803
1268
  gate: "gate";
1804
1269
  interior: "interior";
1805
- "interior-takeover": "interior-takeover";
1806
1270
  "interior-complete": "interior-complete";
1807
1271
  }>;
1808
1272
  }, 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>>>;
1273
+ reviewRuns: z.ZodOptional<z.ZodArray<z.ZodType<PrReviewResult, unknown, z.core.$ZodTypeInternals<PrReviewResult, unknown>>>>;
1892
1274
  reviewTerminalState: z.ZodOptional<z.ZodEnum<{
1893
1275
  blocked: "blocked";
1894
1276
  "accepted-with-findings": "accepted-with-findings";
@@ -1896,73 +1278,90 @@ declare const prReadyProofSchema: z.ZodObject<{
1896
1278
  }>>;
1897
1279
  reviews: z.ZodObject<{
1898
1280
  correctness: z.ZodObject<{
1899
- docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1900
1281
  required: z.ZodBoolean;
1901
1282
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1902
1283
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1903
1284
  status: z.ZodEnum<{
1904
- "not-required": "not-required";
1905
1285
  blocked: "blocked";
1286
+ "not-required": "not-required";
1906
1287
  current: "current";
1907
1288
  stale: "stale";
1908
1289
  missing: "missing";
1909
1290
  }>;
1910
- }, z.core.$strip>;
1291
+ }, z.core.$strict>;
1911
1292
  security: z.ZodOptional<z.ZodObject<{
1912
- docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1913
1293
  required: z.ZodBoolean;
1914
1294
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1915
1295
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1916
1296
  status: z.ZodEnum<{
1917
- "not-required": "not-required";
1918
1297
  blocked: "blocked";
1298
+ "not-required": "not-required";
1919
1299
  current: "current";
1920
1300
  stale: "stale";
1921
1301
  missing: "missing";
1922
1302
  }>;
1923
- }, z.core.$strip>>;
1303
+ }, z.core.$strict>>;
1924
1304
  }, z.core.$strip>;
1925
- schemaVersion: z.ZodLiteral<1>;
1926
- stackRole: z.ZodOptional<z.ZodEnum<{
1927
- single: "single";
1928
- slice: "slice";
1929
- rollup: "rollup";
1930
- "merge-gate prerequisite": "merge-gate prerequisite";
1931
- }>>;
1932
- verification: z.ZodObject<{
1305
+ schemaVersion: z.ZodLiteral<2>;
1306
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
1933
1307
  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>;
1308
+ prVerify: z.ZodLiteral<"missing">;
1309
+ }, z.core.$strict>, z.ZodObject<{
1310
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1311
+ prVerify: z.ZodLiteral<"stale">;
1312
+ verifiedHeadSha: z.ZodString;
1313
+ }, z.core.$strict>, z.ZodObject<{
1314
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1315
+ prVerify: z.ZodLiteral<"passed-via-head">;
1316
+ verifiedHeadSha: z.ZodString;
1317
+ }, z.core.$strict>, z.ZodObject<{
1318
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1319
+ docsOnlyVerifiedHeadSha: z.ZodString;
1320
+ prVerify: z.ZodLiteral<"docs-only-delta">;
1943
1321
  verifiedHeadSha: z.ZodOptional<z.ZodString>;
1944
- }, z.core.$strip>;
1322
+ }, z.core.$strict>, z.ZodObject<{
1323
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1324
+ prVerify: z.ZodLiteral<"trivial-delta">;
1325
+ trivialVerifiedHeadSha: z.ZodString;
1326
+ verifiedHeadSha: z.ZodOptional<z.ZodString>;
1327
+ }, z.core.$strict>], "prVerify">;
1945
1328
  }, z.core.$strip>;
1946
1329
  notices: z.ZodOptional<z.ZodArray<z.ZodString>>;
1330
+ policyResolution: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1331
+ basePolicyDigest: z.ZodString;
1332
+ baseRefName: z.ZodString;
1333
+ candidatePolicyDigest: z.ZodString;
1334
+ effectiveDigest: z.ZodString;
1335
+ policyBaseSha: z.ZodString;
1336
+ reviewPolicyChanged: z.ZodBoolean;
1337
+ status: z.ZodLiteral<"authoritative">;
1338
+ }, z.core.$strict>, z.ZodObject<{
1339
+ baseRefName: z.ZodString;
1340
+ cause: z.ZodOptional<z.ZodEnum<{
1341
+ "no-pull-request": "no-pull-request";
1342
+ "lookup-failed": "lookup-failed";
1343
+ "policy-unreadable": "policy-unreadable";
1344
+ }>>;
1345
+ reason: z.ZodString;
1346
+ status: z.ZodLiteral<"unresolved">;
1347
+ }, z.core.$strict>], "status">>;
1947
1348
  profileBlobSha: z.ZodOptional<z.ZodString>;
1948
1349
  profilePath: z.ZodOptional<z.ZodString>;
1949
1350
  repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
1950
1351
  action: z.ZodString;
1951
1352
  code: z.ZodEnum<{
1952
1353
  "undraft-pr": "undraft-pr";
1953
- "render-pr-body-sections": "render-pr-body-sections";
1954
1354
  "await-post-undraft-checks": "await-post-undraft-checks";
1955
1355
  }>;
1956
1356
  command: z.ZodString;
1957
1357
  }, z.core.$strip>>>;
1958
1358
  repository: z.ZodOptional<z.ZodString>;
1959
- schemaVersion: z.ZodNumber & z.ZodType<1 | 2 | 3, number, z.core.$ZodTypeInternals<1 | 2 | 3, number>>;
1359
+ schemaVersion: z.ZodLiteral<3>;
1960
1360
  status: z.ZodEnum<{
1961
1361
  ready: "ready";
1962
1362
  blocked: "blocked";
1963
- "slice-ready/not-final": "slice-ready/not-final";
1964
1363
  }>;
1965
1364
  waivedDemands: z.ZodOptional<z.ZodArray<z.ZodType<WaivedDemand, unknown, z.core.$ZodTypeInternals<WaivedDemand, unknown>>>>;
1966
1365
  }, z.core.$strip>;
1967
1366
  //#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 };
1367
+ 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 GateTimingRecord, 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, gateTimingRecordSchema, prReadyProofSchema, prReviewFindingSchema, prReviewProofSchema, prReviewResultSchema, prVerifyProofSchema, reviewPromptSectionSchema, reviewPromptSectionsSchema, waivedDemandSchema };