@patronage/software-factory 0.20.0

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.
@@ -0,0 +1,1430 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/boundary-review-proof.d.ts
4
+ declare const boundaryReviewProofBaseSchema: z.ZodObject<{
5
+ boundary: z.ZodString;
6
+ coveredSet: z.ZodArray<z.ZodObject<{
7
+ headSha: z.ZodOptional<z.ZodString>;
8
+ issue: z.ZodOptional<z.ZodNumber>;
9
+ mergedSha: z.ZodOptional<z.ZodString>;
10
+ pr: z.ZodNumber;
11
+ state: z.ZodEnum<{
12
+ merged: "merged";
13
+ open: "open";
14
+ }>;
15
+ wave: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$loose>>;
17
+ dispositions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
18
+ findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
19
+ blockingAfterCap: z.ZodOptional<z.ZodBoolean>;
20
+ category: z.ZodOptional<z.ZodString>;
21
+ disposition: z.ZodOptional<z.ZodString>;
22
+ title: z.ZodString;
23
+ }, z.core.$loose>>>;
24
+ kind: z.ZodLiteral<"boundary-review-proof">;
25
+ manifestHash: z.ZodObject<{
26
+ algo: z.ZodLiteral<"sha256">;
27
+ scope: z.ZodOptional<z.ZodString>;
28
+ value: z.ZodString;
29
+ }, z.core.$loose>;
30
+ outcome: z.ZodEnum<{
31
+ pass: "pass";
32
+ fail: "fail";
33
+ }>;
34
+ producer: z.ZodString;
35
+ rung: z.ZodEnum<{
36
+ "independent-model": "independent-model";
37
+ oracle: "oracle";
38
+ human: "human";
39
+ }>;
40
+ schemaVersion: z.ZodLiteral<1>;
41
+ sessionId: z.ZodOptional<z.ZodString>;
42
+ specHash: z.ZodOptional<z.ZodObject<{
43
+ algo: z.ZodLiteral<"sha256">;
44
+ scope: z.ZodOptional<z.ZodString>;
45
+ value: z.ZodString;
46
+ }, z.core.$loose>>;
47
+ }, z.core.$loose>;
48
+ type BoundaryReviewProof = z.infer<typeof boundaryReviewProofBaseSchema>;
49
+ //#endregion
50
+ //#region src/follow-up.d.ts
51
+ interface FollowUpAction {
52
+ /**
53
+ * Machine-safe argv-style array for the obvious next action, e.g.
54
+ * ["gh","pr","merge","513","--squash"]. Same shape and field name that
55
+ * `factory:delegate --print` emits, so an orchestrating agent can spawn the
56
+ * next command without reconstructing a shell string. argv[0] is the
57
+ * executable; the rest are literal, already-split arguments.
58
+ */
59
+ argv: string[];
60
+ /**
61
+ * Human-readable rendering of {@link argv} for logs and operators. Additive
62
+ * to argv, never a substitute for it — argv is the source of truth.
63
+ */
64
+ command: string;
65
+ }
66
+ //#endregion
67
+ //#region src/diff-classification.d.ts
68
+ declare const DIFF_CLASSIFICATIONS: readonly ["docs/process-only", "trivial", "non-trivial"];
69
+ type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
70
+ //#endregion
71
+ //#region src/pr-verify-mode.d.ts
72
+ /**
73
+ * The verification mode `pr:verify` resolved for a run.
74
+ *
75
+ * Canonically declared here rather than inside `pr-readiness/` so that modules
76
+ * on either side of that boundary — the readiness proof shape and the durable
77
+ * check-run payload — can name the same union without importing each other.
78
+ */
79
+ type ResolvedPrVerifyMode = "docs-only" | "trivial" | "full";
80
+ //#endregion
81
+ //#region src/merge-preflight/worktree-held-branch.d.ts
82
+ /**
83
+ * Detects when a PR head branch is checked out in a local git worktree.
84
+ *
85
+ * `gh pr merge --delete-branch` fails when the local branch is held by a
86
+ * worktree (git refuses to delete a checked-out branch), which previously
87
+ * broke the auto-merge lane mid-merge (patronage/internal#284). The merge
88
+ * preflight surfaces this as an actionable notice — not a hard fail — so the
89
+ * operator merges without `--delete-branch` (or prunes the worktree first)
90
+ * and defers local branch cleanup to closeout.
91
+ */
92
+ interface WorktreeHeldBranch {
93
+ branch: string;
94
+ worktreePath: string;
95
+ }
96
+ //#endregion
97
+ //#region src/pr-readiness/merge-identity.d.ts
98
+ interface PostProofCommit {
99
+ sha: string;
100
+ subject: string;
101
+ }
102
+ type MergeIdentityResult = {
103
+ kind: "match";
104
+ headSha: string;
105
+ } | {
106
+ kind: "diverged";
107
+ liveHeadSha: string;
108
+ postProofCommits?: PostProofCommit[];
109
+ proofHeadSha: string;
110
+ };
111
+ type MergeGuardIdentity = MergeIdentityResult | {
112
+ kind: "live-head-invalid";
113
+ pr: number;
114
+ received: string;
115
+ } | {
116
+ kind: "ready-proof-missing";
117
+ errorDetail?: string;
118
+ readyProofPath: string;
119
+ } | {
120
+ kind: "ready-proof-pr-mismatch";
121
+ proofPr: number;
122
+ requestedPr: number;
123
+ } | {
124
+ kind: "ready-proof-not-ready";
125
+ blockingReasons: string[];
126
+ status: string;
127
+ };
128
+ //#endregion
129
+ //#region src/review-rungs.d.ts
130
+ declare const EVIDENCE_REVIEW_RUNGS: readonly ["independent-model", "oracle", "human"];
131
+ type EvidenceReviewRung = (typeof EVIDENCE_REVIEW_RUNGS)[number];
132
+ //#endregion
133
+ //#region src/pr-merge-check.d.ts
134
+ interface PrMergeCheckProof {
135
+ schemaVersion: 1;
136
+ blockingReasons: string[];
137
+ boundary?: {
138
+ autoMerge: boolean;
139
+ epic: number;
140
+ review: EvidenceReviewRung;
141
+ wave: string;
142
+ };
143
+ command: "patronage-factory pr:merge-check";
144
+ /**
145
+ * Machine-safe arg array for the obvious next action (#523): on `pass`, the
146
+ * remote-only GitHub merge API invocation for this PR; on `fail`, the re-run that clears the
147
+ * block (`pr:ready`, or `pr:verify` then `pr:ready` after a head
148
+ * divergence). Same `argv` shape `factory:delegate --print` emits. Optional
149
+ * and purely additive — existing consumers ignore it.
150
+ */
151
+ followUp?: FollowUpAction;
152
+ identity: MergeGuardIdentity;
153
+ /**
154
+ * The pushed PR head SHA fetched from GitHub at check time. Absent only
155
+ * when GitHub returned no usable 40-hex head (identity kind
156
+ * "live-head-invalid"), which is itself a fail-closed blocking state.
157
+ */
158
+ liveHeadSha?: string;
159
+ /**
160
+ * Actionable operational notices that do not block the merge, e.g. a PR
161
+ * head branch held by a local worktree, which makes
162
+ * `gh pr merge --delete-branch` fail (patronage/internal#284).
163
+ */
164
+ notices?: string[];
165
+ pr: number;
166
+ status: "pass" | "fail";
167
+ /** Present when the PR head branch is checked out in a local worktree. */
168
+ worktreeHeldBranch?: WorktreeHeldBranch;
169
+ /** All merge-relevant branches held by local worktrees (head and default). */
170
+ worktreeHeldBranches?: WorktreeHeldBranch[];
171
+ }
172
+ //#endregion
173
+ //#region src/packages/review-prompt-sections/schema.d.ts
174
+ declare const reviewPromptSectionSchema: z.ZodObject<{
175
+ provenance: z.ZodEnum<{
176
+ "prior-review-ledger": "prior-review-ledger";
177
+ "profile-standing-checklist": "profile-standing-checklist";
178
+ "issue-review-focus": "issue-review-focus";
179
+ }>;
180
+ source: z.ZodString;
181
+ text: z.ZodString;
182
+ }, z.core.$strict>;
183
+ type ReviewPromptSection = z.infer<typeof reviewPromptSectionSchema>;
184
+ //#endregion
185
+ //#region src/review-ladder-policy.d.ts
186
+ type ReviewFindingCategory = "correctness" | "safety" | "coordination" | "maintainability" | "unknown";
187
+ declare const FINDING_DISPOSITIONS: readonly ["open", "fixed-in-thread", "follow-up-filed", "waived", "stale-repeat", "rerun-noise"];
188
+ type FindingDisposition = (typeof FINDING_DISPOSITIONS)[number];
189
+ interface ReviewFindingAttributes {
190
+ blockingAfterCap?: boolean;
191
+ category?: string;
192
+ citedSpan?: string;
193
+ file?: string;
194
+ prescribedAction?: string;
195
+ priority?: string;
196
+ supersedes?: {
197
+ file?: string;
198
+ title: string;
199
+ };
200
+ title: string;
201
+ }
202
+ //#endregion
203
+ //#region src/review-ladder-ledger.d.ts
204
+ type LadderCycleStage = "interior" | "gate";
205
+ type LadderFindingReport = ReviewFindingAttributes;
206
+ type DeclarableFindingDisposition = Exclude<FindingDisposition, "open" | "stale-repeat" | "rerun-noise">;
207
+ interface LadderDispositionDeclaration {
208
+ disposition: DeclarableFindingDisposition;
209
+ finding: {
210
+ file?: string;
211
+ title: string;
212
+ };
213
+ findingReport?: LadderFindingReport;
214
+ reference?: string;
215
+ }
216
+ //#endregion
217
+ //#region src/review-ladder.d.ts
218
+ interface LadderSessionAttribution {
219
+ orchestrationMode?: "autonomous" | "manual";
220
+ resumedSession?: boolean;
221
+ runtime?: string;
222
+ sessionId?: string;
223
+ }
224
+ interface LadderUsageReport {
225
+ estimatedCostUsd?: number;
226
+ source?: string;
227
+ totalTokens?: number;
228
+ }
229
+ interface ReviewLadderCycle {
230
+ dispositions?: LadderDispositionDeclaration[];
231
+ engine?: string;
232
+ findings: LadderFindingReport[];
233
+ identity?: {
234
+ headSha: string;
235
+ patchId: string;
236
+ };
237
+ model?: string;
238
+ correlatedRerun?: boolean;
239
+ session?: LadderSessionAttribution;
240
+ stage: LadderCycleStage;
241
+ usage?: LadderUsageReport;
242
+ }
243
+ //#endregion
244
+ //#region src/pr-readiness/ladder-proof-state.d.ts
245
+ interface PrReviewLadderState {
246
+ cycles: ReviewLadderCycle[];
247
+ }
248
+ //#endregion
249
+ //#region src/pr-readiness/review-proof-types.d.ts
250
+ type PrReviewKind = "correctness" | "security";
251
+ type PrReviewOutcome = "passed" | "failed" | "error";
252
+ //#endregion
253
+ //#region src/pr-readiness/review-proof-shape.d.ts
254
+ interface PrReviewFinding extends ReviewFindingAttributes {
255
+ body: string;
256
+ category?: ReviewFindingCategory;
257
+ line?: number;
258
+ protocolFinding?: true;
259
+ }
260
+ interface PrReviewResult {
261
+ kind: PrReviewKind;
262
+ startedAt: string;
263
+ endedAt: string;
264
+ durationMs: number;
265
+ model?: string;
266
+ producer?: string;
267
+ rung?: EvidenceReviewRung;
268
+ sessionId?: string;
269
+ outcome: PrReviewOutcome;
270
+ issuesFlagged: number;
271
+ summary: string;
272
+ findings: PrReviewFinding[];
273
+ typedVerdict?: boolean;
274
+ verdictSource?: "footer" | "recovered";
275
+ promptSections?: ReviewPromptSection[];
276
+ }
277
+ interface PrReviewProof {
278
+ schemaVersion: 2;
279
+ findingProvenanceVersion: 1;
280
+ base: string;
281
+ headSha: string;
282
+ patchId: string;
283
+ reviewCycle?: number;
284
+ maxReviewCycles?: number;
285
+ changedFiles: string[];
286
+ cleanedPaths: string[];
287
+ ladder?: PrReviewLadderState;
288
+ reviewRequirement?: {
289
+ reason: "docs-only-profile-bypass";
290
+ status: "not-required";
291
+ };
292
+ reviews: PrReviewResult[];
293
+ }
294
+ //#endregion
295
+ //#region src/pr-readiness/readiness-ledger.d.ts
296
+ declare const readinessRepairSchema: z.ZodObject<{
297
+ action: z.ZodString;
298
+ code: z.ZodEnum<{
299
+ "undraft-pr": "undraft-pr";
300
+ "render-pr-body-sections": "render-pr-body-sections";
301
+ "await-post-undraft-checks": "await-post-undraft-checks";
302
+ }>;
303
+ command: z.ZodString;
304
+ }, z.core.$strip>;
305
+ declare const managedReadinessLedgerSchema: z.ZodObject<{
306
+ baseSha: z.ZodString;
307
+ blockingReasons: z.ZodArray<z.ZodString>;
308
+ classification: z.ZodEnum<{
309
+ "docs/process-only": "docs/process-only";
310
+ trivial: "trivial";
311
+ "non-trivial": "non-trivial";
312
+ }>;
313
+ externalChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
314
+ checkType: z.ZodEnum<{
315
+ review: "review";
316
+ verify: "verify";
317
+ }>;
318
+ inScope: z.ZodBoolean;
319
+ name: z.ZodString;
320
+ reason: z.ZodOptional<z.ZodString>;
321
+ scope: z.ZodOptional<z.ZodObject<{
322
+ classifications: z.ZodOptional<z.ZodArray<z.ZodEnum<{
323
+ "docs/process-only": "docs/process-only";
324
+ trivial: "trivial";
325
+ "non-trivial": "non-trivial";
326
+ }>>>;
327
+ labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
328
+ }, z.core.$strict>>;
329
+ scopeReason: z.ZodString;
330
+ status: z.ZodEnum<{
331
+ satisfied: "satisfied";
332
+ unmet: "unmet";
333
+ "out-of-scope": "out-of-scope";
334
+ }>;
335
+ }, z.core.$strip>>>;
336
+ finalReviewPoint: z.ZodBoolean;
337
+ github: z.ZodObject<{
338
+ currentWithBase: z.ZodBoolean;
339
+ draft: z.ZodBoolean;
340
+ mergeStateStatus: z.ZodString;
341
+ mergeable: z.ZodString;
342
+ requiredChecks: z.ZodEnum<{
343
+ unknown: "unknown";
344
+ passed: "passed";
345
+ failed: "failed";
346
+ pending: "pending";
347
+ none: "none";
348
+ }>;
349
+ unresolvedReviewThreads: z.ZodNumber;
350
+ }, z.core.$strip>;
351
+ handledCommentsProducer: z.ZodOptional<z.ZodObject<{
352
+ identity: z.ZodString;
353
+ mode: z.ZodEnum<{
354
+ app: "app";
355
+ "commit-status": "commit-status";
356
+ }>;
357
+ }, z.core.$strip>>;
358
+ handledHumanComments: z.ZodOptional<z.ZodArray<z.ZodObject<{
359
+ clearedAt: z.ZodOptional<z.ZodString>;
360
+ sessionId: z.ZodOptional<z.ZodString>;
361
+ source: z.ZodEnum<{
362
+ cli: "cli";
363
+ "check-run": "check-run";
364
+ }>;
365
+ url: z.ZodString;
366
+ }, z.core.$strip>>>;
367
+ headSha: z.ZodString;
368
+ mergeBaseSha: z.ZodOptional<z.ZodString>;
369
+ patchId: z.ZodString;
370
+ postReadinessHumanComments: z.ZodOptional<z.ZodArray<z.ZodObject<{
371
+ author: z.ZodString;
372
+ createdAt: z.ZodString;
373
+ summary: z.ZodString;
374
+ url: z.ZodString;
375
+ }, z.core.$strip>>>;
376
+ postReadinessHumanReviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
377
+ author: z.ZodString;
378
+ createdAt: z.ZodString;
379
+ summary: z.ZodString;
380
+ url: z.ZodString;
381
+ }, z.core.$strip>>>;
382
+ pr: z.ZodNumber;
383
+ previewDeploy: z.ZodOptional<z.ZodObject<{
384
+ adminUrl: z.ZodOptional<z.ZodString>;
385
+ apiHealthUrl: z.ZodOptional<z.ZodString>;
386
+ headSha: z.ZodOptional<z.ZodString>;
387
+ localPreviewProof: z.ZodOptional<z.ZodUnknown>;
388
+ localProofPath: z.ZodOptional<z.ZodString>;
389
+ proofSource: z.ZodOptional<z.ZodEnum<{
390
+ "github-actions": "github-actions";
391
+ "local-self-certified": "local-self-certified";
392
+ }>>;
393
+ publicUrl: z.ZodOptional<z.ZodString>;
394
+ seedStatus: z.ZodEnum<{
395
+ unknown: "unknown";
396
+ passed: "passed";
397
+ failed: "failed";
398
+ skipped: "skipped";
399
+ }>;
400
+ stage: z.ZodOptional<z.ZodString>;
401
+ timingsMs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNumber>>>;
402
+ workflowRunUrl: z.ZodOptional<z.ZodString>;
403
+ }, z.core.$strip>>;
404
+ previewDeployRequired: z.ZodBoolean;
405
+ repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
406
+ action: z.ZodString;
407
+ code: z.ZodEnum<{
408
+ "undraft-pr": "undraft-pr";
409
+ "render-pr-body-sections": "render-pr-body-sections";
410
+ "await-post-undraft-checks": "await-post-undraft-checks";
411
+ }>;
412
+ command: z.ZodString;
413
+ }, z.core.$strip>>>;
414
+ reviewCycleState: z.ZodOptional<z.ZodObject<{
415
+ autoBlockingFindings: z.ZodNumber;
416
+ countsBySeverity: z.ZodObject<{
417
+ critical: z.ZodNumber;
418
+ high: z.ZodNumber;
419
+ low: z.ZodNumber;
420
+ medium: z.ZodNumber;
421
+ unknown: z.ZodNumber;
422
+ }, z.core.$strip>;
423
+ highestBlockingSeverity: z.ZodOptional<z.ZodEnum<{
424
+ unknown: "unknown";
425
+ low: "low";
426
+ medium: "medium";
427
+ high: "high";
428
+ critical: "critical";
429
+ }>>;
430
+ highestOpenSeverity: z.ZodOptional<z.ZodEnum<{
431
+ unknown: "unknown";
432
+ low: "low";
433
+ medium: "medium";
434
+ high: "high";
435
+ critical: "critical";
436
+ }>>;
437
+ maxReviewCycles: z.ZodOptional<z.ZodNumber>;
438
+ nonBlockingFindings: z.ZodNumber;
439
+ openFindings: z.ZodNumber;
440
+ reviewCycle: z.ZodOptional<z.ZodNumber>;
441
+ staleRepeatFindings: z.ZodOptional<z.ZodNumber>;
442
+ windowExhausted: z.ZodBoolean;
443
+ }, z.core.$strip>>;
444
+ reviewLadder: z.ZodOptional<z.ZodObject<{
445
+ cycleCounts: z.ZodObject<{
446
+ gate: z.ZodNumber;
447
+ interior: z.ZodNumber;
448
+ }, z.core.$strip>;
449
+ forcedTransition: z.ZodOptional<z.ZodEnum<{
450
+ "gate-cap-exhausted": "gate-cap-exhausted";
451
+ "interior-cap-reached": "interior-cap-reached";
452
+ }>>;
453
+ nextAction: z.ZodEnum<{
454
+ "run-interior-cycle": "run-interior-cycle";
455
+ "advance-to-gate": "advance-to-gate";
456
+ "run-gate-cycle": "run-gate-cycle";
457
+ "accept-nonblocking-findings": "accept-nonblocking-findings";
458
+ "escalate-to-triage": "escalate-to-triage";
459
+ "ready-for-human": "ready-for-human";
460
+ }>;
461
+ stage: z.ZodEnum<{
462
+ gate: "gate";
463
+ interior: "interior";
464
+ "interior-complete": "interior-complete";
465
+ }>;
466
+ }, z.core.$strip>>;
467
+ reviewRuns: z.ZodOptional<z.ZodArray<z.ZodType<PrReviewResult, unknown, z.core.$ZodTypeInternals<PrReviewResult, unknown>>>>;
468
+ reviewTerminalState: z.ZodOptional<z.ZodEnum<{
469
+ blocked: "blocked";
470
+ "accepted-with-findings": "accepted-with-findings";
471
+ clean: "clean";
472
+ }>>;
473
+ reviews: z.ZodObject<{
474
+ correctness: z.ZodObject<{
475
+ docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
476
+ required: z.ZodBoolean;
477
+ reviewedHeadSha: z.ZodOptional<z.ZodString>;
478
+ reviewedPatchId: z.ZodOptional<z.ZodString>;
479
+ status: z.ZodEnum<{
480
+ "not-required": "not-required";
481
+ blocked: "blocked";
482
+ current: "current";
483
+ stale: "stale";
484
+ missing: "missing";
485
+ }>;
486
+ }, z.core.$strip>;
487
+ security: z.ZodOptional<z.ZodObject<{
488
+ docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
489
+ required: z.ZodBoolean;
490
+ reviewedHeadSha: z.ZodOptional<z.ZodString>;
491
+ reviewedPatchId: z.ZodOptional<z.ZodString>;
492
+ status: z.ZodEnum<{
493
+ "not-required": "not-required";
494
+ blocked: "blocked";
495
+ current: "current";
496
+ stale: "stale";
497
+ missing: "missing";
498
+ }>;
499
+ }, z.core.$strip>>;
500
+ }, z.core.$strip>;
501
+ schemaVersion: z.ZodLiteral<1>;
502
+ stackRole: z.ZodEnum<{
503
+ single: "single";
504
+ slice: "slice";
505
+ rollup: "rollup";
506
+ "merge-gate prerequisite": "merge-gate prerequisite";
507
+ }>;
508
+ verification: z.ZodObject<{
509
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
510
+ docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
511
+ docsOnlyVerifiedHeadSha: z.ZodOptional<z.ZodString>;
512
+ prVerify: z.ZodEnum<{
513
+ passed: "passed";
514
+ stale: "stale";
515
+ missing: "missing";
516
+ }>;
517
+ trivialDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
518
+ trivialVerifiedHeadSha: z.ZodOptional<z.ZodString>;
519
+ verifiedHeadSha: z.ZodOptional<z.ZodString>;
520
+ }, z.core.$strip>;
521
+ }, z.core.$strip>;
522
+ type ReadinessRepair = z.infer<typeof readinessRepairSchema>;
523
+ type ReadinessStatus = "ready" | "blocked" | "slice-ready/not-final";
524
+ type ManagedReadinessLedger = z.infer<typeof managedReadinessLedgerSchema>;
525
+ //#endregion
526
+ //#region src/pr-ready.d.ts
527
+ interface PrReadyProof {
528
+ schemaVersion: 1;
529
+ blockingReasons: string[];
530
+ humanBlockingReasons: string[];
531
+ command: "patronage-factory pr:ready";
532
+ /**
533
+ * Machine-safe arg array for the obvious next action (#523): when `ready`,
534
+ * the `pr:merge-check` that must precede a merge; otherwise the `pr:verify`
535
+ * re-run that the blocking reasons name (re-verify the head, then re-run
536
+ * pr:ready). Same `argv` shape `factory:delegate --print` emits. Optional
537
+ * and purely additive.
538
+ */
539
+ followUp?: FollowUpAction;
540
+ /**
541
+ * `ledger.headSha` is the evaluated head SHA: the GitHub `pr.headRefOid`
542
+ * captured at evaluation time (not a local git read), recorded explicitly
543
+ * so merge-time identity checks are a pure comparison against the live
544
+ * pushed HEAD, not a re-derivation. See the ledger schema.
545
+ */
546
+ ledger: ManagedReadinessLedger;
547
+ /** Committed profile blob evaluated by readiness. Required for merge. */
548
+ profileBlobSha?: string;
549
+ /** Checkout-relative committed profile path evaluated by readiness. */
550
+ profilePath?: string;
551
+ repairs: ReadinessRepair[];
552
+ /** Trusted checkout repository used for all GitHub reads and writes. */
553
+ repository?: string;
554
+ status: ReadinessStatus;
555
+ }
556
+ //#endregion
557
+ //#region src/pr-readiness/external-evidence.d.ts
558
+ declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
559
+ check: z.ZodString;
560
+ checkType: z.ZodEnum<{
561
+ review: "review";
562
+ verify: "verify";
563
+ }>;
564
+ findingsPointer: z.ZodOptional<z.ZodString>;
565
+ headSha: z.ZodString;
566
+ mergeBaseSha: z.ZodString;
567
+ model: z.ZodOptional<z.ZodString>;
568
+ outcome: z.ZodEnum<{
569
+ pass: "pass";
570
+ fail: "fail";
571
+ }>;
572
+ patchId: z.ZodString;
573
+ policyVersion: z.ZodOptional<z.ZodString>;
574
+ producer: z.ZodString;
575
+ requestId: z.ZodOptional<z.ZodString>;
576
+ rung: z.ZodOptional<z.ZodEnum<{
577
+ "independent-model": "independent-model";
578
+ oracle: "oracle";
579
+ human: "human";
580
+ }>>;
581
+ schemaVersion: z.ZodLiteral<1>;
582
+ sessionId: z.ZodOptional<z.ZodString>;
583
+ timestamp: z.ZodOptional<z.ZodISODateTime>;
584
+ }, z.core.$loose>;
585
+ type EvidenceEnvelope = z.infer<typeof evidenceEnvelopeBaseSchema>;
586
+ //#endregion
587
+ //#region src/pr-readiness/verification-proof.d.ts
588
+ declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS$1: readonly [1, 2, 3, 4];
589
+ type PrVerifySchemaVersion = (typeof SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS$1)[number];
590
+ interface PrVerifyCommandResult {
591
+ command: string;
592
+ description: string;
593
+ name: string;
594
+ scope: "always" | "docs-only" | "trivial" | "full";
595
+ }
596
+ interface PrVerifyExecutedCommand {
597
+ command: string;
598
+ counts?: {
599
+ testFiles?: number;
600
+ tests?: number;
601
+ };
602
+ durationMs: number;
603
+ exitCode: number;
604
+ name: string;
605
+ scope: "always" | "docs-only" | "trivial" | "full";
606
+ }
607
+ interface PrVerifyProof {
608
+ schemaVersion: PrVerifySchemaVersion;
609
+ authoringSession?: string;
610
+ base: string;
611
+ baselineFullProofs?: {
612
+ base: string;
613
+ changedFiles: string[];
614
+ headSha: string;
615
+ profilePath: string;
616
+ projectKey: string;
617
+ repository: string;
618
+ }[];
619
+ changedFiles: string[];
620
+ classification: DiffClassification;
621
+ classificationReasons: string[];
622
+ command: "patronage-factory pr:verify";
623
+ durationMs: number;
624
+ endedAt: string;
625
+ executedCommands?: PrVerifyExecutedCommand[];
626
+ headSha: string;
627
+ mode: ResolvedPrVerifyMode;
628
+ mergeBaseSha?: string;
629
+ outcome?: "aborted" | "passed";
630
+ patchId?: string;
631
+ profilePath: string;
632
+ projectKey: string;
633
+ repository: string;
634
+ startedAt: string;
635
+ verificationCommands: PrVerifyCommandResult[];
636
+ }
637
+ //#endregion
638
+ //#region src/closeout-artifact.d.ts
639
+ /** Strict, bounded runtime transport contract emitted by factory:closeout. */
640
+ declare const closeoutArtifactSchema: z.ZodObject<{
641
+ boundaryThermo: z.ZodObject<{
642
+ owner: z.ZodString;
643
+ runs: z.ZodNumber;
644
+ waived: z.ZodBoolean;
645
+ waiverRationale: z.ZodOptional<z.ZodString>;
646
+ }, z.core.$strict>;
647
+ budget: z.ZodObject<{
648
+ interiorSourcesConsumed: z.ZodNumber;
649
+ note: z.ZodString;
650
+ scoping: z.ZodOptional<z.ZodObject<{
651
+ epic: z.ZodString;
652
+ issueFilter: z.ZodOptional<z.ZodNumber>;
653
+ prFilter: z.ZodOptional<z.ZodNumber>;
654
+ repo: z.ZodString;
655
+ scopedByEpicIssueSet: z.ZodBoolean;
656
+ window: z.ZodObject<{
657
+ from: z.ZodString;
658
+ to: z.ZodString;
659
+ }, z.core.$strict>;
660
+ }, z.core.$strict>>;
661
+ tier: z.ZodLiteral<"overseer">;
662
+ }, z.core.$strict>;
663
+ couldNotSee: z.ZodArray<z.ZodObject<{
664
+ id: z.ZodString;
665
+ note: z.ZodString;
666
+ reason: z.ZodOptional<z.ZodString>;
667
+ }, z.core.$strict>>;
668
+ epic: z.ZodString;
669
+ generatedAt: z.ZodISODateTime;
670
+ ledgerRows: z.ZodArray<z.ZodObject<{
671
+ detail: z.ZodOptional<z.ZodString>;
672
+ epic: z.ZodString;
673
+ generatedAt: z.ZodISODateTime;
674
+ key: z.ZodString;
675
+ landingSpot: z.ZodOptional<z.ZodEnum<{
676
+ CLI: "CLI";
677
+ profile: "profile";
678
+ skill: "skill";
679
+ ADR: "ADR";
680
+ }>>;
681
+ repo: z.ZodString;
682
+ rowType: z.ZodEnum<{
683
+ metric: "metric";
684
+ lesson: "lesson";
685
+ blindspot: "blindspot";
686
+ }>;
687
+ schemaVersion: z.ZodLiteral<3>;
688
+ source: z.ZodString;
689
+ unit: z.ZodOptional<z.ZodString>;
690
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
691
+ }, z.core.$strict>>;
692
+ lessons: z.ZodArray<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
+ "interior-telemetry": "interior-telemetry";
706
+ "boundary-thermo-attestation": "boundary-thermo-attestation";
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.ZodEnum<{
716
+ "interior-telemetry": "interior-telemetry";
717
+ "boundary-thermo-attestation": "boundary-thermo-attestation";
718
+ }>;
719
+ }, z.core.$strict>;
720
+ unit: z.ZodEnum<{
721
+ boolean: "boolean";
722
+ text: "text";
723
+ tokens: "tokens";
724
+ usd: "usd";
725
+ count: "count";
726
+ ratio: "ratio";
727
+ }>;
728
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
729
+ }, z.core.$strict>>;
730
+ repo: z.ZodString;
731
+ schemaVersion: z.ZodLiteral<3>;
732
+ }, z.core.$strict>;
733
+ type CloseoutArtifact = z.infer<typeof closeoutArtifactSchema>;
734
+ //#endregion
735
+ //#region src/schemas.d.ts
736
+ declare const EVIDENCE_ENVELOPE_SCHEMA_VERSION = 1;
737
+ declare const evidenceEnvelopeSchema: z.ZodObject<{
738
+ check: z.ZodString;
739
+ checkType: z.ZodEnum<{
740
+ review: "review";
741
+ verify: "verify";
742
+ }>;
743
+ findingsPointer: z.ZodOptional<z.ZodString>;
744
+ headSha: z.ZodString;
745
+ mergeBaseSha: z.ZodString;
746
+ model: z.ZodOptional<z.ZodString>;
747
+ outcome: z.ZodEnum<{
748
+ pass: "pass";
749
+ fail: "fail";
750
+ }>;
751
+ patchId: z.ZodString;
752
+ policyVersion: z.ZodOptional<z.ZodString>;
753
+ producer: z.ZodString;
754
+ requestId: z.ZodOptional<z.ZodString>;
755
+ rung: z.ZodOptional<z.ZodEnum<{
756
+ "independent-model": "independent-model";
757
+ oracle: "oracle";
758
+ human: "human";
759
+ }>>;
760
+ schemaVersion: z.ZodLiteral<1>;
761
+ sessionId: z.ZodOptional<z.ZodString>;
762
+ timestamp: z.ZodOptional<z.ZodISODateTime>;
763
+ }, z.core.$loose>;
764
+ declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [1, 2, 3, 4];
765
+ declare const prVerifyProofSchema: z.ZodObject<{
766
+ authoringSession: z.ZodOptional<z.ZodString>;
767
+ base: z.ZodString;
768
+ baselineFullProofs: z.ZodOptional<z.ZodArray<z.ZodObject<{
769
+ base: z.ZodString;
770
+ changedFiles: z.ZodArray<z.ZodString>;
771
+ headSha: z.ZodString;
772
+ profilePath: z.ZodString;
773
+ projectKey: z.ZodString;
774
+ repository: z.ZodString;
775
+ }, z.core.$strip>>>;
776
+ changedFiles: z.ZodArray<z.ZodString>;
777
+ classification: z.ZodEnum<{
778
+ "docs/process-only": "docs/process-only";
779
+ trivial: "trivial";
780
+ "non-trivial": "non-trivial";
781
+ }>;
782
+ classificationReasons: z.ZodArray<z.ZodString>;
783
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
784
+ durationMs: z.ZodNumber;
785
+ endedAt: z.ZodISODateTime;
786
+ executedCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
787
+ command: z.ZodString;
788
+ counts: z.ZodOptional<z.ZodObject<{
789
+ testFiles: z.ZodOptional<z.ZodNumber>;
790
+ tests: z.ZodOptional<z.ZodNumber>;
791
+ }, z.core.$strip>>;
792
+ durationMs: z.ZodNumber;
793
+ exitCode: z.ZodNumber;
794
+ name: z.ZodString;
795
+ scope: z.ZodEnum<{
796
+ trivial: "trivial";
797
+ always: "always";
798
+ "docs-only": "docs-only";
799
+ full: "full";
800
+ }>;
801
+ }, z.core.$strip>>>;
802
+ headSha: z.ZodString;
803
+ mergeBaseSha: z.ZodOptional<z.ZodString>;
804
+ mode: z.ZodEnum<{
805
+ trivial: "trivial";
806
+ "docs-only": "docs-only";
807
+ full: "full";
808
+ }>;
809
+ outcome: z.ZodOptional<z.ZodEnum<{
810
+ aborted: "aborted";
811
+ passed: "passed";
812
+ }>>;
813
+ patchId: z.ZodOptional<z.ZodString>;
814
+ profilePath: z.ZodString;
815
+ projectKey: z.ZodString;
816
+ repository: z.ZodString;
817
+ schemaVersion: z.ZodNumber & z.ZodType<1 | 2 | 3 | 4, number, z.core.$ZodTypeInternals<1 | 2 | 3 | 4, number>>;
818
+ startedAt: z.ZodISODateTime;
819
+ verificationCommands: z.ZodArray<z.ZodObject<{
820
+ command: z.ZodString;
821
+ description: z.ZodString;
822
+ name: z.ZodString;
823
+ scope: z.ZodEnum<{
824
+ trivial: "trivial";
825
+ always: "always";
826
+ "docs-only": "docs-only";
827
+ full: "full";
828
+ }>;
829
+ }, z.core.$strip>>;
830
+ }, z.core.$strip>;
831
+ declare const PR_REVIEW_SCHEMA_VERSION = 2;
832
+ declare const prReviewProofSchema: z.ZodObject<{
833
+ base: z.ZodString;
834
+ changedFiles: z.ZodArray<z.ZodString>;
835
+ cleanedPaths: z.ZodArray<z.ZodString>;
836
+ findingProvenanceVersion: z.ZodLiteral<1>;
837
+ headSha: z.ZodString;
838
+ ladder: z.ZodOptional<z.ZodObject<{
839
+ cycles: z.ZodArray<z.ZodObject<{
840
+ dispositions: z.ZodOptional<z.ZodArray<z.ZodObject<{
841
+ disposition: z.ZodEnum<{
842
+ "fixed-in-thread": "fixed-in-thread";
843
+ "follow-up-filed": "follow-up-filed";
844
+ waived: "waived";
845
+ }>;
846
+ finding: z.ZodObject<{
847
+ file: z.ZodOptional<z.ZodString>;
848
+ title: z.ZodString;
849
+ }, z.core.$strip>;
850
+ reference: z.ZodOptional<z.ZodString>;
851
+ }, z.core.$loose>>>;
852
+ findings: z.ZodArray<z.ZodObject<{
853
+ citedSpan: z.ZodOptional<z.ZodString>;
854
+ file: z.ZodOptional<z.ZodString>;
855
+ prescribedAction: z.ZodOptional<z.ZodString>;
856
+ supersedes: z.ZodOptional<z.ZodObject<{
857
+ file: z.ZodOptional<z.ZodString>;
858
+ title: z.ZodString;
859
+ }, z.core.$strip>>;
860
+ title: z.ZodString;
861
+ }, z.core.$loose>>;
862
+ }, z.core.$loose>>;
863
+ }, z.core.$strip>>;
864
+ maxReviewCycles: z.ZodOptional<z.ZodNumber>;
865
+ patchId: z.ZodString;
866
+ reviewCycle: z.ZodOptional<z.ZodNumber>;
867
+ reviewRequirement: z.ZodOptional<z.ZodObject<{
868
+ reason: z.ZodLiteral<"docs-only-profile-bypass">;
869
+ status: z.ZodLiteral<"not-required">;
870
+ }, z.core.$strict>>;
871
+ reviews: z.ZodArray<z.ZodObject<{
872
+ command: z.ZodOptional<z.ZodString>;
873
+ durationMs: z.ZodNumber;
874
+ endedAt: z.ZodString;
875
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
876
+ findings: z.ZodArray<z.ZodObject<{
877
+ blockingAfterCap: z.ZodOptional<z.ZodBoolean>;
878
+ body: z.ZodString;
879
+ category: z.ZodOptional<z.ZodEnum<{
880
+ unknown: "unknown";
881
+ correctness: "correctness";
882
+ safety: "safety";
883
+ coordination: "coordination";
884
+ maintainability: "maintainability";
885
+ }>>;
886
+ citedSpan: z.ZodOptional<z.ZodString>;
887
+ file: z.ZodOptional<z.ZodString>;
888
+ line: z.ZodOptional<z.ZodNumber>;
889
+ prescribedAction: z.ZodOptional<z.ZodString>;
890
+ priority: z.ZodOptional<z.ZodString>;
891
+ protocolFinding: z.ZodOptional<z.ZodLiteral<true>>;
892
+ supersedes: z.ZodOptional<z.ZodObject<{
893
+ file: z.ZodOptional<z.ZodString>;
894
+ title: z.ZodString;
895
+ }, z.core.$strip>>;
896
+ title: z.ZodString;
897
+ }, z.core.$strip>>;
898
+ issuesFlagged: z.ZodNumber;
899
+ kind: z.ZodEnum<{
900
+ correctness: "correctness";
901
+ security: "security";
902
+ }>;
903
+ model: z.ZodOptional<z.ZodString>;
904
+ outcome: z.ZodEnum<{
905
+ error: "error";
906
+ passed: "passed";
907
+ failed: "failed";
908
+ }>;
909
+ producer: z.ZodOptional<z.ZodString>;
910
+ promptSections: z.ZodOptional<z.ZodArray<z.ZodObject<{
911
+ provenance: z.ZodEnum<{
912
+ "prior-review-ledger": "prior-review-ledger";
913
+ "profile-standing-checklist": "profile-standing-checklist";
914
+ "issue-review-focus": "issue-review-focus";
915
+ }>;
916
+ source: z.ZodString;
917
+ text: z.ZodString;
918
+ }, z.core.$strict>>>;
919
+ rung: z.ZodOptional<z.ZodEnum<{
920
+ "independent-model": "independent-model";
921
+ oracle: "oracle";
922
+ human: "human";
923
+ }>>;
924
+ sessionId: z.ZodOptional<z.ZodString>;
925
+ stageResolution: z.ZodOptional<z.ZodObject<{
926
+ effort: z.ZodOptional<z.ZodEnum<{
927
+ low: "low";
928
+ medium: "medium";
929
+ high: "high";
930
+ xhigh: "xhigh";
931
+ }>>;
932
+ engine: z.ZodString;
933
+ layerSource: z.ZodEnum<{
934
+ cli: "cli";
935
+ operatorSessionGlobal: "operatorSessionGlobal";
936
+ operatorSessionKind: "operatorSessionKind";
937
+ profilePin: "profilePin";
938
+ stageConfig: "stageConfig";
939
+ userConfig: "userConfig";
940
+ }>;
941
+ model: z.ZodString;
942
+ rung: z.ZodOptional<z.ZodEnum<{
943
+ oracle: "oracle";
944
+ independentModel: "independentModel";
945
+ }>>;
946
+ }, z.core.$strip>>;
947
+ startedAt: z.ZodString;
948
+ summary: z.ZodString;
949
+ typedVerdict: z.ZodOptional<z.ZodBoolean>;
950
+ verdictSource: z.ZodOptional<z.ZodEnum<{
951
+ footer: "footer";
952
+ recovered: "recovered";
953
+ }>>;
954
+ }, z.core.$strip>>;
955
+ schemaVersion: z.ZodLiteral<2>;
956
+ }, z.core.$loose>;
957
+ declare const BOUNDARY_REVIEW_PROOF_KIND = "boundary-review-proof";
958
+ declare const boundaryReviewProofSchema: z.ZodObject<{
959
+ boundary: z.ZodString;
960
+ coveredSet: z.ZodArray<z.ZodObject<{
961
+ headSha: z.ZodOptional<z.ZodString>;
962
+ issue: z.ZodOptional<z.ZodNumber>;
963
+ mergedSha: z.ZodOptional<z.ZodString>;
964
+ pr: z.ZodNumber;
965
+ state: z.ZodEnum<{
966
+ merged: "merged";
967
+ open: "open";
968
+ }>;
969
+ wave: z.ZodOptional<z.ZodString>;
970
+ }, z.core.$loose>>;
971
+ dispositions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
972
+ findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
973
+ blockingAfterCap: z.ZodOptional<z.ZodBoolean>;
974
+ category: z.ZodOptional<z.ZodString>;
975
+ disposition: z.ZodOptional<z.ZodString>;
976
+ title: z.ZodString;
977
+ }, z.core.$loose>>>;
978
+ kind: z.ZodLiteral<"boundary-review-proof">;
979
+ manifestHash: z.ZodObject<{
980
+ algo: z.ZodLiteral<"sha256">;
981
+ scope: z.ZodOptional<z.ZodString>;
982
+ value: z.ZodString;
983
+ }, z.core.$loose>;
984
+ outcome: z.ZodEnum<{
985
+ pass: "pass";
986
+ fail: "fail";
987
+ }>;
988
+ producer: z.ZodString;
989
+ rung: z.ZodEnum<{
990
+ "independent-model": "independent-model";
991
+ oracle: "oracle";
992
+ human: "human";
993
+ }>;
994
+ schemaVersion: z.ZodLiteral<1>;
995
+ sessionId: z.ZodOptional<z.ZodString>;
996
+ specHash: z.ZodOptional<z.ZodObject<{
997
+ algo: z.ZodLiteral<"sha256">;
998
+ scope: z.ZodOptional<z.ZodString>;
999
+ value: z.ZodString;
1000
+ }, z.core.$loose>>;
1001
+ }, z.core.$loose>;
1002
+ declare const BOUNDARY_CHECK_SCHEMA_VERSION = 1;
1003
+ declare const boundaryCheckProofSchema: z.ZodObject<{
1004
+ blockingReasons: z.ZodArray<z.ZodString>;
1005
+ boundary: z.ZodOptional<z.ZodString>;
1006
+ command: z.ZodLiteral<"patronage-factory boundary:check">;
1007
+ coveredSet: z.ZodArray<z.ZodObject<{
1008
+ issue: z.ZodOptional<z.ZodNumber>;
1009
+ pr: z.ZodNumber;
1010
+ sha: z.ZodString;
1011
+ state: z.ZodEnum<{
1012
+ merged: "merged";
1013
+ open: "open";
1014
+ }>;
1015
+ wave: z.ZodString;
1016
+ }, z.core.$strip>>;
1017
+ demandedRung: z.ZodOptional<z.ZodEnum<{
1018
+ "independent-model": "independent-model";
1019
+ oracle: "oracle";
1020
+ human: "human";
1021
+ }>>;
1022
+ epicIssue: z.ZodNumber;
1023
+ manifestHash: z.ZodOptional<z.ZodObject<{
1024
+ algo: z.ZodLiteral<"sha256">;
1025
+ value: z.ZodString;
1026
+ }, z.core.$strip>>;
1027
+ notices: z.ZodArray<z.ZodString>;
1028
+ repo: z.ZodString;
1029
+ reviewProof: z.ZodOptional<z.ZodObject<{
1030
+ commentId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
1031
+ commentUrl: z.ZodOptional<z.ZodString>;
1032
+ producer: z.ZodString;
1033
+ rung: z.ZodEnum<{
1034
+ "independent-model": "independent-model";
1035
+ oracle: "oracle";
1036
+ human: "human";
1037
+ }>;
1038
+ sessionId: z.ZodOptional<z.ZodString>;
1039
+ specHash: z.ZodOptional<z.ZodObject<{
1040
+ algo: z.ZodLiteral<"sha256">;
1041
+ scope: z.ZodOptional<z.ZodString>;
1042
+ value: z.ZodString;
1043
+ }, z.core.$loose>>;
1044
+ }, z.core.$strip>>;
1045
+ schemaVersion: z.ZodLiteral<1>;
1046
+ specHash: z.ZodOptional<z.ZodObject<{
1047
+ algo: z.ZodLiteral<"sha256">;
1048
+ value: z.ZodString;
1049
+ }, z.core.$strip>>;
1050
+ status: z.ZodEnum<{
1051
+ ready: "ready";
1052
+ blocked: "blocked";
1053
+ }>;
1054
+ }, z.core.$strip>;
1055
+ type BoundaryCheckProofRecord = z.infer<typeof boundaryCheckProofSchema>;
1056
+ declare const PR_MERGE_CHECK_SCHEMA_VERSION = 1;
1057
+ declare const prMergeCheckProofSchema: z.ZodObject<{
1058
+ blockingReasons: z.ZodArray<z.ZodString>;
1059
+ command: z.ZodLiteral<"patronage-factory pr:merge-check">;
1060
+ followUp: z.ZodOptional<z.ZodObject<{
1061
+ argv: z.ZodArray<z.ZodString>;
1062
+ command: z.ZodString;
1063
+ }, z.core.$strict>>;
1064
+ identity: z.ZodDiscriminatedUnion<[z.ZodObject<{
1065
+ headSha: z.ZodString;
1066
+ kind: z.ZodLiteral<"match">;
1067
+ }, z.core.$strip>, z.ZodObject<{
1068
+ kind: z.ZodLiteral<"diverged">;
1069
+ liveHeadSha: z.ZodString;
1070
+ postProofCommits: z.ZodOptional<z.ZodArray<z.ZodObject<{
1071
+ sha: z.ZodString;
1072
+ subject: z.ZodString;
1073
+ }, z.core.$strip>>>;
1074
+ proofHeadSha: z.ZodString;
1075
+ }, z.core.$strip>, z.ZodObject<{
1076
+ kind: z.ZodLiteral<"live-head-invalid">;
1077
+ pr: z.ZodNumber;
1078
+ received: z.ZodString;
1079
+ }, z.core.$strip>, z.ZodObject<{
1080
+ errorDetail: z.ZodOptional<z.ZodString>;
1081
+ kind: z.ZodLiteral<"ready-proof-missing">;
1082
+ readyProofPath: z.ZodString;
1083
+ }, z.core.$strip>, z.ZodObject<{
1084
+ kind: z.ZodLiteral<"ready-proof-pr-mismatch">;
1085
+ proofPr: z.ZodNumber;
1086
+ requestedPr: z.ZodNumber;
1087
+ }, z.core.$strip>, z.ZodObject<{
1088
+ blockingReasons: z.ZodArray<z.ZodString>;
1089
+ kind: z.ZodLiteral<"ready-proof-not-ready">;
1090
+ status: z.ZodString;
1091
+ }, z.core.$strip>], "kind">;
1092
+ liveHeadSha: z.ZodOptional<z.ZodString>;
1093
+ notices: z.ZodOptional<z.ZodArray<z.ZodString>>;
1094
+ pr: z.ZodNumber;
1095
+ schemaVersion: z.ZodLiteral<1>;
1096
+ status: z.ZodEnum<{
1097
+ pass: "pass";
1098
+ fail: "fail";
1099
+ }>;
1100
+ worktreeHeldBranch: z.ZodOptional<z.ZodObject<{
1101
+ branch: z.ZodString;
1102
+ worktreePath: z.ZodString;
1103
+ }, z.core.$strip>>;
1104
+ }, z.core.$strip>;
1105
+ declare const PR_READY_SCHEMA_VERSION = 1;
1106
+ declare const prReadyProofSchema: z.ZodObject<{
1107
+ blockingReasons: z.ZodArray<z.ZodString>;
1108
+ command: z.ZodLiteral<"patronage-factory pr:ready">;
1109
+ followUp: z.ZodOptional<z.ZodObject<{
1110
+ argv: z.ZodArray<z.ZodString>;
1111
+ command: z.ZodString;
1112
+ }, z.core.$strict>>;
1113
+ humanBlockingReasons: z.ZodDefault<z.ZodArray<z.ZodString>>;
1114
+ ledger: z.ZodObject<{
1115
+ baseSha: z.ZodString;
1116
+ blockingReasons: z.ZodArray<z.ZodString>;
1117
+ classification: z.ZodEnum<{
1118
+ "docs/process-only": "docs/process-only";
1119
+ trivial: "trivial";
1120
+ "non-trivial": "non-trivial";
1121
+ }>;
1122
+ externalChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1123
+ checkType: z.ZodEnum<{
1124
+ review: "review";
1125
+ verify: "verify";
1126
+ }>;
1127
+ inScope: z.ZodBoolean;
1128
+ name: z.ZodString;
1129
+ reason: z.ZodOptional<z.ZodString>;
1130
+ scope: z.ZodOptional<z.ZodObject<{
1131
+ classifications: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1132
+ "docs/process-only": "docs/process-only";
1133
+ trivial: "trivial";
1134
+ "non-trivial": "non-trivial";
1135
+ }>>>;
1136
+ labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
1137
+ }, z.core.$strict>>;
1138
+ scopeReason: z.ZodString;
1139
+ status: z.ZodEnum<{
1140
+ satisfied: "satisfied";
1141
+ unmet: "unmet";
1142
+ "out-of-scope": "out-of-scope";
1143
+ }>;
1144
+ }, z.core.$strip>>>;
1145
+ finalReviewPoint: z.ZodBoolean;
1146
+ github: z.ZodObject<{
1147
+ currentWithBase: z.ZodBoolean;
1148
+ draft: z.ZodBoolean;
1149
+ mergeStateStatus: z.ZodString;
1150
+ mergeable: z.ZodString;
1151
+ requiredChecks: z.ZodEnum<{
1152
+ unknown: "unknown";
1153
+ passed: "passed";
1154
+ failed: "failed";
1155
+ pending: "pending";
1156
+ none: "none";
1157
+ }>;
1158
+ unresolvedReviewThreads: z.ZodNumber;
1159
+ }, z.core.$strip>;
1160
+ handledCommentsProducer: z.ZodOptional<z.ZodObject<{
1161
+ identity: z.ZodString;
1162
+ mode: z.ZodEnum<{
1163
+ app: "app";
1164
+ "commit-status": "commit-status";
1165
+ }>;
1166
+ }, z.core.$strip>>;
1167
+ handledHumanComments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1168
+ clearedAt: z.ZodOptional<z.ZodString>;
1169
+ sessionId: z.ZodOptional<z.ZodString>;
1170
+ source: z.ZodEnum<{
1171
+ cli: "cli";
1172
+ "check-run": "check-run";
1173
+ }>;
1174
+ url: z.ZodString;
1175
+ }, z.core.$strip>>>;
1176
+ headSha: z.ZodString;
1177
+ mergeBaseSha: z.ZodOptional<z.ZodString>;
1178
+ patchId: z.ZodString;
1179
+ postReadinessHumanComments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1180
+ author: z.ZodString;
1181
+ createdAt: z.ZodString;
1182
+ summary: z.ZodString;
1183
+ url: z.ZodString;
1184
+ }, z.core.$strip>>>;
1185
+ pr: z.ZodNumber;
1186
+ previewDeploy: z.ZodOptional<z.ZodObject<{
1187
+ adminUrl: z.ZodOptional<z.ZodString>;
1188
+ apiHealthUrl: z.ZodOptional<z.ZodString>;
1189
+ headSha: z.ZodOptional<z.ZodString>;
1190
+ localPreviewProof: z.ZodOptional<z.ZodUnknown>;
1191
+ localProofPath: z.ZodOptional<z.ZodString>;
1192
+ proofSource: z.ZodOptional<z.ZodEnum<{
1193
+ "github-actions": "github-actions";
1194
+ "local-self-certified": "local-self-certified";
1195
+ }>>;
1196
+ publicUrl: z.ZodOptional<z.ZodString>;
1197
+ seedStatus: z.ZodEnum<{
1198
+ unknown: "unknown";
1199
+ passed: "passed";
1200
+ failed: "failed";
1201
+ skipped: "skipped";
1202
+ }>;
1203
+ stage: z.ZodOptional<z.ZodString>;
1204
+ timingsMs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNumber>>>;
1205
+ workflowRunUrl: z.ZodOptional<z.ZodString>;
1206
+ }, z.core.$strip>>;
1207
+ previewDeployRequired: z.ZodBoolean;
1208
+ repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
1209
+ action: z.ZodString;
1210
+ code: z.ZodEnum<{
1211
+ "undraft-pr": "undraft-pr";
1212
+ "render-pr-body-sections": "render-pr-body-sections";
1213
+ "await-post-undraft-checks": "await-post-undraft-checks";
1214
+ }>;
1215
+ command: z.ZodString;
1216
+ }, z.core.$strip>>>;
1217
+ reviewCycleState: z.ZodOptional<z.ZodObject<{
1218
+ autoBlockingFindings: z.ZodNumber;
1219
+ countsBySeverity: z.ZodObject<{
1220
+ critical: z.ZodNumber;
1221
+ high: z.ZodNumber;
1222
+ low: z.ZodNumber;
1223
+ medium: z.ZodNumber;
1224
+ unknown: z.ZodNumber;
1225
+ }, z.core.$strip>;
1226
+ highestBlockingSeverity: z.ZodOptional<z.ZodEnum<{
1227
+ unknown: "unknown";
1228
+ low: "low";
1229
+ medium: "medium";
1230
+ high: "high";
1231
+ critical: "critical";
1232
+ }>>;
1233
+ highestOpenSeverity: z.ZodOptional<z.ZodEnum<{
1234
+ unknown: "unknown";
1235
+ low: "low";
1236
+ medium: "medium";
1237
+ high: "high";
1238
+ critical: "critical";
1239
+ }>>;
1240
+ maxReviewCycles: z.ZodOptional<z.ZodNumber>;
1241
+ nonBlockingFindings: z.ZodNumber;
1242
+ openFindings: z.ZodNumber;
1243
+ reviewCycle: z.ZodOptional<z.ZodNumber>;
1244
+ staleRepeatFindings: z.ZodOptional<z.ZodNumber>;
1245
+ windowExhausted: z.ZodBoolean;
1246
+ }, z.core.$strip>>;
1247
+ reviewLadder: z.ZodOptional<z.ZodObject<{
1248
+ cycleCounts: z.ZodObject<{
1249
+ gate: z.ZodNumber;
1250
+ interior: z.ZodNumber;
1251
+ }, z.core.$strip>;
1252
+ forcedTransition: z.ZodOptional<z.ZodEnum<{
1253
+ "gate-cap-exhausted": "gate-cap-exhausted";
1254
+ "interior-cap-reached": "interior-cap-reached";
1255
+ "interior-takeover": "interior-takeover";
1256
+ }>>;
1257
+ nextAction: z.ZodEnum<{
1258
+ "run-interior-cycle": "run-interior-cycle";
1259
+ "advance-to-gate": "advance-to-gate";
1260
+ "run-gate-cycle": "run-gate-cycle";
1261
+ "accept-nonblocking-findings": "accept-nonblocking-findings";
1262
+ "escalate-to-triage": "escalate-to-triage";
1263
+ "ready-for-human": "ready-for-human";
1264
+ }>;
1265
+ stage: z.ZodEnum<{
1266
+ gate: "gate";
1267
+ interior: "interior";
1268
+ "interior-takeover": "interior-takeover";
1269
+ "interior-complete": "interior-complete";
1270
+ }>;
1271
+ }, z.core.$strip>>;
1272
+ reviewRuns: z.ZodOptional<z.ZodArray<z.ZodObject<{
1273
+ command: z.ZodOptional<z.ZodString>;
1274
+ durationMs: z.ZodNumber;
1275
+ endedAt: z.ZodString;
1276
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1277
+ findings: z.ZodArray<z.ZodObject<{
1278
+ blockingAfterCap: z.ZodOptional<z.ZodBoolean>;
1279
+ body: z.ZodString;
1280
+ category: z.ZodOptional<z.ZodEnum<{
1281
+ unknown: "unknown";
1282
+ correctness: "correctness";
1283
+ safety: "safety";
1284
+ coordination: "coordination";
1285
+ maintainability: "maintainability";
1286
+ }>>;
1287
+ citedSpan: z.ZodOptional<z.ZodString>;
1288
+ file: z.ZodOptional<z.ZodString>;
1289
+ line: z.ZodOptional<z.ZodNumber>;
1290
+ prescribedAction: z.ZodOptional<z.ZodString>;
1291
+ priority: z.ZodOptional<z.ZodString>;
1292
+ protocolFinding: z.ZodOptional<z.ZodLiteral<true>>;
1293
+ supersedes: z.ZodOptional<z.ZodObject<{
1294
+ file: z.ZodOptional<z.ZodString>;
1295
+ title: z.ZodString;
1296
+ }, z.core.$strip>>;
1297
+ title: z.ZodString;
1298
+ }, z.core.$strip>>;
1299
+ issuesFlagged: z.ZodNumber;
1300
+ kind: z.ZodEnum<{
1301
+ correctness: "correctness";
1302
+ security: "security";
1303
+ }>;
1304
+ model: z.ZodOptional<z.ZodString>;
1305
+ outcome: z.ZodEnum<{
1306
+ error: "error";
1307
+ passed: "passed";
1308
+ failed: "failed";
1309
+ }>;
1310
+ producer: z.ZodOptional<z.ZodString>;
1311
+ promptSections: z.ZodOptional<z.ZodArray<z.ZodObject<{
1312
+ provenance: z.ZodEnum<{
1313
+ "prior-review-ledger": "prior-review-ledger";
1314
+ "profile-standing-checklist": "profile-standing-checklist";
1315
+ "issue-review-focus": "issue-review-focus";
1316
+ }>;
1317
+ source: z.ZodString;
1318
+ text: z.ZodString;
1319
+ }, z.core.$strict>>>;
1320
+ rung: z.ZodOptional<z.ZodEnum<{
1321
+ "independent-model": "independent-model";
1322
+ oracle: "oracle";
1323
+ human: "human";
1324
+ }>>;
1325
+ sessionId: z.ZodOptional<z.ZodString>;
1326
+ stageResolution: z.ZodOptional<z.ZodObject<{
1327
+ effort: z.ZodOptional<z.ZodEnum<{
1328
+ low: "low";
1329
+ medium: "medium";
1330
+ high: "high";
1331
+ xhigh: "xhigh";
1332
+ }>>;
1333
+ engine: z.ZodString;
1334
+ layerSource: z.ZodEnum<{
1335
+ cli: "cli";
1336
+ operatorSessionGlobal: "operatorSessionGlobal";
1337
+ operatorSessionKind: "operatorSessionKind";
1338
+ profilePin: "profilePin";
1339
+ stageConfig: "stageConfig";
1340
+ userConfig: "userConfig";
1341
+ }>;
1342
+ model: z.ZodString;
1343
+ rung: z.ZodOptional<z.ZodEnum<{
1344
+ oracle: "oracle";
1345
+ independentModel: "independentModel";
1346
+ }>>;
1347
+ }, z.core.$strip>>;
1348
+ startedAt: z.ZodString;
1349
+ summary: z.ZodString;
1350
+ typedVerdict: z.ZodOptional<z.ZodBoolean>;
1351
+ verdictSource: z.ZodOptional<z.ZodEnum<{
1352
+ footer: "footer";
1353
+ recovered: "recovered";
1354
+ }>>;
1355
+ }, z.core.$strip>>>;
1356
+ reviewTerminalState: z.ZodOptional<z.ZodEnum<{
1357
+ blocked: "blocked";
1358
+ "accepted-with-findings": "accepted-with-findings";
1359
+ clean: "clean";
1360
+ }>>;
1361
+ reviews: z.ZodObject<{
1362
+ correctness: z.ZodObject<{
1363
+ docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1364
+ required: z.ZodBoolean;
1365
+ reviewedHeadSha: z.ZodOptional<z.ZodString>;
1366
+ reviewedPatchId: z.ZodOptional<z.ZodString>;
1367
+ status: z.ZodEnum<{
1368
+ "not-required": "not-required";
1369
+ blocked: "blocked";
1370
+ current: "current";
1371
+ stale: "stale";
1372
+ missing: "missing";
1373
+ }>;
1374
+ }, z.core.$strip>;
1375
+ security: z.ZodOptional<z.ZodObject<{
1376
+ docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1377
+ required: z.ZodBoolean;
1378
+ reviewedHeadSha: z.ZodOptional<z.ZodString>;
1379
+ reviewedPatchId: z.ZodOptional<z.ZodString>;
1380
+ status: z.ZodEnum<{
1381
+ "not-required": "not-required";
1382
+ blocked: "blocked";
1383
+ current: "current";
1384
+ stale: "stale";
1385
+ missing: "missing";
1386
+ }>;
1387
+ }, z.core.$strip>>;
1388
+ }, z.core.$strip>;
1389
+ schemaVersion: z.ZodLiteral<1>;
1390
+ stackRole: z.ZodEnum<{
1391
+ single: "single";
1392
+ slice: "slice";
1393
+ rollup: "rollup";
1394
+ "merge-gate prerequisite": "merge-gate prerequisite";
1395
+ }>;
1396
+ verification: z.ZodObject<{
1397
+ command: z.ZodLiteral<"patronage-factory pr:verify">;
1398
+ docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1399
+ docsOnlyVerifiedHeadSha: z.ZodOptional<z.ZodString>;
1400
+ prVerify: z.ZodEnum<{
1401
+ passed: "passed";
1402
+ stale: "stale";
1403
+ missing: "missing";
1404
+ }>;
1405
+ trivialDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1406
+ trivialVerifiedHeadSha: z.ZodOptional<z.ZodString>;
1407
+ verifiedHeadSha: z.ZodOptional<z.ZodString>;
1408
+ }, z.core.$strip>;
1409
+ }, z.core.$strip>;
1410
+ profileBlobSha: z.ZodOptional<z.ZodString>;
1411
+ profilePath: z.ZodOptional<z.ZodString>;
1412
+ repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
1413
+ action: z.ZodString;
1414
+ code: z.ZodEnum<{
1415
+ "undraft-pr": "undraft-pr";
1416
+ "render-pr-body-sections": "render-pr-body-sections";
1417
+ "await-post-undraft-checks": "await-post-undraft-checks";
1418
+ }>;
1419
+ command: z.ZodString;
1420
+ }, z.core.$strip>>>;
1421
+ repository: z.ZodOptional<z.ZodString>;
1422
+ schemaVersion: z.ZodLiteral<1>;
1423
+ status: z.ZodEnum<{
1424
+ ready: "ready";
1425
+ blocked: "blocked";
1426
+ "slice-ready/not-final": "slice-ready/not-final";
1427
+ }>;
1428
+ }, z.core.$strip>;
1429
+ //#endregion
1430
+ export { BOUNDARY_CHECK_SCHEMA_VERSION, BOUNDARY_REVIEW_PROOF_KIND, BoundaryCheckProofRecord, type BoundaryReviewProof, type CloseoutArtifact, EVIDENCE_ENVELOPE_SCHEMA_VERSION, type EvidenceEnvelope, PR_MERGE_CHECK_SCHEMA_VERSION, PR_READY_SCHEMA_VERSION, PR_REVIEW_SCHEMA_VERSION, type PrMergeCheckProof, type PrReadyProof, type PrReviewProof, type PrVerifyProof, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, boundaryCheckProofSchema, boundaryReviewProofSchema, closeoutArtifactSchema, evidenceEnvelopeSchema, prMergeCheckProofSchema, prReadyProofSchema, prReviewProofSchema, prVerifyProofSchema };