@patronage/software-factory 1.0.0-alpha.24 → 1.0.0-alpha.26

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
@@ -17,8 +17,8 @@ declare const boundaryManifestBaseSchema: z.ZodObject<{
17
17
  boundary: z.ZodString;
18
18
  closeout: z.ZodOptional<z.ZodObject<{
19
19
  review: z.ZodEnum<{
20
- "independent-model": "independent-model";
21
20
  oracle: "oracle";
21
+ "independent-model": "independent-model";
22
22
  human: "human";
23
23
  }>;
24
24
  }, z.core.$loose>>;
@@ -26,8 +26,8 @@ declare const boundaryManifestBaseSchema: z.ZodObject<{
26
26
  integrationBranch: z.ZodOptional<z.ZodString>;
27
27
  schemaVersion: z.ZodLiteral<1>;
28
28
  topology: z.ZodEnum<{
29
- "each-to-main": "each-to-main";
30
29
  flagged: "flagged";
30
+ "each-to-main": "each-to-main";
31
31
  stacked: "stacked";
32
32
  "each-to-epic": "each-to-epic";
33
33
  }>;
@@ -36,8 +36,8 @@ declare const boundaryManifestBaseSchema: z.ZodObject<{
36
36
  issues: z.ZodArray<z.ZodNumber>;
37
37
  name: z.ZodString;
38
38
  review: z.ZodEnum<{
39
- "independent-model": "independent-model";
40
39
  oracle: "oracle";
40
+ "independent-model": "independent-model";
41
41
  human: "human";
42
42
  }>;
43
43
  }, z.core.$loose>>;
@@ -46,8 +46,8 @@ declare const boundaryManifestSchema: z.ZodObject<{
46
46
  boundary: z.ZodString;
47
47
  closeout: z.ZodOptional<z.ZodObject<{
48
48
  review: z.ZodEnum<{
49
- "independent-model": "independent-model";
50
49
  oracle: "oracle";
50
+ "independent-model": "independent-model";
51
51
  human: "human";
52
52
  }>;
53
53
  }, z.core.$loose>>;
@@ -55,8 +55,8 @@ declare const boundaryManifestSchema: z.ZodObject<{
55
55
  integrationBranch: z.ZodOptional<z.ZodString>;
56
56
  schemaVersion: z.ZodLiteral<1>;
57
57
  topology: z.ZodEnum<{
58
- "each-to-main": "each-to-main";
59
58
  flagged: "flagged";
59
+ "each-to-main": "each-to-main";
60
60
  stacked: "stacked";
61
61
  "each-to-epic": "each-to-epic";
62
62
  }>;
@@ -65,8 +65,8 @@ declare const boundaryManifestSchema: z.ZodObject<{
65
65
  issues: z.ZodArray<z.ZodNumber>;
66
66
  name: z.ZodString;
67
67
  review: z.ZodEnum<{
68
- "independent-model": "independent-model";
69
68
  oracle: "oracle";
69
+ "independent-model": "independent-model";
70
70
  human: "human";
71
71
  }>;
72
72
  }, z.core.$loose>>;
@@ -151,8 +151,8 @@ declare const boundaryReviewProofBaseSchema: z.ZodObject<{
151
151
  }>;
152
152
  producer: z.ZodString;
153
153
  rung: z.ZodEnum<{
154
- "independent-model": "independent-model";
155
154
  oracle: "oracle";
155
+ "independent-model": "independent-model";
156
156
  human: "human";
157
157
  }>;
158
158
  schemaVersion: z.ZodLiteral<1>;
@@ -195,8 +195,8 @@ declare const boundaryReviewProofSchema: z.ZodObject<{
195
195
  }>;
196
196
  producer: z.ZodString;
197
197
  rung: z.ZodEnum<{
198
- "independent-model": "independent-model";
199
198
  oracle: "oracle";
199
+ "independent-model": "independent-model";
200
200
  human: "human";
201
201
  }>;
202
202
  schemaVersion: z.ZodLiteral<1>;
@@ -235,6 +235,102 @@ interface BoundaryPullRequestRef {
235
235
  state: "OPEN" | "CLOSED" | "MERGED";
236
236
  }
237
237
  //#endregion
238
+ //#region src/demand-waiver.d.ts
239
+ declare const DEFAULT_DEMAND_WAIVER_PATH = ".factory-memory/demand-waivers.json";
240
+ /** One recorded operator act: this demand, on this candidate, waived. */
241
+ interface DemandWaiver {
242
+ candidate: {
243
+ headSha: string;
244
+ pr: number;
245
+ };
246
+ demand: string;
247
+ /** The authenticated GitHub account that recorded the waiver. */
248
+ operator: string;
249
+ rationale: string;
250
+ recordedAt: string;
251
+ /** Optional audit metadata; never waiver authority. */
252
+ session?: string;
253
+ }
254
+ interface DemandWaiverStore {
255
+ command: "patronage-factory demand:waive";
256
+ schemaVersion: 1;
257
+ waivers: DemandWaiver[];
258
+ }
259
+ declare const validateDemandWaiverStore: (value: unknown) => DemandWaiverStore;
260
+ /**
261
+ * A demand that was in force, was NOT met, and was waived by the operator.
262
+ *
263
+ * `unmetReasons` is required and non-empty: every reason the demand refused is
264
+ * carried through verbatim. There is no field on this record that could say
265
+ * "satisfied", and no code path constructs one without a refusal to carry.
266
+ */
267
+ interface WaivedDemand {
268
+ demand: string;
269
+ operator: string;
270
+ rationale: string;
271
+ recordedAt: string;
272
+ session?: string;
273
+ /** The demand's refusals at evaluation time, preserved verbatim. */
274
+ unmetReasons: string[];
275
+ }
276
+ declare const waivedDemandSchema: z.ZodType<WaivedDemand>;
277
+ /** The waivers that bind one candidate: same PR, same head. */
278
+ declare const selectWaiversForCandidate: ({
279
+ headSha,
280
+ pr,
281
+ waivers
282
+ }: {
283
+ headSha: string | undefined;
284
+ pr: number;
285
+ waivers: readonly DemandWaiver[];
286
+ }) => DemandWaiver[];
287
+ interface DemandOutcome {
288
+ blockingReasons: string[];
289
+ waived?: WaivedDemand;
290
+ }
291
+ /**
292
+ * Fold one resolved demand's refusals through the operator's waivers.
293
+ *
294
+ * A satisfied demand (no refusals) stays satisfied and the waiver stays inert
295
+ * — a waiver can only ever move a demand from *unmet-and-blocking* to
296
+ * *unmet-and-waived*, never to met.
297
+ */
298
+ declare const applyDemandWaiver: ({
299
+ demand,
300
+ reasons,
301
+ waivers
302
+ }: {
303
+ demand: string;
304
+ reasons: readonly string[];
305
+ waivers: readonly DemandWaiver[];
306
+ }) => DemandOutcome;
307
+ /** How a waived demand reads to a human. Never the word "satisfied". */
308
+ declare const waivedDemandNotice: (waived: WaivedDemand) => string;
309
+ interface DemandWaiverAuthorization {
310
+ operator: string;
311
+ session?: string;
312
+ }
313
+ type AuthorizeDemandWaiverResult = {
314
+ authorization: DemandWaiverAuthorization;
315
+ refusals?: undefined;
316
+ } | {
317
+ authorization?: undefined;
318
+ refusals: string[];
319
+ };
320
+ /**
321
+ * Operator identity, `declaredBy`-style: a named human account, recorded on
322
+ * the waiver and enforced here. Session is optional audit metadata only: it is
323
+ * not credential-backed, so its absence or equality never authorizes or
324
+ * refuses an operator act.
325
+ */
326
+ declare const authorizeDemandWaiver: ({
327
+ authenticatedLogin,
328
+ session
329
+ }: {
330
+ authenticatedLogin: string | undefined;
331
+ session: string | undefined;
332
+ }) => AuthorizeDemandWaiverResult;
333
+ //#endregion
238
334
  //#region src/hq-ingest-sink.d.ts
239
335
  interface HqIngestDependencies {
240
336
  /**
@@ -494,6 +590,23 @@ declare const reviewPromptSectionsSchema: z.ZodArray<z.ZodObject<{
494
590
  text: z.ZodString;
495
591
  }, z.core.$strict>>;
496
592
  //#endregion
593
+ //#region src/policy-resolution.d.ts
594
+ /** How a gate resolved the review policy it evaluated a candidate under. */
595
+ declare const policyResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
596
+ basePolicyDigest: z.ZodString;
597
+ baseRefName: z.ZodString;
598
+ candidatePolicyDigest: z.ZodString;
599
+ effectiveDigest: z.ZodString;
600
+ policyBaseSha: z.ZodString;
601
+ reviewPolicyChanged: z.ZodBoolean;
602
+ status: z.ZodLiteral<"authoritative">;
603
+ }, z.core.$strict>, z.ZodObject<{
604
+ baseRefName: z.ZodString;
605
+ reason: z.ZodString;
606
+ status: z.ZodLiteral<"unresolved">;
607
+ }, z.core.$strict>], "status">;
608
+ type PolicyResolution = z.infer<typeof policyResolutionSchema>;
609
+ //#endregion
497
610
  //#region src/review-ladder-policy.d.ts
498
611
  type ReviewFindingSeverity = "critical" | "high" | "medium" | "low" | "unknown";
499
612
  type ReviewFindingCategory = "correctness" | "safety" | "coordination" | "maintainability" | "unknown";
@@ -589,6 +702,7 @@ interface ReviewLadderCycle {
589
702
  headSha: string;
590
703
  patchId: string;
591
704
  };
705
+ historical?: true;
592
706
  model?: string;
593
707
  correlatedRerun?: boolean;
594
708
  session?: LadderSessionAttribution;
@@ -756,6 +870,13 @@ interface PrReviewProof {
756
870
  changedFiles: string[];
757
871
  cleanedPaths: string[];
758
872
  ladder?: PrReviewLadderState;
873
+ /**
874
+ * The policy identity this review run resolved its demanded kinds under
875
+ * (#922 Slice B). Optional: a run that could not reach the authority records
876
+ * the refusal instead, and `pr:ready` decides what an unresolved or
877
+ * disagreeing identity means for admission.
878
+ */
879
+ policyResolution?: PolicyResolution;
759
880
  reviewRequirement?: {
760
881
  reason: "no-applicable-mode" | "faithful-merge";
761
882
  status: "not-required";
@@ -763,102 +884,6 @@ interface PrReviewProof {
763
884
  reviews: PrReviewResult[];
764
885
  }
765
886
  //#endregion
766
- //#region src/demand-waiver.d.ts
767
- declare const DEFAULT_DEMAND_WAIVER_PATH = ".factory-memory/demand-waivers.json";
768
- /** One recorded operator act: this demand, on this candidate, waived. */
769
- interface DemandWaiver {
770
- candidate: {
771
- headSha: string;
772
- pr: number;
773
- };
774
- demand: string;
775
- /** The authenticated GitHub account that recorded the waiver. */
776
- operator: string;
777
- rationale: string;
778
- recordedAt: string;
779
- /** Optional audit metadata; never waiver authority. */
780
- session?: string;
781
- }
782
- interface DemandWaiverStore {
783
- command: "patronage-factory demand:waive";
784
- schemaVersion: 1;
785
- waivers: DemandWaiver[];
786
- }
787
- declare const validateDemandWaiverStore: (value: unknown) => DemandWaiverStore;
788
- /**
789
- * A demand that was in force, was NOT met, and was waived by the operator.
790
- *
791
- * `unmetReasons` is required and non-empty: every reason the demand refused is
792
- * carried through verbatim. There is no field on this record that could say
793
- * "satisfied", and no code path constructs one without a refusal to carry.
794
- */
795
- interface WaivedDemand {
796
- demand: string;
797
- operator: string;
798
- rationale: string;
799
- recordedAt: string;
800
- session?: string;
801
- /** The demand's refusals at evaluation time, preserved verbatim. */
802
- unmetReasons: string[];
803
- }
804
- declare const waivedDemandSchema: z.ZodType<WaivedDemand>;
805
- /** The waivers that bind one candidate: same PR, same head. */
806
- declare const selectWaiversForCandidate: ({
807
- headSha,
808
- pr,
809
- waivers
810
- }: {
811
- headSha: string | undefined;
812
- pr: number;
813
- waivers: readonly DemandWaiver[];
814
- }) => DemandWaiver[];
815
- interface DemandOutcome {
816
- blockingReasons: string[];
817
- waived?: WaivedDemand;
818
- }
819
- /**
820
- * Fold one resolved demand's refusals through the operator's waivers.
821
- *
822
- * A satisfied demand (no refusals) stays satisfied and the waiver stays inert
823
- * — a waiver can only ever move a demand from *unmet-and-blocking* to
824
- * *unmet-and-waived*, never to met.
825
- */
826
- declare const applyDemandWaiver: ({
827
- demand,
828
- reasons,
829
- waivers
830
- }: {
831
- demand: string;
832
- reasons: readonly string[];
833
- waivers: readonly DemandWaiver[];
834
- }) => DemandOutcome;
835
- /** How a waived demand reads to a human. Never the word "satisfied". */
836
- declare const waivedDemandNotice: (waived: WaivedDemand) => string;
837
- interface DemandWaiverAuthorization {
838
- operator: string;
839
- session?: string;
840
- }
841
- type AuthorizeDemandWaiverResult = {
842
- authorization: DemandWaiverAuthorization;
843
- refusals?: undefined;
844
- } | {
845
- authorization?: undefined;
846
- refusals: string[];
847
- };
848
- /**
849
- * Operator identity, `declaredBy`-style: a named human account, recorded on
850
- * the waiver and enforced here. Session is optional audit metadata only: it is
851
- * not credential-backed, so its absence or equality never authorizes or
852
- * refuses an operator act.
853
- */
854
- declare const authorizeDemandWaiver: ({
855
- authenticatedLogin,
856
- session
857
- }: {
858
- authenticatedLogin: string | undefined;
859
- session: string | undefined;
860
- }) => AuthorizeDemandWaiverResult;
861
- //#endregion
862
887
  //#region src/blocked-reasons.d.ts
863
888
  declare const blockedReasonSchema: z.ZodObject<{
864
889
  code: z.ZodString;
@@ -893,23 +918,6 @@ interface CheckoutRepository {
893
918
  owner: string;
894
919
  }
895
920
  //#endregion
896
- //#region src/policy-resolution.d.ts
897
- /** How a gate resolved the review policy it evaluated a candidate under. */
898
- declare const policyResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
899
- basePolicyDigest: z.ZodString;
900
- baseRefName: z.ZodString;
901
- candidatePolicyDigest: z.ZodString;
902
- effectiveDigest: z.ZodString;
903
- policyBaseSha: z.ZodString;
904
- reviewPolicyChanged: z.ZodBoolean;
905
- status: z.ZodLiteral<"authoritative">;
906
- }, z.core.$strict>, z.ZodObject<{
907
- baseRefName: z.ZodString;
908
- reason: z.ZodString;
909
- status: z.ZodLiteral<"unresolved">;
910
- }, z.core.$strict>], "status">;
911
- type PolicyResolution = z.infer<typeof policyResolutionSchema>;
912
- //#endregion
913
921
  //#region src/profile.d.ts
914
922
  declare const DEFAULT_FACTORY_REPOSITORY = "unknown/unknown";
915
923
  /** The one profile shape this build accepts (ADR 0023, #318, #351, #742). */
@@ -1126,6 +1134,27 @@ interface BaseReviewPolicyAuthority {
1126
1134
  repository: CheckoutRepository;
1127
1135
  }) => string;
1128
1136
  }
1137
+ /**
1138
+ * The pull request whose base ref is the authority, as the resolving stage
1139
+ * knows it (#922 Slice B).
1140
+ *
1141
+ * `pr:ready` is handed a PR number and reads the record; `pr:verify` and
1142
+ * `pr:review` run in the authoring checkout and look the PR up from the branch,
1143
+ * which can legitimately find nothing. `isCrossRepository` stays `unknown` for
1144
+ * the reason the reader below states: an unstated fork answer is not a "no".
1145
+ */
1146
+ interface CandidatePullRequestPolicyContext {
1147
+ baseRefName: string;
1148
+ isCrossRepository: unknown;
1149
+ }
1150
+ /** What a stage found when it looked for the pull request that owns this branch. */
1151
+ type CandidatePullRequestLookup = {
1152
+ pullRequest: CandidatePullRequestPolicyContext;
1153
+ status: "found";
1154
+ } | {
1155
+ reason: string;
1156
+ status: "unavailable";
1157
+ };
1129
1158
  //#endregion
1130
1159
  //#region src/follow-up.d.ts
1131
1160
  interface FactoryCliInvocation {
@@ -1309,8 +1338,8 @@ declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1309
1338
  generationId: z.ZodNumber;
1310
1339
  headSha: z.ZodString;
1311
1340
  outcome: z.ZodEnum<{
1312
- stale: "stale";
1313
1341
  active: "active";
1342
+ stale: "stale";
1314
1343
  }>;
1315
1344
  reason: z.ZodString;
1316
1345
  recordedAt: z.ZodISODateTime;
@@ -1472,9 +1501,9 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1472
1501
  mergeable: z.ZodString;
1473
1502
  requiredChecks: z.ZodEnum<{
1474
1503
  unknown: "unknown";
1504
+ pending: "pending";
1475
1505
  passed: "passed";
1476
1506
  failed: "failed";
1477
- pending: "pending";
1478
1507
  none: "none";
1479
1508
  }>;
1480
1509
  reviewDecision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1540,8 +1569,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1540
1569
  "run-interior-cycle": "run-interior-cycle";
1541
1570
  }>;
1542
1571
  stage: z.ZodEnum<{
1543
- gate: "gate";
1544
1572
  interior: "interior";
1573
+ gate: "gate";
1545
1574
  "interior-complete": "interior-complete";
1546
1575
  }>;
1547
1576
  }, z.core.$strip>>;
@@ -1557,10 +1586,10 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1557
1586
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1558
1587
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1559
1588
  status: z.ZodEnum<{
1560
- blocked: "blocked";
1589
+ stale: "stale";
1561
1590
  "not-required": "not-required";
1591
+ blocked: "blocked";
1562
1592
  current: "current";
1563
- stale: "stale";
1564
1593
  missing: "missing";
1565
1594
  }>;
1566
1595
  }, z.core.$strip>;
@@ -1569,10 +1598,10 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1569
1598
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1570
1599
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1571
1600
  status: z.ZodEnum<{
1572
- blocked: "blocked";
1601
+ stale: "stale";
1573
1602
  "not-required": "not-required";
1603
+ blocked: "blocked";
1574
1604
  current: "current";
1575
- stale: "stale";
1576
1605
  missing: "missing";
1577
1606
  }>;
1578
1607
  }, z.core.$strip>>;
@@ -1606,7 +1635,7 @@ type ReadinessStatus = "ready" | "blocked";
1606
1635
  type ManagedReadinessLedger = z.infer<typeof managedReadinessLedgerSchema>;
1607
1636
  declare function validateManagedReadinessLedger(value: unknown): ManagedReadinessLedger;
1608
1637
  declare namespace status_check_rollup_d_exports {
1609
- export { CheckState, HOSTED_VERIFY_CHECK_NAME, StatusCheckRollup, hostedVerifyCheckState, isFactoryReadyCheck, isHostedVerifyCheck, statusCheckState };
1638
+ export { CheckState, HOSTED_VERIFY_CHECK_NAME, StatusCheckRollup, hostedVerifyCheckState, isFactoryReadyCheck, isHostedVerifyCheck, pendingCheckNames, statusCheckState };
1610
1639
  }
1611
1640
  type CheckState = "passed" | "failed" | "pending" | "none" | "unknown";
1612
1641
  interface StatusCheckRollup {
@@ -1653,8 +1682,23 @@ declare const isHostedVerifyCheck: (check: StatusCheckRollup) => boolean;
1653
1682
  * nothing else in the rollup would have said so.
1654
1683
  */
1655
1684
  declare const hostedVerifyCheckState: (rollup: StatusCheckRollup[] | undefined) => CheckState;
1685
+ /**
1686
+ * The names of the runs `statusCheckState` would count as pending, in the
1687
+ * order the rollup reports them.
1688
+ *
1689
+ * Same reader, same collapsing of superseded generations — this only says
1690
+ * *which* runs hold the head open, so a caller that waits on them can name
1691
+ * them. A run with no context and no name is reported as `unnamed check`
1692
+ * rather than dropped: a wait must not look settled because one row was
1693
+ * unprintable.
1694
+ */
1695
+ declare const pendingCheckNames: (rollup: StatusCheckRollup[] | undefined, exclude?: (check: StatusCheckRollup) => boolean) => string[];
1656
1696
  declare const statusCheckState: (rollup: StatusCheckRollup[] | undefined, exclude?: (check: StatusCheckRollup) => boolean) => CheckState;
1657
1697
  //#endregion
1698
+ //#region src/github-client.d.ts
1699
+ /** Read a branch tip from GitHub rather than a checkout's cached remote ref. */
1700
+ declare const fetchGitHubBranchTipSha: (repository: CheckoutRepository, branch: string, cwd: string) => string;
1701
+ //#endregion
1658
1702
  //#region src/github-app-client.d.ts
1659
1703
  interface FactoryAppRequest {
1660
1704
  body?: unknown;
@@ -1772,6 +1816,16 @@ interface PrVerifyProof {
1772
1816
  notRequiredCommands?: PrVerifyNotRequiredCommand[];
1773
1817
  outcome?: "aborted" | "passed";
1774
1818
  patchId?: string;
1819
+ /**
1820
+ * The review policy identity this verification run resolved (#922 Slice B).
1821
+ *
1822
+ * Verification demands no review mode of its own. It records the identity so
1823
+ * `pr:ready` can see whether the stage that produced this proof judged the
1824
+ * candidate under the same policy readiness resolves. Optional, and normally
1825
+ * `unresolved` on the first run of a branch: a candidate is verified before
1826
+ * it has a pull request, and there is no authority to read without one.
1827
+ */
1828
+ policyResolution?: PolicyResolution;
1775
1829
  profilePath: string;
1776
1830
  projectKey: string;
1777
1831
  repository: string;
@@ -2051,6 +2105,8 @@ interface FailedPreviewSnapshot {
2051
2105
  readonly name: string;
2052
2106
  }
2053
2107
  interface FactoryPrStatusSources {
2108
+ /** Live PR base ref name observed with the sources. Identity, not a SHA. */
2109
+ readonly baseRefName?: string;
2054
2110
  readonly baseSha: string;
2055
2111
  readonly checks: Readonly<Partial<Record<FactoryPrStatusCheckName, CompletedFactoryCheckSnapshot>>>;
2056
2112
  readonly previewFailures?: Readonly<Partial<Record<string, FailedPreviewSnapshot>>>;
@@ -2086,9 +2142,14 @@ interface PresentFactoryPrStatusHudDependencies {
2086
2142
  previewTargets?: readonly string[];
2087
2143
  repo: string;
2088
2144
  }) => Promise<FactoryPrStatusSources>;
2089
- /** Recheck both PR endpoints immediately before mutating the sticky HUD. */
2145
+ /**
2146
+ * Recheck the pulls identity immediately before mutating the sticky HUD.
2147
+ * Happy path reads `/pulls/:n` only; git-ref is fetched to decorate a
2148
+ * head-moved error, not as a second identity endpoint.
2149
+ */
2090
2150
  readonly assertCurrentIdentity: (input: {
2091
- baseSha: string;
2151
+ baseRefName?: string; /** Retained for rendering/callers; identity compares base ref name. */
2152
+ baseSha?: string;
2092
2153
  headSha: string;
2093
2154
  owner: string;
2094
2155
  pr: number;
@@ -2099,10 +2160,11 @@ interface PresentFactoryPrStatusHudDependencies {
2099
2160
  interface ReadFactoryPrStatusSourcesInput {
2100
2161
  readonly headSha: string;
2101
2162
  /**
2102
- * Read token for `previewProofInventory.list`. The list walks the
2103
- * force-push timeline, which needs commit (contents) read; the Factory App
2104
- * token has no contents permission, so pass a workflow `GITHUB_TOKEN`
2105
- * (#825). Falls back to `token`.
2163
+ * Contents-read token for `previewProofInventory.list` and the live
2164
+ * `git/ref/heads/<base>` tip. Both need `contents: read`; the Factory App
2165
+ * token has none, so pass a workflow `GITHUB_TOKEN` (#825, #908). The
2166
+ * inventory list falls back to `token`. The base tip has no HTTP fallback:
2167
+ * without this token it is read through `gh`.
2106
2168
  */
2107
2169
  readonly inventoryToken?: string;
2108
2170
  readonly owner: string;
@@ -2118,6 +2180,11 @@ interface ReadFactoryPrStatusSourcesInput {
2118
2180
  }
2119
2181
  interface ReadFactoryPrStatusSourcesDependencies {
2120
2182
  readonly fetch?: typeof fetch;
2183
+ /**
2184
+ * Local base-tip reader used when no `inventoryToken` exists. Defaults to
2185
+ * the `gh`-backed reader `pr:ready` already uses.
2186
+ */
2187
+ readonly fetchBranchTipSha?: typeof fetchGitHubBranchTipSha;
2121
2188
  readonly listPreviewRegistrations?: (input: {
2122
2189
  owner: string;
2123
2190
  pr: number;
@@ -2129,7 +2196,8 @@ interface ReadFactoryPrStatusSourcesDependencies {
2129
2196
  declare function renderFactoryPrStatusHud(input: RenderFactoryPrStatusHudInput): string;
2130
2197
  declare function presentFactoryPrStatusHud(input: PresentFactoryPrStatusHudInput, dependencies: PresentFactoryPrStatusHudDependencies): Promise<UpsertFactoryPrStatusCommentResult>;
2131
2198
  declare function assertFactoryPrStatusIdentity(input: ReadFactoryPrStatusSourcesInput & {
2132
- readonly baseSha: string;
2199
+ readonly baseRefName?: string; /** Retained for rendering/callers; identity compares base ref name. */
2200
+ readonly baseSha?: string;
2133
2201
  }, dependencies?: ReadFactoryPrStatusSourcesDependencies): Promise<void>;
2134
2202
  declare function readFactoryPrStatusSources(input: ReadFactoryPrStatusSourcesInput, dependencies?: ReadFactoryPrStatusSourcesDependencies): Promise<FactoryPrStatusSources>;
2135
2203
  interface PlanFactoryPrStatusHudInput {
@@ -2149,6 +2217,11 @@ declare function planFactoryPrStatusHud(input: PlanFactoryPrStatusHudInput): Pre
2149
2217
  interface RefreshFactoryPrStatusHudInput {
2150
2218
  readonly cwd: string;
2151
2219
  readonly headSha: string;
2220
+ /**
2221
+ * Workflow `GITHUB_TOKEN` with `contents: read` for the live git-ref and
2222
+ * preview inventory. The Factory App token cannot read those (#825, #908).
2223
+ */
2224
+ readonly inventoryToken?: string;
2152
2225
  readonly mergeBaseSha?: string;
2153
2226
  readonly owner: string;
2154
2227
  readonly patchId?: string;
@@ -2357,6 +2430,12 @@ interface PrReadyGitDependencies {
2357
2430
  canResolveCommit: (cwd: string, sha: string) => boolean;
2358
2431
  changedFiles: (cwd: string, base: string, headSha?: string) => string[];
2359
2432
  checkoutRepository: (cwd: string) => CheckoutRepository;
2433
+ /**
2434
+ * Bring `refs/heads/<baseRefName>` into the checkout so the live tip
2435
+ * `pr.baseRefOid` can resolve. Optional so fixtures that already resolve
2436
+ * every SHA can omit it.
2437
+ */
2438
+ fetchOriginRef?: (cwd: string, refName: string) => void;
2360
2439
  currentHeadSha: (cwd: string) => string;
2361
2440
  mergeBaseSha: (cwd: string, base: string) => string;
2362
2441
  objectIdAtRef: (cwd: string, ref: string, absolutePath: string) => string | undefined;
@@ -2399,8 +2478,8 @@ declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
2399
2478
  producer: z.ZodString;
2400
2479
  requestId: z.ZodOptional<z.ZodString>;
2401
2480
  rung: z.ZodOptional<z.ZodEnum<{
2402
- "independent-model": "independent-model";
2403
2481
  oracle: "oracle";
2482
+ "independent-model": "independent-model";
2404
2483
  human: "human";
2405
2484
  }>>;
2406
2485
  schemaVersion: z.ZodLiteral<1>;
@@ -2426,8 +2505,8 @@ declare const evidenceEnvelopeSchema: z.ZodObject<{
2426
2505
  producer: z.ZodString;
2427
2506
  requestId: z.ZodOptional<z.ZodString>;
2428
2507
  rung: z.ZodOptional<z.ZodEnum<{
2429
- "independent-model": "independent-model";
2430
2508
  oracle: "oracle";
2509
+ "independent-model": "independent-model";
2431
2510
  human: "human";
2432
2511
  }>>;
2433
2512
  schemaVersion: z.ZodLiteral<1>;
@@ -2529,10 +2608,10 @@ declare const loadEvidenceEnvelopes: (cwd: string) => LoadedEvidenceEnvelope[];
2529
2608
  //#region src/review-proof-applicability.d.ts
2530
2609
  declare const REVIEW_STATUS_VALUES: readonly ["not-required", "current", "stale", "missing", "blocked"];
2531
2610
  declare const reviewStatusSchema: z.ZodEnum<{
2532
- blocked: "blocked";
2611
+ stale: "stale";
2533
2612
  "not-required": "not-required";
2613
+ blocked: "blocked";
2534
2614
  current: "current";
2535
- stale: "stale";
2536
2615
  missing: "missing";
2537
2616
  }>;
2538
2617
  type ReviewStatus = z.infer<typeof reviewStatusSchema>;
@@ -2647,8 +2726,8 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
2647
2726
  wave: z.ZodString;
2648
2727
  }, z.core.$strip>>;
2649
2728
  demandedRung: z.ZodOptional<z.ZodEnum<{
2650
- "independent-model": "independent-model";
2651
2729
  oracle: "oracle";
2730
+ "independent-model": "independent-model";
2652
2731
  human: "human";
2653
2732
  }>>;
2654
2733
  epicIssue: z.ZodNumber;
@@ -2663,8 +2742,8 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
2663
2742
  commentUrl: z.ZodOptional<z.ZodString>;
2664
2743
  producer: z.ZodString;
2665
2744
  rung: z.ZodEnum<{
2666
- "independent-model": "independent-model";
2667
2745
  oracle: "oracle";
2746
+ "independent-model": "independent-model";
2668
2747
  human: "human";
2669
2748
  }>;
2670
2749
  sessionId: z.ZodOptional<z.ZodString>;
@@ -2692,6 +2771,22 @@ interface BoundaryCheckGithub {
2692
2771
  fetchIssueComments: (repo: string, issue: number) => GithubIssueComment[];
2693
2772
  fetchClosingPullRequests: (repo: string, issue: number) => BoundaryPullRequestRef[];
2694
2773
  fetchPullRequest?: (repo: string, pr: number) => BoundaryPullRequestRef;
2774
+ /**
2775
+ * Child issue state for the close-gate (#901). Required so a stub cannot
2776
+ * skip the gate and look like a pass.
2777
+ */
2778
+ fetchIssueState: (repo: string, issue: number) => "OPEN" | "CLOSED";
2779
+ /**
2780
+ * PRs whose bodies may contribute closing-keyword membership (#901). For
2781
+ * `each-to-epic`, production lists PRs targeting the integration branch.
2782
+ * Branch targeting never joins; only a keyword naming a declared child does.
2783
+ * Required so omitting the channel cannot silently drop it.
2784
+ */
2785
+ listCandidatePullRequests: (repo: string, input: {
2786
+ integrationBranch?: string;
2787
+ }) => (BoundaryPullRequestRef & {
2788
+ body?: string;
2789
+ })[];
2695
2790
  }
2696
2791
  interface BoundaryCheckArgs {
2697
2792
  cwd?: string;
@@ -2711,6 +2806,7 @@ interface BoundaryCheckArgs {
2711
2806
  interface BoundaryCheckDependencies {
2712
2807
  github?: BoundaryCheckGithub;
2713
2808
  hq?: HqIngestDependencies;
2809
+ readWaivers?: (cwd: string) => DemandWaiver[];
2714
2810
  resolveRepo?: (cwd: string) => string;
2715
2811
  }
2716
2812
  declare function runBoundaryCheck(args: BoundaryCheckArgs, dependencies?: BoundaryCheckDependencies): BoundaryCheckProofRecord;
@@ -2807,6 +2903,7 @@ interface PrReviewArgs extends LoadProjectProfileInput {
2807
2903
  cycle: number;
2808
2904
  dispositions?: string;
2809
2905
  findings?: string;
2906
+ historical?: boolean;
2810
2907
  issue?: number;
2811
2908
  mode: PrReviewMode;
2812
2909
  output?: string;
@@ -2814,12 +2911,15 @@ interface PrReviewArgs extends LoadProjectProfileInput {
2814
2911
  }
2815
2912
  interface PrReviewGitDependencies {
2816
2913
  changedFiles: (cwd: string, base: string) => string[];
2914
+ checkoutRepository?: (cwd: string) => CheckoutRepository;
2817
2915
  currentHeadSha: (cwd: string) => string;
2916
+ firstParentCommits?: (cwd: string, base: string) => string[];
2818
2917
  isAncestor: (cwd: string, ancestor: string, descendant: string) => boolean;
2819
2918
  recognizeCatchUp?: CatchUpRecognizer;
2820
2919
  repositoryRoot?: (cwd: string) => string;
2821
2920
  showFileAtRef?: (cwd: string, ref: string, absolutePath: string) => string | undefined;
2822
2921
  stablePatchId: (cwd: string, base: string) => string;
2922
+ stablePatchIdAtRef?: (cwd: string, base: string, ref: string) => string;
2823
2923
  statusPorcelain: (cwd: string) => string;
2824
2924
  }
2825
2925
  interface PrReviewIssueBodyInput {
@@ -2828,9 +2928,20 @@ interface PrReviewIssueBodyInput {
2828
2928
  repo: string;
2829
2929
  }
2830
2930
  interface PrReviewDependencies {
2931
+ /**
2932
+ * The authoritative base-policy reader (#922). Injectable for the same
2933
+ * reason `pr:ready` injects it: an unstated authority must be a refusal a
2934
+ * test can state, never a silent pass.
2935
+ */
2936
+ basePolicy?: BaseReviewPolicyAuthority;
2831
2937
  fetchIssueBody?: (input: PrReviewIssueBodyInput) => string;
2832
2938
  git?: PrReviewGitDependencies;
2833
2939
  hq?: HqIngestDependencies;
2940
+ /**
2941
+ * How this run finds the pull request whose base ref is the policy authority
2942
+ * (#922 Slice B). Defaults to the GitHub lookup.
2943
+ */
2944
+ lookupPullRequest?: (cwd: string) => CandidatePullRequestLookup;
2834
2945
  }
2835
2946
  declare function runPrReview(args: PrReviewArgs, dependencies?: PrReviewDependencies): Promise<PrReviewProof>;
2836
2947
  //#endregion
@@ -2861,6 +2972,7 @@ interface PrVerifyArgs extends LoadProjectProfileInput {
2861
2972
  }
2862
2973
  interface PrVerifyGitDependencies {
2863
2974
  changedFiles: (cwd: string, base: string) => string[];
2975
+ checkoutRepository?: (cwd: string) => CheckoutRepository;
2864
2976
  currentHeadSha: (cwd: string) => string;
2865
2977
  emptyTreeHash: (cwd: string) => string;
2866
2978
  mergeBaseSha: (cwd: string, base: string) => string;
@@ -2871,7 +2983,19 @@ interface PrVerifyGitDependencies {
2871
2983
  stablePatchId: (cwd: string, base: string) => string;
2872
2984
  }
2873
2985
  interface PrVerifyDependencies {
2986
+ /**
2987
+ * The authoritative base-policy reader (#922). Injectable for the same
2988
+ * reason `pr:ready` injects it: an unstated authority must be a refusal a
2989
+ * test can state, never a silent pass.
2990
+ */
2991
+ basePolicy?: BaseReviewPolicyAuthority;
2874
2992
  cleanInstall?: CleanInstallResolutionDependencies | false;
2993
+ /**
2994
+ * How this run finds the pull request whose base ref is the policy authority
2995
+ * (#922 Slice B). Defaults to the GitHub lookup; a checkout with no pull
2996
+ * request resolves `unavailable`, which is normal before publication.
2997
+ */
2998
+ lookupPullRequest?: (cwd: string) => CandidatePullRequestLookup;
2875
2999
  env?: NodeJS.ProcessEnv;
2876
3000
  git?: PrVerifyGitDependencies;
2877
3001
  hq?: HqIngestDependencies;
@@ -3058,9 +3182,9 @@ interface PrStatusHudArgs {
3058
3182
  readonly cwd: string;
3059
3183
  readonly headSha: string;
3060
3184
  /**
3061
- * Read token for the preview-proof inventory list. The App token cannot
3062
- * read the force-push timeline (no contents permission), so the workflow
3063
- * `GITHUB_TOKEN` serves that read (#825).
3185
+ * Contents-read token for the preview-proof inventory list and the live
3186
+ * git-ref tip. The App token has no contents permission, so the workflow
3187
+ * `GITHUB_TOKEN` serves those reads (#825, #908).
3064
3188
  */
3065
3189
  readonly inventoryToken?: string;
3066
3190
  readonly owner: string;
@@ -3148,11 +3272,11 @@ declare const LegacyWorkerCloseoutStatusTraceEventSchema: z.ZodObject<{
3148
3272
  threadId: z.ZodOptional<z.ZodString>;
3149
3273
  workerId: z.ZodOptional<z.ZodString>;
3150
3274
  archiveStatus: z.ZodOptional<z.ZodEnum<{
3151
- pending: "pending";
3152
3275
  unavailable: "unavailable";
3153
3276
  archived: "archived";
3154
3277
  skipped: "skipped";
3155
3278
  "not-applicable": "not-applicable";
3279
+ pending: "pending";
3156
3280
  }>>;
3157
3281
  closeoutReason: z.ZodOptional<z.ZodString>;
3158
3282
  eventType: z.ZodLiteral<"worker-closeout-lessons">;
@@ -3325,8 +3449,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3325
3449
  sessionId: z.ZodOptional<z.ZodString>;
3326
3450
  }, z.core.$strict>>;
3327
3451
  stage: z.ZodEnum<{
3328
- gate: "gate";
3329
3452
  interior: "interior";
3453
+ gate: "gate";
3330
3454
  }>;
3331
3455
  usage: z.ZodOptional<z.ZodObject<{
3332
3456
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -3378,8 +3502,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3378
3502
  sessionId: z.ZodOptional<z.ZodString>;
3379
3503
  }, z.core.$strict>>;
3380
3504
  stage: z.ZodEnum<{
3381
- gate: "gate";
3382
3505
  interior: "interior";
3506
+ gate: "gate";
3383
3507
  }>;
3384
3508
  usage: z.ZodOptional<z.ZodObject<{
3385
3509
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -3422,8 +3546,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3422
3546
  sessionId: z.ZodOptional<z.ZodString>;
3423
3547
  }, z.core.$strict>>;
3424
3548
  stage: z.ZodEnum<{
3425
- gate: "gate";
3426
3549
  interior: "interior";
3550
+ gate: "gate";
3427
3551
  }>;
3428
3552
  usage: z.ZodOptional<z.ZodObject<{
3429
3553
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -3453,7 +3577,7 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3453
3577
  staleRepeats: number;
3454
3578
  };
3455
3579
  observedAt: string;
3456
- stage: "gate" | "interior";
3580
+ stage: "interior" | "gate";
3457
3581
  issue?: number | undefined;
3458
3582
  pr?: number | undefined;
3459
3583
  threadId?: string | undefined;
@@ -3546,11 +3670,11 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3546
3670
  threadId: z.ZodOptional<z.ZodString>;
3547
3671
  workerId: z.ZodOptional<z.ZodString>;
3548
3672
  archiveStatus: z.ZodOptional<z.ZodEnum<{
3549
- pending: "pending";
3550
3673
  unavailable: "unavailable";
3551
3674
  archived: "archived";
3552
3675
  skipped: "skipped";
3553
3676
  "not-applicable": "not-applicable";
3677
+ pending: "pending";
3554
3678
  }>>;
3555
3679
  closeoutReason: z.ZodOptional<z.ZodString>;
3556
3680
  eventType: z.ZodLiteral<"worker-closeout-lessons">;
@@ -3587,11 +3711,11 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3587
3711
  }, z.core.$strict>], "lessonStatus">;
3588
3712
  readonly 2: z.ZodObject<{
3589
3713
  archiveStatus: z.ZodOptional<z.ZodEnum<{
3590
- pending: "pending";
3591
3714
  unavailable: "unavailable";
3592
3715
  archived: "archived";
3593
3716
  skipped: "skipped";
3594
3717
  "not-applicable": "not-applicable";
3718
+ pending: "pending";
3595
3719
  }>>;
3596
3720
  closeoutReason: z.ZodOptional<z.ZodString>;
3597
3721
  lessonStatus: z.ZodOptional<z.ZodEnum<{
@@ -3729,8 +3853,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3729
3853
  model: z.ZodString;
3730
3854
  tier: z.ZodEnum<{
3731
3855
  review: "review";
3732
- oracle: "oracle";
3733
3856
  delegate: "delegate";
3857
+ oracle: "oracle";
3734
3858
  workhorse: "workhorse";
3735
3859
  scout: "scout";
3736
3860
  }>;
@@ -3738,8 +3862,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3738
3862
  startedAt: z.ZodString;
3739
3863
  tier: z.ZodEnum<{
3740
3864
  review: "review";
3741
- oracle: "oracle";
3742
3865
  delegate: "delegate";
3866
+ oracle: "oracle";
3743
3867
  workhorse: "workhorse";
3744
3868
  scout: "scout";
3745
3869
  }>;
@@ -3808,8 +3932,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3808
3932
  model: z.ZodString;
3809
3933
  tier: z.ZodEnum<{
3810
3934
  review: "review";
3811
- oracle: "oracle";
3812
3935
  delegate: "delegate";
3936
+ oracle: "oracle";
3813
3937
  workhorse: "workhorse";
3814
3938
  scout: "scout";
3815
3939
  }>;
@@ -3817,8 +3941,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3817
3941
  startedAt: z.ZodString;
3818
3942
  tier: z.ZodEnum<{
3819
3943
  review: "review";
3820
- oracle: "oracle";
3821
3944
  delegate: "delegate";
3945
+ oracle: "oracle";
3822
3946
  workhorse: "workhorse";
3823
3947
  scout: "scout";
3824
3948
  }>;
@@ -3878,8 +4002,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3878
4002
  model: z.ZodString;
3879
4003
  tier: z.ZodEnum<{
3880
4004
  review: "review";
3881
- oracle: "oracle";
3882
4005
  delegate: "delegate";
4006
+ oracle: "oracle";
3883
4007
  workhorse: "workhorse";
3884
4008
  scout: "scout";
3885
4009
  }>;
@@ -3887,8 +4011,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3887
4011
  startedAt: z.ZodString;
3888
4012
  tier: z.ZodEnum<{
3889
4013
  review: "review";
3890
- oracle: "oracle";
3891
4014
  delegate: "delegate";
4015
+ oracle: "oracle";
3892
4016
  workhorse: "workhorse";
3893
4017
  scout: "scout";
3894
4018
  }>;
@@ -3937,11 +4061,11 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3937
4061
  engine: string;
3938
4062
  layerSource: "committedDefault" | "operatorSession" | "userConfig";
3939
4063
  model: string;
3940
- tier: "review" | "oracle" | "delegate" | "workhorse" | "scout";
4064
+ tier: "review" | "delegate" | "oracle" | "workhorse" | "scout";
3941
4065
  fallbackTier?: "delegate" | undefined;
3942
4066
  };
3943
4067
  startedAt: string;
3944
- tier: "review" | "oracle" | "delegate" | "workhorse" | "scout";
4068
+ tier: "review" | "delegate" | "oracle" | "workhorse" | "scout";
3945
4069
  tokenUsage: {
3946
4070
  source: "cursor-csv" | "codex-json" | "cursor-json" | "claude-json";
3947
4071
  status: "available";
@@ -4233,6 +4357,13 @@ interface EvaluationInput {
4233
4357
  mergeStateStatus: string;
4234
4358
  ladderPolicy?: ReviewLadderPolicy;
4235
4359
  reviewModes?: PrReviewKind[];
4360
+ /**
4361
+ * Cross-stage policy-identity refusals resolved at the command boundary
4362
+ * (#922 Slice B), already worded. Evaluation only decides whether they are
4363
+ * in force: a recognized catch-up withdraws every review demand, so it
4364
+ * withdraws these with them.
4365
+ */
4366
+ policyIdentityRefusals?: string[];
4236
4367
  reviewProof?: PrReviewProof;
4237
4368
  verificationProof?: VerificationProofState;
4238
4369
  docsOnlyVerifyBaselineHeadShas?: string[];
@@ -4263,7 +4394,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4263
4394
  draft: boolean;
4264
4395
  mergeStateStatus: string;
4265
4396
  mergeable: string;
4266
- requiredChecks: "unknown" | "passed" | "failed" | "pending" | "none";
4397
+ requiredChecks: "unknown" | "pending" | "passed" | "failed" | "none";
4267
4398
  unresolvedReviewThreads: number;
4268
4399
  reviewDecision?: string | null | undefined;
4269
4400
  };
@@ -4278,13 +4409,13 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4278
4409
  reviews: {
4279
4410
  correctness: {
4280
4411
  required: boolean;
4281
- status: "blocked" | "not-required" | "current" | "stale" | "missing";
4412
+ status: "stale" | "not-required" | "blocked" | "current" | "missing";
4282
4413
  reviewedHeadSha?: string | undefined;
4283
4414
  reviewedPatchId?: string | undefined;
4284
4415
  };
4285
4416
  security?: {
4286
4417
  required: boolean;
4287
- status: "blocked" | "not-required" | "current" | "stale" | "missing";
4418
+ status: "stale" | "not-required" | "blocked" | "current" | "missing";
4288
4419
  reviewedHeadSha?: string | undefined;
4289
4420
  reviewedPatchId?: string | undefined;
4290
4421
  } | undefined;
@@ -4347,7 +4478,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4347
4478
  interior: number;
4348
4479
  };
4349
4480
  nextAction: "run-gate-cycle" | "accept-nonblocking-findings" | "escalate-to-triage" | "ready-for-human" | "advance-to-gate" | "run-interior-cycle";
4350
- stage: "gate" | "interior" | "interior-complete";
4481
+ stage: "interior" | "gate" | "interior-complete";
4351
4482
  forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4352
4483
  } | undefined;
4353
4484
  reviewRuns?: PrReviewResult[] | undefined;