@patronage/software-factory 1.0.0-alpha.27 → 1.0.0-alpha.29

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>;
@@ -1360,8 +1360,8 @@ declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1360
1360
  generationId: z.ZodNumber;
1361
1361
  headSha: z.ZodString;
1362
1362
  outcome: z.ZodEnum<{
1363
- stale: "stale";
1364
1363
  active: "active";
1364
+ stale: "stale";
1365
1365
  }>;
1366
1366
  reason: z.ZodString;
1367
1367
  recordedAt: z.ZodISODateTime;
@@ -1523,9 +1523,9 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1523
1523
  mergeable: z.ZodString;
1524
1524
  requiredChecks: z.ZodEnum<{
1525
1525
  unknown: "unknown";
1526
+ pending: "pending";
1526
1527
  passed: "passed";
1527
1528
  failed: "failed";
1528
- pending: "pending";
1529
1529
  none: "none";
1530
1530
  }>;
1531
1531
  reviewDecision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1591,8 +1591,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1591
1591
  "run-interior-cycle": "run-interior-cycle";
1592
1592
  }>;
1593
1593
  stage: z.ZodEnum<{
1594
- gate: "gate";
1595
1594
  interior: "interior";
1595
+ gate: "gate";
1596
1596
  "interior-complete": "interior-complete";
1597
1597
  }>;
1598
1598
  }, z.core.$strip>>;
@@ -1608,10 +1608,10 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1608
1608
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1609
1609
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1610
1610
  status: z.ZodEnum<{
1611
- blocked: "blocked";
1612
1611
  "not-required": "not-required";
1613
- current: "current";
1614
1612
  stale: "stale";
1613
+ blocked: "blocked";
1614
+ current: "current";
1615
1615
  missing: "missing";
1616
1616
  }>;
1617
1617
  }, z.core.$strip>;
@@ -1620,10 +1620,10 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1620
1620
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1621
1621
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1622
1622
  status: z.ZodEnum<{
1623
- blocked: "blocked";
1624
1623
  "not-required": "not-required";
1625
- current: "current";
1626
1624
  stale: "stale";
1625
+ blocked: "blocked";
1626
+ current: "current";
1627
1627
  missing: "missing";
1628
1628
  }>;
1629
1629
  }, z.core.$strip>>;
@@ -1657,7 +1657,7 @@ type ReadinessStatus = "ready" | "blocked";
1657
1657
  type ManagedReadinessLedger = z.infer<typeof managedReadinessLedgerSchema>;
1658
1658
  declare function validateManagedReadinessLedger(value: unknown): ManagedReadinessLedger;
1659
1659
  declare namespace status_check_rollup_d_exports {
1660
- export { CheckState, HOSTED_VERIFY_CHECK_NAME, StatusCheckRollup, hostedVerifyCheckState, isFactoryReadyCheck, isHostedVerifyCheck, pendingCheckNames, statusCheckState };
1660
+ export { CheckState, HOSTED_VERIFY_CHECK_NAME, HOSTED_VERIFY_DRAFT_CHECK_NAME, StatusCheckRollup, hostedVerifyCheckState, isDraftHostedVerifyCheck, isExcludedFromAdmissionChecks, isFactoryReadyCheck, isHostedVerifyCheck, isSupersededHostedVerifyCheck, pendingCheckNames, statusCheckState };
1661
1661
  }
1662
1662
  type CheckState = "passed" | "failed" | "pending" | "none" | "unknown";
1663
1663
  interface StatusCheckRollup {
@@ -1691,6 +1691,39 @@ declare const HOSTED_VERIFY_CHECK_NAME = "verify";
1691
1691
  * would accept exactly the thing the pin rejects.
1692
1692
  */
1693
1693
  declare const isHostedVerifyCheck: (check: StatusCheckRollup) => boolean;
1694
+ /**
1695
+ * The name the hosted summary job takes on a DRAFT head (#1045).
1696
+ *
1697
+ * The workflow renames that job so the pinned `verify` context does not exist
1698
+ * while the candidate is a draft. The generator that emits the workflow owns
1699
+ * the literal; this is the reader's copy of it, and
1700
+ * `software-factory-hq/alchemy/verify-workflow.test.ts` pins the two equal.
1701
+ */
1702
+ declare const HOSTED_VERIFY_DRAFT_CHECK_NAME = "verify (draft)";
1703
+ /**
1704
+ * Is this the draft-head summary run's residue?
1705
+ *
1706
+ * The draft run and the `ready_for_review` run land on the SAME head SHA, and
1707
+ * they post two different contexts — `verify (draft)` and `verify` — which
1708
+ * `effectiveChecks` keys separately and therefore never collapses. The Verify
1709
+ * workflow cancels an in-flight pull-request run when the next one starts, and
1710
+ * `ready_for_review` IS the next one, so undrafting typically cancels the
1711
+ * draft run mid-flight. That leaves a CANCELLED `verify (draft)` row sitting
1712
+ * next to a green `verify` on the admitted head.
1713
+ *
1714
+ * GitHub does not care: the branch ruleset pins `verify` alone. The factory's
1715
+ * own rollup read would: `CANCELLED` is a failed state, so the candidate's
1716
+ * `requiredChecks` would read `failed` forever and no push-free repair could
1717
+ * clear it. The draft run is a superseded generation of the summary job the
1718
+ * `verify` row already answers for, so admission does not judge it.
1719
+ */
1720
+ declare const isDraftHostedVerifyCheck: (check: StatusCheckRollup) => boolean;
1721
+ /**
1722
+ * The rollup rows an admission read must not judge: the factory's own branded
1723
+ * checks (it would be judging itself) and the draft-head summary residue
1724
+ * above.
1725
+ */
1726
+ declare const isExcludedFromAdmissionChecks: (check: StatusCheckRollup) => boolean;
1694
1727
  /**
1695
1728
  * The hosted `verify` gate's state on this head, read by presence (#477).
1696
1729
  *
@@ -1716,6 +1749,25 @@ declare const hostedVerifyCheckState: (rollup: StatusCheckRollup[] | undefined)
1716
1749
  */
1717
1750
  declare const pendingCheckNames: (rollup: StatusCheckRollup[] | undefined, exclude?: (check: StatusCheckRollup) => boolean) => string[];
1718
1751
  declare const statusCheckState: (rollup: StatusCheckRollup[] | undefined, exclude?: (check: StatusCheckRollup) => boolean) => CheckState;
1752
+ /**
1753
+ * Is this a hosted `verify` check run that GitHub started before `cutoffIso`?
1754
+ * (#1045)
1755
+ *
1756
+ * A caller that waits for `verify` on a head it just changed the state of —
1757
+ * `pr:publish` undrafting a candidate — must not accept the run that was
1758
+ * already there. #1034's history is the shape: a draft head carried a `verify`
1759
+ * that had run nothing, the wait saw it as terminal on its first attempt, and
1760
+ * readiness read `passed` about two minutes before the `ready_for_review` run
1761
+ * created its own check runs. The same shape is reachable from any superseded
1762
+ * `verify` generation still on the head.
1763
+ *
1764
+ * Fail CLOSED on an unreadable timestamp: a `verify` row that cannot be shown
1765
+ * to be newer than the cutoff is treated as superseded. The wait is bounded,
1766
+ * so the cost of that refusal is one timeout that falls through to the
1767
+ * caller's existing behaviour; the cost of failing open is the false green
1768
+ * this exists to remove.
1769
+ */
1770
+ declare const isSupersededHostedVerifyCheck: (check: StatusCheckRollup, cutoffIso: string) => boolean;
1719
1771
  //#endregion
1720
1772
  //#region src/github-client.d.ts
1721
1773
  /** Read a branch tip from GitHub rather than a checkout's cached remote ref. */
@@ -1782,6 +1834,33 @@ interface PrVerifyCommandResult {
1782
1834
  name: string;
1783
1835
  scope: "docs-only" | "trivial" | "full";
1784
1836
  }
1837
+ /**
1838
+ * One failing test a verification command reported (#1035).
1839
+ *
1840
+ * The proof keeps the failing test's IDENTITY and its failure CLASS, and
1841
+ * nothing else. That is enough to decide retry-or-fix — a `timeout` under
1842
+ * machine load is a flake, an `assertion` is a real break — without rerunning
1843
+ * the aggregate to read a title off the console.
1844
+ *
1845
+ * It deliberately keeps no raw output tail and no error message body. This
1846
+ * payload is transmitted to HQ ingest, and arbitrary command output can carry
1847
+ * secrets (an echoed environment, a connection string inside a stack frame). A
1848
+ * file path, a test title, and a closed `kind` enum cannot. The cost is the
1849
+ * assertion diff and the stack frames: they help you FIX a failure, and the
1850
+ * operator still reads them from the run's own console output.
1851
+ */
1852
+ interface PrVerifyTestFailure {
1853
+ /** The test file the reporter named, as the reporter wrote it. */
1854
+ file: string;
1855
+ /**
1856
+ * The failure class. `timeout` is the test-timeout error vitest raises at
1857
+ * its own ceiling; `assertion` is a failed expectation; `error` is every
1858
+ * other thrown failure.
1859
+ */
1860
+ kind: "assertion" | "error" | "timeout";
1861
+ /** The full test title, suite names included, as the reporter wrote it. */
1862
+ title: string;
1863
+ }
1785
1864
  interface PrVerifyExecutedCommand {
1786
1865
  command: string;
1787
1866
  counts?: {
@@ -1790,6 +1869,12 @@ interface PrVerifyExecutedCommand {
1790
1869
  };
1791
1870
  durationMs: number;
1792
1871
  exitCode: number;
1872
+ /**
1873
+ * The failing tests this command reported (#1035). Present only when the
1874
+ * command produced parseable failures, so a passing command's record is
1875
+ * byte-identical to the one it wrote before this field existed.
1876
+ */
1877
+ failures?: PrVerifyTestFailure[];
1793
1878
  name: string;
1794
1879
  scope: "docs-only" | "trivial" | "full";
1795
1880
  }
@@ -1864,7 +1949,7 @@ interface PrVerifyProof {
1864
1949
  type PrVerifyBaselineFullProof = NonNullable<PrVerifyProof["baselineFullProofs"]>[number];
1865
1950
  declare function validatePrVerifyProof(value: unknown): PrVerifyProof;
1866
1951
  declare namespace verification_proof_d_exports {
1867
- export { PrVerifyBaselineFullProof, PrVerifyCommandResult, PrVerifyExecutedCommand, PrVerifyNotDemandedRecord, PrVerifyNotRequiredCommand, PrVerifyProof, PrVerifySchemaVersion, ResolvedPrVerifyMode, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, VerificationHeadShas, VerificationProofState, VerifiedHeadShas, prVerifyFullHeadShasForDiff, prVerifyProofHeadShas, readPrVerifyProof, resolveVerifyProofApplicability, trustedCatchUpRecognition, trustedImpactStamp, validatePrVerifyProof, verificationProofApplicabilityFor, verificationProofBlockingReason, verificationProofForReadiness, verificationProofStateFor, verifyProofIdentityMatches, verifyProofPassed };
1952
+ export { PrVerifyBaselineFullProof, PrVerifyCommandResult, PrVerifyExecutedCommand, PrVerifyNotDemandedRecord, PrVerifyNotRequiredCommand, PrVerifyProof, PrVerifySchemaVersion, PrVerifyTestFailure, ResolvedPrVerifyMode, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, VerificationHeadShas, VerificationProofState, VerifiedHeadShas, prVerifyFullHeadShasForDiff, prVerifyProofHeadShas, readPrVerifyProof, resolveVerifyProofApplicability, trustedCatchUpRecognition, trustedImpactStamp, validatePrVerifyProof, verificationProofApplicabilityFor, verificationProofBlockingReason, verificationProofForReadiness, verificationProofStateFor, verifyProofIdentityMatches, verifyProofPassed };
1868
1953
  }
1869
1954
  interface VerifiedHeadShas {
1870
1955
  docsOnlyVerifiedHeadShas: string[];
@@ -2334,6 +2419,14 @@ interface PrReadyProof {
2334
2419
  headSha: string;
2335
2420
  outcome: "armed" | "merged" | "not-armed";
2336
2421
  };
2422
+ /**
2423
+ * The authoring session readiness resolved for the review-independence
2424
+ * cross-check (#1037). Recorded so the branded check can print it beside the
2425
+ * review session, model, and producer the ledger already carries — the four
2426
+ * identities a human weighs at merge time. Additive and optional: proofs
2427
+ * written before it carry no field, so no schema version moves.
2428
+ */
2429
+ authoringSession?: string;
2337
2430
  /**
2338
2431
  * Why this run blocked, one entry per refusing demand (#391): `code` is the
2339
2432
  * demand key from the resolver's vocabulary, `detail` the one-sentence
@@ -2508,8 +2601,8 @@ declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
2508
2601
  producer: z.ZodString;
2509
2602
  requestId: z.ZodOptional<z.ZodString>;
2510
2603
  rung: z.ZodOptional<z.ZodEnum<{
2511
- "independent-model": "independent-model";
2512
2604
  oracle: "oracle";
2605
+ "independent-model": "independent-model";
2513
2606
  human: "human";
2514
2607
  }>>;
2515
2608
  schemaVersion: z.ZodLiteral<1>;
@@ -2535,8 +2628,8 @@ declare const evidenceEnvelopeSchema: z.ZodObject<{
2535
2628
  producer: z.ZodString;
2536
2629
  requestId: z.ZodOptional<z.ZodString>;
2537
2630
  rung: z.ZodOptional<z.ZodEnum<{
2538
- "independent-model": "independent-model";
2539
2631
  oracle: "oracle";
2632
+ "independent-model": "independent-model";
2540
2633
  human: "human";
2541
2634
  }>>;
2542
2635
  schemaVersion: z.ZodLiteral<1>;
@@ -2638,10 +2731,10 @@ declare const loadEvidenceEnvelopes: (cwd: string) => LoadedEvidenceEnvelope[];
2638
2731
  //#region src/review-proof-applicability.d.ts
2639
2732
  declare const REVIEW_STATUS_VALUES: readonly ["not-required", "current", "stale", "missing", "blocked"];
2640
2733
  declare const reviewStatusSchema: z.ZodEnum<{
2641
- blocked: "blocked";
2642
2734
  "not-required": "not-required";
2643
- current: "current";
2644
2735
  stale: "stale";
2736
+ blocked: "blocked";
2737
+ current: "current";
2645
2738
  missing: "missing";
2646
2739
  }>;
2647
2740
  type ReviewStatus = z.infer<typeof reviewStatusSchema>;
@@ -2756,8 +2849,8 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
2756
2849
  wave: z.ZodString;
2757
2850
  }, z.core.$strip>>;
2758
2851
  demandedRung: z.ZodOptional<z.ZodEnum<{
2759
- "independent-model": "independent-model";
2760
2852
  oracle: "oracle";
2853
+ "independent-model": "independent-model";
2761
2854
  human: "human";
2762
2855
  }>>;
2763
2856
  epicIssue: z.ZodNumber;
@@ -2772,8 +2865,8 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
2772
2865
  commentUrl: z.ZodOptional<z.ZodString>;
2773
2866
  producer: z.ZodString;
2774
2867
  rung: z.ZodEnum<{
2775
- "independent-model": "independent-model";
2776
2868
  oracle: "oracle";
2869
+ "independent-model": "independent-model";
2777
2870
  human: "human";
2778
2871
  }>;
2779
2872
  sessionId: z.ZodOptional<z.ZodString>;
@@ -2789,8 +2882,8 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
2789
2882
  value: z.ZodString;
2790
2883
  }, z.core.$strip>>;
2791
2884
  status: z.ZodEnum<{
2792
- blocked: "blocked";
2793
2885
  ready: "ready";
2886
+ blocked: "blocked";
2794
2887
  }>;
2795
2888
  }, z.core.$strip>;
2796
2889
  type BoundaryCheckProofRecord = z.infer<typeof boundaryCheckProofSchema>;
@@ -2931,6 +3024,13 @@ interface PrReviewArgs extends LoadProjectProfileInput {
2931
3024
  assemble?: boolean;
2932
3025
  base: string;
2933
3026
  cycle: number;
3027
+ /**
3028
+ * Issue carrying the factory-boundary manifest, which may be the work issue
3029
+ * itself. `--assemble` uses it to name the review rung the candidate's wave
3030
+ * demands, so the prompt asks for the findings schema the gate accepts
3031
+ * (#1001). It is the same handle `pr:publish` and `pr:ready` take.
3032
+ */
3033
+ epic?: number;
2934
3034
  dispositions?: string;
2935
3035
  findings?: string;
2936
3036
  historical?: boolean;
@@ -2964,7 +3064,22 @@ interface PrReviewDependencies {
2964
3064
  * test can state, never a silent pass.
2965
3065
  */
2966
3066
  basePolicy?: BaseReviewPolicyAuthority;
3067
+ /**
3068
+ * How the wave resolver reads an issue's closing pull requests (#1001).
3069
+ * Injected for the same reason `fetchIssueBody` is: the wave demand must be
3070
+ * statable in a test without a live repository.
3071
+ */
3072
+ fetchClosingPullRequests?: (input: PrReviewIssueBodyInput) => {
3073
+ number: number;
3074
+ state?: "OPEN" | "CLOSED" | "MERGED";
3075
+ }[];
2967
3076
  fetchIssueBody?: (input: PrReviewIssueBodyInput) => string;
3077
+ /**
3078
+ * How `--assemble` reads the pull request whose wave demand names the review
3079
+ * rung (#1001). Defaults to the GitHub lookup, and its result is validated
3080
+ * before use, so an injected stub is held to the same shape.
3081
+ */
3082
+ fetchWavePullRequest?: (cwd: string) => unknown;
2968
3083
  git?: PrReviewGitDependencies;
2969
3084
  hq?: HqIngestDependencies;
2970
3085
  /**
@@ -2992,6 +3107,8 @@ interface VerificationCommandOutcome {
2992
3107
  };
2993
3108
  durationMs: number;
2994
3109
  exitCode: number;
3110
+ /** The failing tests scraped from this command's output (#1035). */
3111
+ failures?: PrVerifyTestFailure[];
2995
3112
  }
2996
3113
  interface PrVerifyArgs extends LoadProjectProfileInput {
2997
3114
  authoringSession?: string;
@@ -3128,6 +3245,12 @@ interface PrPublishDependencies extends PrReadyDependencies {
3128
3245
  cwd: string;
3129
3246
  }) => Promise<HqFlushResult>;
3130
3247
  runPrVerify?: (args: PrVerifyArgs) => Promise<PrVerifyProof>;
3248
+ /**
3249
+ * Injectable clock for the promotion instant the hosted-run await measures
3250
+ * `verify` staleness against (#1045; tests only — production reads the real
3251
+ * clock).
3252
+ */
3253
+ now?: () => Date;
3131
3254
  /**
3132
3255
  * Injectable delay for the bounded hosted-run await (#348; tests only —
3133
3256
  * production always waits the real interval).
@@ -3302,11 +3425,11 @@ declare const LegacyWorkerCloseoutStatusTraceEventSchema: z.ZodObject<{
3302
3425
  threadId: z.ZodOptional<z.ZodString>;
3303
3426
  workerId: z.ZodOptional<z.ZodString>;
3304
3427
  archiveStatus: z.ZodOptional<z.ZodEnum<{
3305
- pending: "pending";
3306
3428
  unavailable: "unavailable";
3307
3429
  archived: "archived";
3308
3430
  skipped: "skipped";
3309
3431
  "not-applicable": "not-applicable";
3432
+ pending: "pending";
3310
3433
  }>>;
3311
3434
  closeoutReason: z.ZodOptional<z.ZodString>;
3312
3435
  eventType: z.ZodLiteral<"worker-closeout-lessons">;
@@ -3479,8 +3602,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3479
3602
  sessionId: z.ZodOptional<z.ZodString>;
3480
3603
  }, z.core.$strict>>;
3481
3604
  stage: z.ZodEnum<{
3482
- gate: "gate";
3483
3605
  interior: "interior";
3606
+ gate: "gate";
3484
3607
  }>;
3485
3608
  usage: z.ZodOptional<z.ZodObject<{
3486
3609
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -3532,8 +3655,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3532
3655
  sessionId: z.ZodOptional<z.ZodString>;
3533
3656
  }, z.core.$strict>>;
3534
3657
  stage: z.ZodEnum<{
3535
- gate: "gate";
3536
3658
  interior: "interior";
3659
+ gate: "gate";
3537
3660
  }>;
3538
3661
  usage: z.ZodOptional<z.ZodObject<{
3539
3662
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -3576,8 +3699,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3576
3699
  sessionId: z.ZodOptional<z.ZodString>;
3577
3700
  }, z.core.$strict>>;
3578
3701
  stage: z.ZodEnum<{
3579
- gate: "gate";
3580
3702
  interior: "interior";
3703
+ gate: "gate";
3581
3704
  }>;
3582
3705
  usage: z.ZodOptional<z.ZodObject<{
3583
3706
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -3607,7 +3730,7 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3607
3730
  staleRepeats: number;
3608
3731
  };
3609
3732
  observedAt: string;
3610
- stage: "gate" | "interior";
3733
+ stage: "interior" | "gate";
3611
3734
  issue?: number | undefined;
3612
3735
  pr?: number | undefined;
3613
3736
  threadId?: string | undefined;
@@ -3700,11 +3823,11 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3700
3823
  threadId: z.ZodOptional<z.ZodString>;
3701
3824
  workerId: z.ZodOptional<z.ZodString>;
3702
3825
  archiveStatus: z.ZodOptional<z.ZodEnum<{
3703
- pending: "pending";
3704
3826
  unavailable: "unavailable";
3705
3827
  archived: "archived";
3706
3828
  skipped: "skipped";
3707
3829
  "not-applicable": "not-applicable";
3830
+ pending: "pending";
3708
3831
  }>>;
3709
3832
  closeoutReason: z.ZodOptional<z.ZodString>;
3710
3833
  eventType: z.ZodLiteral<"worker-closeout-lessons">;
@@ -3741,11 +3864,11 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3741
3864
  }, z.core.$strict>], "lessonStatus">;
3742
3865
  readonly 2: z.ZodObject<{
3743
3866
  archiveStatus: z.ZodOptional<z.ZodEnum<{
3744
- pending: "pending";
3745
3867
  unavailable: "unavailable";
3746
3868
  archived: "archived";
3747
3869
  skipped: "skipped";
3748
3870
  "not-applicable": "not-applicable";
3871
+ pending: "pending";
3749
3872
  }>>;
3750
3873
  closeoutReason: z.ZodOptional<z.ZodString>;
3751
3874
  lessonStatus: z.ZodOptional<z.ZodEnum<{
@@ -3883,8 +4006,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3883
4006
  model: z.ZodString;
3884
4007
  tier: z.ZodEnum<{
3885
4008
  review: "review";
3886
- oracle: "oracle";
3887
4009
  delegate: "delegate";
4010
+ oracle: "oracle";
3888
4011
  workhorse: "workhorse";
3889
4012
  scout: "scout";
3890
4013
  }>;
@@ -3892,8 +4015,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3892
4015
  startedAt: z.ZodString;
3893
4016
  tier: z.ZodEnum<{
3894
4017
  review: "review";
3895
- oracle: "oracle";
3896
4018
  delegate: "delegate";
4019
+ oracle: "oracle";
3897
4020
  workhorse: "workhorse";
3898
4021
  scout: "scout";
3899
4022
  }>;
@@ -3962,8 +4085,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3962
4085
  model: z.ZodString;
3963
4086
  tier: z.ZodEnum<{
3964
4087
  review: "review";
3965
- oracle: "oracle";
3966
4088
  delegate: "delegate";
4089
+ oracle: "oracle";
3967
4090
  workhorse: "workhorse";
3968
4091
  scout: "scout";
3969
4092
  }>;
@@ -3971,8 +4094,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3971
4094
  startedAt: z.ZodString;
3972
4095
  tier: z.ZodEnum<{
3973
4096
  review: "review";
3974
- oracle: "oracle";
3975
4097
  delegate: "delegate";
4098
+ oracle: "oracle";
3976
4099
  workhorse: "workhorse";
3977
4100
  scout: "scout";
3978
4101
  }>;
@@ -4032,8 +4155,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4032
4155
  model: z.ZodString;
4033
4156
  tier: z.ZodEnum<{
4034
4157
  review: "review";
4035
- oracle: "oracle";
4036
4158
  delegate: "delegate";
4159
+ oracle: "oracle";
4037
4160
  workhorse: "workhorse";
4038
4161
  scout: "scout";
4039
4162
  }>;
@@ -4041,8 +4164,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4041
4164
  startedAt: z.ZodString;
4042
4165
  tier: z.ZodEnum<{
4043
4166
  review: "review";
4044
- oracle: "oracle";
4045
4167
  delegate: "delegate";
4168
+ oracle: "oracle";
4046
4169
  workhorse: "workhorse";
4047
4170
  scout: "scout";
4048
4171
  }>;
@@ -4091,11 +4214,11 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4091
4214
  engine: string;
4092
4215
  layerSource: "committedDefault" | "operatorSession" | "userConfig";
4093
4216
  model: string;
4094
- tier: "review" | "oracle" | "delegate" | "workhorse" | "scout";
4217
+ tier: "review" | "delegate" | "oracle" | "workhorse" | "scout";
4095
4218
  fallbackTier?: "delegate" | undefined;
4096
4219
  };
4097
4220
  startedAt: string;
4098
- tier: "review" | "oracle" | "delegate" | "workhorse" | "scout";
4221
+ tier: "review" | "delegate" | "oracle" | "workhorse" | "scout";
4099
4222
  tokenUsage: {
4100
4223
  source: "cursor-csv" | "codex-json" | "cursor-json" | "claude-json";
4101
4224
  status: "available";
@@ -4424,7 +4547,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4424
4547
  draft: boolean;
4425
4548
  mergeStateStatus: string;
4426
4549
  mergeable: string;
4427
- requiredChecks: "unknown" | "passed" | "failed" | "pending" | "none";
4550
+ requiredChecks: "unknown" | "pending" | "passed" | "failed" | "none";
4428
4551
  unresolvedReviewThreads: number;
4429
4552
  reviewDecision?: string | null | undefined;
4430
4553
  };
@@ -4439,13 +4562,13 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4439
4562
  reviews: {
4440
4563
  correctness: {
4441
4564
  required: boolean;
4442
- status: "blocked" | "not-required" | "current" | "stale" | "missing";
4565
+ status: "not-required" | "stale" | "blocked" | "current" | "missing";
4443
4566
  reviewedHeadSha?: string | undefined;
4444
4567
  reviewedPatchId?: string | undefined;
4445
4568
  };
4446
4569
  security?: {
4447
4570
  required: boolean;
4448
- status: "blocked" | "not-required" | "current" | "stale" | "missing";
4571
+ status: "not-required" | "stale" | "blocked" | "current" | "missing";
4449
4572
  reviewedHeadSha?: string | undefined;
4450
4573
  reviewedPatchId?: string | undefined;
4451
4574
  } | undefined;
@@ -4508,7 +4631,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4508
4631
  interior: number;
4509
4632
  };
4510
4633
  nextAction: "run-gate-cycle" | "accept-nonblocking-findings" | "escalate-to-triage" | "ready-for-human" | "advance-to-gate" | "run-interior-cycle";
4511
- stage: "gate" | "interior" | "interior-complete";
4634
+ stage: "interior" | "gate" | "interior-complete";
4512
4635
  forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4513
4636
  } | undefined;
4514
4637
  reviewRuns?: PrReviewResult[] | undefined;
@@ -4772,6 +4895,7 @@ interface AssembleReviewPromptInput {
4772
4895
  patchId: string;
4773
4896
  priorLedgerEntries?: FindingLedgerEntry[];
4774
4897
  profile: FactoryProjectProfile;
4898
+ waveRung?: EvidenceReviewRung;
4775
4899
  }
4776
4900
  interface AssembleReviewPromptGitDependencies {
4777
4901
  repositoryRoot: (cwd: string) => string;
@@ -4793,7 +4917,8 @@ declare const assembleReviewPrompt: ({
4793
4917
  kind,
4794
4918
  patchId,
4795
4919
  priorLedgerEntries,
4796
- profile
4920
+ profile,
4921
+ waveRung
4797
4922
  }: AssembleReviewPromptInput, dependencies?: AssembleReviewPromptDependencies) => AssembledReviewPrompt;
4798
4923
  //#endregion
4799
4924
  //#region src/review-ladder-trace.d.ts