@patronage/software-factory 1.0.0-alpha.45 → 1.0.0-alpha.46

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/index.d.ts CHANGED
@@ -2,8 +2,6 @@ import { Command } from "commander";
2
2
  import { existsSync, readFileSync, rmSync } from "node:fs";
3
3
  import { PreviewProofRegistration } from "@patronage/factory-ci";
4
4
  import { z } from "zod";
5
-
6
- //#region src/factory-app-broker-client.d.ts
7
5
  /**
8
6
  * The opt-in broker permission set (#1360): `actions: read`, `checks: read`,
9
7
  * `contents: read`, `issues: read`, and `pull_requests: write` on the
@@ -14,8 +12,6 @@ import { z } from "zod";
14
12
  * A request without a scope is the `checks: write` mint, unchanged.
15
13
  */
16
14
  declare const FACTORY_APP_BROKER_ADMISSION_SCOPE = "admission";
17
- //#endregion
18
- //#region src/user-config.d.ts
19
15
  declare const githubAppConfigSchema: z.ZodObject<{
20
16
  appId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
21
17
  installationId: z.ZodOptional<z.ZodNumber>;
@@ -46,8 +42,6 @@ interface LoadUserConfigResult {
46
42
  config: FactoryUserConfig;
47
43
  ignoredKeys?: string[];
48
44
  }
49
- //#endregion
50
- //#region src/github-app-access.d.ts
51
45
  interface FactoryAppAccessDependencies {
52
46
  env?: NodeJS.ProcessEnv;
53
47
  existsSync?: (path: string) => boolean;
@@ -78,8 +72,6 @@ interface FactoryAppAccessDependencies {
78
72
  token?: string;
79
73
  transportAttempts?: number;
80
74
  }
81
- //#endregion
82
- //#region src/admission-credential.d.ts
83
75
  /**
84
76
  * The GitHub calls a Cursor VM's own `gh` credential cannot make (#1327).
85
77
  * Cursor mints the VM token without `pull_requests: write` or `issues`, so on
@@ -114,8 +106,6 @@ interface AdmissionCredential {
114
106
  */
115
107
  token: (operation: AdmissionOperation, repository: AdmissionRepository) => Promise<string | undefined>;
116
108
  }
117
- //#endregion
118
- //#region src/review-rungs.d.ts
119
109
  declare const EVIDENCE_REVIEW_RUNGS: readonly ["independent-model", "oracle", "human"];
120
110
  type EvidenceReviewRung = (typeof EVIDENCE_REVIEW_RUNGS)[number];
121
111
  declare namespace boundary_manifest_d_exports {
@@ -129,28 +119,28 @@ declare const boundaryManifestBaseSchema: z.ZodObject<{
129
119
  boundary: z.ZodString;
130
120
  closeout: z.ZodOptional<z.ZodObject<{
131
121
  review: z.ZodEnum<{
122
+ human: "human";
132
123
  "independent-model": "independent-model";
133
124
  oracle: "oracle";
134
- human: "human";
135
125
  }>;
136
126
  }, z.core.$loose>>;
137
127
  declaredBy: z.ZodString;
138
128
  integrationBranch: z.ZodOptional<z.ZodString>;
139
129
  schemaVersion: z.ZodLiteral<1>;
140
130
  topology: z.ZodEnum<{
131
+ "each-to-epic": "each-to-epic";
141
132
  "each-to-main": "each-to-main";
142
133
  flagged: "flagged";
143
134
  stacked: "stacked";
144
- "each-to-epic": "each-to-epic";
145
135
  }>;
146
136
  waves: z.ZodArray<z.ZodObject<{
147
137
  autoMerge: z.ZodOptional<z.ZodBoolean>;
148
138
  issues: z.ZodArray<z.ZodNumber>;
149
139
  name: z.ZodString;
150
140
  review: z.ZodEnum<{
141
+ human: "human";
151
142
  "independent-model": "independent-model";
152
143
  oracle: "oracle";
153
- human: "human";
154
144
  }>;
155
145
  }, z.core.$loose>>;
156
146
  }, z.core.$loose>;
@@ -158,28 +148,28 @@ declare const boundaryManifestSchema: z.ZodObject<{
158
148
  boundary: z.ZodString;
159
149
  closeout: z.ZodOptional<z.ZodObject<{
160
150
  review: z.ZodEnum<{
151
+ human: "human";
161
152
  "independent-model": "independent-model";
162
153
  oracle: "oracle";
163
- human: "human";
164
154
  }>;
165
155
  }, z.core.$loose>>;
166
156
  declaredBy: z.ZodString;
167
157
  integrationBranch: z.ZodOptional<z.ZodString>;
168
158
  schemaVersion: z.ZodLiteral<1>;
169
159
  topology: z.ZodEnum<{
160
+ "each-to-epic": "each-to-epic";
170
161
  "each-to-main": "each-to-main";
171
162
  flagged: "flagged";
172
163
  stacked: "stacked";
173
- "each-to-epic": "each-to-epic";
174
164
  }>;
175
165
  waves: z.ZodArray<z.ZodObject<{
176
166
  autoMerge: z.ZodOptional<z.ZodBoolean>;
177
167
  issues: z.ZodArray<z.ZodNumber>;
178
168
  name: z.ZodString;
179
169
  review: z.ZodEnum<{
170
+ human: "human";
180
171
  "independent-model": "independent-model";
181
172
  oracle: "oracle";
182
- human: "human";
183
173
  }>;
184
174
  }, z.core.$loose>>;
185
175
  }, z.core.$loose>;
@@ -204,8 +194,6 @@ type BoundaryManifestParse = {
204
194
  };
205
195
  declare const parseBoundaryManifest: (issueBody: string) => BoundaryManifestParse;
206
196
  declare const closeoutRungFor: (manifest: BoundaryManifest) => EvidenceReviewRung;
207
- //#endregion
208
- //#region src/github-issue-comments.d.ts
209
197
  interface GithubIssueCommentApi {
210
198
  body: string;
211
199
  created_at: string;
@@ -226,7 +214,7 @@ interface GithubIssueComment {
226
214
  updatedAt: string;
227
215
  url: string;
228
216
  }
229
- declare const normalizeIssueComments: (value: GithubIssueCommentApi[] | GithubIssueCommentApi[][]) => GithubIssueComment[];
217
+ export declare const normalizeIssueComments: (value: GithubIssueCommentApi[] | GithubIssueCommentApi[][]) => GithubIssueComment[];
230
218
  declare namespace boundary_review_proof_d_exports {
231
219
  export { BOUNDARY_REVIEW_PROOF_KIND, BoundaryReviewProof, BoundaryReviewProofComment, BoundaryReviewProofParseFailure, boundaryReviewProofAuthorsSeen, boundaryReviewProofParseFailures, boundaryReviewProofSchema, selectBoundaryReviewProof, undispositionedBlockingFindings };
232
220
  }
@@ -239,8 +227,8 @@ declare const boundaryReviewProofBaseSchema: z.ZodObject<{
239
227
  mergedSha: z.ZodOptional<z.ZodString>;
240
228
  pr: z.ZodNumber;
241
229
  state: z.ZodEnum<{
242
- open: "open";
243
230
  merged: "merged";
231
+ open: "open";
244
232
  }>;
245
233
  wave: z.ZodOptional<z.ZodString>;
246
234
  }, z.core.$loose>>;
@@ -258,14 +246,14 @@ declare const boundaryReviewProofBaseSchema: z.ZodObject<{
258
246
  value: z.ZodString;
259
247
  }, z.core.$loose>;
260
248
  outcome: z.ZodEnum<{
261
- pass: "pass";
262
249
  fail: "fail";
250
+ pass: "pass";
263
251
  }>;
264
252
  producer: z.ZodString;
265
253
  rung: z.ZodEnum<{
254
+ human: "human";
266
255
  "independent-model": "independent-model";
267
256
  oracle: "oracle";
268
- human: "human";
269
257
  }>;
270
258
  schemaVersion: z.ZodLiteral<1>;
271
259
  sessionId: z.ZodOptional<z.ZodString>;
@@ -283,8 +271,8 @@ declare const boundaryReviewProofSchema: z.ZodObject<{
283
271
  mergedSha: z.ZodOptional<z.ZodString>;
284
272
  pr: z.ZodNumber;
285
273
  state: z.ZodEnum<{
286
- open: "open";
287
274
  merged: "merged";
275
+ open: "open";
288
276
  }>;
289
277
  wave: z.ZodOptional<z.ZodString>;
290
278
  }, z.core.$loose>>;
@@ -302,14 +290,14 @@ declare const boundaryReviewProofSchema: z.ZodObject<{
302
290
  value: z.ZodString;
303
291
  }, z.core.$loose>;
304
292
  outcome: z.ZodEnum<{
305
- pass: "pass";
306
293
  fail: "fail";
294
+ pass: "pass";
307
295
  }>;
308
296
  producer: z.ZodString;
309
297
  rung: z.ZodEnum<{
298
+ human: "human";
310
299
  "independent-model": "independent-model";
311
300
  oracle: "oracle";
312
- human: "human";
313
301
  }>;
314
302
  schemaVersion: z.ZodLiteral<1>;
315
303
  sessionId: z.ZodOptional<z.ZodString>;
@@ -334,8 +322,6 @@ declare const selectBoundaryReviewProof: (comments: GithubIssueComment[], bounda
334
322
  declare const boundaryReviewProofAuthorsSeen: (comments: GithubIssueComment[], boundary: string) => string[];
335
323
  declare const boundaryReviewProofParseFailures: (comments: GithubIssueComment[], boundary: string) => BoundaryReviewProofParseFailure[];
336
324
  declare const undispositionedBlockingFindings: (proof: BoundaryReviewProof) => string[];
337
- //#endregion
338
- //#region src/boundary-membership-graph.d.ts
339
325
  /** The boundary-manifest wave demand that applies to one pull request. */
340
326
  interface WaveReviewDemand {
341
327
  autoMerge: boolean;
@@ -352,9 +338,7 @@ interface BoundaryPullRequestRef {
352
338
  number: number;
353
339
  state: "OPEN" | "CLOSED" | "MERGED";
354
340
  }
355
- //#endregion
356
- //#region src/demand-waiver.d.ts
357
- declare const DEFAULT_DEMAND_WAIVER_PATH = ".factory-memory/demand-waivers.json";
341
+ export declare const DEFAULT_DEMAND_WAIVER_PATH = ".factory-memory/demand-waivers.json";
358
342
  /** One recorded operator act: this demand, on this candidate, waived. */
359
343
  interface DemandWaiver {
360
344
  candidate: {
@@ -374,7 +358,7 @@ interface DemandWaiverStore {
374
358
  schemaVersion: 1;
375
359
  waivers: DemandWaiver[];
376
360
  }
377
- declare const validateDemandWaiverStore: (value: unknown) => DemandWaiverStore;
361
+ export declare const validateDemandWaiverStore: (value: unknown) => DemandWaiverStore;
378
362
  /**
379
363
  * A demand that was in force, was NOT met, and was waived by the operator.
380
364
  *
@@ -391,13 +375,9 @@ interface WaivedDemand {
391
375
  /** The demand's refusals at evaluation time, preserved verbatim. */
392
376
  unmetReasons: string[];
393
377
  }
394
- declare const waivedDemandSchema: z.ZodType<WaivedDemand>;
378
+ export declare const waivedDemandSchema: z.ZodType<WaivedDemand>;
395
379
  /** The waivers that bind one candidate: same PR, same head. */
396
- declare const selectWaiversForCandidate: ({
397
- headSha,
398
- pr,
399
- waivers
400
- }: {
380
+ export declare const selectWaiversForCandidate: ({ headSha, pr, waivers }: {
401
381
  headSha: string | undefined;
402
382
  pr: number;
403
383
  waivers: readonly DemandWaiver[];
@@ -413,17 +393,13 @@ interface DemandOutcome {
413
393
  * — a waiver can only ever move a demand from *unmet-and-blocking* to
414
394
  * *unmet-and-waived*, never to met.
415
395
  */
416
- declare const applyDemandWaiver: ({
417
- demand,
418
- reasons,
419
- waivers
420
- }: {
396
+ export declare const applyDemandWaiver: ({ demand, reasons, waivers }: {
421
397
  demand: string;
422
398
  reasons: readonly string[];
423
399
  waivers: readonly DemandWaiver[];
424
400
  }) => DemandOutcome;
425
401
  /** How a waived demand reads to a human. Never the word "satisfied". */
426
- declare const waivedDemandNotice: (waived: WaivedDemand) => string;
402
+ export declare const waivedDemandNotice: (waived: WaivedDemand) => string;
427
403
  interface DemandWaiverAuthorization {
428
404
  operator: string;
429
405
  session?: string;
@@ -441,15 +417,10 @@ type AuthorizeDemandWaiverResult = {
441
417
  * not credential-backed, so its absence or equality never authorizes or
442
418
  * refuses an operator act.
443
419
  */
444
- declare const authorizeDemandWaiver: ({
445
- authenticatedLogin,
446
- session
447
- }: {
420
+ export declare const authorizeDemandWaiver: ({ authenticatedLogin, session }: {
448
421
  authenticatedLogin: string | undefined;
449
422
  session: string | undefined;
450
423
  }) => AuthorizeDemandWaiverResult;
451
- //#endregion
452
- //#region src/hq-credentials.d.ts
453
424
  /**
454
425
  * Why a reference did not resolve. Each value names a different remedy, and
455
426
  * none of them can be inferred from a value-or-nothing result:
@@ -474,14 +445,7 @@ type SecretResolution = {
474
445
  };
475
446
  /** Resolves a secret reference. Injected so tests stay offline. */
476
447
  type SecretReferenceResolver = (reference: string) => SecretResolution;
477
- //#endregion
478
- //#region src/hq-ingest-sink.d.ts
479
448
  interface HqIngestDependencies {
480
- /**
481
- * @deprecated Custom persistence seam. It receives an immutable spool-file
482
- * target and one complete JSON event; production never appends legacy JSONL.
483
- */
484
- appendJournal?: (target: string, row: string) => Promise<void> | void;
485
449
  diagnostic?: (line: string) => Promise<void> | void;
486
450
  env?: NodeJS.ProcessEnv;
487
451
  fetch?: typeof fetch;
@@ -633,7 +597,8 @@ interface HqSpoolWorkCount {
633
597
  * directory is created, nothing is secured, and nothing is delivered.
634
598
  */
635
599
  declare function countHqSpoolWork(input: Pick<HqSpoolFlushInput, "explicitDirectories" | "repository"> & {
636
- /** Also read each pending event's recorded reason (#1317). */reasons?: boolean;
600
+ /** Also read each pending event's recorded reason (#1317). */
601
+ reasons?: boolean;
637
602
  }, dependencies?: {
638
603
  budgetMs?: number;
639
604
  env?: NodeJS.ProcessEnv;
@@ -663,30 +628,26 @@ declare function sweepHqSpoolOrphans(input: {
663
628
  budgetMs?: number;
664
629
  env?: NodeJS.ProcessEnv;
665
630
  }): Promise<HqSpoolOrphanSweep>;
666
- //#endregion
667
- //#region src/packages/review-prompt-sections/schema.d.ts
668
- declare const reviewPromptSectionSchema: z.ZodObject<{
631
+ export declare const reviewPromptSectionSchema: z.ZodObject<{
669
632
  provenance: z.ZodEnum<{
670
633
  "coding-standards": "coding-standards";
671
- "prior-review-ledger": "prior-review-ledger";
672
634
  "issue-review-focus": "issue-review-focus";
635
+ "prior-review-ledger": "prior-review-ledger";
673
636
  }>;
674
637
  source: z.ZodString;
675
638
  text: z.ZodString;
676
639
  }, z.core.$strict>;
677
640
  type ReviewPromptSection = z.infer<typeof reviewPromptSectionSchema>;
678
641
  type ReviewPromptSectionProvenance = ReviewPromptSection["provenance"];
679
- declare const reviewPromptSectionsSchema: z.ZodArray<z.ZodObject<{
642
+ export declare const reviewPromptSectionsSchema: z.ZodArray<z.ZodObject<{
680
643
  provenance: z.ZodEnum<{
681
644
  "coding-standards": "coding-standards";
682
- "prior-review-ledger": "prior-review-ledger";
683
645
  "issue-review-focus": "issue-review-focus";
646
+ "prior-review-ledger": "prior-review-ledger";
684
647
  }>;
685
648
  source: z.ZodString;
686
649
  text: z.ZodString;
687
650
  }, z.core.$strict>>;
688
- //#endregion
689
- //#region src/policy-resolution.d.ts
690
651
  /** How a gate resolved the review policy it evaluated a candidate under. */
691
652
  declare const policyResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
692
653
  basePolicyDigest: z.ZodString;
@@ -699,16 +660,14 @@ declare const policyResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
699
660
  }, z.core.$strict>, z.ZodObject<{
700
661
  baseRefName: z.ZodString;
701
662
  cause: z.ZodOptional<z.ZodEnum<{
702
- "no-pull-request": "no-pull-request";
703
663
  "lookup-failed": "lookup-failed";
664
+ "no-pull-request": "no-pull-request";
704
665
  "policy-unreadable": "policy-unreadable";
705
666
  }>>;
706
667
  reason: z.ZodString;
707
668
  status: z.ZodLiteral<"unresolved">;
708
669
  }, z.core.$strict>], "status">;
709
670
  type PolicyResolution = z.infer<typeof policyResolutionSchema>;
710
- //#endregion
711
- //#region src/review-ladder-policy.d.ts
712
671
  type ReviewFindingSeverity = "critical" | "high" | "medium" | "low" | "unknown";
713
672
  type ReviewFindingCategory = "correctness" | "safety" | "coordination" | "maintainability" | "unknown";
714
673
  declare const REVIEW_SEVERITIES: readonly ["critical", "high", "medium", "low", "unknown"];
@@ -732,8 +691,6 @@ interface ReviewLadderPolicy {
732
691
  cap: number;
733
692
  };
734
693
  }
735
- //#endregion
736
- //#region src/review-ladder-ledger.d.ts
737
694
  type LadderCycleStage = "interior" | "gate";
738
695
  interface LadderCycleRef {
739
696
  cycle: number;
@@ -798,8 +755,6 @@ interface FindingLedgerEntry extends ReviewFindingAttributes {
798
755
  reopenedCount: number;
799
756
  staleRepeatCount: number;
800
757
  }
801
- //#endregion
802
- //#region src/review-recording-schema.d.ts
803
758
  interface ReviewRecordedCycleIdentity {
804
759
  /**
805
760
  * SHA-256 of the proof file bytes this recording was applied to, or
@@ -818,11 +773,10 @@ interface ReviewRecordedCycleIdentity {
818
773
  recordingId: string;
819
774
  }
820
775
  type ReviewCycleRecording = {
821
- declarations: ReviewDeclarationRecord[]; /** Index-aligned with the cycle's `findings`. */
776
+ declarations: ReviewDeclarationRecord[];
777
+ /** Index-aligned with the cycle's `findings`. */
822
778
  occurrences: ReviewOccurrenceRecord[];
823
779
  } & ReviewRecordedCycleIdentity;
824
- //#endregion
825
- //#region src/review-ladder.d.ts
826
780
  type ReviewLadderExecutedStage = "interior" | "gate";
827
781
  interface LadderSessionAttribution {
828
782
  orchestrationMode?: "autonomous" | "manual";
@@ -848,6 +802,10 @@ interface ReviewLadderCycle {
848
802
  session?: LadderSessionAttribution;
849
803
  stage: LadderCycleStage;
850
804
  usage?: LadderUsageReport;
805
+ verdicts?: {
806
+ outcome: "error" | "failed" | "passed";
807
+ rung?: EvidenceReviewRung;
808
+ }[];
851
809
  }
852
810
  type LadderNextActionKind = "run-interior-cycle" | "advance-to-gate" | "run-gate-cycle" | "accept-nonblocking-findings" | "escalate-to-triage" | "ready-for-human";
853
811
  type ReviewLadderStage = "interior" | "interior-complete" | "gate";
@@ -900,8 +858,6 @@ type ReviewLadderEvaluation = LadderPosition & {
900
858
  ledger: FindingLedgerEntry[];
901
859
  occurrences: LedgerOccurrence[];
902
860
  };
903
- //#endregion
904
- //#region src/pr-readiness/ladder-proof-state.d.ts
905
861
  interface PrReviewLadderState {
906
862
  cycles: ReviewLadderCycle[];
907
863
  }
@@ -934,8 +890,6 @@ type ReviewEpochMode = {
934
890
  } | {
935
891
  kind: "declared-window";
936
892
  };
937
- //#endregion
938
- //#region src/pr-readiness/review-proof-types.d.ts
939
893
  type PrReviewKind = "correctness" | "security";
940
894
  type PrReviewMode = PrReviewKind | "all";
941
895
  type PrReviewOutcome = "passed" | "failed" | "error";
@@ -943,8 +897,6 @@ interface PrReviewStageResolution {
943
897
  model: string;
944
898
  sessionId: string;
945
899
  }
946
- //#endregion
947
- //#region src/pr-readiness/review-proof-shape.d.ts
948
900
  interface PrReviewFinding extends ReviewFindingAttributes {
949
901
  body: string;
950
902
  category?: ReviewFindingCategory;
@@ -995,15 +947,11 @@ interface PrReviewProof {
995
947
  };
996
948
  reviews: PrReviewResult[];
997
949
  }
998
- //#endregion
999
- //#region src/blocked-reasons.d.ts
1000
950
  declare const blockedReasonSchema: z.ZodObject<{
1001
951
  code: z.ZodString;
1002
952
  detail: z.ZodString;
1003
953
  }, z.core.$strip>;
1004
954
  type BlockedReason = z.infer<typeof blockedReasonSchema>;
1005
- //#endregion
1006
- //#region src/arm-auto-merge.d.ts
1007
955
  /**
1008
956
  * How GitHub merges the candidate. `pr:ready` chooses `merge` for a
1009
957
  * recognized faithful catch-up merge (ADR 0028), because a squash drops the
@@ -1031,15 +979,11 @@ interface ArmAutoMergeOutcome {
1031
979
  headSha: string;
1032
980
  outcome: "armed" | "merged" | "not-armed";
1033
981
  }
1034
- //#endregion
1035
- //#region src/checkout-repository.d.ts
1036
982
  interface CheckoutRepository {
1037
983
  name: string;
1038
984
  owner: string;
1039
985
  }
1040
- //#endregion
1041
- //#region src/profile.d.ts
1042
- declare const DEFAULT_FACTORY_REPOSITORY = "unknown/unknown";
986
+ export declare const DEFAULT_FACTORY_REPOSITORY = "unknown/unknown";
1043
987
  /** The one profile shape this build accepts (ADR 0021, #318, #351, #742). */
1044
988
  declare const PROFILE_SCHEMA_VERSION = 6;
1045
989
  declare const factoryProjectProfileSchema: z.ZodObject<{
@@ -1089,15 +1033,15 @@ declare const factoryProjectProfileSchema: z.ZodObject<{
1089
1033
  name: z.ZodString;
1090
1034
  requiredCheck: z.ZodOptional<z.ZodString>;
1091
1035
  scope: z.ZodDefault<z.ZodEnum<{
1092
- trivial: "trivial";
1093
1036
  "docs-only": "docs-only";
1094
1037
  full: "full";
1038
+ trivial: "trivial";
1095
1039
  }>>;
1096
1040
  }, z.core.$strip>>;
1097
1041
  }, z.core.$strip>;
1098
1042
  }, z.core.$strict>;
1099
1043
  type FactoryProjectProfile = z.infer<typeof factoryProjectProfileSchema>;
1100
- declare const resolveFactoryRepository: (profile?: Pick<FactoryProjectProfile, "repository"> | undefined) => string;
1044
+ export declare const resolveFactoryRepository: (profile?: Pick<FactoryProjectProfile, "repository"> | undefined) => string;
1101
1045
  interface LoadProjectProfileInput {
1102
1046
  cwd?: string;
1103
1047
  profilePath?: string;
@@ -1106,9 +1050,7 @@ interface LoadProjectProfileResult {
1106
1050
  path: string;
1107
1051
  profile: FactoryProjectProfile;
1108
1052
  }
1109
- declare function loadProjectProfile(input?: LoadProjectProfileInput): LoadProjectProfileResult;
1110
- //#endregion
1111
- //#region src/catch-up-recognition-record.d.ts
1053
+ export declare function loadProjectProfile(input?: LoadProjectProfileInput): LoadProjectProfileResult;
1112
1054
  interface CatchUpRecognition {
1113
1055
  /** The ref the candidate targets, as the recognizing command resolved it. */
1114
1056
  baseRef: string;
@@ -1124,12 +1066,8 @@ interface CatchUpRecognition {
1124
1066
  /** The ref that proves the second parent is admitted content. */
1125
1067
  upstreamRef: string;
1126
1068
  }
1127
- //#endregion
1128
- //#region src/diff-classification.d.ts
1129
1069
  declare const DIFF_CLASSIFICATIONS: readonly ["docs/process-only", "trivial", "non-trivial"];
1130
1070
  type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
1131
- //#endregion
1132
- //#region src/impact-stamp.d.ts
1133
1071
  /**
1134
1072
  * The recorded stamp. `targets` satisfies the completeness invariant: every
1135
1073
  * target the profile declares is present, each with its exact basis — never
@@ -1138,8 +1076,8 @@ type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
1138
1076
  */
1139
1077
  declare const impactStampSchema: z.ZodObject<{
1140
1078
  basis: z.ZodEnum<{
1141
- "target-scoped": "target-scoped";
1142
1079
  conservative: "conservative";
1080
+ "target-scoped": "target-scoped";
1143
1081
  }>;
1144
1082
  inertPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
1145
1083
  reasons: z.ZodArray<z.ZodString>;
@@ -1192,24 +1130,18 @@ interface ImpactScopeDecision {
1192
1130
  * `trustedImpactStamp` in `pr-readiness/verification-proof.ts`); pass
1193
1131
  * `undefined` otherwise.
1194
1132
  */
1195
- declare const impactStampScopeDecision: ({
1196
- stamp,
1197
- surface,
1198
- targetName
1199
- }: {
1133
+ export declare const impactStampScopeDecision: ({ stamp, surface, targetName }: {
1200
1134
  stamp: ImpactStamp | undefined;
1201
1135
  surface: ImpactScopeSurface;
1202
1136
  targetName: string;
1203
1137
  }) => ImpactScopeDecision;
1204
- //#endregion
1205
- //#region src/required-check-policy.d.ts
1206
1138
  declare const EVIDENCE_CHECK_TYPES: readonly ["review", "verify"];
1207
1139
  type EvidenceCheckType = (typeof EVIDENCE_CHECK_TYPES)[number];
1208
1140
  declare const requiredCheckScopeSchema: z.ZodObject<{
1209
1141
  classifications: z.ZodArray<z.ZodEnum<{
1210
1142
  "docs/process-only": "docs/process-only";
1211
- trivial: "trivial";
1212
1143
  "non-trivial": "non-trivial";
1144
+ trivial: "trivial";
1213
1145
  }>>;
1214
1146
  }, z.core.$strict>;
1215
1147
  type RequiredCheckScope = z.infer<typeof requiredCheckScopeSchema>;
@@ -1222,10 +1154,7 @@ interface ScopeDecision {
1222
1154
  inScope: boolean;
1223
1155
  reason: string;
1224
1156
  }
1225
- declare const requiredCheckInScope: ({
1226
- context,
1227
- scope
1228
- }: {
1157
+ declare const requiredCheckInScope: ({ context, scope }: {
1229
1158
  context: RequiredCheckScopeContext;
1230
1159
  scope?: RequiredCheckScope;
1231
1160
  }) => ScopeDecision;
@@ -1234,8 +1163,6 @@ interface RequiredCheck {
1234
1163
  checkType: EvidenceCheckType;
1235
1164
  scope?: RequiredCheckScope;
1236
1165
  }
1237
- //#endregion
1238
- //#region src/demand-resolution.d.ts
1239
1166
  /**
1240
1167
  * The two GitHub reads that make the base policy authoritative: the live tip of
1241
1168
  * a branch, and one file's content at an exact commit. Injectable so tests can
@@ -1278,14 +1205,12 @@ type CandidatePullRequestLookup = {
1278
1205
  reason: string;
1279
1206
  status: "unavailable";
1280
1207
  };
1281
- //#endregion
1282
- //#region src/follow-up.d.ts
1283
1208
  interface FactoryCliInvocation {
1284
1209
  /** Runtime arguments ending with the factory CLI entry module. */
1285
1210
  argvPrefix: string[];
1286
1211
  executable: string;
1287
1212
  }
1288
- declare const FactoryCliInvocationSchema: z.ZodType<FactoryCliInvocation>;
1213
+ export declare const FactoryCliInvocationSchema: z.ZodType<FactoryCliInvocation>;
1289
1214
  interface FollowUpAction {
1290
1215
  /**
1291
1216
  * Machine-safe argv-style array for the obvious next action, e.g.
@@ -1305,24 +1230,18 @@ interface FollowUpAction {
1305
1230
  * Build a {@link FollowUpAction} from a literal argv array. The `command`
1306
1231
  * string is derived from argv so the two never drift.
1307
1232
  */
1308
- declare const followUpFromArgv: (argv: string[]) => FollowUpAction;
1233
+ export declare const followUpFromArgv: (argv: string[]) => FollowUpAction;
1309
1234
  /** Canonical zod schema for the optional follow-up field on JSON outputs. */
1310
- declare const FollowUpActionSchema: z.ZodType<FollowUpAction>;
1311
- //#endregion
1312
- //#region src/hq-access.d.ts
1235
+ export declare const FollowUpActionSchema: z.ZodType<FollowUpAction>;
1313
1236
  /** Cloudflare Access service-token credentials for production HQ ingest. */
1314
1237
  interface CloudflareAccessServiceToken {
1315
1238
  clientId: string;
1316
1239
  clientSecret: string;
1317
1240
  }
1318
- //#endregion
1319
- //#region src/check-run-relay.d.ts
1320
1241
  interface CheckRunRelay {
1321
1242
  credentials: CloudflareAccessServiceToken;
1322
1243
  url: URL;
1323
1244
  }
1324
- //#endregion
1325
- //#region src/pr-verify-mode.d.ts
1326
1245
  /**
1327
1246
  * The verification mode `pr:verify` resolved for a run.
1328
1247
  *
@@ -1331,8 +1250,6 @@ interface CheckRunRelay {
1331
1250
  * check-run payload — can name the same union without importing each other.
1332
1251
  */
1333
1252
  type ResolvedPrVerifyMode = "docs-only" | "trivial" | "full";
1334
- //#endregion
1335
- //#region src/pr-verify-proof-contract.d.ts
1336
1253
  /**
1337
1254
  * The pr:verify proof versions a reader accepts: the current one only (#920
1338
1255
  * item 1). #917 narrowed the pr:ready reader the same way. A pr:verify proof
@@ -1402,6 +1319,34 @@ interface PrVerifyExecutedCommand {
1402
1319
  name: string;
1403
1320
  scope: "docs-only" | "trivial" | "full";
1404
1321
  }
1322
+ /** Where a verification battery ran (#1570). */
1323
+ declare const PR_VERIFY_RUNNER_KINDS: readonly ["ci", "cloud", "local"];
1324
+ /**
1325
+ * The machine a pr:verify battery ran on (#1570), so per-step durations in
1326
+ * `executedCommands` can be compared like for like: a Mac against a Mac, a
1327
+ * cloud agent VM against a cloud agent VM. It names the class of machine, not
1328
+ * the machine: no hostname, user, or path is recorded, because this proof is
1329
+ * sent to HQ.
1330
+ */
1331
+ interface PrVerifyRunner {
1332
+ /** Node's `process.arch`, such as `arm64` or `x64`. */
1333
+ arch: string;
1334
+ /** Logical CPUs the run could see. */
1335
+ cpuCount: number;
1336
+ /**
1337
+ * `ci` is a hosted CI runner, `cloud` an agent's cloud VM, and `local` a
1338
+ * developer machine: everything that is neither.
1339
+ */
1340
+ kind: (typeof PR_VERIFY_RUNNER_KINDS)[number];
1341
+ /** Node's `process.platform`, such as `darwin` or `linux`. */
1342
+ os: string;
1343
+ /**
1344
+ * The host that provided a `ci` or `cloud` runner when its environment
1345
+ * names it: `claude-code`, `cursor`, or `github-actions`. Absent for
1346
+ * `local` and for an unnamed CI.
1347
+ */
1348
+ provider?: "claude-code" | "cursor" | "github-actions";
1349
+ }
1405
1350
  /**
1406
1351
  * Epic #550 wave 3 (#430): a verification command the impact stamp proved this
1407
1352
  * candidate cannot reach, so the battery did not run it.
@@ -1473,13 +1418,17 @@ interface PrVerifyProof {
1473
1418
  profilePath: string;
1474
1419
  projectKey: string;
1475
1420
  repository: string;
1421
+ /**
1422
+ * The machine the battery ran on (#1570). Optional and additive: a proof
1423
+ * written before it existed parses unchanged, and the schema version does
1424
+ * not move.
1425
+ */
1426
+ runner?: PrVerifyRunner;
1476
1427
  startedAt: string;
1477
1428
  verificationCommands: PrVerifyCommandResult[];
1478
1429
  }
1479
1430
  type PrVerifyBaselineFullProof = NonNullable<PrVerifyProof["baselineFullProofs"]>[number];
1480
- declare function validatePrVerifyProof(value: unknown): PrVerifyProof;
1481
- //#endregion
1482
- //#region src/pr-verify-check-payload.d.ts
1431
+ export declare function validatePrVerifyProof(value: unknown): PrVerifyProof;
1483
1432
  /**
1484
1433
  * Machine-readable binding carried on the `patronage-factory/pr-verify` check
1485
1434
  * run (#247), alongside the human-readable prose summary.
@@ -1537,8 +1486,6 @@ interface PrVerifyCheckPayload {
1537
1486
  /** Original validated proof. Absence requires normal verification on a fresh runner. */
1538
1487
  verificationProof?: PrVerifyProof;
1539
1488
  }
1540
- //#endregion
1541
- //#region src/pr-verify-status.d.ts
1542
1489
  type CommitStatusState = "failure" | "pending" | "success";
1543
1490
  interface PostCommitStatusInput {
1544
1491
  context?: string;
@@ -1563,8 +1510,6 @@ interface PostCommitStatusInput {
1563
1510
  targetUrl: string;
1564
1511
  }
1565
1512
  type PostCommitStatus = (input: PostCommitStatusInput) => void;
1566
- //#endregion
1567
- //#region src/github-check-runs.d.ts
1568
1513
  declare const FACTORY_CHECK_NAMES: {
1569
1514
  readonly "pr-ready": "patronage-factory/pr-ready";
1570
1515
  readonly "pr-review": "patronage-factory/pr-review";
@@ -1672,15 +1617,9 @@ interface PrVerifyProofBinding {
1672
1617
  * can never satisfy a consumer that wants proof. Absent, foreign, or
1673
1618
  * unparseable ⇒ `undefined` (fail closed).
1674
1619
  */
1675
- declare function fetchPrVerifyProofBinding({
1676
- expectedAppId,
1677
- githubApp,
1678
- owner,
1679
- repo,
1680
- sha,
1681
- runJson
1682
- }: {
1683
- /** Overrides the configured App id — CI has no user config (#247 part 3). */expectedAppId?: string;
1620
+ declare function fetchPrVerifyProofBinding({ expectedAppId, githubApp, owner, repo, sha, runJson }: {
1621
+ /** Overrides the configured App id — CI has no user config (#247 part 3). */
1622
+ expectedAppId?: string;
1684
1623
  githubApp?: GithubAppConfig;
1685
1624
  owner: string;
1686
1625
  repo: string;
@@ -1696,15 +1635,19 @@ interface ExactHeadRunSource {
1696
1635
  appId?: () => string;
1697
1636
  runJson?: GhJsonRunner;
1698
1637
  }
1699
- //#endregion
1700
- //#region src/merge-freeze.d.ts
1701
- declare const MERGE_FREEZE_CHECK_NAME = "patronage-factory/merge-freeze";
1638
+ interface HoldPullRequestInput {
1639
+ cwd: string;
1640
+ owner: string;
1641
+ pr: number;
1642
+ repo: string;
1643
+ }
1644
+ export declare const MERGE_FREEZE_CHECK_NAME = "patronage-factory/merge-freeze";
1702
1645
  /**
1703
1646
  * The Factory App's slug, as GitHub serves it on the runs the writer posts.
1704
1647
  * It is not a trust predicate: an App chooses its own slug, so the reader
1705
1648
  * trusts the pinned numeric App id instead (ADR 0022, #1393).
1706
1649
  */
1707
- declare const MERGE_FREEZE_APP_SLUG = "patronage-factory";
1650
+ export declare const MERGE_FREEZE_APP_SLUG = "patronage-factory";
1708
1651
  declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1709
1652
  active: z.ZodLiteral<true>;
1710
1653
  generationId: z.ZodNumber;
@@ -1718,10 +1661,10 @@ declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1718
1661
  schemaVersion: z.ZodLiteral<1>;
1719
1662
  verification: z.ZodOptional<z.ZodObject<{
1720
1663
  jobs: z.ZodRecord<z.ZodString, z.ZodEnum<{
1721
- success: "success";
1722
- failure: "failure";
1723
1664
  cancelled: "cancelled";
1665
+ failure: "failure";
1724
1666
  skipped: "skipped";
1667
+ success: "success";
1725
1668
  }>>;
1726
1669
  runAttempt: z.ZodNumber;
1727
1670
  runId: z.ZodNumber;
@@ -1737,10 +1680,10 @@ declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1737
1680
  schemaVersion: z.ZodLiteral<1>;
1738
1681
  verification: z.ZodOptional<z.ZodObject<{
1739
1682
  jobs: z.ZodRecord<z.ZodString, z.ZodEnum<{
1740
- success: "success";
1741
- failure: "failure";
1742
1683
  cancelled: "cancelled";
1684
+ failure: "failure";
1743
1685
  skipped: "skipped";
1686
+ success: "success";
1744
1687
  }>>;
1745
1688
  runAttempt: z.ZodNumber;
1746
1689
  runId: z.ZodNumber;
@@ -1754,7 +1697,7 @@ type MergeFreezeState = z.infer<typeof mergeFreezeStateSchema>;
1754
1697
  * payload must parse under this exact reader schema, which is what the
1755
1698
  * workflow's own tests assert through this export.
1756
1699
  */
1757
- declare function validateMergeFreezeState(value: unknown): MergeFreezeState;
1700
+ export declare function validateMergeFreezeState(value: unknown): MergeFreezeState;
1758
1701
  interface MergeFreezeStoreInput {
1759
1702
  cwd: string;
1760
1703
  headSha: string;
@@ -1851,17 +1794,13 @@ interface GitHubCheckRunMergeFreezeApi {
1851
1794
  workflowId: number;
1852
1795
  }) => unknown;
1853
1796
  }
1854
- declare function createGitHubCheckRunMergeFreezeStore(api: GitHubCheckRunMergeFreezeApi): MergeFreezeAuthority;
1855
- //#endregion
1856
- //#region src/pr-proof-io.d.ts
1797
+ export declare function createGitHubCheckRunMergeFreezeStore(api: GitHubCheckRunMergeFreezeApi): MergeFreezeAuthority;
1857
1798
  interface ProofDescriptor<T> {
1858
1799
  label: string;
1859
1800
  defaultPath: string;
1860
1801
  schemaVersion: number;
1861
1802
  parse: (raw: unknown) => T;
1862
1803
  }
1863
- //#endregion
1864
- //#region src/pr-readiness/readiness-ledger.d.ts
1865
1804
  /**
1866
1805
  * Ledger schema version 2 (#894): `verification` is a tagged union on
1867
1806
  * `prVerify` and `externalChecks` no longer echoes `inScope`. Version 1
@@ -1873,8 +1812,8 @@ declare const READINESS_REPAIR_CODES: readonly ["undraft-pr", "await-post-undraf
1873
1812
  declare const readinessRepairSchema: z.ZodObject<{
1874
1813
  action: z.ZodString;
1875
1814
  code: z.ZodEnum<{
1876
- "undraft-pr": "undraft-pr";
1877
1815
  "await-post-undraft-checks": "await-post-undraft-checks";
1816
+ "undraft-pr": "undraft-pr";
1878
1817
  }>;
1879
1818
  command: z.ZodString;
1880
1819
  }, z.core.$strip>;
@@ -1883,8 +1822,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1883
1822
  blockingReasons: z.ZodArray<z.ZodString>;
1884
1823
  classification: z.ZodEnum<{
1885
1824
  "docs/process-only": "docs/process-only";
1886
- trivial: "trivial";
1887
1825
  "non-trivial": "non-trivial";
1826
+ trivial: "trivial";
1888
1827
  }>;
1889
1828
  externalChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1890
1829
  checkType: z.ZodEnum<{
@@ -1896,15 +1835,15 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1896
1835
  scope: z.ZodOptional<z.ZodObject<{
1897
1836
  classifications: z.ZodArray<z.ZodEnum<{
1898
1837
  "docs/process-only": "docs/process-only";
1899
- trivial: "trivial";
1900
1838
  "non-trivial": "non-trivial";
1839
+ trivial: "trivial";
1901
1840
  }>>;
1902
1841
  }, z.core.$strict>>;
1903
1842
  scopeReason: z.ZodString;
1904
1843
  status: z.ZodEnum<{
1844
+ "out-of-scope": "out-of-scope";
1905
1845
  satisfied: "satisfied";
1906
1846
  unmet: "unmet";
1907
- "out-of-scope": "out-of-scope";
1908
1847
  }>;
1909
1848
  }, z.core.$strip>>>;
1910
1849
  github: z.ZodObject<{
@@ -1912,11 +1851,11 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1912
1851
  mergeStateStatus: z.ZodString;
1913
1852
  mergeable: z.ZodString;
1914
1853
  requiredChecks: z.ZodEnum<{
1915
- unknown: "unknown";
1916
- passed: "passed";
1917
1854
  failed: "failed";
1918
- pending: "pending";
1919
1855
  none: "none";
1856
+ passed: "passed";
1857
+ pending: "pending";
1858
+ unknown: "unknown";
1920
1859
  }>;
1921
1860
  reviewDecision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1922
1861
  unresolvedReviewThreads: z.ZodNumber;
@@ -1928,8 +1867,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1928
1867
  repairs: z.ZodDefault<z.ZodArray<z.ZodObject<{
1929
1868
  action: z.ZodString;
1930
1869
  code: z.ZodEnum<{
1931
- "undraft-pr": "undraft-pr";
1932
1870
  "await-post-undraft-checks": "await-post-undraft-checks";
1871
+ "undraft-pr": "undraft-pr";
1933
1872
  }>;
1934
1873
  command: z.ZodString;
1935
1874
  }, z.core.$strip>>>;
@@ -1943,18 +1882,18 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1943
1882
  unknown: z.ZodNumber;
1944
1883
  }, z.core.$strip>;
1945
1884
  highestBlockingSeverity: z.ZodOptional<z.ZodEnum<{
1946
- unknown: "unknown";
1947
1885
  critical: "critical";
1948
1886
  high: "high";
1949
1887
  low: "low";
1950
1888
  medium: "medium";
1889
+ unknown: "unknown";
1951
1890
  }>>;
1952
1891
  highestOpenSeverity: z.ZodOptional<z.ZodEnum<{
1953
- unknown: "unknown";
1954
1892
  critical: "critical";
1955
1893
  high: "high";
1956
1894
  low: "low";
1957
1895
  medium: "medium";
1896
+ unknown: "unknown";
1958
1897
  }>>;
1959
1898
  maxReviewCycles: z.ZodOptional<z.ZodNumber>;
1960
1899
  nonBlockingFindings: z.ZodNumber;
@@ -1973,12 +1912,12 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1973
1912
  "interior-cap-reached": "interior-cap-reached";
1974
1913
  }>>;
1975
1914
  nextAction: z.ZodEnum<{
1976
- "run-interior-cycle": "run-interior-cycle";
1977
- "advance-to-gate": "advance-to-gate";
1978
- "run-gate-cycle": "run-gate-cycle";
1979
1915
  "accept-nonblocking-findings": "accept-nonblocking-findings";
1916
+ "advance-to-gate": "advance-to-gate";
1980
1917
  "escalate-to-triage": "escalate-to-triage";
1981
1918
  "ready-for-human": "ready-for-human";
1919
+ "run-gate-cycle": "run-gate-cycle";
1920
+ "run-interior-cycle": "run-interior-cycle";
1982
1921
  }>;
1983
1922
  stage: z.ZodEnum<{
1984
1923
  gate: "gate";
@@ -1988,8 +1927,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1988
1927
  }, z.core.$strip>>;
1989
1928
  reviewRuns: z.ZodOptional<z.ZodArray<z.ZodType<PrReviewResult, unknown, z.core.$ZodTypeInternals<PrReviewResult, unknown>>>>;
1990
1929
  reviewTerminalState: z.ZodOptional<z.ZodEnum<{
1991
- blocked: "blocked";
1992
1930
  "accepted-with-findings": "accepted-with-findings";
1931
+ blocked: "blocked";
1993
1932
  clean: "clean";
1994
1933
  }>>;
1995
1934
  reviews: z.ZodObject<{
@@ -1998,11 +1937,11 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1998
1937
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1999
1938
  reviewedPatchId: z.ZodOptional<z.ZodString>;
2000
1939
  status: z.ZodEnum<{
2001
- stale: "stale";
2002
1940
  blocked: "blocked";
2003
- "not-required": "not-required";
2004
1941
  current: "current";
2005
1942
  missing: "missing";
1943
+ "not-required": "not-required";
1944
+ stale: "stale";
2006
1945
  }>;
2007
1946
  }, z.core.$strip>;
2008
1947
  security: z.ZodOptional<z.ZodObject<{
@@ -2010,11 +1949,11 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
2010
1949
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
2011
1950
  reviewedPatchId: z.ZodOptional<z.ZodString>;
2012
1951
  status: z.ZodEnum<{
2013
- stale: "stale";
2014
1952
  blocked: "blocked";
2015
- "not-required": "not-required";
2016
1953
  current: "current";
2017
1954
  missing: "missing";
1955
+ "not-required": "not-required";
1956
+ stale: "stale";
2018
1957
  }>;
2019
1958
  }, z.core.$strip>>;
2020
1959
  }, z.core.$strip>;
@@ -2215,8 +2154,6 @@ declare const fetchRequiredStatusCheckContexts: (fetchRules: () => unknown, fetc
2215
2154
  * whether the narrowing took effect or the read fell back to every run.
2216
2155
  */
2217
2156
  declare const admissionCheckSetDescription: (requiredContexts?: readonly string[]) => string;
2218
- //#endregion
2219
- //#region src/github-client.d.ts
2220
2157
  /**
2221
2158
  * Read a branch tip from GitHub rather than a checkout's cached remote ref.
2222
2159
  * `gh` is injectable so a test can hand the real read a fake GitHub.
@@ -2224,8 +2161,6 @@ declare const admissionCheckSetDescription: (requiredContexts?: readonly string[
2224
2161
  declare const fetchGitHubBranchTipSha: (repository: CheckoutRepository, branch: string, cwd: string, gh?: <T>(args: string[], cwd: string) => T) => string;
2225
2162
  /** An asynchronous `gh` JSON read. Injected so a test can hand the reads a fake GitHub. */
2226
2163
  type GhBoundedJsonReader = (args: string[], cwd: string) => Promise<unknown>;
2227
- //#endregion
2228
- //#region src/github-app-client.d.ts
2229
2164
  interface FactoryAppRequest {
2230
2165
  body?: unknown;
2231
2166
  headers?: Readonly<Record<string, string>>;
@@ -2239,8 +2174,6 @@ interface FactoryAppExchange<T = unknown> {
2239
2174
  readonly json: T;
2240
2175
  readonly status: number;
2241
2176
  }
2242
- //#endregion
2243
- //#region src/github-pr-status-comment.d.ts
2244
2177
  interface UpsertFactoryPrStatusCommentInput {
2245
2178
  body: string;
2246
2179
  /** ISO instant at which this presentation was observed. */
@@ -2273,10 +2206,7 @@ type VerificationHeadShas = {
2273
2206
  declare function readPrVerifyProof(filePath: string): PrVerifyProof;
2274
2207
  declare const verifyProofPassed: (proof: PrVerifyProof) => boolean;
2275
2208
  declare const prVerifyProofHeadShas: (proof: PrVerifyProof | undefined, creditedHeadSha?: string) => VerifiedHeadShas;
2276
- declare const verifyProofIdentityMatches: ({
2277
- currentIdentity,
2278
- proof
2279
- }: {
2209
+ declare const verifyProofIdentityMatches: ({ currentIdentity, proof }: {
2280
2210
  currentIdentity?: {
2281
2211
  patchId: string;
2282
2212
  mergeBaseSha?: string;
@@ -2295,10 +2225,7 @@ declare const verifyProofIdentityMatches: ({
2295
2225
  * head-only or patch-id-only match): a stamp narrows external demands, so it
2296
2226
  * is trusted only on an exact double binding, fail closed.
2297
2227
  */
2298
- declare const trustedImpactStamp: ({
2299
- candidate,
2300
- proof
2301
- }: {
2228
+ declare const trustedImpactStamp: ({ candidate, proof }: {
2302
2229
  candidate: {
2303
2230
  headSha: string;
2304
2231
  patchId: string;
@@ -2313,21 +2240,14 @@ declare const trustedImpactStamp: ({
2313
2240
  * review and preview demands, so it earns the same strict double binding and
2314
2241
  * the same fail-closed answer (`undefined`) on every other state.
2315
2242
  */
2316
- declare const trustedCatchUpRecognition: ({
2317
- candidate,
2318
- proof
2319
- }: {
2243
+ declare const trustedCatchUpRecognition: ({ candidate, proof }: {
2320
2244
  candidate: {
2321
2245
  headSha: string;
2322
2246
  patchId: string;
2323
2247
  };
2324
2248
  proof: PrVerifyProof | undefined;
2325
2249
  }) => CatchUpRecognition | undefined;
2326
- declare const prVerifyFullHeadShasForDiff: ({
2327
- docsOnlyDeltaAcceptedSince,
2328
- files,
2329
- proof
2330
- }: {
2250
+ declare const prVerifyFullHeadShasForDiff: ({ docsOnlyDeltaAcceptedSince, files, proof }: {
2331
2251
  docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
2332
2252
  files: string[];
2333
2253
  proof: PrVerifyProof;
@@ -2348,25 +2268,12 @@ type VerificationProofState = {
2348
2268
  kind: "typed-diff-mismatch";
2349
2269
  mode: ResolvedPrVerifyMode;
2350
2270
  };
2351
- declare const verificationProofStateFor: ({
2352
- proof,
2353
- proofMatchesCurrentDiff,
2354
- proofPath
2355
- }: {
2271
+ declare const verificationProofStateFor: ({ proof, proofMatchesCurrentDiff, proofPath }: {
2356
2272
  proof?: PrVerifyProof;
2357
2273
  proofMatchesCurrentDiff?: boolean;
2358
2274
  proofPath?: string;
2359
2275
  }) => VerificationProofState;
2360
- declare const verificationProofApplicabilityFor: ({
2361
- docsOnlyDeltaAcceptedSince,
2362
- explicitProof,
2363
- files,
2364
- headSha,
2365
- currentIdentity,
2366
- proof,
2367
- proofPath,
2368
- proofReadError
2369
- }: {
2276
+ declare const verificationProofApplicabilityFor: ({ docsOnlyDeltaAcceptedSince, explicitProof, files, headSha, currentIdentity, proof, proofPath, proofReadError }: {
2370
2277
  docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
2371
2278
  explicitProof: boolean;
2372
2279
  files: string[];
@@ -2389,15 +2296,7 @@ declare const verificationProofApplicabilityFor: ({
2389
2296
  proof: PrVerifyProof;
2390
2297
  };
2391
2298
  };
2392
- declare const resolveVerifyProofApplicability: ({
2393
- proofPath,
2394
- explicitProof,
2395
- docsOnlyDeltaAcceptedSince,
2396
- files,
2397
- headSha,
2398
- currentVerifyIdentityForBase,
2399
- preread
2400
- }: {
2299
+ declare const resolveVerifyProofApplicability: ({ proofPath, explicitProof, docsOnlyDeltaAcceptedSince, files, headSha, currentVerifyIdentityForBase, preread }: {
2401
2300
  proofPath: string;
2402
2301
  explicitProof: boolean;
2403
2302
  docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
@@ -2424,8 +2323,6 @@ declare const resolveVerifyProofApplicability: ({
2424
2323
  };
2425
2324
  declare const verificationProofForReadiness: (state: VerificationProofState) => VerificationHeadShas;
2426
2325
  declare const verificationProofBlockingReason: (state: VerificationProofState) => string | undefined;
2427
- //#endregion
2428
- //#region src/preview-lifecycle.d.ts
2429
2326
  type PreviewDisposition = "deploy" | "not-required";
2430
2327
  interface PreviewTargetPlan {
2431
2328
  basis: string;
@@ -2443,7 +2340,7 @@ interface PreviewLifecyclePlan {
2443
2340
  targets: PreviewTargetPlan[];
2444
2341
  }
2445
2342
  /** Validate a serialized plan without deriving or changing its dispositions. */
2446
- declare const validatePreviewLifecyclePlan: (value: unknown) => PreviewLifecyclePlan;
2343
+ export declare const validatePreviewLifecyclePlan: (value: unknown) => PreviewLifecyclePlan;
2447
2344
  /**
2448
2345
  * Structural subset of the profile: the impact declarations plus the external
2449
2346
  * demand list. Structural rather than a `Pick` so this module does not import
@@ -2469,7 +2366,7 @@ interface PreviewLifecycleProfile {
2469
2366
  * plan can withhold are precisely the demands wave 2 can release, so a stack
2470
2367
  * can never be skipped while its proof stays demanded.
2471
2368
  */
2472
- declare const previewLifecycleTargets: (profile: PreviewLifecycleProfile) => string[];
2369
+ export declare const previewLifecycleTargets: (profile: PreviewLifecycleProfile) => string[];
2473
2370
  /**
2474
2371
  * Plan the preview lifecycle for one candidate.
2475
2372
  *
@@ -2481,12 +2378,7 @@ declare const previewLifecycleTargets: (profile: PreviewLifecycleProfile) => str
2481
2378
  * throw. A malformed CALL is the deliberate exception: omitting
2482
2379
  * `vetoedTargets` is API misuse, not data doubt, and throws.
2483
2380
  */
2484
- declare const planPreviewLifecycle: ({
2485
- candidate,
2486
- profile,
2487
- proof,
2488
- vetoedTargets
2489
- }: {
2381
+ export declare const planPreviewLifecycle: ({ candidate, profile, proof, vetoedTargets }: {
2490
2382
  candidate: {
2491
2383
  headSha: string;
2492
2384
  patchId: string;
@@ -2512,8 +2404,6 @@ declare const planPreviewLifecycle: ({
2512
2404
  */
2513
2405
  vetoedTargets: readonly string[];
2514
2406
  }) => PreviewLifecyclePlan;
2515
- //#endregion
2516
- //#region src/pr-status-hud.d.ts
2517
2407
  type FactoryPrStatusCheckName = "patronage-factory/merge-freeze" | "patronage-factory/pr-ready" | "patronage-factory/pr-verify";
2518
2408
  interface CompletedFactoryCheckSnapshot {
2519
2409
  readonly completedAt: string;
@@ -2585,7 +2475,8 @@ interface PresentFactoryPrStatusHudDependencies {
2585
2475
  * head-moved error, not as a second identity endpoint.
2586
2476
  */
2587
2477
  readonly assertCurrentIdentity: (input: {
2588
- baseRefName?: string; /** Retained for rendering/callers; identity compares base ref name. */
2478
+ baseRefName?: string;
2479
+ /** Retained for rendering/callers; identity compares base ref name. */
2589
2480
  baseSha?: string;
2590
2481
  headSha: string;
2591
2482
  owner: string;
@@ -2636,13 +2527,14 @@ interface ReadFactoryPrStatusSourcesDependencies {
2636
2527
  }) => Promise<readonly PreviewProofRegistration[]>;
2637
2528
  readonly timeoutMs?: number;
2638
2529
  }
2639
- declare function renderFactoryPrStatusHud(input: RenderFactoryPrStatusHudInput): string;
2640
- declare function presentFactoryPrStatusHud(input: PresentFactoryPrStatusHudInput, dependencies: PresentFactoryPrStatusHudDependencies): Promise<UpsertFactoryPrStatusCommentResult>;
2641
- declare function assertFactoryPrStatusIdentity(input: ReadFactoryPrStatusSourcesInput & {
2642
- readonly baseRefName?: string; /** Retained for rendering/callers; identity compares base ref name. */
2530
+ export declare function renderFactoryPrStatusHud(input: RenderFactoryPrStatusHudInput): string;
2531
+ export declare function presentFactoryPrStatusHud(input: PresentFactoryPrStatusHudInput, dependencies: PresentFactoryPrStatusHudDependencies): Promise<UpsertFactoryPrStatusCommentResult>;
2532
+ export declare function assertFactoryPrStatusIdentity(input: ReadFactoryPrStatusSourcesInput & {
2533
+ readonly baseRefName?: string;
2534
+ /** Retained for rendering/callers; identity compares base ref name. */
2643
2535
  readonly baseSha?: string;
2644
2536
  }, dependencies?: ReadFactoryPrStatusSourcesDependencies): Promise<void>;
2645
- declare function readFactoryPrStatusSources(input: ReadFactoryPrStatusSourcesInput, dependencies?: ReadFactoryPrStatusSourcesDependencies): Promise<FactoryPrStatusSources>;
2537
+ export declare function readFactoryPrStatusSources(input: ReadFactoryPrStatusSourcesInput, dependencies?: ReadFactoryPrStatusSourcesDependencies): Promise<FactoryPrStatusSources>;
2646
2538
  interface PlanFactoryPrStatusHudInput {
2647
2539
  readonly cwd: string;
2648
2540
  readonly headSha: string;
@@ -2656,7 +2548,7 @@ interface PlanFactoryPrStatusHudInput {
2656
2548
  * Candidate identity is never copied from the proof. Absent independent
2657
2549
  * identity or an unbound verify proof is the planner's conservative path.
2658
2550
  */
2659
- declare function planFactoryPrStatusHud(input: PlanFactoryPrStatusHudInput): PreviewLifecyclePlan;
2551
+ export declare function planFactoryPrStatusHud(input: PlanFactoryPrStatusHudInput): PreviewLifecyclePlan;
2660
2552
  interface RefreshFactoryPrStatusHudInput {
2661
2553
  readonly cwd: string;
2662
2554
  readonly headSha: string;
@@ -2685,18 +2577,17 @@ interface RefreshFactoryPrStatusHudDependencies {
2685
2577
  readonly fetch?: typeof fetch;
2686
2578
  }
2687
2579
  /** Plan from the checkout and present the App-owned HUD. */
2688
- declare function refreshFactoryPrStatusHud(input: RefreshFactoryPrStatusHudInput, dependencies?: RefreshFactoryPrStatusHudDependencies): Promise<UpsertFactoryPrStatusCommentResult>;
2580
+ export declare function refreshFactoryPrStatusHud(input: RefreshFactoryPrStatusHudInput, dependencies?: RefreshFactoryPrStatusHudDependencies): Promise<UpsertFactoryPrStatusCommentResult>;
2689
2581
  /**
2690
2582
  * Presentation must not fail an admission gate. Used after pr:ready publishes
2691
2583
  * its check so the table is not stuck at first-write.
2692
2584
  */
2693
- declare function refreshFactoryPrStatusHudSafely(input: RefreshFactoryPrStatusHudInput, onNotice?: (message: string) => void): Promise<void>;
2694
- //#endregion
2695
- //#region src/pr-ready.d.ts
2585
+ export declare function refreshFactoryPrStatusHudSafely(input: RefreshFactoryPrStatusHudInput, onNotice?: (message: string) => void): Promise<void>;
2696
2586
  interface PrReadyArgs extends LoadProjectProfileInput {
2697
2587
  authoringSessionIds?: string[];
2698
2588
  base: string;
2699
2589
  epic?: number;
2590
+ hold?: boolean;
2700
2591
  json?: boolean;
2701
2592
  output?: string;
2702
2593
  report?: boolean;
@@ -2907,6 +2798,8 @@ interface PrReadyDependencies {
2907
2798
  * real GraphQL reads.
2908
2799
  */
2909
2800
  armingPolicy?: ArmingPolicyReads;
2801
+ /** Applies `factory:hold` for `--hold` (#1513). Defaults to the REST call. */
2802
+ holdPullRequest?: (input: HoldPullRequestInput) => Promise<void> | void;
2910
2803
  /**
2911
2804
  * Reads the authoritative base review policy (#922): the profile committed at
2912
2805
  * the live tip of the PR's own base ref. Defaults to the real GitHub reads,
@@ -2993,15 +2886,10 @@ interface PrReadyGitDependencies {
2993
2886
  showFileAtRef: (cwd: string, ref: string, absolutePath: string) => string | undefined;
2994
2887
  stablePatchId: (cwd: string, base: string) => string;
2995
2888
  }
2996
- declare function validatePrReadyProof(value: unknown): PrReadyProof;
2997
- declare function readPrReadyProof(filePath: string): PrReadyProof;
2998
- declare function runPrReady(args: PrReadyArgs, dependencies?: PrReadyDependencies): Promise<PrReadyProof>;
2999
- //#endregion
3000
- //#region src/factory-session.d.ts
3001
- declare const resolveAuthoringSessionIds: ({
3002
- override,
3003
- recorded
3004
- }: {
2889
+ export declare function validatePrReadyProof(value: unknown): PrReadyProof;
2890
+ export declare function readPrReadyProof(filePath: string): PrReadyProof;
2891
+ export declare function runPrReady(args: PrReadyArgs, dependencies?: PrReadyDependencies): Promise<PrReadyProof>;
2892
+ declare const resolveAuthoringSessionIds: ({ override, recorded }: {
3005
2893
  override?: string[];
3006
2894
  recorded?: string;
3007
2895
  }) => string[];
@@ -3020,17 +2908,17 @@ declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
3020
2908
  mergeBaseSha: z.ZodString;
3021
2909
  model: z.ZodOptional<z.ZodString>;
3022
2910
  outcome: z.ZodEnum<{
3023
- pass: "pass";
3024
2911
  fail: "fail";
2912
+ pass: "pass";
3025
2913
  }>;
3026
2914
  patchId: z.ZodString;
3027
2915
  policyVersion: z.ZodOptional<z.ZodString>;
3028
2916
  producer: z.ZodString;
3029
2917
  requestId: z.ZodOptional<z.ZodString>;
3030
2918
  rung: z.ZodOptional<z.ZodEnum<{
2919
+ human: "human";
3031
2920
  "independent-model": "independent-model";
3032
2921
  oracle: "oracle";
3033
- human: "human";
3034
2922
  }>>;
3035
2923
  schemaVersion: z.ZodLiteral<1>;
3036
2924
  sessionId: z.ZodOptional<z.ZodString>;
@@ -3047,17 +2935,17 @@ declare const evidenceEnvelopeSchema: z.ZodObject<{
3047
2935
  mergeBaseSha: z.ZodString;
3048
2936
  model: z.ZodOptional<z.ZodString>;
3049
2937
  outcome: z.ZodEnum<{
3050
- pass: "pass";
3051
2938
  fail: "fail";
2939
+ pass: "pass";
3052
2940
  }>;
3053
2941
  patchId: z.ZodString;
3054
2942
  policyVersion: z.ZodOptional<z.ZodString>;
3055
2943
  producer: z.ZodString;
3056
2944
  requestId: z.ZodOptional<z.ZodString>;
3057
2945
  rung: z.ZodOptional<z.ZodEnum<{
2946
+ human: "human";
3058
2947
  "independent-model": "independent-model";
3059
2948
  oracle: "oracle";
3060
- human: "human";
3061
2949
  }>>;
3062
2950
  schemaVersion: z.ZodLiteral<1>;
3063
2951
  sessionId: z.ZodOptional<z.ZodString>;
@@ -3077,10 +2965,7 @@ interface EvidenceCandidateIdentity {
3077
2965
  patchId: string;
3078
2966
  mergeBaseSha: string;
3079
2967
  }
3080
- declare const evidenceBindingFresh: ({
3081
- candidate,
3082
- envelope
3083
- }: {
2968
+ declare const evidenceBindingFresh: ({ candidate, envelope }: {
3084
2969
  candidate: EvidenceCandidateIdentity;
3085
2970
  envelope: EvidenceEnvelope;
3086
2971
  }) => boolean;
@@ -3088,10 +2973,7 @@ interface IndependenceResult {
3088
2973
  independent: boolean;
3089
2974
  reason?: "no-session" | "unknown-authoring-identity" | "same-session";
3090
2975
  }
3091
- declare const evidenceReviewIndependence: ({
3092
- authoringSessionIds,
3093
- envelope
3094
- }: {
2976
+ declare const evidenceReviewIndependence: ({ authoringSessionIds, envelope }: {
3095
2977
  authoringSessionIds: string[];
3096
2978
  envelope: EvidenceEnvelope;
3097
2979
  }) => IndependenceResult;
@@ -3116,11 +2998,7 @@ type LoadedEvidenceEnvelope = {
3116
2998
  * verify-only (`resolveProfileRequiredChecks`), so a scoping caller passes
3117
2999
  * `"verify"` and matches exactly the pair wave 2 evaluates.
3118
3000
  */
3119
- declare const boundFailingCheckNames: ({
3120
- candidate,
3121
- checkType,
3122
- envelopes
3123
- }: {
3001
+ declare const boundFailingCheckNames: ({ candidate, checkType, envelopes }: {
3124
3002
  candidate: EvidenceCandidateIdentity;
3125
3003
  checkType: EvidenceCheckType;
3126
3004
  envelopes: LoadedEvidenceEnvelope[];
@@ -3145,38 +3023,23 @@ interface RequiredCheckEvaluation {
3145
3023
  outcomes: RequiredCheckOutcome[];
3146
3024
  blockingReasons: string[];
3147
3025
  }
3148
- declare const evaluateRequiredChecks: ({
3149
- authoringSessionIds,
3150
- candidate,
3151
- envelopes,
3152
- requiredChecks,
3153
- scopeContext
3154
- }: RequiredCheckEvaluationInput) => RequiredCheckEvaluation;
3026
+ declare const evaluateRequiredChecks: ({ authoringSessionIds, candidate, envelopes, requiredChecks, scopeContext }: RequiredCheckEvaluationInput) => RequiredCheckEvaluation;
3155
3027
  declare const EVIDENCE_DIR = ".factory-memory/evidence";
3156
3028
  declare const loadEvidenceEnvelopes: (cwd: string) => LoadedEvidenceEnvelope[];
3157
- //#endregion
3158
- //#region src/review-proof-applicability.d.ts
3159
3029
  declare const REVIEW_STATUS_VALUES: readonly ["not-required", "current", "stale", "missing", "blocked"];
3160
3030
  declare const reviewStatusSchema: z.ZodEnum<{
3161
- stale: "stale";
3162
3031
  blocked: "blocked";
3163
- "not-required": "not-required";
3164
3032
  current: "current";
3165
3033
  missing: "missing";
3034
+ "not-required": "not-required";
3035
+ stale: "stale";
3166
3036
  }>;
3167
3037
  type ReviewStatus = z.infer<typeof reviewStatusSchema>;
3168
3038
  interface CurrentReviewIdentity {
3169
3039
  headSha: string;
3170
3040
  patchId: string;
3171
3041
  }
3172
- declare const reviewStatus: ({
3173
- blocked,
3174
- required,
3175
- reviewedHeadSha,
3176
- reviewedPatchId,
3177
- headSha,
3178
- patchId
3179
- }: CurrentReviewIdentity & {
3042
+ declare const reviewStatus: ({ blocked, required, reviewedHeadSha, reviewedPatchId, headSha, patchId }: CurrentReviewIdentity & {
3180
3043
  blocked?: boolean;
3181
3044
  required: boolean;
3182
3045
  reviewedHeadSha?: string;
@@ -3210,17 +3073,13 @@ declare const explicitFailureIdentity: (proof: ReviewProofClaim) => {
3210
3073
  reviewedHeadSha?: string;
3211
3074
  reviewedPatchId?: string;
3212
3075
  };
3213
- declare const selectReviewProof: ({
3214
- reviewProof
3215
- }: {
3076
+ declare const selectReviewProof: ({ reviewProof }: {
3216
3077
  reviewProof: ReviewProofClaim;
3217
3078
  }) => {
3218
3079
  reviewedHeadSha?: string;
3219
3080
  reviewedPatchId?: string;
3220
3081
  untypedVerdict?: boolean;
3221
3082
  };
3222
- //#endregion
3223
- //#region src/pr-readiness/review-epoch.d.ts
3224
3083
  interface ReviewCycleState {
3225
3084
  autoBlockingFindings: number;
3226
3085
  countsBySeverity: Record<ReviewFindingSeverity, number>;
@@ -3258,8 +3117,6 @@ declare const prReviewProofSchema: z.ZodType<PrReviewProof>;
3258
3117
  declare const validatePrReviewResult: (value: unknown) => PrReviewResult;
3259
3118
  declare const validatePrReviewProof: (value: unknown) => PrReviewProof;
3260
3119
  declare const PR_REVIEW_PROOF_DESCRIPTOR: ProofDescriptor<PrReviewProof>;
3261
- //#endregion
3262
- //#region src/schemas.d.ts
3263
3120
  declare const boundaryCheckProofSchema: z.ZodObject<{
3264
3121
  blockingReasons: z.ZodArray<z.ZodString>;
3265
3122
  boundary: z.ZodOptional<z.ZodString>;
@@ -3269,15 +3126,15 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
3269
3126
  pr: z.ZodNumber;
3270
3127
  sha: z.ZodString;
3271
3128
  state: z.ZodEnum<{
3272
- open: "open";
3273
3129
  merged: "merged";
3130
+ open: "open";
3274
3131
  }>;
3275
3132
  wave: z.ZodString;
3276
3133
  }, z.core.$strip>>;
3277
3134
  demandedRung: z.ZodOptional<z.ZodEnum<{
3135
+ human: "human";
3278
3136
  "independent-model": "independent-model";
3279
3137
  oracle: "oracle";
3280
- human: "human";
3281
3138
  }>>;
3282
3139
  epicIssue: z.ZodNumber;
3283
3140
  manifestHash: z.ZodOptional<z.ZodObject<{
@@ -3291,9 +3148,9 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
3291
3148
  commentUrl: z.ZodOptional<z.ZodString>;
3292
3149
  producer: z.ZodString;
3293
3150
  rung: z.ZodEnum<{
3151
+ human: "human";
3294
3152
  "independent-model": "independent-model";
3295
3153
  oracle: "oracle";
3296
- human: "human";
3297
3154
  }>;
3298
3155
  sessionId: z.ZodOptional<z.ZodString>;
3299
3156
  specHash: z.ZodOptional<z.ZodObject<{
@@ -3308,13 +3165,11 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
3308
3165
  value: z.ZodString;
3309
3166
  }, z.core.$strip>>;
3310
3167
  status: z.ZodEnum<{
3311
- ready: "ready";
3312
3168
  blocked: "blocked";
3169
+ ready: "ready";
3313
3170
  }>;
3314
3171
  }, z.core.$strip>;
3315
3172
  type BoundaryCheckProofRecord = z.infer<typeof boundaryCheckProofSchema>;
3316
- //#endregion
3317
- //#region src/boundary-check.d.ts
3318
3173
  interface BoundaryCheckGithub {
3319
3174
  fetchIssueBody: (repo: string, issue: number) => string;
3320
3175
  fetchIssueComments: (repo: string, issue: number) => GithubIssueComment[];
@@ -3363,22 +3218,16 @@ interface BoundaryCheckDependencies {
3363
3218
  readWaivers?: (cwd: string) => DemandWaiver[];
3364
3219
  resolveRepo?: (cwd: string) => string;
3365
3220
  }
3366
- declare function runBoundaryCheck(args: BoundaryCheckArgs, dependencies?: BoundaryCheckDependencies): BoundaryCheckProofRecord;
3367
- declare function validateBoundaryCheckProof(value: unknown): BoundaryCheckProofRecord;
3368
- //#endregion
3369
- //#region src/cli-output.d.ts
3221
+ export declare function runBoundaryCheck(args: BoundaryCheckArgs, dependencies?: BoundaryCheckDependencies): BoundaryCheckProofRecord;
3222
+ export declare function validateBoundaryCheckProof(value: unknown): BoundaryCheckProofRecord;
3370
3223
  interface CliOutput {
3371
3224
  stderr: Pick<NodeJS.WriteStream, "write">;
3372
3225
  stdout: Pick<NodeJS.WriteStream, "write">;
3373
3226
  }
3374
- //#endregion
3375
- //#region src/commands/boundary-check.d.ts
3376
3227
  type BoundaryCheckAction = (args: BoundaryCheckArgs) => BoundaryCheckProofRecord;
3377
- //#endregion
3378
- //#region src/demand-waive.d.ts
3379
3228
  /** Every waiver recorded in this checkout; an absent or unreadable store is
3380
3229
  * no waivers, so a damaged file can only ever block, never permit. */
3381
- declare const readDemandWaivers: (cwd: string, filePath?: string) => DemandWaiver[];
3230
+ export declare const readDemandWaivers: (cwd: string, filePath?: string) => DemandWaiver[];
3382
3231
  interface DemandWaiveArgs {
3383
3232
  cwd?: string;
3384
3233
  demand: string;
@@ -3399,7 +3248,7 @@ interface DemandWaiveDependencies {
3399
3248
  }) => string | undefined;
3400
3249
  now?: () => Date;
3401
3250
  }
3402
- declare class DemandWaiveRefusalError extends Error {
3251
+ export declare class DemandWaiveRefusalError extends Error {
3403
3252
  readonly refusals: string[];
3404
3253
  constructor(refusals: string[]);
3405
3254
  }
@@ -3409,12 +3258,8 @@ declare class DemandWaiveRefusalError extends Error {
3409
3258
  * puts the bar at operator identity, not at ceremony aimed at the operator
3410
3259
  * (ADR 0025).
3411
3260
  */
3412
- declare const runDemandWaive: (args: DemandWaiveArgs, dependencies?: DemandWaiveDependencies) => DemandWaiver;
3413
- //#endregion
3414
- //#region src/commands/demand-waive.d.ts
3261
+ export declare const runDemandWaive: (args: DemandWaiveArgs, dependencies?: DemandWaiveDependencies) => DemandWaiver;
3415
3262
  type DemandWaiveAction = (args: DemandWaiveArgs) => DemandWaiver;
3416
- //#endregion
3417
- //#region src/hq-flush.d.ts
3418
3263
  /**
3419
3264
  * Spool locations this run did not drain because they sit under an earlier
3420
3265
  * key for this repository. Reported, never drained: draining an older key's
@@ -3436,8 +3281,6 @@ type HqFlushResult = (HqFlushOrphans & {
3436
3281
  endpoint: string;
3437
3282
  status: "flushed";
3438
3283
  });
3439
- //#endregion
3440
- //#region src/candidate-base.d.ts
3441
3284
  interface LivePullRequestBase {
3442
3285
  baseRefName: string;
3443
3286
  /** Left unvalidated: the base-policy reader is its one consumer (#922). */
@@ -3459,8 +3302,6 @@ type LivePullRequestBaseLookup = {
3459
3302
  reason: string;
3460
3303
  status: "unavailable";
3461
3304
  };
3462
- //#endregion
3463
- //#region src/catch-up-recognition.d.ts
3464
3305
  type CatchUpRecognitionResult = {
3465
3306
  recognition: CatchUpRecognition;
3466
3307
  recognized: true;
@@ -3472,8 +3313,6 @@ type CatchUpRecognizer = (input: {
3472
3313
  base: string;
3473
3314
  cwd: string;
3474
3315
  }) => CatchUpRecognitionResult;
3475
- //#endregion
3476
- //#region src/pr-review.d.ts
3477
3316
  interface PrReviewArgs extends LoadProjectProfileInput {
3478
3317
  /**
3479
3318
  * Test-only (#1131): honour `FACTORY_REVIEW_FAULT` outside `NODE_ENV=test`
@@ -3585,17 +3424,13 @@ interface PrReviewDependencies {
3585
3424
  */
3586
3425
  publishCheckRun?: (input: PublishFactoryCheckInput) => void;
3587
3426
  }
3588
- declare function runPrReview(args: PrReviewArgs, dependencies?: PrReviewDependencies): Promise<PrReviewProof>;
3589
- //#endregion
3590
- //#region src/workspace-install-resolution.d.ts
3427
+ export declare function runPrReview(args: PrReviewArgs, dependencies?: PrReviewDependencies): Promise<PrReviewProof>;
3591
3428
  interface CleanInstallResolutionDependencies {
3592
3429
  existsSync?: typeof existsSync;
3593
3430
  readFileSync?: typeof readFileSync;
3594
3431
  rmSync?: typeof rmSync;
3595
3432
  runInstall?: (repoRoot: string) => void;
3596
3433
  }
3597
- //#endregion
3598
- //#region src/pr-verify.d.ts
3599
3434
  type PrVerifyMode = "auto" | "docs-only" | "full";
3600
3435
  interface VerificationCommandOutcome {
3601
3436
  counts?: {
@@ -3653,6 +3488,11 @@ interface PrVerifyDependencies {
3653
3488
  * request resolves `unavailable`, which is normal before publication.
3654
3489
  */
3655
3490
  lookupPullRequest?: (cwd: string) => CandidatePullRequestLookup;
3491
+ /**
3492
+ * Classifies the machine the battery runs on (#1570). Injectable so a test
3493
+ * pins it instead of recording the host it happens to run on.
3494
+ */
3495
+ describeRunner?: (env: NodeJS.ProcessEnv) => PrVerifyRunner;
3656
3496
  env?: NodeJS.ProcessEnv;
3657
3497
  git?: PrVerifyGitDependencies;
3658
3498
  hq?: HqIngestDependencies;
@@ -3670,17 +3510,14 @@ interface PrVerifyDependencies {
3670
3510
  postCommitStatus?: PostCommitStatus;
3671
3511
  publishCheckRun?: (input: PublishFactoryCheckInput) => void;
3672
3512
  }
3673
- declare function runPrVerify(args: PrVerifyArgs, dependencies?: PrVerifyDependencies): PrVerifyProof;
3674
- //#endregion
3675
- //#region src/pull-request-fill.d.ts
3513
+ export declare function runPrVerify(args: PrVerifyArgs, dependencies?: PrVerifyDependencies): PrVerifyProof;
3676
3514
  interface CommitMessage {
3677
3515
  body: string;
3678
3516
  subject: string;
3679
3517
  }
3680
- //#endregion
3681
- //#region src/pr-publish.d.ts
3682
3518
  type PrPublishArgs = Omit<PrReadyArgs, "pr" | "throwWhenBlocked"> & {
3683
- /** A clean-session findings file to validate into the review proof. */findings?: string;
3519
+ /** A clean-session findings file to validate into the review proof. */
3520
+ findings?: string;
3684
3521
  pr?: number;
3685
3522
  };
3686
3523
  type GhRunner = (args: string[], cwd: string) => string;
@@ -3710,13 +3547,13 @@ type PrPublishFollowUpOutcome = {
3710
3547
  action: FollowUpAction;
3711
3548
  error: string;
3712
3549
  status: "failed";
3713
- }
3550
+ } |
3714
3551
  /**
3715
3552
  * The planner declined to run the follow-up because it cannot change the
3716
3553
  * condition that produced it (#291). `reason` is the one-line causal
3717
3554
  * statement; a skip is a decision, never a silent omission.
3718
3555
  */
3719
- | {
3556
+ {
3720
3557
  action: FollowUpAction;
3721
3558
  reason: string;
3722
3559
  status: "skipped";
@@ -3754,7 +3591,7 @@ interface PrPublishResult {
3754
3591
  */
3755
3592
  verifyProofBinding?: VerifyProofBindingOutcome;
3756
3593
  }
3757
- declare class PrPublishFollowUpError extends Error {
3594
+ export declare class PrPublishFollowUpError extends Error {
3758
3595
  readonly result: PrPublishResult;
3759
3596
  constructor(result: PrPublishResult, cause: unknown);
3760
3597
  }
@@ -3899,29 +3736,16 @@ type PublishFollowUpPlan = {
3899
3736
  * verify-once entry point (#692 / ADR 0016). Equal SHAs mean the proof was
3900
3737
  * accepted for this exact head rather than relabelled onto it.
3901
3738
  */
3902
- declare const planPublishFollowUp: ({
3903
- binding,
3904
- followUp,
3905
- proofHeadSha,
3906
- verifiedHeadSha
3907
- }: {
3739
+ export declare const planPublishFollowUp: ({ binding, followUp, proofHeadSha, verifiedHeadSha }: {
3908
3740
  binding: VerifyProofBindingOutcome;
3909
3741
  followUp: FollowUpAction;
3910
3742
  proofHeadSha: string;
3911
3743
  verifiedHeadSha: string;
3912
3744
  }) => PublishFollowUpPlan;
3913
- declare function runPrPublish(args: PrPublishArgs, dependencies?: PrPublishDependencies): Promise<PrPublishResult>;
3914
- //#endregion
3915
- //#region src/commands/pr-publish.d.ts
3745
+ export declare function runPrPublish(args: PrPublishArgs, dependencies?: PrPublishDependencies): Promise<PrPublishResult>;
3916
3746
  type PrPublishAction = (args: PrPublishArgs) => Promise<unknown>;
3917
- //#endregion
3918
- //#region src/commands/pr-ready.d.ts
3919
3747
  type PrReadyAction = (args: PrReadyArgs) => Promise<unknown>;
3920
- //#endregion
3921
- //#region src/commands/pr-review.d.ts
3922
3748
  type PrReviewAction = (args: PrReviewArgs) => Promise<unknown>;
3923
- //#endregion
3924
- //#region src/pr-status-hud-command.d.ts
3925
3749
  interface PrStatusHudArgs {
3926
3750
  readonly cwd: string;
3927
3751
  readonly headSha: string;
@@ -3942,8 +3766,6 @@ type PrStatusHudAction = (args: PrStatusHudArgs) => Promise<{
3942
3766
  commentId: number;
3943
3767
  url: string;
3944
3768
  }>;
3945
- //#endregion
3946
- //#region src/packages/trace/implementation/core.d.ts
3947
3769
  declare const FactoryTraceEnvelopeCoreSchema: z.ZodObject<{
3948
3770
  createdAt: z.ZodString;
3949
3771
  envelope: z.ZodLiteral<1>;
@@ -3972,8 +3794,6 @@ declare const UnknownFactoryTraceEventSchema: z.ZodObject<{
3972
3794
  payload: z.ZodUnknown;
3973
3795
  unknownTraceEvent: z.ZodLiteral<true>;
3974
3796
  }, z.core.$strict>;
3975
- //#endregion
3976
- //#region src/packages/trace/implementation/definitions.d.ts
3977
3797
  type InferSchema<TSchema> = TSchema extends z.ZodType ? z.infer<TSchema> : never;
3978
3798
  type ReadEventSchemasOf<TDefinition> = TDefinition extends {
3979
3799
  readEventSchemas: readonly (infer TSchema)[];
@@ -4002,8 +3822,6 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4002
3822
  schemaVersion: z.ZodLiteral<1>;
4003
3823
  threadId: z.ZodOptional<z.ZodString>;
4004
3824
  workerId: z.ZodOptional<z.ZodString>;
4005
- eventType: z.ZodLiteral<"review-gate">;
4006
- typeVersion: z.ZodLiteral<1>;
4007
3825
  base: z.ZodString;
4008
3826
  changedFiles: z.ZodArray<z.ZodString>;
4009
3827
  headSha: z.ZodString;
@@ -4012,10 +3830,12 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4012
3830
  outcome: z.ZodLiteral<"not-required">;
4013
3831
  patchId: z.ZodString;
4014
3832
  reason: z.ZodEnum<{
4015
- "no-applicable-mode": "no-applicable-mode";
4016
3833
  "faithful-merge": "faithful-merge";
3834
+ "no-applicable-mode": "no-applicable-mode";
4017
3835
  }>;
4018
3836
  reviewCycle: z.ZodNumber;
3837
+ eventType: z.ZodLiteral<"review-gate">;
3838
+ typeVersion: z.ZodLiteral<1>;
4019
3839
  }, z.core.$strict>, readonly [z.ZodObject<{
4020
3840
  createdAt: z.ZodString;
4021
3841
  eventId: z.ZodString;
@@ -4025,8 +3845,6 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4025
3845
  schemaVersion: z.ZodLiteral<1>;
4026
3846
  threadId: z.ZodOptional<z.ZodString>;
4027
3847
  workerId: z.ZodOptional<z.ZodString>;
4028
- eventType: z.ZodLiteral<"review-gate">;
4029
- typeVersion: z.ZodLiteral<1>;
4030
3848
  base: z.ZodString;
4031
3849
  changedFiles: z.ZodArray<z.ZodString>;
4032
3850
  headSha: z.ZodString;
@@ -4035,10 +3853,12 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4035
3853
  outcome: z.ZodLiteral<"not-required">;
4036
3854
  patchId: z.ZodString;
4037
3855
  reason: z.ZodEnum<{
4038
- "no-applicable-mode": "no-applicable-mode";
4039
3856
  "faithful-merge": "faithful-merge";
3857
+ "no-applicable-mode": "no-applicable-mode";
4040
3858
  }>;
4041
3859
  reviewCycle: z.ZodNumber;
3860
+ eventType: z.ZodLiteral<"review-gate">;
3861
+ typeVersion: z.ZodLiteral<1>;
4042
3862
  }, z.core.$strict>], {
4043
3863
  readonly 1: z.ZodObject<{
4044
3864
  base: z.ZodString;
@@ -4049,18 +3869,20 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4049
3869
  outcome: z.ZodLiteral<"not-required">;
4050
3870
  patchId: z.ZodString;
4051
3871
  reason: z.ZodEnum<{
4052
- "no-applicable-mode": "no-applicable-mode";
4053
3872
  "faithful-merge": "faithful-merge";
3873
+ "no-applicable-mode": "no-applicable-mode";
4054
3874
  }>;
4055
3875
  reviewCycle: z.ZodNumber;
4056
3876
  }, z.core.$strict>;
4057
3877
  }, {
4058
3878
  createdAt: string;
4059
3879
  eventId: string;
3880
+ issue?: number | undefined;
3881
+ pr?: number | undefined;
4060
3882
  repo: string;
4061
3883
  schemaVersion: 1;
4062
- eventType: "review-gate";
4063
- typeVersion: 1;
3884
+ threadId?: string | undefined;
3885
+ workerId?: string | undefined;
4064
3886
  base: string;
4065
3887
  changedFiles: string[];
4066
3888
  headSha: string;
@@ -4068,12 +3890,10 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4068
3890
  observedAt: string;
4069
3891
  outcome: "not-required";
4070
3892
  patchId: string;
4071
- reason: "no-applicable-mode" | "faithful-merge";
3893
+ reason: "faithful-merge" | "no-applicable-mode";
4072
3894
  reviewCycle: number;
4073
- issue?: number | undefined;
4074
- pr?: number | undefined;
4075
- threadId?: string | undefined;
4076
- workerId?: string | undefined;
3895
+ eventType: "review-gate";
3896
+ typeVersion: 1;
4077
3897
  }>, DefinedTraceEvent<"review-ladder-stage", z.ZodObject<{
4078
3898
  createdAt: z.ZodString;
4079
3899
  eventId: z.ZodString;
@@ -4083,8 +3903,6 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4083
3903
  schemaVersion: z.ZodLiteral<1>;
4084
3904
  threadId: z.ZodOptional<z.ZodString>;
4085
3905
  workerId: z.ZodOptional<z.ZodString>;
4086
- eventType: z.ZodLiteral<"review-ladder-stage">;
4087
- typeVersion: z.ZodLiteral<1>;
4088
3906
  cycle: z.ZodNumber;
4089
3907
  cyclesToClean: z.ZodOptional<z.ZodNumber>;
4090
3908
  engine: z.ZodOptional<z.ZodString>;
@@ -4127,6 +3945,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4127
3945
  source: z.ZodOptional<z.ZodString>;
4128
3946
  totalTokens: z.ZodOptional<z.ZodNumber>;
4129
3947
  }, z.core.$strict>>;
3948
+ eventType: z.ZodLiteral<"review-ladder-stage">;
3949
+ typeVersion: z.ZodLiteral<1>;
4130
3950
  }, z.core.$strict>, readonly [z.ZodObject<{
4131
3951
  createdAt: z.ZodString;
4132
3952
  eventId: z.ZodString;
@@ -4136,8 +3956,6 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4136
3956
  schemaVersion: z.ZodLiteral<1>;
4137
3957
  threadId: z.ZodOptional<z.ZodString>;
4138
3958
  workerId: z.ZodOptional<z.ZodString>;
4139
- eventType: z.ZodLiteral<"review-ladder-stage">;
4140
- typeVersion: z.ZodLiteral<1>;
4141
3959
  cycle: z.ZodNumber;
4142
3960
  cyclesToClean: z.ZodOptional<z.ZodNumber>;
4143
3961
  engine: z.ZodOptional<z.ZodString>;
@@ -4180,6 +3998,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4180
3998
  source: z.ZodOptional<z.ZodString>;
4181
3999
  totalTokens: z.ZodOptional<z.ZodNumber>;
4182
4000
  }, z.core.$strict>>;
4001
+ eventType: z.ZodLiteral<"review-ladder-stage">;
4002
+ typeVersion: z.ZodLiteral<1>;
4183
4003
  }, z.core.$strict>], {
4184
4004
  readonly 1: z.ZodObject<{
4185
4005
  cycle: z.ZodNumber;
@@ -4228,11 +4048,15 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4228
4048
  }, {
4229
4049
  createdAt: string;
4230
4050
  eventId: string;
4051
+ issue?: number | undefined;
4052
+ pr?: number | undefined;
4231
4053
  repo: string;
4232
4054
  schemaVersion: 1;
4233
- eventType: "review-ladder-stage";
4234
- typeVersion: 1;
4055
+ threadId?: string | undefined;
4056
+ workerId?: string | undefined;
4235
4057
  cycle: number;
4058
+ cyclesToClean?: number | undefined;
4059
+ engine?: string | undefined;
4236
4060
  findingsSummary: {
4237
4061
  blocking: number;
4238
4062
  bySeverity: {
@@ -4246,17 +4070,10 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4246
4070
  open: number;
4247
4071
  staleRepeats: number;
4248
4072
  };
4249
- observedAt: string;
4250
- stage: "gate" | "interior";
4251
- issue?: number | undefined;
4252
- pr?: number | undefined;
4253
- threadId?: string | undefined;
4254
- workerId?: string | undefined;
4255
- cyclesToClean?: number | undefined;
4256
- engine?: string | undefined;
4257
4073
  forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4258
4074
  headSha?: string | undefined;
4259
4075
  model?: string | undefined;
4076
+ observedAt: string;
4260
4077
  patchId?: string | undefined;
4261
4078
  session?: {
4262
4079
  orchestrationMode?: "autonomous" | "manual" | undefined;
@@ -4264,18 +4081,413 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4264
4081
  runtime?: string | undefined;
4265
4082
  sessionId?: string | undefined;
4266
4083
  } | undefined;
4084
+ stage: "gate" | "interior";
4267
4085
  usage?: {
4268
4086
  estimatedCostUsd?: number | undefined;
4269
4087
  source?: string | undefined;
4270
4088
  totalTokens?: number | undefined;
4271
4089
  } | undefined;
4090
+ eventType: "review-ladder-stage";
4091
+ typeVersion: 1;
4272
4092
  }>];
4273
4093
  type FactoryTraceEvent = FactoryTraceEventFromDefinitions<typeof FACTORY_TRACE_EVENT_DEFINITIONS>;
4274
- //#endregion
4275
- //#region src/packages/trace/implementation/trace-shard.d.ts
4094
+ declare const { appendFactoryTraceEventSchema: AppendFactoryTraceEventSchema, factoryTraceEventSchema: FactoryTraceEventSchema, payloadSchemaRegistry, payloadVersions: FACTORY_TRACE_PAYLOAD_VERSIONS, wirePayloadFor }: {
4095
+ appendFactoryTraceEventSchema: z.ZodType<{
4096
+ createdAt: string;
4097
+ eventId: string;
4098
+ issue?: number | undefined;
4099
+ pr?: number | undefined;
4100
+ repo: string;
4101
+ schemaVersion: 1;
4102
+ threadId?: string | undefined;
4103
+ workerId?: string | undefined;
4104
+ base: string;
4105
+ changedFiles: string[];
4106
+ headSha: string;
4107
+ maxReviewCycles: number;
4108
+ observedAt: string;
4109
+ outcome: "not-required";
4110
+ patchId: string;
4111
+ reason: "faithful-merge" | "no-applicable-mode";
4112
+ reviewCycle: number;
4113
+ eventType: "review-gate";
4114
+ typeVersion: 1;
4115
+ } | {
4116
+ createdAt: string;
4117
+ eventId: string;
4118
+ issue?: number | undefined;
4119
+ pr?: number | undefined;
4120
+ repo: string;
4121
+ schemaVersion: 1;
4122
+ threadId?: string | undefined;
4123
+ workerId?: string | undefined;
4124
+ cycle: number;
4125
+ cyclesToClean?: number | undefined;
4126
+ engine?: string | undefined;
4127
+ findingsSummary: {
4128
+ blocking: number;
4129
+ bySeverity: {
4130
+ critical: number;
4131
+ high: number;
4132
+ low: number;
4133
+ medium: number;
4134
+ unknown: number;
4135
+ };
4136
+ flagged: number;
4137
+ open: number;
4138
+ staleRepeats: number;
4139
+ };
4140
+ forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4141
+ headSha?: string | undefined;
4142
+ model?: string | undefined;
4143
+ observedAt: string;
4144
+ patchId?: string | undefined;
4145
+ session?: {
4146
+ orchestrationMode?: "autonomous" | "manual" | undefined;
4147
+ resumedSession?: boolean | undefined;
4148
+ runtime?: string | undefined;
4149
+ sessionId?: string | undefined;
4150
+ } | undefined;
4151
+ stage: "gate" | "interior";
4152
+ usage?: {
4153
+ estimatedCostUsd?: number | undefined;
4154
+ source?: string | undefined;
4155
+ totalTokens?: number | undefined;
4156
+ } | undefined;
4157
+ eventType: "review-ladder-stage";
4158
+ typeVersion: 1;
4159
+ }, unknown, z.core.$ZodTypeInternals<{
4160
+ createdAt: string;
4161
+ eventId: string;
4162
+ issue?: number | undefined;
4163
+ pr?: number | undefined;
4164
+ repo: string;
4165
+ schemaVersion: 1;
4166
+ threadId?: string | undefined;
4167
+ workerId?: string | undefined;
4168
+ base: string;
4169
+ changedFiles: string[];
4170
+ headSha: string;
4171
+ maxReviewCycles: number;
4172
+ observedAt: string;
4173
+ outcome: "not-required";
4174
+ patchId: string;
4175
+ reason: "faithful-merge" | "no-applicable-mode";
4176
+ reviewCycle: number;
4177
+ eventType: "review-gate";
4178
+ typeVersion: 1;
4179
+ } | {
4180
+ createdAt: string;
4181
+ eventId: string;
4182
+ issue?: number | undefined;
4183
+ pr?: number | undefined;
4184
+ repo: string;
4185
+ schemaVersion: 1;
4186
+ threadId?: string | undefined;
4187
+ workerId?: string | undefined;
4188
+ cycle: number;
4189
+ cyclesToClean?: number | undefined;
4190
+ engine?: string | undefined;
4191
+ findingsSummary: {
4192
+ blocking: number;
4193
+ bySeverity: {
4194
+ critical: number;
4195
+ high: number;
4196
+ low: number;
4197
+ medium: number;
4198
+ unknown: number;
4199
+ };
4200
+ flagged: number;
4201
+ open: number;
4202
+ staleRepeats: number;
4203
+ };
4204
+ forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4205
+ headSha?: string | undefined;
4206
+ model?: string | undefined;
4207
+ observedAt: string;
4208
+ patchId?: string | undefined;
4209
+ session?: {
4210
+ orchestrationMode?: "autonomous" | "manual" | undefined;
4211
+ resumedSession?: boolean | undefined;
4212
+ runtime?: string | undefined;
4213
+ sessionId?: string | undefined;
4214
+ } | undefined;
4215
+ stage: "gate" | "interior";
4216
+ usage?: {
4217
+ estimatedCostUsd?: number | undefined;
4218
+ source?: string | undefined;
4219
+ totalTokens?: number | undefined;
4220
+ } | undefined;
4221
+ eventType: "review-ladder-stage";
4222
+ typeVersion: 1;
4223
+ }, unknown>>;
4224
+ appendUnionSchemas: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>[];
4225
+ definitionByKind: Record<string, {
4226
+ emit: (event: {
4227
+ createdAt: string;
4228
+ eventId: string;
4229
+ issue?: number | undefined;
4230
+ pr?: number | undefined;
4231
+ repo: string;
4232
+ schemaVersion: 1;
4233
+ threadId?: string | undefined;
4234
+ workerId?: string | undefined;
4235
+ base: string;
4236
+ changedFiles: string[];
4237
+ headSha: string;
4238
+ maxReviewCycles: number;
4239
+ observedAt: string;
4240
+ outcome: "not-required";
4241
+ patchId: string;
4242
+ reason: "faithful-merge" | "no-applicable-mode";
4243
+ reviewCycle: number;
4244
+ eventType: "review-gate";
4245
+ typeVersion: 1;
4246
+ } | {
4247
+ createdAt: string;
4248
+ eventId: string;
4249
+ issue?: number | undefined;
4250
+ pr?: number | undefined;
4251
+ repo: string;
4252
+ schemaVersion: 1;
4253
+ threadId?: string | undefined;
4254
+ workerId?: string | undefined;
4255
+ cycle: number;
4256
+ cyclesToClean?: number | undefined;
4257
+ engine?: string | undefined;
4258
+ findingsSummary: {
4259
+ blocking: number;
4260
+ bySeverity: {
4261
+ critical: number;
4262
+ high: number;
4263
+ low: number;
4264
+ medium: number;
4265
+ unknown: number;
4266
+ };
4267
+ flagged: number;
4268
+ open: number;
4269
+ staleRepeats: number;
4270
+ };
4271
+ forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4272
+ headSha?: string | undefined;
4273
+ model?: string | undefined;
4274
+ observedAt: string;
4275
+ patchId?: string | undefined;
4276
+ session?: {
4277
+ orchestrationMode?: "autonomous" | "manual" | undefined;
4278
+ resumedSession?: boolean | undefined;
4279
+ runtime?: string | undefined;
4280
+ sessionId?: string | undefined;
4281
+ } | undefined;
4282
+ stage: "gate" | "interior";
4283
+ usage?: {
4284
+ estimatedCostUsd?: number | undefined;
4285
+ source?: string | undefined;
4286
+ totalTokens?: number | undefined;
4287
+ } | undefined;
4288
+ eventType: "review-ladder-stage";
4289
+ typeVersion: 1;
4290
+ }) => unknown;
4291
+ }>;
4292
+ factoryTraceEventSchema: z.ZodType<{
4293
+ createdAt: string;
4294
+ eventId: string;
4295
+ issue?: number | undefined;
4296
+ pr?: number | undefined;
4297
+ repo: string;
4298
+ schemaVersion: 1;
4299
+ threadId?: string | undefined;
4300
+ workerId?: string | undefined;
4301
+ base: string;
4302
+ changedFiles: string[];
4303
+ headSha: string;
4304
+ maxReviewCycles: number;
4305
+ observedAt: string;
4306
+ outcome: "not-required";
4307
+ patchId: string;
4308
+ reason: "faithful-merge" | "no-applicable-mode";
4309
+ reviewCycle: number;
4310
+ eventType: "review-gate";
4311
+ typeVersion: 1;
4312
+ } | {
4313
+ createdAt: string;
4314
+ eventId: string;
4315
+ issue?: number | undefined;
4316
+ pr?: number | undefined;
4317
+ repo: string;
4318
+ schemaVersion: 1;
4319
+ threadId?: string | undefined;
4320
+ workerId?: string | undefined;
4321
+ cycle: number;
4322
+ cyclesToClean?: number | undefined;
4323
+ engine?: string | undefined;
4324
+ findingsSummary: {
4325
+ blocking: number;
4326
+ bySeverity: {
4327
+ critical: number;
4328
+ high: number;
4329
+ low: number;
4330
+ medium: number;
4331
+ unknown: number;
4332
+ };
4333
+ flagged: number;
4334
+ open: number;
4335
+ staleRepeats: number;
4336
+ };
4337
+ forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4338
+ headSha?: string | undefined;
4339
+ model?: string | undefined;
4340
+ observedAt: string;
4341
+ patchId?: string | undefined;
4342
+ session?: {
4343
+ orchestrationMode?: "autonomous" | "manual" | undefined;
4344
+ resumedSession?: boolean | undefined;
4345
+ runtime?: string | undefined;
4346
+ sessionId?: string | undefined;
4347
+ } | undefined;
4348
+ stage: "gate" | "interior";
4349
+ usage?: {
4350
+ estimatedCostUsd?: number | undefined;
4351
+ source?: string | undefined;
4352
+ totalTokens?: number | undefined;
4353
+ } | undefined;
4354
+ eventType: "review-ladder-stage";
4355
+ typeVersion: 1;
4356
+ }, unknown, z.core.$ZodTypeInternals<{
4357
+ createdAt: string;
4358
+ eventId: string;
4359
+ issue?: number | undefined;
4360
+ pr?: number | undefined;
4361
+ repo: string;
4362
+ schemaVersion: 1;
4363
+ threadId?: string | undefined;
4364
+ workerId?: string | undefined;
4365
+ base: string;
4366
+ changedFiles: string[];
4367
+ headSha: string;
4368
+ maxReviewCycles: number;
4369
+ observedAt: string;
4370
+ outcome: "not-required";
4371
+ patchId: string;
4372
+ reason: "faithful-merge" | "no-applicable-mode";
4373
+ reviewCycle: number;
4374
+ eventType: "review-gate";
4375
+ typeVersion: 1;
4376
+ } | {
4377
+ createdAt: string;
4378
+ eventId: string;
4379
+ issue?: number | undefined;
4380
+ pr?: number | undefined;
4381
+ repo: string;
4382
+ schemaVersion: 1;
4383
+ threadId?: string | undefined;
4384
+ workerId?: string | undefined;
4385
+ cycle: number;
4386
+ cyclesToClean?: number | undefined;
4387
+ engine?: string | undefined;
4388
+ findingsSummary: {
4389
+ blocking: number;
4390
+ bySeverity: {
4391
+ critical: number;
4392
+ high: number;
4393
+ low: number;
4394
+ medium: number;
4395
+ unknown: number;
4396
+ };
4397
+ flagged: number;
4398
+ open: number;
4399
+ staleRepeats: number;
4400
+ };
4401
+ forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4402
+ headSha?: string | undefined;
4403
+ model?: string | undefined;
4404
+ observedAt: string;
4405
+ patchId?: string | undefined;
4406
+ session?: {
4407
+ orchestrationMode?: "autonomous" | "manual" | undefined;
4408
+ resumedSession?: boolean | undefined;
4409
+ runtime?: string | undefined;
4410
+ sessionId?: string | undefined;
4411
+ } | undefined;
4412
+ stage: "gate" | "interior";
4413
+ usage?: {
4414
+ estimatedCostUsd?: number | undefined;
4415
+ source?: string | undefined;
4416
+ totalTokens?: number | undefined;
4417
+ } | undefined;
4418
+ eventType: "review-ladder-stage";
4419
+ typeVersion: 1;
4420
+ }, unknown>>;
4421
+ payloadSchemaRegistry: Record<string, Record<number, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
4422
+ payloadVersions: Record<string, readonly number[]>;
4423
+ readUnionSchemas: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>[];
4424
+ wirePayloadFor: (event: {
4425
+ createdAt: string;
4426
+ eventId: string;
4427
+ issue?: number | undefined;
4428
+ pr?: number | undefined;
4429
+ repo: string;
4430
+ schemaVersion: 1;
4431
+ threadId?: string | undefined;
4432
+ workerId?: string | undefined;
4433
+ base: string;
4434
+ changedFiles: string[];
4435
+ headSha: string;
4436
+ maxReviewCycles: number;
4437
+ observedAt: string;
4438
+ outcome: "not-required";
4439
+ patchId: string;
4440
+ reason: "faithful-merge" | "no-applicable-mode";
4441
+ reviewCycle: number;
4442
+ eventType: "review-gate";
4443
+ typeVersion: 1;
4444
+ } | {
4445
+ createdAt: string;
4446
+ eventId: string;
4447
+ issue?: number | undefined;
4448
+ pr?: number | undefined;
4449
+ repo: string;
4450
+ schemaVersion: 1;
4451
+ threadId?: string | undefined;
4452
+ workerId?: string | undefined;
4453
+ cycle: number;
4454
+ cyclesToClean?: number | undefined;
4455
+ engine?: string | undefined;
4456
+ findingsSummary: {
4457
+ blocking: number;
4458
+ bySeverity: {
4459
+ critical: number;
4460
+ high: number;
4461
+ low: number;
4462
+ medium: number;
4463
+ unknown: number;
4464
+ };
4465
+ flagged: number;
4466
+ open: number;
4467
+ staleRepeats: number;
4468
+ };
4469
+ forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4470
+ headSha?: string | undefined;
4471
+ model?: string | undefined;
4472
+ observedAt: string;
4473
+ patchId?: string | undefined;
4474
+ session?: {
4475
+ orchestrationMode?: "autonomous" | "manual" | undefined;
4476
+ resumedSession?: boolean | undefined;
4477
+ runtime?: string | undefined;
4478
+ sessionId?: string | undefined;
4479
+ } | undefined;
4480
+ stage: "gate" | "interior";
4481
+ usage?: {
4482
+ estimatedCostUsd?: number | undefined;
4483
+ source?: string | undefined;
4484
+ totalTokens?: number | undefined;
4485
+ } | undefined;
4486
+ eventType: "review-ladder-stage";
4487
+ typeVersion: 1;
4488
+ }) => unknown;
4489
+ };
4276
4490
  type FactoryTraceEnvelope = z.infer<typeof FactoryTraceEnvelopeCoreSchema>;
4277
- //#endregion
4278
- //#region src/packages/trace/implementation/trace-sinks.d.ts
4279
4491
  interface TraceSink {
4280
4492
  append: (envelope: FactoryTraceEnvelope) => void;
4281
4493
  }
@@ -4294,11 +4506,9 @@ interface TraceWriteResult {
4294
4506
  interface ResolveTraceWriteSinksOptions {
4295
4507
  mirror?: TraceSink;
4296
4508
  }
4297
- declare const createLocalJsonlTraceSink: (repoRoot: string) => TraceSink;
4298
- declare const appendWithTraceSinks: (envelope: FactoryTraceEnvelope, sinks: TraceWriteSinks) => TraceWriteResult;
4299
- declare const resolveTraceWriteSinks: (repoRoot: string, options?: ResolveTraceWriteSinksOptions) => TraceWriteSinks;
4300
- //#endregion
4301
- //#region src/packages/trace/implementation/facade.d.ts
4509
+ export declare const createLocalJsonlTraceSink: (repoRoot: string) => TraceSink;
4510
+ export declare const appendWithTraceSinks: (envelope: FactoryTraceEnvelope, sinks: TraceWriteSinks) => TraceWriteResult;
4511
+ export declare const resolveTraceWriteSinks: (repoRoot: string, options?: ResolveTraceWriteSinksOptions) => TraceWriteSinks;
4302
4512
  type ReadableFactoryTraceEvent = FactoryTraceEvent | z.infer<typeof UnknownFactoryTraceEventSchema>;
4303
4513
  interface FactoryTraceFilters {
4304
4514
  eventType?: string | readonly string[];
@@ -4341,18 +4551,18 @@ interface ScanFactoryTraceDiagnosticsOptions {
4341
4551
  repoRoot: string;
4342
4552
  to: string;
4343
4553
  }
4344
- declare const validateFactoryTraceEvent: (event: unknown) => FactoryTraceEvent;
4345
- declare const toFactoryTraceEnvelope: (event: FactoryTraceEvent) => {
4554
+ export declare const validateFactoryTraceEvent: (event: unknown) => FactoryTraceEvent;
4555
+ export declare const toFactoryTraceEnvelope: (event: FactoryTraceEvent) => {
4346
4556
  createdAt: string;
4347
4557
  envelope: 1;
4348
4558
  eventId: string;
4559
+ issue?: number | undefined;
4349
4560
  payload: unknown;
4561
+ pr?: number | undefined;
4350
4562
  repo: string;
4563
+ thread?: string | undefined;
4351
4564
  type: string;
4352
4565
  typeVersion: number;
4353
- issue?: number | undefined;
4354
- pr?: number | undefined;
4355
- thread?: string | undefined;
4356
4566
  worker?: string | undefined;
4357
4567
  };
4358
4568
  interface AppendFactoryTraceEventResult {
@@ -4360,14 +4570,7 @@ interface AppendFactoryTraceEventResult {
4360
4570
  filePath: string;
4361
4571
  mirrorDiagnostics: TraceMirrorDiagnostic[];
4362
4572
  }
4363
- declare const scanFactoryTraceEvents: ({
4364
- diagnosticsOnly,
4365
- filters,
4366
- from,
4367
- malformed,
4368
- repoRoot,
4369
- to
4370
- }: ScanFactoryTraceOptions) => ScanFactoryTraceResult;
4573
+ export declare const scanFactoryTraceEvents: ({ diagnosticsOnly, filters, from, malformed, repoRoot, to }: ScanFactoryTraceOptions) => ScanFactoryTraceResult;
4371
4574
  /**
4372
4575
  * Diagnostics-only trace read (#707). Scans the shard window purely to surface
4373
4576
  * malformed / unknown-record diagnostics, without materializing (and then
@@ -4376,20 +4579,13 @@ declare const scanFactoryTraceEvents: ({
4376
4579
  * but no event payloads — e.g. epic closeout after the orchestrator-metrics
4377
4580
  * removal.
4378
4581
  */
4379
- declare const scanFactoryTraceDiagnostics: ({
4380
- filters,
4381
- from,
4382
- repoRoot,
4383
- to
4384
- }: ScanFactoryTraceDiagnosticsOptions) => FactoryTraceDiagnostic[];
4582
+ export declare const scanFactoryTraceDiagnostics: ({ filters, from, repoRoot, to }: ScanFactoryTraceDiagnosticsOptions) => FactoryTraceDiagnostic[];
4385
4583
  declare namespace comment_provenance_d_exports {
4386
4584
  export { SHA_MATCH_MIN_LENGTH, isBotLogin, sameHeadSha };
4387
4585
  }
4388
4586
  declare const isBotLogin: (login?: string | undefined) => boolean;
4389
4587
  declare const SHA_MATCH_MIN_LENGTH = 7;
4390
4588
  declare const sameHeadSha: (left: string, right: string) => boolean;
4391
- //#endregion
4392
- //#region src/doctor-hq-checks.d.ts
4393
4589
  /**
4394
4590
  * The `doctor` check that makes silent HQ delivery failure loud (#394,
4395
4591
  * epic #389 wave 2): the local spool is empty, and no stranded evidence is
@@ -4414,8 +4610,6 @@ interface HqReadinessCheckDependencies {
4414
4610
  resolveSecret?: SecretReferenceResolver;
4415
4611
  timeoutMs?: number;
4416
4612
  }
4417
- //#endregion
4418
- //#region src/hq-last-stored.d.ts
4419
4613
  declare const lastStoredSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4420
4614
  found: z.ZodLiteral<true>;
4421
4615
  lastFromCaller: z.ZodNullable<z.ZodObject<{
@@ -4484,24 +4678,18 @@ interface HqLastStoredDependencies {
4484
4678
  }
4485
4679
  /** Asks HQ when it last stored an event for `repository`. Never throws. */
4486
4680
  declare function fetchHqLastStored(input: HqLastStoredInput, dependencies?: HqLastStoredDependencies): Promise<HqLastStored>;
4487
- //#endregion
4488
- //#region src/doctor-hq-last-stored.d.ts
4489
4681
  /** Test seams. Production never sets these. */
4490
4682
  interface HqLastStoredCheckDependencies {
4491
4683
  countSpool?: typeof countHqSpoolWork;
4492
4684
  lastStored?: typeof fetchHqLastStored;
4493
4685
  now?: () => Date;
4494
4686
  }
4495
- //#endregion
4496
- //#region src/doctor-hq-webhook.d.ts
4497
4687
  /** Test seams. Production never sets these. */
4498
4688
  interface HqWebhookCheckDependencies {
4499
4689
  gh?: GhBoundedJsonReader;
4500
4690
  lastStored?: typeof fetchHqLastStored;
4501
4691
  now?: () => Date;
4502
4692
  }
4503
- //#endregion
4504
- //#region src/doctor-machine-checks.d.ts
4505
4693
  /** Test seams. Production never sets these. */
4506
4694
  interface MachineCheckDependencies {
4507
4695
  cpuCount?: () => number;
@@ -4514,8 +4702,6 @@ interface MachineCheckDependencies {
4514
4702
  /** What `/bin/sh` resolves to, or undefined when it cannot be resolved. */
4515
4703
  resolveShell?: () => string | undefined;
4516
4704
  }
4517
- //#endregion
4518
- //#region src/doctor.d.ts
4519
4705
  interface DoctorReport {
4520
4706
  checks: DoctorCheck[];
4521
4707
  ok: boolean;
@@ -4551,28 +4737,18 @@ interface DoctorProjectProfileInput extends LoadProjectProfileInput {
4551
4737
  preflight?: boolean;
4552
4738
  userConfig?: LoadUserConfigResult;
4553
4739
  }
4554
- declare function doctorProjectProfile(input?: DoctorProjectProfileInput): Promise<DoctorReport>;
4555
- //#endregion
4556
- //#region src/pr-review-gate-trace.d.ts
4740
+ export declare function doctorProjectProfile(input?: DoctorProjectProfileInput): Promise<DoctorReport>;
4557
4741
  interface ReviewGateTraceIdentity {
4558
4742
  issue?: number;
4559
4743
  repo: string;
4560
4744
  }
4561
4745
  type ReviewGateNotRequiredProof = Pick<PrReviewProof, "base" | "changedFiles" | "headSha" | "patchId"> & Required<Pick<PrReviewProof, "maxReviewCycles" | "reviewCycle" | "reviewRequirement">>;
4562
- declare const buildReviewGateNotRequiredTraceEvent: ({
4563
- createdAt,
4564
- identity,
4565
- proof
4566
- }: {
4746
+ export declare const buildReviewGateNotRequiredTraceEvent: ({ createdAt, identity, proof }: {
4567
4747
  createdAt?: string;
4568
4748
  identity: ReviewGateTraceIdentity;
4569
4749
  proof: ReviewGateNotRequiredProof;
4570
4750
  }) => FactoryTraceEvent;
4571
- declare const tryAppendReviewGateNotRequiredTraceEvent: ({
4572
- identity,
4573
- proof,
4574
- repoRoot
4575
- }: {
4751
+ export declare const tryAppendReviewGateNotRequiredTraceEvent: ({ identity, proof, repoRoot }: {
4576
4752
  identity: ReviewGateTraceIdentity;
4577
4753
  proof: ReviewGateNotRequiredProof;
4578
4754
  repoRoot: string;
@@ -4581,9 +4757,9 @@ declare const tryAppendReviewGateNotRequiredTraceEvent: ({
4581
4757
  readonly ok: true;
4582
4758
  readonly errorMessage?: undefined;
4583
4759
  } | {
4760
+ readonly filePath?: undefined;
4584
4761
  readonly errorMessage: string;
4585
4762
  readonly ok: false;
4586
- readonly filePath?: undefined;
4587
4763
  };
4588
4764
  declare namespace worktree_scratch_files_d_exports {
4589
4765
  export { WorktreeRootLister, WorktreeScratchFileCheck, checkWorktreeScratchFiles, formatScratchFileCheckSummary, isWorktreeScratchFile };
@@ -4607,26 +4783,18 @@ declare function checkWorktreeScratchFiles(worktreePath?: string, listRootEntrie
4607
4783
  * apart.
4608
4784
  */
4609
4785
  declare function formatScratchFileCheckSummary(check: WorktreeScratchFileCheck): string;
4610
- //#endregion
4611
- //#region src/pr-readiness/pr-body-sections.d.ts
4612
4786
  declare const MANAGED_SECTION_NAMES: readonly ["Verification", "Review proof", "How to review"];
4613
4787
  declare namespace pr_body_renderer_d_exports {
4614
4788
  export { MANAGED_SECTION_NAMES as PR_BODY_MANAGED_SECTIONS, renderPrBodySectionParts, renderPrBodySections };
4615
4789
  }
4616
- declare const renderPrBodySectionParts: ({
4617
- reviewProof,
4618
- verifyProof
4619
- }: {
4790
+ declare const renderPrBodySectionParts: ({ reviewProof, verifyProof }: {
4620
4791
  reviewProof?: PrReviewProof;
4621
4792
  verifyProof?: PrVerifyProof;
4622
4793
  }) => {
4623
4794
  heading: string;
4624
4795
  content: string;
4625
4796
  }[];
4626
- declare const renderPrBodySections: ({
4627
- reviewProof,
4628
- verifyProof
4629
- }: {
4797
+ declare const renderPrBodySections: ({ reviewProof, verifyProof }: {
4630
4798
  reviewProof?: PrReviewProof;
4631
4799
  verifyProof?: PrVerifyProof;
4632
4800
  }) => string;
@@ -4637,7 +4805,7 @@ declare const CORRECTNESS_UNTYPED_REVIEW_BLOCKER_REASON = "Correctness review pr
4637
4805
  declare const SECURITY_UNTYPED_REVIEW_BLOCKER_REASON = "Security review proof is not a head-bound typed findings verdict; re-run pr:review with a valid findings file.";
4638
4806
  declare const DRAFT_BLOCKER_REASON = "PR is still marked draft.";
4639
4807
  declare const PENDING_CHECKS_BLOCKER_REASON_PREFIX = "Required/current checks are";
4640
- declare const readinessExitCode: (status: ReadinessStatus) => 1 | 0;
4808
+ declare const readinessExitCode: (status: ReadinessStatus) => 0 | 1;
4641
4809
  interface EvaluationInput {
4642
4810
  pr: number;
4643
4811
  prTitle?: string;
@@ -4683,39 +4851,85 @@ interface EvaluationInput {
4683
4851
  waivers?: DemandWaiver[];
4684
4852
  }
4685
4853
  declare const evaluateReadiness: (input: EvaluationInput) => {
4854
+ catchUpRecognition: CatchUpRecognition;
4855
+ blockedReasons: {
4856
+ code: string;
4857
+ detail: string;
4858
+ }[];
4859
+ blockingReasons: string[];
4686
4860
  humanBlockingReasons: string[];
4687
4861
  ledger: {
4688
4862
  baseSha: string;
4689
4863
  blockingReasons: string[];
4690
- classification: "docs/process-only" | "trivial" | "non-trivial";
4864
+ classification: "docs/process-only" | "non-trivial" | "trivial";
4865
+ externalChecks?: {
4866
+ checkType: "review" | "verify";
4867
+ name: string;
4868
+ reason?: string | undefined;
4869
+ scope?: {
4870
+ classifications: ("docs/process-only" | "non-trivial" | "trivial")[];
4871
+ } | undefined;
4872
+ scopeReason: string;
4873
+ status: "out-of-scope" | "satisfied" | "unmet";
4874
+ }[] | undefined;
4691
4875
  github: {
4692
4876
  draft: boolean;
4693
4877
  mergeStateStatus: string;
4694
4878
  mergeable: string;
4695
- requiredChecks: "unknown" | "passed" | "failed" | "pending" | "none";
4696
- unresolvedReviewThreads: number;
4879
+ requiredChecks: "failed" | "none" | "passed" | "pending" | "unknown";
4697
4880
  reviewDecision?: string | null | undefined;
4881
+ unresolvedReviewThreads: number;
4698
4882
  };
4699
4883
  headSha: string;
4884
+ mergeBaseSha?: string | undefined;
4700
4885
  patchId: string;
4701
4886
  pr: number;
4702
4887
  repairs: {
4703
4888
  action: string;
4704
- code: "undraft-pr" | "await-post-undraft-checks";
4889
+ code: "await-post-undraft-checks" | "undraft-pr";
4705
4890
  command: string;
4706
4891
  }[];
4892
+ reviewCycleState?: {
4893
+ autoBlockingFindings: number;
4894
+ countsBySeverity: {
4895
+ critical: number;
4896
+ high: number;
4897
+ low: number;
4898
+ medium: number;
4899
+ unknown: number;
4900
+ };
4901
+ highestBlockingSeverity?: "critical" | "high" | "low" | "medium" | "unknown" | undefined;
4902
+ highestOpenSeverity?: "critical" | "high" | "low" | "medium" | "unknown" | undefined;
4903
+ maxReviewCycles?: number | undefined;
4904
+ nonBlockingFindings: number;
4905
+ openFindings: number;
4906
+ reviewCycle?: number | undefined;
4907
+ staleRepeatFindings?: number | undefined;
4908
+ windowExhausted: boolean;
4909
+ } | undefined;
4910
+ reviewLadder?: {
4911
+ cycleCounts: {
4912
+ gate: number;
4913
+ interior: number;
4914
+ };
4915
+ forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4916
+ nextAction: "accept-nonblocking-findings" | "advance-to-gate" | "escalate-to-triage" | "ready-for-human" | "run-gate-cycle" | "run-interior-cycle";
4917
+ stage: "gate" | "interior" | "interior-complete";
4918
+ } | undefined;
4919
+ reviewRuns?: PrReviewResult[] | undefined;
4920
+ reviewTerminalState?: "accepted-with-findings" | "blocked" | "clean" | undefined;
4707
4921
  reviews: {
4708
4922
  correctness: {
4709
4923
  required: boolean;
4710
- status: "stale" | "blocked" | "not-required" | "current" | "missing";
4711
4924
  reviewedHeadSha?: string | undefined;
4712
4925
  reviewedPatchId?: string | undefined;
4926
+ status: "blocked" | "current" | "missing" | "not-required" | "stale";
4713
4927
  };
4714
4928
  security?: {
4715
4929
  required: boolean;
4716
- status: "stale" | "blocked" | "not-required" | "current" | "missing";
4717
4930
  reviewedHeadSha?: string | undefined;
4718
4931
  reviewedPatchId?: string | undefined;
4932
+ status: "blocked" | "current" | "missing" | "not-required" | "stale";
4719
4933
  } | undefined;
4720
4934
  };
4721
4935
  schemaVersion: 2;
@@ -4741,46 +4955,6 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4741
4955
  trivialVerifiedHeadSha: string;
4742
4956
  verifiedHeadSha?: string | undefined;
4743
4957
  };
4744
- externalChecks?: {
4745
- checkType: "review" | "verify";
4746
- name: string;
4747
- scopeReason: string;
4748
- status: "satisfied" | "unmet" | "out-of-scope";
4749
- reason?: string | undefined;
4750
- scope?: {
4751
- classifications: ("docs/process-only" | "trivial" | "non-trivial")[];
4752
- } | undefined;
4753
- }[] | undefined;
4754
- mergeBaseSha?: string | undefined;
4755
- reviewCycleState?: {
4756
- autoBlockingFindings: number;
4757
- countsBySeverity: {
4758
- critical: number;
4759
- high: number;
4760
- low: number;
4761
- medium: number;
4762
- unknown: number;
4763
- };
4764
- nonBlockingFindings: number;
4765
- openFindings: number;
4766
- windowExhausted: boolean;
4767
- highestBlockingSeverity?: "unknown" | "critical" | "high" | "low" | "medium" | undefined;
4768
- highestOpenSeverity?: "unknown" | "critical" | "high" | "low" | "medium" | undefined;
4769
- maxReviewCycles?: number | undefined;
4770
- reviewCycle?: number | undefined;
4771
- staleRepeatFindings?: number | undefined;
4772
- } | undefined;
4773
- reviewLadder?: {
4774
- cycleCounts: {
4775
- gate: number;
4776
- interior: number;
4777
- };
4778
- nextAction: "run-interior-cycle" | "advance-to-gate" | "run-gate-cycle" | "accept-nonblocking-findings" | "escalate-to-triage" | "ready-for-human";
4779
- stage: "gate" | "interior" | "interior-complete";
4780
- forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4781
- } | undefined;
4782
- reviewRuns?: PrReviewResult[] | undefined;
4783
- reviewTerminalState?: "blocked" | "accepted-with-findings" | "clean" | undefined;
4784
4958
  };
4785
4959
  /**
4786
4960
  * Facts a reader needs that are not refusals (#477): the settle-window
@@ -4790,51 +4964,92 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4790
4964
  notices: string[];
4791
4965
  repairs: {
4792
4966
  action: string;
4793
- code: "undraft-pr" | "await-post-undraft-checks";
4967
+ code: "await-post-undraft-checks" | "undraft-pr";
4794
4968
  command: string;
4795
4969
  }[];
4796
- status: ReadinessStatus; /** Demands that were in force, were NOT met, and the operator waived. */
4970
+ status: ReadinessStatus;
4971
+ /** Demands that were in force, were NOT met, and the operator waived. */
4797
4972
  waivedDemands: WaivedDemand[];
4798
- catchUpRecognition: CatchUpRecognition;
4973
+ } | {
4974
+ catchUpRecognition?: undefined;
4799
4975
  blockedReasons: {
4800
4976
  code: string;
4801
4977
  detail: string;
4802
4978
  }[];
4803
4979
  blockingReasons: string[];
4804
- } | {
4805
4980
  humanBlockingReasons: string[];
4806
4981
  ledger: {
4807
4982
  baseSha: string;
4808
4983
  blockingReasons: string[];
4809
- classification: "docs/process-only" | "trivial" | "non-trivial";
4984
+ classification: "docs/process-only" | "non-trivial" | "trivial";
4985
+ externalChecks?: {
4986
+ checkType: "review" | "verify";
4987
+ name: string;
4988
+ reason?: string | undefined;
4989
+ scope?: {
4990
+ classifications: ("docs/process-only" | "non-trivial" | "trivial")[];
4991
+ } | undefined;
4992
+ scopeReason: string;
4993
+ status: "out-of-scope" | "satisfied" | "unmet";
4994
+ }[] | undefined;
4810
4995
  github: {
4811
4996
  draft: boolean;
4812
4997
  mergeStateStatus: string;
4813
4998
  mergeable: string;
4814
- requiredChecks: "unknown" | "passed" | "failed" | "pending" | "none";
4815
- unresolvedReviewThreads: number;
4999
+ requiredChecks: "failed" | "none" | "passed" | "pending" | "unknown";
4816
5000
  reviewDecision?: string | null | undefined;
5001
+ unresolvedReviewThreads: number;
4817
5002
  };
4818
5003
  headSha: string;
5004
+ mergeBaseSha?: string | undefined;
4819
5005
  patchId: string;
4820
5006
  pr: number;
4821
5007
  repairs: {
4822
5008
  action: string;
4823
- code: "undraft-pr" | "await-post-undraft-checks";
5009
+ code: "await-post-undraft-checks" | "undraft-pr";
4824
5010
  command: string;
4825
5011
  }[];
5012
+ reviewCycleState?: {
5013
+ autoBlockingFindings: number;
5014
+ countsBySeverity: {
5015
+ critical: number;
5016
+ high: number;
5017
+ low: number;
5018
+ medium: number;
5019
+ unknown: number;
5020
+ };
5021
+ highestBlockingSeverity?: "critical" | "high" | "low" | "medium" | "unknown" | undefined;
5022
+ highestOpenSeverity?: "critical" | "high" | "low" | "medium" | "unknown" | undefined;
5023
+ maxReviewCycles?: number | undefined;
5024
+ nonBlockingFindings: number;
5025
+ openFindings: number;
5026
+ reviewCycle?: number | undefined;
5027
+ staleRepeatFindings?: number | undefined;
5028
+ windowExhausted: boolean;
5029
+ } | undefined;
5030
+ reviewLadder?: {
5031
+ cycleCounts: {
5032
+ gate: number;
5033
+ interior: number;
5034
+ };
5035
+ forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
5036
+ nextAction: "accept-nonblocking-findings" | "advance-to-gate" | "escalate-to-triage" | "ready-for-human" | "run-gate-cycle" | "run-interior-cycle";
5037
+ stage: "gate" | "interior" | "interior-complete";
5038
+ } | undefined;
5039
+ reviewRuns?: PrReviewResult[] | undefined;
5040
+ reviewTerminalState?: "accepted-with-findings" | "blocked" | "clean" | undefined;
4826
5041
  reviews: {
4827
5042
  correctness: {
4828
5043
  required: boolean;
4829
- status: "stale" | "blocked" | "not-required" | "current" | "missing";
4830
5044
  reviewedHeadSha?: string | undefined;
4831
5045
  reviewedPatchId?: string | undefined;
5046
+ status: "blocked" | "current" | "missing" | "not-required" | "stale";
4832
5047
  };
4833
5048
  security?: {
4834
5049
  required: boolean;
4835
- status: "stale" | "blocked" | "not-required" | "current" | "missing";
4836
5050
  reviewedHeadSha?: string | undefined;
4837
5051
  reviewedPatchId?: string | undefined;
5052
+ status: "blocked" | "current" | "missing" | "not-required" | "stale";
4838
5053
  } | undefined;
4839
5054
  };
4840
5055
  schemaVersion: 2;
@@ -4860,46 +5075,6 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4860
5075
  trivialVerifiedHeadSha: string;
4861
5076
  verifiedHeadSha?: string | undefined;
4862
5077
  };
4863
- externalChecks?: {
4864
- checkType: "review" | "verify";
4865
- name: string;
4866
- scopeReason: string;
4867
- status: "satisfied" | "unmet" | "out-of-scope";
4868
- reason?: string | undefined;
4869
- scope?: {
4870
- classifications: ("docs/process-only" | "trivial" | "non-trivial")[];
4871
- } | undefined;
4872
- }[] | undefined;
4873
- mergeBaseSha?: string | undefined;
4874
- reviewCycleState?: {
4875
- autoBlockingFindings: number;
4876
- countsBySeverity: {
4877
- critical: number;
4878
- high: number;
4879
- low: number;
4880
- medium: number;
4881
- unknown: number;
4882
- };
4883
- nonBlockingFindings: number;
4884
- openFindings: number;
4885
- windowExhausted: boolean;
4886
- highestBlockingSeverity?: "unknown" | "critical" | "high" | "low" | "medium" | undefined;
4887
- highestOpenSeverity?: "unknown" | "critical" | "high" | "low" | "medium" | undefined;
4888
- maxReviewCycles?: number | undefined;
4889
- reviewCycle?: number | undefined;
4890
- staleRepeatFindings?: number | undefined;
4891
- } | undefined;
4892
- reviewLadder?: {
4893
- cycleCounts: {
4894
- gate: number;
4895
- interior: number;
4896
- };
4897
- nextAction: "run-interior-cycle" | "advance-to-gate" | "run-gate-cycle" | "accept-nonblocking-findings" | "escalate-to-triage" | "ready-for-human";
4898
- stage: "gate" | "interior" | "interior-complete";
4899
- forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4900
- } | undefined;
4901
- reviewRuns?: PrReviewResult[] | undefined;
4902
- reviewTerminalState?: "blocked" | "accepted-with-findings" | "clean" | undefined;
4903
5078
  };
4904
5079
  /**
4905
5080
  * Facts a reader needs that are not refusals (#477): the settle-window
@@ -4909,20 +5084,13 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4909
5084
  notices: string[];
4910
5085
  repairs: {
4911
5086
  action: string;
4912
- code: "undraft-pr" | "await-post-undraft-checks";
5087
+ code: "await-post-undraft-checks" | "undraft-pr";
4913
5088
  command: string;
4914
5089
  }[];
4915
- status: ReadinessStatus; /** Demands that were in force, were NOT met, and the operator waived. */
5090
+ status: ReadinessStatus;
5091
+ /** Demands that were in force, were NOT met, and the operator waived. */
4916
5092
  waivedDemands: WaivedDemand[];
4917
- catchUpRecognition?: undefined;
4918
- blockedReasons: {
4919
- code: string;
4920
- detail: string;
4921
- }[];
4922
- blockingReasons: string[];
4923
5093
  };
4924
- //#endregion
4925
- //#region src/evidence-emit.d.ts
4926
5094
  interface EvidenceEmitArgs {
4927
5095
  base: string;
4928
5096
  check: string;
@@ -4951,11 +5119,9 @@ interface EvidenceEmitResult {
4951
5119
  envelope: EvidenceEnvelope;
4952
5120
  path: string;
4953
5121
  }
4954
- declare const evidenceEnvelopeFilename: (check: string, headSha: string) => string;
4955
- declare function buildEvidenceEnvelope(args: EvidenceEmitArgs, dependencies?: EvidenceEmitDependencies): EvidenceEnvelope;
4956
- declare function runEvidenceEmit(args: EvidenceEmitArgs, dependencies?: EvidenceEmitDependencies): EvidenceEmitResult;
4957
- //#endregion
4958
- //#region src/epic-structure.d.ts
5122
+ export declare const evidenceEnvelopeFilename: (check: string, headSha: string) => string;
5123
+ export declare function buildEvidenceEnvelope(args: EvidenceEmitArgs, dependencies?: EvidenceEmitDependencies): EvidenceEnvelope;
5124
+ export declare function runEvidenceEmit(args: EvidenceEmitArgs, dependencies?: EvidenceEmitDependencies): EvidenceEmitResult;
4959
5125
  /**
4960
5126
  * Producer-side `epic-structure` v1 emitter (epic #132, lane #135).
4961
5127
  *
@@ -4976,7 +5142,7 @@ declare function runEvidenceEmit(args: EvidenceEmitArgs, dependencies?: Evidence
4976
5142
  * The `dag.yml` schema itself is documented with the epic skill (lane #137);
4977
5143
  * this module is the executable contract, not a second source of truth.
4978
5144
  */
4979
- declare const EPIC_STRUCTURE_SCHEMA_VERSION = 1;
5145
+ export declare const EPIC_STRUCTURE_SCHEMA_VERSION = 1;
4980
5146
  /**
4981
5147
  * DAG-node PLANNING statuses — the planning-plane vocabulary a planner authors
4982
5148
  * on a `dag.yml` node. Carried forward by ADR 0018 and defined by the epic
@@ -4999,7 +5165,7 @@ declare const EPIC_STRUCTURE_SCHEMA_VERSION = 1;
4999
5165
  * emits a lane status. HQ's `epic-structure-parity.test.ts` fails CI if the
5000
5166
  * producer emits any status HQ won't accept.
5001
5167
  */
5002
- declare const EPIC_STRUCTURE_NODE_STATUSES: readonly ["open", "closed", "satisfied-on-main", "parked"];
5168
+ export declare const EPIC_STRUCTURE_NODE_STATUSES: readonly ["open", "closed", "satisfied-on-main", "parked"];
5003
5169
  type EpicStructureNodeStatus = (typeof EPIC_STRUCTURE_NODE_STATUSES)[number];
5004
5170
  interface DagDocument {
5005
5171
  epic?: unknown;
@@ -5047,7 +5213,7 @@ interface BuildEpicStructureEventInput {
5047
5213
  /**
5048
5214
  * Fail-closed validation error carrying every offending node/edge diagnostic.
5049
5215
  */
5050
- declare class EpicStructureValidationError extends Error {
5216
+ export declare class EpicStructureValidationError extends Error {
5051
5217
  readonly diagnostics: string[];
5052
5218
  constructor(diagnostics: string[]);
5053
5219
  }
@@ -5074,13 +5240,13 @@ interface ValidatedDag {
5074
5240
  * Validates a dag document fail-closed. Throws {@link
5075
5241
  * EpicStructureValidationError} with a diagnostic per offending node/edge.
5076
5242
  */
5077
- declare const validateDagDocument: (input: BuildEpicStructureEventInput) => ValidatedDag;
5243
+ export declare const validateDagDocument: (input: BuildEpicStructureEventInput) => ValidatedDag;
5078
5244
  /**
5079
5245
  * Builds the wire payload with deterministic ordering (nodes by slug, edges by
5080
5246
  * from then to) so re-emission of the same graph is byte-stable regardless of
5081
5247
  * the planner's source ordering — the basis for the content-addressed eventId.
5082
5248
  */
5083
- declare const buildEpicStructurePayload: (dag: ValidatedDag) => EpicStructureGraphPayload;
5249
+ export declare const buildEpicStructurePayload: (dag: ValidatedDag) => EpicStructureGraphPayload;
5084
5250
  /**
5085
5251
  * Deterministic eventId = `epic-structure-<boundary>-<sha256(payload)[0:16]>`.
5086
5252
  * Re-emitting identical graph content yields the same eventId (HQ dedups →
@@ -5088,12 +5254,12 @@ declare const buildEpicStructurePayload: (dag: ValidatedDag) => EpicStructureGra
5088
5254
  * supersedes the prior structure wholesale (HQ keeps the latest). This mirrors
5089
5255
  * seed-dev's fixed-eventId idempotency, content-addressed instead of literal.
5090
5256
  */
5091
- declare const epicStructureEventId: (boundary: string, payload: EpicStructureGraphPayload) => string;
5257
+ export declare const epicStructureEventId: (boundary: string, payload: EpicStructureGraphPayload) => string;
5092
5258
  /**
5093
5259
  * Validates and builds the full `epic-structure` v1 ingest event, ready to POST
5094
5260
  * to `/api/ingest`. Throws {@link EpicStructureValidationError} fail-closed.
5095
5261
  */
5096
- declare const buildEpicStructureEvent: (input: BuildEpicStructureEventInput) => EpicStructureEvent;
5262
+ export declare const buildEpicStructureEvent: (input: BuildEpicStructureEventInput) => EpicStructureEvent;
5097
5263
  type FetchLike = (input: string, init?: {
5098
5264
  body?: string;
5099
5265
  headers?: Record<string, string>;
@@ -5131,23 +5297,19 @@ interface PublishEpicStructureResult {
5131
5297
  /** The prod HQ worker is reachable at `hq.patronage.com` and its frozen
5132
5298
  * `-v1.*.workers.dev` alias. Emitting there without an Access service token is
5133
5299
  * fail-closed. */
5134
- declare const isProductionHqUrl: (url: string) => boolean;
5300
+ export declare const isProductionHqUrl: (url: string) => boolean;
5135
5301
  /**
5136
5302
  * POSTs the event to HQ ingest. Fail-closed: a production URL without a
5137
5303
  * Cloudflare Access service token is refused before any request; a 401/403 is
5138
5304
  * surfaced with actionable guidance; any non-2xx throws.
5139
5305
  */
5140
- declare const publishEpicStructure: (args: PublishEpicStructureArgs) => Promise<PublishEpicStructureResult>;
5141
- //#endregion
5142
- //#region src/review-focus.d.ts
5143
- declare const REVIEW_FOCUS_SECTION = "Review focus";
5306
+ export declare const publishEpicStructure: (args: PublishEpicStructureArgs) => Promise<PublishEpicStructureResult>;
5307
+ export declare const REVIEW_FOCUS_SECTION = "Review focus";
5144
5308
  interface IssueReviewFocus {
5145
5309
  issueNumber: number;
5146
5310
  text: string;
5147
5311
  }
5148
- declare const reviewFocusFromIssueBody: (body: string) => string | undefined;
5149
- //#endregion
5150
- //#region src/review-prompt.d.ts
5312
+ export declare const reviewFocusFromIssueBody: (body: string) => string | undefined;
5151
5313
  interface AssembleReviewPromptInput {
5152
5314
  base: string;
5153
5315
  changedFiles: string[];
@@ -5171,27 +5333,14 @@ interface AssembledReviewPrompt {
5171
5333
  prompt: string;
5172
5334
  sections: ReviewPromptSection[];
5173
5335
  }
5174
- declare const assembleReviewPrompt: ({
5175
- base,
5176
- changedFiles,
5177
- cwd,
5178
- headSha,
5179
- issueFocus,
5180
- kind,
5181
- patchId,
5182
- priorLedgerEntries,
5183
- profile,
5184
- waveRung
5185
- }: AssembleReviewPromptInput, dependencies?: AssembleReviewPromptDependencies) => AssembledReviewPrompt;
5186
- //#endregion
5187
- //#region src/verification-run-context.d.ts
5188
- declare const FACTORY_BASE_REF_ENV = "FACTORY_BASE_REF";
5189
- declare const FACTORY_CHANGED_FILES_ENV = "FACTORY_CHANGED_FILES";
5190
- declare const FACTORY_CHANGED_FILES_FILE_ENV = "FACTORY_CHANGED_FILES_FILE";
5191
- declare const FACTORY_LOCKFILE_IMPORTERS_ENV = "FACTORY_LOCKFILE_IMPORTERS";
5192
- declare const FACTORY_LOCKFILE_BASE_REF_ENV = "FACTORY_LOCKFILE_BASE_REF";
5193
- declare const EMPTY_TREE_OBJECT_HASH = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
5194
- declare const DEFAULT_ROOT_SHARED_GLOBS: string[];
5336
+ export declare const assembleReviewPrompt: ({ base, changedFiles, cwd, headSha, issueFocus, kind, patchId, priorLedgerEntries, profile, waveRung }: AssembleReviewPromptInput, dependencies?: AssembleReviewPromptDependencies) => AssembledReviewPrompt;
5337
+ export declare const FACTORY_BASE_REF_ENV = "FACTORY_BASE_REF";
5338
+ export declare const FACTORY_CHANGED_FILES_ENV = "FACTORY_CHANGED_FILES";
5339
+ export declare const FACTORY_CHANGED_FILES_FILE_ENV = "FACTORY_CHANGED_FILES_FILE";
5340
+ export declare const FACTORY_LOCKFILE_IMPORTERS_ENV = "FACTORY_LOCKFILE_IMPORTERS";
5341
+ export declare const FACTORY_LOCKFILE_BASE_REF_ENV = "FACTORY_LOCKFILE_BASE_REF";
5342
+ export declare const EMPTY_TREE_OBJECT_HASH = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
5343
+ export declare const DEFAULT_ROOT_SHARED_GLOBS: string[];
5195
5344
  interface VerificationRunContextInput {
5196
5345
  baseRef: string;
5197
5346
  changedFiles: string[];
@@ -5219,9 +5368,7 @@ interface VerificationRunContext {
5219
5368
  buildEnv: () => VerificationEnv;
5220
5369
  runSummaryLines: () => string[];
5221
5370
  }
5222
- declare function createVerificationRunContext(input: VerificationRunContextInput): VerificationRunContext;
5223
- //#endregion
5224
- //#region src/verification-battery.d.ts
5371
+ export declare function createVerificationRunContext(input: VerificationRunContextInput): VerificationRunContext;
5225
5372
  type BatteryDisposition = "executed" | "not-required";
5226
5373
  /**
5227
5374
  * The structural subset of a profile verification command this planner reads.
@@ -5272,11 +5419,7 @@ interface VerificationBatteryPlan<Command> {
5272
5419
  * candidate's own identity triple; anywhere else it is `trustedImpactStamp`'s
5273
5420
  * output or `undefined`.
5274
5421
  */
5275
- declare const planVerificationBattery: <Command extends BatteryCandidateCommand>({
5276
- commands,
5277
- stamp,
5278
- vetoedTargets
5279
- }: {
5422
+ export declare const planVerificationBattery: <Command extends BatteryCandidateCommand>({ commands, stamp, vetoedTargets }: {
5280
5423
  commands: readonly Command[];
5281
5424
  stamp: ImpactStamp | undefined;
5282
5425
  /**
@@ -5296,28 +5439,20 @@ declare const planVerificationBattery: <Command extends BatteryCandidateCommand>
5296
5439
  vetoedTargets: readonly string[];
5297
5440
  }) => VerificationBatteryPlan<Command>;
5298
5441
  /** Console lines naming every withheld command and why. Never silent. */
5299
- declare const batteryScopeSummaryLines: (plan: VerificationBatteryPlan<BatteryCandidateCommand>) => string[];
5300
- //#endregion
5301
- //#region src/worker-checkout-guard.d.ts
5442
+ export declare const batteryScopeSummaryLines: (plan: VerificationBatteryPlan<BatteryCandidateCommand>) => string[];
5302
5443
  type CheckoutDirsProbe = (cwd: string) => {
5303
5444
  gitCommonDir: string;
5304
5445
  gitDir: string;
5305
5446
  };
5306
- declare class WorkerCheckoutGuardError extends Error {
5447
+ export declare class WorkerCheckoutGuardError extends Error {
5307
5448
  constructor(message: string);
5308
5449
  }
5309
- declare function assertWorkerCheckoutAllowed({
5310
- cwd,
5311
- operation,
5312
- probe
5313
- }: {
5450
+ export declare function assertWorkerCheckoutAllowed({ cwd, operation, probe }: {
5314
5451
  cwd: string;
5315
5452
  operation: string;
5316
5453
  probe?: CheckoutDirsProbe;
5317
5454
  }): void;
5318
- //#endregion
5319
- //#region src/index.d.ts
5320
- interface CreateProgramOptions {
5455
+ export interface CreateProgramOptions {
5321
5456
  actions?: {
5322
5457
  boundaryCheck?: BoundaryCheckAction;
5323
5458
  demandWaive?: DemandWaiveAction;
@@ -5329,7 +5464,7 @@ interface CreateProgramOptions {
5329
5464
  factoryCliInvocation?: FactoryCliInvocation;
5330
5465
  output?: CliOutput;
5331
5466
  }
5332
- declare function createProgram(options?: CreateProgramOptions): Command;
5467
+ export declare function createProgram(options?: CreateProgramOptions): Command;
5333
5468
  /**
5334
5469
  * Parse `argv` and run the matching command. `cliEntry` is the path of the
5335
5470
  * runnable bin module, which follow-up commands spawn; the bin entry passes its
@@ -5342,6 +5477,5 @@ declare function createProgram(options?: CreateProgramOptions): Command;
5342
5477
  * exit. `pr:ready` then prints one line if events are still spooled (#1317).
5343
5478
  * None of these steps can throw or change the command's exit code.
5344
5479
  */
5345
- declare function run(argv?: string[], cliEntry?: string): Promise<void>;
5346
- //#endregion
5347
- export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BatteryCommandDisposition, type BatteryDisposition, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type CloudflareAccessServiceToken, type CompletedFactoryCheckSnapshot, CreateProgramOptions, DEFAULT_DEMAND_WAIVER_PATH, DEFAULT_FACTORY_REPOSITORY, DEFAULT_ROOT_SHARED_GLOBS, type DagDocument, type DemandWaiveArgs, type DemandWaiveDependencies, DemandWaiveRefusalError, type DemandWaiver, type DemandWaiverStore, EMPTY_TREE_OBJECT_HASH, EPIC_STRUCTURE_NODE_STATUSES, EPIC_STRUCTURE_SCHEMA_VERSION, type EpicStructureEvent, type EpicStructureGraphPayload, type EpicStructureNodeStatus, EpicStructureValidationError, type EvidenceEmitArgs, type EvidenceEmitDependencies, type EvidenceEmitResult, FACTORY_BASE_REF_ENV, FACTORY_CHANGED_FILES_ENV, FACTORY_CHANGED_FILES_FILE_ENV, FACTORY_LOCKFILE_BASE_REF_ENV, FACTORY_LOCKFILE_IMPORTERS_ENV, type FactoryCliInvocation, FactoryCliInvocationSchema, type FactoryPrStatusCheckName, type FactoryPrStatusSources, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FollowUpAction, FollowUpActionSchema, type GitHubCheckRunMergeFreezeApi, type ImpactScopeDecision, type ImpactScopeSurface, type IssueReviewFocus, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeAuthority, type MergeFreezeGeneration, type MergeFreezeState, type MergeFreezeStoreInput, type PlanFactoryPrStatusHudInput, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PrVerifyProof, type PresentFactoryPrStatusHudDependencies, type PresentFactoryPrStatusHudInput, type PreviewDisposition, type PreviewLifecyclePlan, type PreviewTargetPlan, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, REVIEW_FOCUS_SECTION, type ReadFactoryPrStatusSourcesDependencies, type ReadFactoryPrStatusSourcesInput, type RefreshFactoryPrStatusHudInput, type RenderFactoryPrStatusHudInput, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, type ReviewPromptSection, type ReviewPromptSectionProvenance, type ScanFactoryTraceDiagnosticsOptions, type ScanFactoryTraceOptions, type ScanFactoryTraceResult, type ScopedOutCommand, type TraceMirrorDiagnostic, type TraceSink, type TraceWriteResult, type TraceWriteSinks, type VerificationBatteryPlan, type VerificationReuse, type VerificationRunContext, type VerificationRunContextInput, type WaivedDemand, WorkerCheckoutGuardError, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertFactoryPrStatusIdentity, assertWorkerCheckoutAllowed, authorizeDemandWaiver, batteryScopeSummaryLines, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildReviewGateNotRequiredTraceEvent, comment_provenance_d_exports as commentProvenance, createGitHubCheckRunMergeFreezeStore, createLocalJsonlTraceSink, createProgram, createVerificationRunContext, doctorProjectProfile, epicStructureEventId, evidenceEnvelopeFilename, followUpFromArgv, impactStampScopeDecision, isProductionHqUrl, loadProjectProfile, normalizeIssueComments, planFactoryPrStatusHud, planPreviewLifecycle, planPublishFollowUp, planVerificationBattery, readiness_evaluation_d_exports as prReadinessEvaluation, external_evidence_d_exports as prReadinessExternalEvidence, pr_body_renderer_d_exports as prReadinessPrBodyRenderer, proof_identity_d_exports as prReadinessProofIdentity, review_proof_d_exports as prReadinessReviewProof, status_check_rollup_d_exports as prReadinessStatusChecks, verification_proof_d_exports as prReadinessVerificationProof, presentFactoryPrStatusHud, previewLifecycleTargets, publishEpicStructure, readDemandWaivers, readFactoryPrStatusSources, readPrReadyProof, refreshFactoryPrStatusHud, refreshFactoryPrStatusHudSafely, renderFactoryPrStatusHud, resolveFactoryRepository, resolveTraceWriteSinks, reviewFocusFromIssueBody, reviewPromptSectionSchema, reviewPromptSectionsSchema, run, runBoundaryCheck, runDemandWaive, runEvidenceEmit, runPrPublish, runPrReady, runPrReview, runPrVerify, scanFactoryTraceDiagnostics, scanFactoryTraceEvents, selectWaiversForCandidate, toFactoryTraceEnvelope, tryAppendReviewGateNotRequiredTraceEvent, validateBoundaryCheckProof, validateDagDocument, validateDemandWaiverStore, validateFactoryTraceEvent, validateMergeFreezeState, validatePrReadyProof, validatePrVerifyProof, validatePreviewLifecyclePlan, waivedDemandNotice, waivedDemandSchema, worktree_scratch_files_d_exports as worktreeScratchFiles };
5480
+ export declare function run(argv?: string[], cliEntry?: string): Promise<void>;
5481
+ export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BatteryCommandDisposition, type BatteryDisposition, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type CloudflareAccessServiceToken, type CompletedFactoryCheckSnapshot, type DagDocument, type DemandWaiveArgs, type DemandWaiveDependencies, type DemandWaiver, type DemandWaiverStore, type EpicStructureEvent, type EpicStructureGraphPayload, type EpicStructureNodeStatus, type EvidenceEmitArgs, type EvidenceEmitDependencies, type EvidenceEmitResult, type FactoryCliInvocation, type FactoryPrStatusCheckName, type FactoryPrStatusSources, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FollowUpAction, type GitHubCheckRunMergeFreezeApi, type ImpactScopeDecision, type ImpactScopeSurface, type IssueReviewFocus, type MergeFreezeAuthority, type MergeFreezeGeneration, type MergeFreezeState, type MergeFreezeStoreInput, type PlanFactoryPrStatusHudInput, type PrPublishArgs, type PrPublishDependencies, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PrVerifyProof, type PresentFactoryPrStatusHudDependencies, type PresentFactoryPrStatusHudInput, type PreviewDisposition, type PreviewLifecyclePlan, type PreviewTargetPlan, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, type ReadFactoryPrStatusSourcesDependencies, type ReadFactoryPrStatusSourcesInput, type RefreshFactoryPrStatusHudInput, type RenderFactoryPrStatusHudInput, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, type ReviewPromptSection, type ReviewPromptSectionProvenance, type ScanFactoryTraceDiagnosticsOptions, type ScanFactoryTraceOptions, type ScanFactoryTraceResult, type ScopedOutCommand, type TraceMirrorDiagnostic, type TraceSink, type TraceWriteResult, type TraceWriteSinks, type VerificationBatteryPlan, type VerificationReuse, type VerificationRunContext, type VerificationRunContextInput, type WaivedDemand, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, comment_provenance_d_exports as commentProvenance, readiness_evaluation_d_exports as prReadinessEvaluation, external_evidence_d_exports as prReadinessExternalEvidence, pr_body_renderer_d_exports as prReadinessPrBodyRenderer, proof_identity_d_exports as prReadinessProofIdentity, review_proof_d_exports as prReadinessReviewProof, status_check_rollup_d_exports as prReadinessStatusChecks, verification_proof_d_exports as prReadinessVerificationProof, worktree_scratch_files_d_exports as worktreeScratchFiles };