@patronage/software-factory 1.0.0-alpha.17 → 1.0.0-alpha.19

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
@@ -1,6 +1,7 @@
1
1
  import { existsSync, readFileSync, rmSync } from "node:fs";
2
2
  import { Command } from "commander";
3
3
  import { z } from "zod";
4
+ import { PreviewProofRegistration } from "@patronage/factory-ci";
4
5
 
5
6
  //#region src/review-rungs.d.ts
6
7
  declare const EVIDENCE_REVIEW_RUNGS: readonly ["independent-model", "oracle", "human"];
@@ -724,6 +725,10 @@ declare const factoryProjectProfileSchema: z.ZodObject<{
724
725
  paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
725
726
  }, z.core.$strict>>;
726
727
  }, z.core.$strict>>;
728
+ lifecycleContract: z.ZodOptional<z.ZodObject<{
729
+ command: z.ZodString;
730
+ jobName: z.ZodOptional<z.ZodString>;
731
+ }, z.core.$strict>>;
727
732
  repository: z.ZodObject<{
728
733
  name: z.ZodString;
729
734
  owner: z.ZodString;
@@ -1505,6 +1510,490 @@ declare const isHostedVerifyCheck: (check: StatusCheckRollup) => boolean;
1505
1510
  declare const hostedVerifyCheckState: (rollup: StatusCheckRollup[] | undefined) => CheckState;
1506
1511
  declare const statusCheckState: (rollup: StatusCheckRollup[] | undefined, exclude?: (check: StatusCheckRollup) => boolean) => CheckState;
1507
1512
  //#endregion
1513
+ //#region src/github-app-client.d.ts
1514
+ interface FactoryAppRequest {
1515
+ body?: unknown;
1516
+ headers?: Readonly<Record<string, string>>;
1517
+ method: "DELETE" | "GET" | "PATCH" | "POST";
1518
+ owner: string;
1519
+ path: string;
1520
+ repo: string;
1521
+ }
1522
+ interface FactoryAppExchange<T = unknown> {
1523
+ readonly etag?: string;
1524
+ readonly json: T;
1525
+ readonly status: number;
1526
+ }
1527
+ //#endregion
1528
+ //#region src/github-pr-status-comment.d.ts
1529
+ interface UpsertFactoryPrStatusCommentInput {
1530
+ body: string;
1531
+ /** ISO instant at which this presentation was observed. */
1532
+ observedAt?: string;
1533
+ owner: string;
1534
+ pr: number;
1535
+ repo: string;
1536
+ }
1537
+ interface UpsertFactoryPrStatusCommentDependencies {
1538
+ request?: (input: FactoryAppRequest) => Promise<FactoryAppExchange>;
1539
+ requestJson?: (input: FactoryAppRequest) => Promise<unknown>;
1540
+ }
1541
+ interface UpsertFactoryPrStatusCommentResult {
1542
+ action: "created" | "updated";
1543
+ commentId: number;
1544
+ url: string;
1545
+ }
1546
+ declare function upsertFactoryPrStatusComment(input: UpsertFactoryPrStatusCommentInput, dependencies?: UpsertFactoryPrStatusCommentDependencies): Promise<UpsertFactoryPrStatusCommentResult>;
1547
+ //#endregion
1548
+ //#region src/pr-verify-proof-contract.d.ts
1549
+ declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [1, 2, 3, 4];
1550
+ type PrVerifySchemaVersion = (typeof SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS)[number];
1551
+ interface PrVerifyCommandResult {
1552
+ command: string;
1553
+ description: string;
1554
+ /**
1555
+ * Epic #550 wave 3 (#430): the profile's declared impact target for this
1556
+ * command, recorded from v4 on. It is the proof's own command→target
1557
+ * mapping: a `notRequiredCommands` entry must name the target recorded HERE
1558
+ * for the same command, so a withholding cannot point at whichever released
1559
+ * target happens to be convenient. Absent for a command the profile does
1560
+ * not scope, and for v1–v3 proofs, which predate the field.
1561
+ */
1562
+ impactTarget?: string;
1563
+ name: string;
1564
+ scope: "always" | "docs-only" | "trivial" | "full";
1565
+ }
1566
+ interface PrVerifyExecutedCommand {
1567
+ command: string;
1568
+ counts?: {
1569
+ testFiles?: number;
1570
+ tests?: number;
1571
+ };
1572
+ durationMs: number;
1573
+ exitCode: number;
1574
+ name: string;
1575
+ scope: "always" | "docs-only" | "trivial" | "full";
1576
+ }
1577
+ /**
1578
+ * Epic #550 wave 3 (#430): a verification command the impact stamp proved this
1579
+ * candidate cannot reach, so the battery did not run it.
1580
+ *
1581
+ * The completeness invariant lives in the pairing: `verificationCommands`
1582
+ * records every command the resolved mode selected, `executedCommands` records
1583
+ * what ran, and this list records the rest WITH the stamp's own basis. A
1584
+ * withheld stack is therefore never silently absent from the proof — it is
1585
+ * present, named, and explained.
1586
+ */
1587
+ interface PrVerifyNotRequiredCommand {
1588
+ basis: string;
1589
+ impactTarget: string;
1590
+ name: string;
1591
+ }
1592
+ /**
1593
+ * Epic #758 (#762): a consumer package a stamp-scoped selection skipped, and
1594
+ * why. Bound to the proof's stamp identity — the field is v4-only (the same
1595
+ * window that can carry `impactStamp`) and refused when the proof records no
1596
+ * stamp. The factory does not write this list; consumers do.
1597
+ */
1598
+ interface PrVerifyNotDemandedRecord {
1599
+ basis: string;
1600
+ name: string;
1601
+ }
1602
+ interface PrVerifyProof {
1603
+ schemaVersion: PrVerifySchemaVersion;
1604
+ authoringSession?: string;
1605
+ base: string;
1606
+ baselineFullProofs?: {
1607
+ base: string;
1608
+ changedFiles: string[];
1609
+ headSha: string;
1610
+ profilePath: string;
1611
+ projectKey: string;
1612
+ repository: string;
1613
+ }[];
1614
+ changedFiles: string[];
1615
+ classification: DiffClassification;
1616
+ classificationReasons: string[];
1617
+ command: "patronage-factory pr:verify";
1618
+ durationMs: number;
1619
+ endedAt: string;
1620
+ executedCommands?: PrVerifyExecutedCommand[];
1621
+ headSha: string;
1622
+ impactStamp?: ImpactStamp;
1623
+ mode: ResolvedPrVerifyMode;
1624
+ mergeBaseSha?: string;
1625
+ notDemandedRecords?: PrVerifyNotDemandedRecord[];
1626
+ notRequiredCommands?: PrVerifyNotRequiredCommand[];
1627
+ outcome?: "aborted" | "passed";
1628
+ patchId?: string;
1629
+ profilePath: string;
1630
+ projectKey: string;
1631
+ repository: string;
1632
+ startedAt: string;
1633
+ verificationCommands: PrVerifyCommandResult[];
1634
+ }
1635
+ type PrVerifyBaselineFullProof = NonNullable<PrVerifyProof["baselineFullProofs"]>[number];
1636
+ declare function validatePrVerifyProof(value: unknown): PrVerifyProof;
1637
+ declare namespace verification_proof_d_exports {
1638
+ export { PrVerifyBaselineFullProof, PrVerifyCommandResult, PrVerifyExecutedCommand, PrVerifyNotDemandedRecord, PrVerifyNotRequiredCommand, PrVerifyProof, PrVerifySchemaVersion, ResolvedPrVerifyMode, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, VerificationHeadShas, VerificationProofState, VerifiedHeadShas, prVerifyFullHeadShasForDiff, prVerifyProofHeadShas, readPrVerifyProof, resolveVerifyProofApplicability, trustedImpactStamp, validatePrVerifyProof, verificationProofApplicabilityFor, verificationProofBlockingReason, verificationProofForReadiness, verificationProofStateFor, verifyProofIdentityMatches, verifyProofPassed };
1639
+ }
1640
+ interface VerifiedHeadShas {
1641
+ docsOnlyVerifiedHeadShas: string[];
1642
+ trivialVerifiedHeadShas: string[];
1643
+ verifiedHeadShas: string[];
1644
+ }
1645
+ type VerificationHeadShas = {
1646
+ explicitFailure: true;
1647
+ } | VerifiedHeadShas;
1648
+ declare function readPrVerifyProof(filePath: string): PrVerifyProof;
1649
+ declare const verifyProofPassed: (proof: PrVerifyProof) => boolean;
1650
+ declare const prVerifyProofHeadShas: (proof: PrVerifyProof | undefined, creditedHeadSha?: string) => VerifiedHeadShas;
1651
+ declare const verifyProofIdentityMatches: ({
1652
+ currentIdentity,
1653
+ proof
1654
+ }: {
1655
+ currentIdentity?: {
1656
+ patchId: string;
1657
+ mergeBaseSha?: string;
1658
+ };
1659
+ proof?: PrVerifyProof;
1660
+ }) => boolean;
1661
+ /**
1662
+ * Wave-2 consumption (#542): the recorded impact stamp, released for demand
1663
+ * resolution ONLY when it is identity-bound to the current candidate — the
1664
+ * proof passed, and its recorded headSha AND patchId both name exactly this
1665
+ * candidate (the same identities the proof already binds). Everything else —
1666
+ * no proof, an aborted run, a stale head, a moved patch id, a pre-stamp proof
1667
+ * — returns `undefined`, and the consumer keeps today's full-demand floor.
1668
+ *
1669
+ * Deliberately stricter than verify-once applicability (which tolerates a
1670
+ * head-only or patch-id-only match): a stamp narrows external demands, so it
1671
+ * is trusted only on an exact double binding, fail closed.
1672
+ */
1673
+ declare const trustedImpactStamp: ({
1674
+ candidate,
1675
+ proof
1676
+ }: {
1677
+ candidate: {
1678
+ headSha: string;
1679
+ patchId: string;
1680
+ };
1681
+ proof: PrVerifyProof | undefined;
1682
+ }) => ImpactStamp | undefined;
1683
+ declare const prVerifyFullHeadShasForDiff: ({
1684
+ docsOnlyDeltaAcceptedSince,
1685
+ files,
1686
+ proof
1687
+ }: {
1688
+ docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
1689
+ files: string[];
1690
+ proof: PrVerifyProof;
1691
+ }) => string[];
1692
+ type VerificationProofState = {
1693
+ kind: "typed-aborted";
1694
+ proof: PrVerifyProof;
1695
+ } | {
1696
+ kind: "typed-missing";
1697
+ path: string;
1698
+ reason: "enoent" | "invalid";
1699
+ message?: string;
1700
+ } | {
1701
+ kind: "typed";
1702
+ headShas: VerifiedHeadShas;
1703
+ proof: PrVerifyProof;
1704
+ } | {
1705
+ kind: "typed-diff-mismatch";
1706
+ mode: ResolvedPrVerifyMode;
1707
+ };
1708
+ declare const verificationProofStateFor: ({
1709
+ proof,
1710
+ proofMatchesCurrentDiff,
1711
+ proofPath
1712
+ }: {
1713
+ proof?: PrVerifyProof;
1714
+ proofMatchesCurrentDiff?: boolean;
1715
+ proofPath?: string;
1716
+ }) => VerificationProofState;
1717
+ declare const verificationProofApplicabilityFor: ({
1718
+ docsOnlyDeltaAcceptedSince,
1719
+ explicitProof,
1720
+ files,
1721
+ headSha,
1722
+ currentIdentity,
1723
+ proof,
1724
+ proofPath,
1725
+ proofReadError
1726
+ }: {
1727
+ docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
1728
+ explicitProof: boolean;
1729
+ files: string[];
1730
+ headSha: string;
1731
+ currentIdentity?: {
1732
+ patchId: string;
1733
+ mergeBaseSha?: string;
1734
+ };
1735
+ proof?: PrVerifyProof;
1736
+ proofPath?: string;
1737
+ proofReadError?: unknown;
1738
+ }) => {
1739
+ fullVerifiedHeadShas: never[];
1740
+ verificationProof: VerificationProofState;
1741
+ } | {
1742
+ fullVerifiedHeadShas: string[];
1743
+ verificationProof: {
1744
+ headShas: VerifiedHeadShas;
1745
+ kind: "typed";
1746
+ proof: PrVerifyProof;
1747
+ };
1748
+ };
1749
+ declare const resolveVerifyProofApplicability: ({
1750
+ proofPath,
1751
+ explicitProof,
1752
+ docsOnlyDeltaAcceptedSince,
1753
+ files,
1754
+ headSha,
1755
+ currentVerifyIdentityForBase,
1756
+ preread
1757
+ }: {
1758
+ proofPath: string;
1759
+ explicitProof: boolean;
1760
+ docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
1761
+ files: string[];
1762
+ headSha: string;
1763
+ currentVerifyIdentityForBase?: (base: string) => {
1764
+ patchId: string;
1765
+ mergeBaseSha?: string;
1766
+ };
1767
+ preread?: {
1768
+ proof?: PrVerifyProof;
1769
+ error?: unknown;
1770
+ };
1771
+ }) => {
1772
+ fullVerifiedHeadShas: never[];
1773
+ verificationProof: VerificationProofState;
1774
+ } | {
1775
+ fullVerifiedHeadShas: string[];
1776
+ verificationProof: {
1777
+ headShas: VerifiedHeadShas;
1778
+ kind: "typed";
1779
+ proof: PrVerifyProof;
1780
+ };
1781
+ };
1782
+ declare const verificationProofForReadiness: (state: VerificationProofState) => VerificationHeadShas;
1783
+ declare const verificationProofBlockingReason: (state: VerificationProofState) => string | undefined;
1784
+ //#endregion
1785
+ //#region src/preview-lifecycle.d.ts
1786
+ type PreviewDisposition = "deploy" | "not-required";
1787
+ interface PreviewTargetPlan {
1788
+ basis: string;
1789
+ disposition: PreviewDisposition;
1790
+ name: string;
1791
+ }
1792
+ interface PreviewLifecyclePlan {
1793
+ /** The declared preview stacks to deploy, in declaration order. */
1794
+ deploy: string[];
1795
+ /** The withheld stacks, in declaration order. */
1796
+ notRequired: PreviewTargetPlan[];
1797
+ /** Whether a trusted, identity-bound stamp was available at all. */
1798
+ stampTrusted: boolean;
1799
+ /** Every declared preview target with its disposition, in declaration order. */
1800
+ targets: PreviewTargetPlan[];
1801
+ }
1802
+ /** Validate a serialized plan without deriving or changing its dispositions. */
1803
+ declare const validatePreviewLifecyclePlan: (value: unknown) => PreviewLifecyclePlan;
1804
+ /**
1805
+ * Structural subset of the profile: the impact declarations plus the external
1806
+ * demand list. Structural rather than a `Pick` so this module does not import
1807
+ * `profile.ts`.
1808
+ */
1809
+ interface PreviewLifecycleProfile {
1810
+ impact?: {
1811
+ targets: {
1812
+ name: string;
1813
+ }[];
1814
+ };
1815
+ requiredChecks?: {
1816
+ name: string;
1817
+ }[];
1818
+ }
1819
+ /**
1820
+ * The declared preview stacks: impact targets that are ALSO declared required
1821
+ * checks — i.e. targets whose proof is produced externally, which is exactly
1822
+ * what a preview producer is.
1823
+ *
1824
+ * Deriving the list from the two existing declarations rather than adding a
1825
+ * third is what makes lifecycle and demand unable to disagree: the stacks this
1826
+ * plan can withhold are precisely the demands wave 2 can release, so a stack
1827
+ * can never be skipped while its proof stays demanded.
1828
+ */
1829
+ declare const previewLifecycleTargets: (profile: PreviewLifecycleProfile) => string[];
1830
+ /**
1831
+ * Plan the preview lifecycle for one candidate.
1832
+ *
1833
+ * Trust is resolved here through the SAME identity gate demand release uses
1834
+ * (`trustedImpactStamp`): the proof must have passed and must bind both the
1835
+ * candidate's headSha and its patchId. A stale, aborted, absent, or
1836
+ * differently-bound proof yields no stamp, and every declared stack is planned
1837
+ * for deploy. Total over its INPUTS — no proof, stamp, or profile can make it
1838
+ * throw. A malformed CALL is the deliberate exception: omitting
1839
+ * `vetoedTargets` is API misuse, not data doubt, and throws.
1840
+ */
1841
+ declare const planPreviewLifecycle: ({
1842
+ candidate,
1843
+ profile,
1844
+ proof,
1845
+ vetoedTargets
1846
+ }: {
1847
+ candidate: {
1848
+ headSha: string;
1849
+ patchId: string;
1850
+ };
1851
+ profile: PreviewLifecycleProfile;
1852
+ proof: PrVerifyProof | undefined;
1853
+ /**
1854
+ * Stack names with a current, candidate-bound FAILING envelope. Scoping is
1855
+ * withheld for these whatever the stamp says — the same veto demand release
1856
+ * applies, and for the same reason: a withheld stack is a stack that can
1857
+ * never re-emit the envelope its standing demand needs. Callers hold the
1858
+ * checkout context, so they resolve the set with `boundFailingCheckNames`
1859
+ * and pass it in; this module stays pure.
1860
+ *
1861
+ * REQUIRED, with no default, on purpose: a defaulted `[]` reads the same
1862
+ * whether the caller inspected the envelopes or never looked, and this seam
1863
+ * exists precisely for EXTERNAL preview producers — the callers most likely
1864
+ * to skip the lookup. Pass the result of `boundFailingCheckNames`; pass `[]`
1865
+ * only to mean "inspected the envelopes and found no bound failure".
1866
+ *
1867
+ * Deliberately visible to `api:check` as a breaking signature change
1868
+ * (pre-1.0, no external callers yet).
1869
+ */
1870
+ vetoedTargets: readonly string[];
1871
+ }) => PreviewLifecyclePlan;
1872
+ //#endregion
1873
+ //#region src/pr-status-hud.d.ts
1874
+ type FactoryPrStatusCheckName = "patronage-factory/merge-freeze" | "patronage-factory/pr-ready" | "patronage-factory/pr-verify";
1875
+ interface CompletedFactoryCheckSnapshot {
1876
+ readonly completedAt: string;
1877
+ readonly conclusion: string;
1878
+ readonly detailsUrl?: string;
1879
+ readonly headSha: string;
1880
+ readonly name: FactoryPrStatusCheckName;
1881
+ }
1882
+ interface FailedPreviewSnapshot {
1883
+ readonly completedAt: string;
1884
+ readonly conclusion: string;
1885
+ readonly detailsUrl?: string;
1886
+ readonly headSha: string;
1887
+ readonly name: string;
1888
+ }
1889
+ interface FactoryPrStatusSources {
1890
+ readonly baseSha: string;
1891
+ readonly checks: Readonly<Partial<Record<FactoryPrStatusCheckName, CompletedFactoryCheckSnapshot>>>;
1892
+ readonly previewFailures?: Readonly<Partial<Record<string, FailedPreviewSnapshot>>>;
1893
+ readonly previewRegistrations: readonly PreviewProofRegistration[];
1894
+ }
1895
+ interface RenderFactoryPrStatusHudInput extends FactoryPrStatusSources {
1896
+ readonly headSha: string;
1897
+ readonly plan: PreviewLifecyclePlan;
1898
+ readonly planHeadSha: string;
1899
+ readonly pr: number;
1900
+ /** ISO instant at which the presentation sources were observed. */
1901
+ readonly renderedAt: string;
1902
+ }
1903
+ interface PresentFactoryPrStatusHudInput {
1904
+ readonly headSha: string;
1905
+ readonly owner: string;
1906
+ readonly plan: PreviewLifecyclePlan;
1907
+ readonly planHeadSha: string;
1908
+ readonly pr: number;
1909
+ readonly renderedAt?: string;
1910
+ readonly repo: string;
1911
+ }
1912
+ interface PresentFactoryPrStatusHudDependencies {
1913
+ /**
1914
+ * Read only `previewProofInventory.list` registrations and completed,
1915
+ * Factory-App-owned check snapshots. PR comment bodies are not an evidence
1916
+ * source and are deliberately absent from this contract.
1917
+ */
1918
+ readonly readSources: (input: {
1919
+ headSha: string;
1920
+ owner: string;
1921
+ pr: number;
1922
+ previewTargets?: readonly string[];
1923
+ repo: string;
1924
+ }) => Promise<FactoryPrStatusSources>;
1925
+ /** Recheck both PR endpoints immediately before mutating the sticky HUD. */
1926
+ readonly assertCurrentIdentity: (input: {
1927
+ baseSha: string;
1928
+ headSha: string;
1929
+ owner: string;
1930
+ pr: number;
1931
+ repo: string;
1932
+ }) => Promise<void>;
1933
+ readonly upsert?: typeof upsertFactoryPrStatusComment;
1934
+ }
1935
+ interface ReadFactoryPrStatusSourcesInput {
1936
+ readonly headSha: string;
1937
+ readonly owner: string;
1938
+ readonly pr: number;
1939
+ /**
1940
+ * Demanded preview stack names from the lifecycle plan. Used only to look up
1941
+ * a completed unsuccessful check run when inventory has no registration.
1942
+ */
1943
+ readonly previewTargets?: readonly string[];
1944
+ readonly repo: string;
1945
+ /** Factory App installation token, normally minted by the presentation job. */
1946
+ readonly token: string;
1947
+ }
1948
+ interface ReadFactoryPrStatusSourcesDependencies {
1949
+ readonly fetch?: typeof fetch;
1950
+ readonly listPreviewRegistrations?: (input: {
1951
+ owner: string;
1952
+ pr: number;
1953
+ repo: string;
1954
+ token: string;
1955
+ }) => Promise<readonly PreviewProofRegistration[]>;
1956
+ readonly timeoutMs?: number;
1957
+ }
1958
+ declare function renderFactoryPrStatusHud(input: RenderFactoryPrStatusHudInput): string;
1959
+ declare function presentFactoryPrStatusHud(input: PresentFactoryPrStatusHudInput, dependencies: PresentFactoryPrStatusHudDependencies): Promise<UpsertFactoryPrStatusCommentResult>;
1960
+ declare function assertFactoryPrStatusIdentity(input: ReadFactoryPrStatusSourcesInput & {
1961
+ readonly baseSha: string;
1962
+ }, dependencies?: ReadFactoryPrStatusSourcesDependencies): Promise<void>;
1963
+ declare function readFactoryPrStatusSources(input: ReadFactoryPrStatusSourcesInput, dependencies?: ReadFactoryPrStatusSourcesDependencies): Promise<FactoryPrStatusSources>;
1964
+ interface PlanFactoryPrStatusHudInput {
1965
+ readonly cwd: string;
1966
+ readonly headSha: string;
1967
+ readonly mergeBaseSha?: string;
1968
+ readonly patchId?: string;
1969
+ readonly profilePath?: string;
1970
+ }
1971
+ /**
1972
+ * Consume `planPreviewLifecycle` for the current checkout. No second plan is
1973
+ * invented: dispositions are Ready/Skipped from `deploy` vs `not-required`.
1974
+ * Candidate identity is never copied from the proof. Absent independent
1975
+ * identity or an unbound verify proof is the planner's conservative path.
1976
+ */
1977
+ declare function planFactoryPrStatusHud(input: PlanFactoryPrStatusHudInput): PreviewLifecyclePlan;
1978
+ interface RefreshFactoryPrStatusHudInput {
1979
+ readonly cwd: string;
1980
+ readonly headSha: string;
1981
+ readonly mergeBaseSha?: string;
1982
+ readonly owner: string;
1983
+ readonly patchId?: string;
1984
+ readonly pr: number;
1985
+ readonly profilePath?: string;
1986
+ readonly repo: string;
1987
+ readonly token?: string;
1988
+ }
1989
+ /** Plan from the checkout and present the App-owned HUD. */
1990
+ declare function refreshFactoryPrStatusHud(input: RefreshFactoryPrStatusHudInput): Promise<UpsertFactoryPrStatusCommentResult>;
1991
+ /**
1992
+ * Presentation must not fail an admission gate. Used after pr:ready publishes
1993
+ * its check so the table is not stuck at first-write.
1994
+ */
1995
+ declare function refreshFactoryPrStatusHudSafely(input: RefreshFactoryPrStatusHudInput, onNotice?: (message: string) => void): Promise<void>;
1996
+ //#endregion
1508
1997
  //#region src/pr-ready.d.ts
1509
1998
  interface PrReadyArgs extends LoadProjectProfileInput {
1510
1999
  authoringSessionIds?: string[];
@@ -1662,6 +2151,12 @@ interface PrReadyDependencies {
1662
2151
  publishFinalCheckRun?: (input: Omit<PublishFactoryCheckInput, "status"> & {
1663
2152
  conclusion: "failure" | "success";
1664
2153
  }) => Promise<boolean> | boolean;
2154
+ /**
2155
+ * Re-present the App-owned HUD after this run's ready check is published
2156
+ * so the table is not stuck at first-write. Defaults to a safe refresh
2157
+ * that never fails the gate.
2158
+ */
2159
+ presentStatusHud?: (input: RefreshFactoryPrStatusHudInput) => Promise<void> | void;
1665
2160
  /** Injectable delay for the UNKNOWN-mergeable brief poll (tests). */
1666
2161
  sleep?: (ms: number) => Promise<void>;
1667
2162
  }
@@ -1963,108 +2458,18 @@ declare const reviewProofFor: (proof: PrReviewProof | undefined, kind: PrReviewK
1963
2458
  declare namespace review_proof_d_exports {
1964
2459
  export { DEFAULT_PR_REVIEW_MAX_CYCLES, DEFAULT_PR_REVIEW_PROOF_PATH, PR_REVIEW_FINAL_READINESS_NOTICE, PR_REVIEW_FINDING_PROVENANCE_VERSION, PR_REVIEW_PROOF_DESCRIPTOR, PR_REVIEW_SCHEMA_VERSION, PrReviewFinding, PrReviewKind, PrReviewLadderState, PrReviewMode, PrReviewOutcome, PrReviewProof, PrReviewResult, PrReviewStageResolution, REVIEW_SEVERITIES, ReviewAcceptance, ReviewCycleState, ReviewFindingCategory, ReviewFindingSeverity, ReviewTerminalState, prReviewFindingSchema, prReviewProofSchema, prReviewResultSchema, readPrReviewProof, resolveReviewAcceptance, resolveReviewTerminalState, resolveReviewTerminalStateAcrossReviews, resolveReviewTerminalStateAcrossReviewsForPolicy, resolveReviewTerminalStateForEpoch, reviewCycleStateFor, reviewProofFor, validatePrReviewProof, validatePrReviewResult };
1965
2460
  }
1966
- declare const PR_REVIEW_SCHEMA_VERSION = 2;
1967
- declare const PR_REVIEW_FINDING_PROVENANCE_VERSION = 1;
1968
- declare const DEFAULT_PR_REVIEW_PROOF_PATH = ".factory-memory/pr-review.json";
1969
- declare const DEFAULT_PR_REVIEW_MAX_CYCLES = 5;
1970
- declare const PR_REVIEW_FINAL_READINESS_NOTICE = "pr:review is a final readiness proof gate. Run it after local verification and avoid repeated full runs unless the review proof records actionable findings. Default review window: 5 cycles.";
1971
- declare const prReviewFindingSchema: z.ZodType<PrReviewFinding>;
1972
- declare const prReviewResultSchema: z.ZodType<PrReviewResult>;
1973
- declare const prReviewProofSchema: z.ZodType<PrReviewProof>;
1974
- declare const validatePrReviewResult: (value: unknown) => PrReviewResult;
1975
- declare const validatePrReviewProof: (value: unknown) => PrReviewProof;
1976
- declare const readPrReviewProof: (filePath: string) => PrReviewProof;
1977
- declare const PR_REVIEW_PROOF_DESCRIPTOR: ProofDescriptor<PrReviewProof>;
1978
- //#endregion
1979
- //#region src/pr-verify-proof-contract.d.ts
1980
- declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [1, 2, 3, 4];
1981
- type PrVerifySchemaVersion = (typeof SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS)[number];
1982
- interface PrVerifyCommandResult {
1983
- command: string;
1984
- description: string;
1985
- /**
1986
- * Epic #550 wave 3 (#430): the profile's declared impact target for this
1987
- * command, recorded from v4 on. It is the proof's own command→target
1988
- * mapping: a `notRequiredCommands` entry must name the target recorded HERE
1989
- * for the same command, so a withholding cannot point at whichever released
1990
- * target happens to be convenient. Absent for a command the profile does
1991
- * not scope, and for v1–v3 proofs, which predate the field.
1992
- */
1993
- impactTarget?: string;
1994
- name: string;
1995
- scope: "always" | "docs-only" | "trivial" | "full";
1996
- }
1997
- interface PrVerifyExecutedCommand {
1998
- command: string;
1999
- counts?: {
2000
- testFiles?: number;
2001
- tests?: number;
2002
- };
2003
- durationMs: number;
2004
- exitCode: number;
2005
- name: string;
2006
- scope: "always" | "docs-only" | "trivial" | "full";
2007
- }
2008
- /**
2009
- * Epic #550 wave 3 (#430): a verification command the impact stamp proved this
2010
- * candidate cannot reach, so the battery did not run it.
2011
- *
2012
- * The completeness invariant lives in the pairing: `verificationCommands`
2013
- * records every command the resolved mode selected, `executedCommands` records
2014
- * what ran, and this list records the rest WITH the stamp's own basis. A
2015
- * withheld stack is therefore never silently absent from the proof — it is
2016
- * present, named, and explained.
2017
- */
2018
- interface PrVerifyNotRequiredCommand {
2019
- basis: string;
2020
- impactTarget: string;
2021
- name: string;
2022
- }
2023
- /**
2024
- * Epic #758 (#762): a consumer package a stamp-scoped selection skipped, and
2025
- * why. Bound to the proof's stamp identity — the field is v4-only (the same
2026
- * window that can carry `impactStamp`) and refused when the proof records no
2027
- * stamp. The factory does not write this list; consumers do.
2028
- */
2029
- interface PrVerifyNotDemandedRecord {
2030
- basis: string;
2031
- name: string;
2032
- }
2033
- interface PrVerifyProof {
2034
- schemaVersion: PrVerifySchemaVersion;
2035
- authoringSession?: string;
2036
- base: string;
2037
- baselineFullProofs?: {
2038
- base: string;
2039
- changedFiles: string[];
2040
- headSha: string;
2041
- profilePath: string;
2042
- projectKey: string;
2043
- repository: string;
2044
- }[];
2045
- changedFiles: string[];
2046
- classification: DiffClassification;
2047
- classificationReasons: string[];
2048
- command: "patronage-factory pr:verify";
2049
- durationMs: number;
2050
- endedAt: string;
2051
- executedCommands?: PrVerifyExecutedCommand[];
2052
- headSha: string;
2053
- impactStamp?: ImpactStamp;
2054
- mode: ResolvedPrVerifyMode;
2055
- mergeBaseSha?: string;
2056
- notDemandedRecords?: PrVerifyNotDemandedRecord[];
2057
- notRequiredCommands?: PrVerifyNotRequiredCommand[];
2058
- outcome?: "aborted" | "passed";
2059
- patchId?: string;
2060
- profilePath: string;
2061
- projectKey: string;
2062
- repository: string;
2063
- startedAt: string;
2064
- verificationCommands: PrVerifyCommandResult[];
2065
- }
2066
- type PrVerifyBaselineFullProof = NonNullable<PrVerifyProof["baselineFullProofs"]>[number];
2067
- declare function validatePrVerifyProof(value: unknown): PrVerifyProof;
2461
+ declare const PR_REVIEW_SCHEMA_VERSION = 2;
2462
+ declare const PR_REVIEW_FINDING_PROVENANCE_VERSION = 1;
2463
+ declare const DEFAULT_PR_REVIEW_PROOF_PATH = ".factory-memory/pr-review.json";
2464
+ declare const DEFAULT_PR_REVIEW_MAX_CYCLES = 5;
2465
+ declare const PR_REVIEW_FINAL_READINESS_NOTICE = "pr:review is a final readiness proof gate. Run it after local verification and avoid repeated full runs unless the review proof records actionable findings. Default review window: 5 cycles.";
2466
+ declare const prReviewFindingSchema: z.ZodType<PrReviewFinding>;
2467
+ declare const prReviewResultSchema: z.ZodType<PrReviewResult>;
2468
+ declare const prReviewProofSchema: z.ZodType<PrReviewProof>;
2469
+ declare const validatePrReviewResult: (value: unknown) => PrReviewResult;
2470
+ declare const validatePrReviewProof: (value: unknown) => PrReviewProof;
2471
+ declare const readPrReviewProof: (filePath: string) => PrReviewProof;
2472
+ declare const PR_REVIEW_PROOF_DESCRIPTOR: ProofDescriptor<PrReviewProof>;
2068
2473
  //#endregion
2069
2474
  //#region src/schemas.d.ts
2070
2475
  declare const boundaryCheckProofSchema: z.ZodObject<{
@@ -2143,7 +2548,7 @@ interface BoundaryCheckDependencies {
2143
2548
  declare function runBoundaryCheck(args: BoundaryCheckArgs, dependencies?: BoundaryCheckDependencies): BoundaryCheckProofRecord;
2144
2549
  declare function validateBoundaryCheckProof(value: unknown): BoundaryCheckProofRecord;
2145
2550
  //#endregion
2146
- //#region src/commands/doctor.d.ts
2551
+ //#region src/cli-output.d.ts
2147
2552
  interface CliOutput {
2148
2553
  stderr: Pick<NodeJS.WriteStream, "write">;
2149
2554
  stdout: Pick<NodeJS.WriteStream, "write">;
@@ -2237,153 +2642,6 @@ interface PrReviewDependencies {
2237
2642
  hq?: HqIngestDependencies;
2238
2643
  }
2239
2644
  declare function runPrReview(args: PrReviewArgs, dependencies?: PrReviewDependencies): Promise<PrReviewProof>;
2240
- declare namespace verification_proof_d_exports {
2241
- export { PrVerifyBaselineFullProof, PrVerifyCommandResult, PrVerifyExecutedCommand, PrVerifyNotDemandedRecord, PrVerifyNotRequiredCommand, PrVerifyProof, PrVerifySchemaVersion, ResolvedPrVerifyMode, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, VerificationHeadShas, VerificationProofState, VerifiedHeadShas, prVerifyFullHeadShasForDiff, prVerifyProofHeadShas, readPrVerifyProof, resolveVerifyProofApplicability, trustedImpactStamp, validatePrVerifyProof, verificationProofApplicabilityFor, verificationProofBlockingReason, verificationProofForReadiness, verificationProofStateFor, verifyProofIdentityMatches, verifyProofPassed };
2242
- }
2243
- interface VerifiedHeadShas {
2244
- docsOnlyVerifiedHeadShas: string[];
2245
- trivialVerifiedHeadShas: string[];
2246
- verifiedHeadShas: string[];
2247
- }
2248
- type VerificationHeadShas = {
2249
- explicitFailure: true;
2250
- } | VerifiedHeadShas;
2251
- declare function readPrVerifyProof(filePath: string): PrVerifyProof;
2252
- declare const verifyProofPassed: (proof: PrVerifyProof) => boolean;
2253
- declare const prVerifyProofHeadShas: (proof: PrVerifyProof | undefined, creditedHeadSha?: string) => VerifiedHeadShas;
2254
- declare const verifyProofIdentityMatches: ({
2255
- currentIdentity,
2256
- proof
2257
- }: {
2258
- currentIdentity?: {
2259
- patchId: string;
2260
- mergeBaseSha?: string;
2261
- };
2262
- proof?: PrVerifyProof;
2263
- }) => boolean;
2264
- /**
2265
- * Wave-2 consumption (#542): the recorded impact stamp, released for demand
2266
- * resolution ONLY when it is identity-bound to the current candidate — the
2267
- * proof passed, and its recorded headSha AND patchId both name exactly this
2268
- * candidate (the same identities the proof already binds). Everything else —
2269
- * no proof, an aborted run, a stale head, a moved patch id, a pre-stamp proof
2270
- * — returns `undefined`, and the consumer keeps today's full-demand floor.
2271
- *
2272
- * Deliberately stricter than verify-once applicability (which tolerates a
2273
- * head-only or patch-id-only match): a stamp narrows external demands, so it
2274
- * is trusted only on an exact double binding, fail closed.
2275
- */
2276
- declare const trustedImpactStamp: ({
2277
- candidate,
2278
- proof
2279
- }: {
2280
- candidate: {
2281
- headSha: string;
2282
- patchId: string;
2283
- };
2284
- proof: PrVerifyProof | undefined;
2285
- }) => ImpactStamp | undefined;
2286
- declare const prVerifyFullHeadShasForDiff: ({
2287
- docsOnlyDeltaAcceptedSince,
2288
- files,
2289
- proof
2290
- }: {
2291
- docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
2292
- files: string[];
2293
- proof: PrVerifyProof;
2294
- }) => string[];
2295
- type VerificationProofState = {
2296
- kind: "typed-aborted";
2297
- proof: PrVerifyProof;
2298
- } | {
2299
- kind: "typed-missing";
2300
- path: string;
2301
- reason: "enoent" | "invalid";
2302
- message?: string;
2303
- } | {
2304
- kind: "typed";
2305
- headShas: VerifiedHeadShas;
2306
- proof: PrVerifyProof;
2307
- } | {
2308
- kind: "typed-diff-mismatch";
2309
- mode: ResolvedPrVerifyMode;
2310
- };
2311
- declare const verificationProofStateFor: ({
2312
- proof,
2313
- proofMatchesCurrentDiff,
2314
- proofPath
2315
- }: {
2316
- proof?: PrVerifyProof;
2317
- proofMatchesCurrentDiff?: boolean;
2318
- proofPath?: string;
2319
- }) => VerificationProofState;
2320
- declare const verificationProofApplicabilityFor: ({
2321
- docsOnlyDeltaAcceptedSince,
2322
- explicitProof,
2323
- files,
2324
- headSha,
2325
- currentIdentity,
2326
- proof,
2327
- proofPath,
2328
- proofReadError
2329
- }: {
2330
- docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
2331
- explicitProof: boolean;
2332
- files: string[];
2333
- headSha: string;
2334
- currentIdentity?: {
2335
- patchId: string;
2336
- mergeBaseSha?: string;
2337
- };
2338
- proof?: PrVerifyProof;
2339
- proofPath?: string;
2340
- proofReadError?: unknown;
2341
- }) => {
2342
- fullVerifiedHeadShas: never[];
2343
- verificationProof: VerificationProofState;
2344
- } | {
2345
- fullVerifiedHeadShas: string[];
2346
- verificationProof: {
2347
- headShas: VerifiedHeadShas;
2348
- kind: "typed";
2349
- proof: PrVerifyProof;
2350
- };
2351
- };
2352
- declare const resolveVerifyProofApplicability: ({
2353
- proofPath,
2354
- explicitProof,
2355
- docsOnlyDeltaAcceptedSince,
2356
- files,
2357
- headSha,
2358
- currentVerifyIdentityForBase,
2359
- preread
2360
- }: {
2361
- proofPath: string;
2362
- explicitProof: boolean;
2363
- docsOnlyDeltaAcceptedSince?: (baselineHeadSha: string) => boolean;
2364
- files: string[];
2365
- headSha: string;
2366
- currentVerifyIdentityForBase?: (base: string) => {
2367
- patchId: string;
2368
- mergeBaseSha?: string;
2369
- };
2370
- preread?: {
2371
- proof?: PrVerifyProof;
2372
- error?: unknown;
2373
- };
2374
- }) => {
2375
- fullVerifiedHeadShas: never[];
2376
- verificationProof: VerificationProofState;
2377
- } | {
2378
- fullVerifiedHeadShas: string[];
2379
- verificationProof: {
2380
- headShas: VerifiedHeadShas;
2381
- kind: "typed";
2382
- proof: PrVerifyProof;
2383
- };
2384
- };
2385
- declare const verificationProofForReadiness: (state: VerificationProofState) => VerificationHeadShas;
2386
- declare const verificationProofBlockingReason: (state: VerificationProofState) => string | undefined;
2387
2645
  //#endregion
2388
2646
  //#region src/workspace-install-resolution.d.ts
2389
2647
  interface CleanInstallResolutionDependencies {
@@ -2603,6 +2861,22 @@ type PrReadyAction = (args: PrReadyArgs) => Promise<unknown>;
2603
2861
  //#region src/commands/pr-review.d.ts
2604
2862
  type PrReviewAction = (args: PrReviewArgs) => Promise<unknown>;
2605
2863
  //#endregion
2864
+ //#region src/pr-status-hud-command.d.ts
2865
+ interface PrStatusHudArgs {
2866
+ readonly cwd: string;
2867
+ readonly headSha: string;
2868
+ readonly owner: string;
2869
+ readonly planPath?: string;
2870
+ readonly pr: number;
2871
+ readonly repo: string;
2872
+ readonly token: string;
2873
+ }
2874
+ type PrStatusHudAction = (args: PrStatusHudArgs) => Promise<{
2875
+ action: string;
2876
+ commentId: number;
2877
+ url: string;
2878
+ }>;
2879
+ //#endregion
2606
2880
  //#region src/packages/trace/implementation/core.d.ts
2607
2881
  declare const FactoryTraceEnvelopeCoreSchema: z.ZodObject<{
2608
2882
  createdAt: z.ZodString;
@@ -3234,8 +3508,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3234
3508
  interiorCycle: z.ZodOptional<z.ZodNumber>;
3235
3509
  observedAt: z.ZodString;
3236
3510
  purpose: z.ZodEnum<{
3237
- review: "review";
3238
3511
  code: "code";
3512
+ review: "review";
3239
3513
  }>;
3240
3514
  slotResolution: z.ZodObject<{
3241
3515
  effort: z.ZodEnum<{
@@ -3313,8 +3587,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3313
3587
  interiorCycle: z.ZodOptional<z.ZodNumber>;
3314
3588
  observedAt: z.ZodString;
3315
3589
  purpose: z.ZodEnum<{
3316
- review: "review";
3317
3590
  code: "code";
3591
+ review: "review";
3318
3592
  }>;
3319
3593
  slotResolution: z.ZodObject<{
3320
3594
  effort: z.ZodEnum<{
@@ -3383,8 +3657,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3383
3657
  interiorCycle: z.ZodOptional<z.ZodNumber>;
3384
3658
  observedAt: z.ZodString;
3385
3659
  purpose: z.ZodEnum<{
3386
- review: "review";
3387
3660
  code: "code";
3661
+ review: "review";
3388
3662
  }>;
3389
3663
  slotResolution: z.ZodObject<{
3390
3664
  effort: z.ZodEnum<{
@@ -3456,7 +3730,7 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3456
3730
  exitCode: number | null;
3457
3731
  harness: string;
3458
3732
  observedAt: string;
3459
- purpose: "review" | "code";
3733
+ purpose: "code" | "review";
3460
3734
  slotResolution: {
3461
3735
  effort: "high" | "low" | "medium" | "xhigh";
3462
3736
  engine: string;
@@ -3739,7 +4013,7 @@ declare const CORRECTNESS_UNTYPED_REVIEW_BLOCKER_REASON = "Correctness review pr
3739
4013
  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.";
3740
4014
  declare const DRAFT_BLOCKER_REASON = "PR is still marked draft.";
3741
4015
  declare const PENDING_CHECKS_BLOCKER_REASON_PREFIX = "Required/current checks are";
3742
- declare const readinessExitCode: (status: ReadinessStatus) => 1 | 0;
4016
+ declare const readinessExitCode: (status: ReadinessStatus) => 0 | 1;
3743
4017
  interface EvaluationInput {
3744
4018
  pr: number;
3745
4019
  prTitle?: string;
@@ -4290,92 +4564,6 @@ declare const planVerificationBattery: <Command extends BatteryCandidateCommand>
4290
4564
  /** Console lines naming every withheld command and why. Never silent. */
4291
4565
  declare const batteryScopeSummaryLines: (plan: VerificationBatteryPlan<BatteryCandidateCommand>) => string[];
4292
4566
  //#endregion
4293
- //#region src/preview-lifecycle.d.ts
4294
- type PreviewDisposition = "deploy" | "not-required";
4295
- interface PreviewTargetPlan {
4296
- basis: string;
4297
- disposition: PreviewDisposition;
4298
- name: string;
4299
- }
4300
- interface PreviewLifecyclePlan {
4301
- /** The declared preview stacks to deploy, in declaration order. */
4302
- deploy: string[];
4303
- /** The withheld stacks, in declaration order. */
4304
- notRequired: PreviewTargetPlan[];
4305
- /** Whether a trusted, identity-bound stamp was available at all. */
4306
- stampTrusted: boolean;
4307
- /** Every declared preview target with its disposition, in declaration order. */
4308
- targets: PreviewTargetPlan[];
4309
- }
4310
- /**
4311
- * Structural subset of the profile: the impact declarations plus the external
4312
- * demand list. Structural rather than a `Pick` so this module does not import
4313
- * `profile.ts`.
4314
- */
4315
- interface PreviewLifecycleProfile {
4316
- impact?: {
4317
- targets: {
4318
- name: string;
4319
- }[];
4320
- };
4321
- requiredChecks?: {
4322
- name: string;
4323
- }[];
4324
- }
4325
- /**
4326
- * The declared preview stacks: impact targets that are ALSO declared required
4327
- * checks — i.e. targets whose proof is produced externally, which is exactly
4328
- * what a preview producer is.
4329
- *
4330
- * Deriving the list from the two existing declarations rather than adding a
4331
- * third is what makes lifecycle and demand unable to disagree: the stacks this
4332
- * plan can withhold are precisely the demands wave 2 can release, so a stack
4333
- * can never be skipped while its proof stays demanded.
4334
- */
4335
- declare const previewLifecycleTargets: (profile: PreviewLifecycleProfile) => string[];
4336
- /**
4337
- * Plan the preview lifecycle for one candidate.
4338
- *
4339
- * Trust is resolved here through the SAME identity gate demand release uses
4340
- * (`trustedImpactStamp`): the proof must have passed and must bind both the
4341
- * candidate's headSha and its patchId. A stale, aborted, absent, or
4342
- * differently-bound proof yields no stamp, and every declared stack is planned
4343
- * for deploy. Total over its INPUTS — no proof, stamp, or profile can make it
4344
- * throw. A malformed CALL is the deliberate exception: omitting
4345
- * `vetoedTargets` is API misuse, not data doubt, and throws.
4346
- */
4347
- declare const planPreviewLifecycle: ({
4348
- candidate,
4349
- profile,
4350
- proof,
4351
- vetoedTargets
4352
- }: {
4353
- candidate: {
4354
- headSha: string;
4355
- patchId: string;
4356
- };
4357
- profile: PreviewLifecycleProfile;
4358
- proof: PrVerifyProof | undefined;
4359
- /**
4360
- * Stack names with a current, candidate-bound FAILING envelope. Scoping is
4361
- * withheld for these whatever the stamp says — the same veto demand release
4362
- * applies, and for the same reason: a withheld stack is a stack that can
4363
- * never re-emit the envelope its standing demand needs. Callers hold the
4364
- * checkout context, so they resolve the set with `boundFailingCheckNames`
4365
- * and pass it in; this module stays pure.
4366
- *
4367
- * REQUIRED, with no default, on purpose: a defaulted `[]` reads the same
4368
- * whether the caller inspected the envelopes or never looked, and this seam
4369
- * exists precisely for EXTERNAL preview producers — the callers most likely
4370
- * to skip the lookup. Pass the result of `boundFailingCheckNames`; pass `[]`
4371
- * only to mean "inspected the envelopes and found no bound failure".
4372
- *
4373
- * Deliberately visible to `api:check` as a breaking signature change
4374
- * (pre-1.0, no external callers yet).
4375
- */
4376
- vetoedTargets: readonly string[];
4377
- }) => PreviewLifecyclePlan;
4378
- //#endregion
4379
4567
  //#region src/worker-checkout-guard.d.ts
4380
4568
  type CheckoutDirsProbe = (cwd: string) => {
4381
4569
  gitCommonDir: string;
@@ -4402,6 +4590,7 @@ interface CreateProgramOptions {
4402
4590
  prPublish?: PrPublishAction;
4403
4591
  prReady?: PrReadyAction;
4404
4592
  prReview?: PrReviewAction;
4593
+ prStatusHud?: PrStatusHudAction;
4405
4594
  };
4406
4595
  factoryCliInvocation?: FactoryCliInvocation;
4407
4596
  output?: CliOutput;
@@ -4409,4 +4598,4 @@ interface CreateProgramOptions {
4409
4598
  declare function createProgram(options?: CreateProgramOptions): Command;
4410
4599
  declare function run(argv?: string[]): Promise<void>;
4411
4600
  //#endregion
4412
- export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BatteryCommandDisposition, type BatteryDisposition, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type CloudflareAccessServiceToken, 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, type FactoryCliInvocation, FactoryCliInvocationSchema, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FindingDisposition, type FindingLedgerEntry, type FollowUpAction, FollowUpActionSchema, type ImpactScopeDecision, type ImpactScopeSurface, type IssueReviewFocus, type LadderDispositionDeclaration, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeState, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PreviewDisposition, type PreviewLifecyclePlan, type PreviewTargetPlan, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, REVIEW_FOCUS_SECTION, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, type ReviewLadderCycle, type ReviewLadderEvaluation, type ReviewLadderPolicy, type ReviewLadderStageEvent, type ReviewLadderTraceIdentity, 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, type WorkerCloseoutLessonsTraceEvent, appendReviewLadderStageTraceEvent, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertWorkerCheckoutAllowed, authorizeDemandWaiver, batteryScopeSummaryLines, blockingLadderFindings, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildReviewGateNotRequiredTraceEvent, buildReviewLadderStageTraceEvent, comment_provenance_d_exports as commentProvenance, createLocalJsonlTraceSink, createProgram, createVerificationRunContext, doctorProjectProfile, epicStructureEventId, evaluateReviewLadder, evidenceEnvelopeFilename, findingKey, followUpFromArgv, impactStampScopeDecision, inferFixedInThreadDispositions, isProductionHqUrl, loadProjectProfile, normalizeIssueComments, openLadderFindings, 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, previewLifecycleTargets, publishEpicStructure, readDemandWaivers, readPrReadyProof, readPrReviewProof, resolveFactoryRepository, resolveFindingBlocking, resolveReviewFindingCategory, resolveReviewFindingSeverity, resolveReviewLadderPolicy, resolveTraceWriteSinks, reviewCycleStateFor, reviewFocusFromIssueBody, reviewPromptSectionSchema, reviewPromptSectionsSchema, run, runBoundaryCheck, runDemandWaive, runEvidenceEmit, runPrPublish, runPrReady, runPrReview, runPrVerify, scanFactoryTraceDiagnostics, scanFactoryTraceEvents, selectWaiversForCandidate, staleRepeatLadderFindings, toFactoryTraceEnvelope, tryAppendReviewGateNotRequiredTraceEvent, tryAppendReviewLadderStageTraceEvent, validateBoundaryCheckProof, validateDagDocument, validateDemandWaiverStore, validateFactoryTraceEvent, validateMergeFreezeState, validatePrReadyProof, validatePrReviewProof, validatePrVerifyProof, waivedDemandNotice, waivedDemandSchema, worktree_scratch_files_d_exports as worktreeScratchFiles };
4601
+ 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, type FactoryCliInvocation, FactoryCliInvocationSchema, type FactoryPrStatusCheckName, type FactoryPrStatusSources, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FindingDisposition, type FindingLedgerEntry, type FollowUpAction, FollowUpActionSchema, type ImpactScopeDecision, type ImpactScopeSurface, type IssueReviewFocus, type LadderDispositionDeclaration, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeState, type PlanFactoryPrStatusHudInput, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, 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 ReviewLadderCycle, type ReviewLadderEvaluation, type ReviewLadderPolicy, type ReviewLadderStageEvent, type ReviewLadderTraceIdentity, 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, type WorkerCloseoutLessonsTraceEvent, appendReviewLadderStageTraceEvent, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertFactoryPrStatusIdentity, assertWorkerCheckoutAllowed, authorizeDemandWaiver, batteryScopeSummaryLines, blockingLadderFindings, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildReviewGateNotRequiredTraceEvent, buildReviewLadderStageTraceEvent, comment_provenance_d_exports as commentProvenance, createLocalJsonlTraceSink, createProgram, createVerificationRunContext, doctorProjectProfile, epicStructureEventId, evaluateReviewLadder, evidenceEnvelopeFilename, findingKey, followUpFromArgv, impactStampScopeDecision, inferFixedInThreadDispositions, isProductionHqUrl, loadProjectProfile, normalizeIssueComments, openLadderFindings, 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, readPrReviewProof, refreshFactoryPrStatusHud, refreshFactoryPrStatusHudSafely, renderFactoryPrStatusHud, resolveFactoryRepository, resolveFindingBlocking, resolveReviewFindingCategory, resolveReviewFindingSeverity, resolveReviewLadderPolicy, resolveTraceWriteSinks, reviewCycleStateFor, reviewFocusFromIssueBody, reviewPromptSectionSchema, reviewPromptSectionsSchema, run, runBoundaryCheck, runDemandWaive, runEvidenceEmit, runPrPublish, runPrReady, runPrReview, runPrVerify, scanFactoryTraceDiagnostics, scanFactoryTraceEvents, selectWaiversForCandidate, staleRepeatLadderFindings, toFactoryTraceEnvelope, tryAppendReviewGateNotRequiredTraceEvent, tryAppendReviewLadderStageTraceEvent, validateBoundaryCheckProof, validateDagDocument, validateDemandWaiverStore, validateFactoryTraceEvent, validateMergeFreezeState, validatePrReadyProof, validatePrReviewProof, validatePrVerifyProof, validatePreviewLifecyclePlan, waivedDemandNotice, waivedDemandSchema, worktree_scratch_files_d_exports as worktreeScratchFiles };