@patronage/software-factory 0.25.0 → 0.30.0-alpha.1
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/CONTEXT.md +1 -1
- package/README.md +5 -5
- package/dist/index.d.ts +284 -392
- package/dist/index.js +1149 -1099
- package/dist/schemas.d.ts +60 -168
- package/dist/schemas.js +39 -70
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ interface GithubIssueComment {
|
|
|
26
26
|
}
|
|
27
27
|
declare const normalizeIssueComments: (value: GithubIssueCommentApi[] | GithubIssueCommentApi[][]) => GithubIssueComment[];
|
|
28
28
|
declare namespace boundary_review_proof_d_exports {
|
|
29
|
-
export { BOUNDARY_REVIEW_PROOF_KIND, BoundaryReviewProof, BoundaryReviewProofComment, boundaryReviewProofSchema, selectBoundaryReviewProof, undispositionedBlockingFindings };
|
|
29
|
+
export { BOUNDARY_REVIEW_PROOF_KIND, BoundaryReviewProof, BoundaryReviewProofComment, boundaryReviewProofAuthorsSeen, boundaryReviewProofSchema, selectBoundaryReviewProof, undispositionedBlockingFindings };
|
|
30
30
|
}
|
|
31
31
|
declare const BOUNDARY_REVIEW_PROOF_KIND = "boundary-review-proof";
|
|
32
32
|
declare const boundaryReviewProofBaseSchema: z.ZodObject<{
|
|
@@ -124,6 +124,7 @@ interface BoundaryReviewProofComment {
|
|
|
124
124
|
commentUrl?: string;
|
|
125
125
|
}
|
|
126
126
|
declare const selectBoundaryReviewProof: (comments: GithubIssueComment[], boundary: string, declaredBy: string) => BoundaryReviewProofComment | undefined;
|
|
127
|
+
declare const boundaryReviewProofAuthorsSeen: (comments: GithubIssueComment[], boundary: string) => string[];
|
|
127
128
|
declare const undispositionedBlockingFindings: (proof: BoundaryReviewProof) => string[];
|
|
128
129
|
//#endregion
|
|
129
130
|
//#region src/hq-ingest-sink.d.ts
|
|
@@ -461,6 +462,27 @@ declare const blockedReasonSchema: z.ZodObject<{
|
|
|
461
462
|
}, z.core.$strip>;
|
|
462
463
|
type BlockedReason = z.infer<typeof blockedReasonSchema>;
|
|
463
464
|
//#endregion
|
|
465
|
+
//#region src/arm-auto-merge.d.ts
|
|
466
|
+
interface ArmAutoMergeInput {
|
|
467
|
+
cwd: string;
|
|
468
|
+
/** The validated PR head this arming is a compare-and-set against. */
|
|
469
|
+
headSha: string;
|
|
470
|
+
owner: string;
|
|
471
|
+
pr: number;
|
|
472
|
+
repo: string;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* What the PR actually did, read back after the call — never inferred from the
|
|
476
|
+
* exit code. `not-armed` is a failure: the candidate is admitted but nothing
|
|
477
|
+
* will merge it, so it carries the detail and `pr:ready` emits a re-dispatch.
|
|
478
|
+
*/
|
|
479
|
+
interface ArmAutoMergeOutcome {
|
|
480
|
+
/** Why the arming did not take effect, or what the invocation reported. */
|
|
481
|
+
detail?: string;
|
|
482
|
+
headSha: string;
|
|
483
|
+
outcome: "armed" | "merged" | "not-armed";
|
|
484
|
+
}
|
|
485
|
+
//#endregion
|
|
464
486
|
//#region src/checkout-repository.d.ts
|
|
465
487
|
interface CheckoutRepository {
|
|
466
488
|
name: string;
|
|
@@ -497,235 +519,30 @@ declare const followUpFromArgv: (argv: string[]) => FollowUpAction;
|
|
|
497
519
|
/** Canonical zod schema for the optional follow-up field on JSON outputs. */
|
|
498
520
|
declare const FollowUpActionSchema: z.ZodType<FollowUpAction>;
|
|
499
521
|
//#endregion
|
|
500
|
-
//#region src/
|
|
501
|
-
|
|
502
|
-
author: {
|
|
503
|
-
login?: string;
|
|
504
|
-
};
|
|
505
|
-
body: string;
|
|
506
|
-
/** GraphQL `PullRequestReview.lastEditedAt` — REST's `/pulls/reviews` has no equivalent (#843). */
|
|
507
|
-
lastEditedAt?: string;
|
|
508
|
-
state: string;
|
|
509
|
-
submittedAt?: string;
|
|
510
|
-
url: string;
|
|
511
|
-
}
|
|
512
|
-
//#endregion
|
|
513
|
-
//#region src/merge-freeze.d.ts
|
|
514
|
-
declare const MERGE_FREEZE_CHECK_NAME = "patronage-factory/merge-freeze";
|
|
515
|
-
declare const MERGE_FREEZE_APP_SLUG = "patronage-factory";
|
|
516
|
-
declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
517
|
-
active: z.ZodLiteral<true>;
|
|
518
|
-
generationId: z.ZodNumber;
|
|
519
|
-
headSha: z.ZodString;
|
|
520
|
-
outcome: z.ZodEnum<{
|
|
521
|
-
active: "active";
|
|
522
|
-
stale: "stale";
|
|
523
|
-
}>;
|
|
524
|
-
reason: z.ZodString;
|
|
525
|
-
recordedAt: z.ZodISODateTime;
|
|
526
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
527
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
528
|
-
active: z.ZodLiteral<false>;
|
|
529
|
-
clearRationale: z.ZodOptional<z.ZodString>;
|
|
530
|
-
generationId: z.ZodNumber;
|
|
531
|
-
headSha: z.ZodString;
|
|
532
|
-
outcome: z.ZodLiteral<"inactive">;
|
|
533
|
-
reason: z.ZodString;
|
|
534
|
-
recordedAt: z.ZodISODateTime;
|
|
535
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
536
|
-
}, z.core.$strip>], "active">;
|
|
537
|
-
type MergeFreezeState = z.infer<typeof mergeFreezeStateSchema>;
|
|
538
|
-
/**
|
|
539
|
-
* The write side of this contract lives in the generated main-push verify
|
|
540
|
-
* workflow (#356, ADR 0016 as amended): it is the ONLY producer of
|
|
541
|
-
* `patronage-factory/merge-freeze` generations. Its emitted `output.text`
|
|
542
|
-
* payload must parse under this exact reader schema, which is what the
|
|
543
|
-
* workflow's own tests assert through this export.
|
|
544
|
-
*/
|
|
545
|
-
declare function validateMergeFreezeState(value: unknown): MergeFreezeState;
|
|
546
|
-
interface MergeFreezeStoreInput {
|
|
547
|
-
cwd: string;
|
|
548
|
-
headSha: string;
|
|
549
|
-
repository: CheckoutRepository;
|
|
550
|
-
}
|
|
551
|
-
interface MergeFreezeStore {
|
|
552
|
-
read: (input: MergeFreezeStoreInput) => unknown;
|
|
553
|
-
}
|
|
554
|
-
declare namespace worktree_held_branch_d_exports {
|
|
555
|
-
export { MergeOperationalNotices, WorktreeHeldBranch, WorktreeHeldBranchCheck, WorktreeListEntry, checkWorktreeHeldBranch, findWorktreeHeldBranch, formatHeldBranchCloseoutSummary, listWorktreesPorcelain, parseGitWorktreeList, resolveMergeOperationalNotices, worktreeHeldBranchNotice };
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
* Detects when a PR head branch is checked out in a local git worktree.
|
|
559
|
-
*
|
|
560
|
-
* `gh pr merge --delete-branch` fails when the local branch is held by a
|
|
561
|
-
* worktree (git refuses to delete a checked-out branch), which previously
|
|
562
|
-
* broke the auto-merge lane mid-merge (patronage/internal#284). The merge
|
|
563
|
-
* preflight surfaces this as an actionable notice — not a hard fail — so the
|
|
564
|
-
* operator merges without `--delete-branch` (or prunes the worktree first)
|
|
565
|
-
* and defers local branch cleanup to closeout.
|
|
566
|
-
*/
|
|
567
|
-
interface WorktreeHeldBranch {
|
|
568
|
-
branch: string;
|
|
569
|
-
worktreePath: string;
|
|
570
|
-
}
|
|
571
|
-
interface WorktreeListEntry {
|
|
572
|
-
branch?: string;
|
|
573
|
-
path: string;
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Parses `git worktree list --porcelain` output. Entries are separated by
|
|
577
|
-
* blank lines; each starts with `worktree <path>` and carries an optional
|
|
578
|
-
* `branch refs/heads/<name>` attribute (detached worktrees have none).
|
|
579
|
-
*/
|
|
580
|
-
declare function parseGitWorktreeList(porcelain: string): WorktreeListEntry[];
|
|
581
|
-
/**
|
|
582
|
-
* Returns the worktree holding `branch`, or undefined when no local worktree
|
|
583
|
-
* has it checked out (or the porcelain listing was unavailable).
|
|
584
|
-
*/
|
|
585
|
-
declare function findWorktreeHeldBranch({
|
|
586
|
-
branch,
|
|
587
|
-
worktreeListPorcelain
|
|
588
|
-
}: {
|
|
589
|
-
branch: string;
|
|
590
|
-
worktreeListPorcelain: string | undefined;
|
|
591
|
-
}): undefined | WorktreeHeldBranch;
|
|
592
|
-
declare function worktreeHeldBranchNotice(held: WorktreeHeldBranch): string;
|
|
593
|
-
interface MergeOperationalNotices {
|
|
594
|
-
notices: string[];
|
|
595
|
-
worktreeHeldBranch?: WorktreeHeldBranch;
|
|
596
|
-
worktreeHeldBranches?: WorktreeHeldBranch[];
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* Single entry point for non-blocking merge preflight notices, mirroring
|
|
600
|
-
* `resolveMergeGuardIdentity`/`mergeGuardBlockingReasons` in
|
|
601
|
-
* merge-identity.ts: adding a notice kind never requires coordinated edits
|
|
602
|
-
* in the command runner, and persisted notice strings cannot drift from the
|
|
603
|
-
* structured detection result.
|
|
604
|
-
*/
|
|
605
|
-
declare function resolveMergeOperationalNotices({
|
|
606
|
-
headRefName,
|
|
607
|
-
worktreeListPorcelain
|
|
608
|
-
}: {
|
|
609
|
-
headRefName: string | undefined;
|
|
610
|
-
worktreeListPorcelain: string | undefined;
|
|
611
|
-
}): MergeOperationalNotices;
|
|
612
|
-
/**
|
|
613
|
-
* Shared `git worktree list --porcelain` reader for merge preflight and
|
|
614
|
-
* closeout. Returns undefined when the directory is missing, not a git
|
|
615
|
-
* repository, or git is unavailable — detection is best-effort and callers
|
|
616
|
-
* report "skipped" rather than fabricating a result.
|
|
617
|
-
*/
|
|
618
|
-
declare function listWorktreesPorcelain(cwd: string): string | undefined;
|
|
619
|
-
interface WorktreeHeldBranchCheck {
|
|
620
|
-
held?: WorktreeHeldBranch;
|
|
621
|
-
/** "skipped" means no branch was recorded or worktrees were unlistable. */
|
|
622
|
-
status: "clean" | "held" | "skipped";
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* Closeout-side counterpart to the merge-preflight notice: the merge step
|
|
626
|
-
* defers local branch cleanup to closeout, so closeout planning checks
|
|
627
|
-
* whether the worker branch is still held by a worktree (#284).
|
|
628
|
-
*/
|
|
629
|
-
declare function checkWorktreeHeldBranch({
|
|
630
|
-
branch,
|
|
631
|
-
worktreeListPorcelain
|
|
632
|
-
}: {
|
|
633
|
-
branch: string | undefined;
|
|
634
|
-
worktreeListPorcelain: string | undefined;
|
|
635
|
-
}): WorktreeHeldBranchCheck;
|
|
636
|
-
/** One-line closeout summary, owned beside the detection logic. */
|
|
637
|
-
declare function formatHeldBranchCloseoutSummary(check: WorktreeHeldBranchCheck): string;
|
|
638
|
-
declare namespace merge_identity_d_exports {
|
|
639
|
-
export { LiveHeadInput, MergeGuardIdentity, MergeIdentityResult, PostProofCommit, ReadyProofForMergeIdentity, evaluateMergeIdentity, mergeGuardBlockingReasons, mergeGuardIdentitySchema, resolveMergeGuardIdentity };
|
|
640
|
-
}
|
|
641
|
-
interface PostProofCommit {
|
|
642
|
-
sha: string;
|
|
643
|
-
subject: string;
|
|
644
|
-
}
|
|
522
|
+
//#region src/pr-readiness/handled-human-comments.d.ts
|
|
523
|
+
declare const HANDLED_COMMENTS_PAYLOAD_KIND: "handled-human-comments";
|
|
645
524
|
/**
|
|
646
|
-
*
|
|
647
|
-
*
|
|
648
|
-
* structurally assignable to this type.
|
|
525
|
+
* Authenticated producer of the durable handled set. Recorded on the readiness
|
|
526
|
+
* ledger; unverifiable producers are ignored on read (fail closed).
|
|
649
527
|
*/
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
* at evaluation time. The merge guard compares it to the live pushed
|
|
656
|
-
* HEAD with exact equality.
|
|
657
|
-
*/
|
|
658
|
-
headSha: string;
|
|
659
|
-
pr: number;
|
|
660
|
-
};
|
|
661
|
-
status: string;
|
|
528
|
+
type HandledCommentsProducerMode = "app" | "commit-status";
|
|
529
|
+
interface HandledCommentsProducer {
|
|
530
|
+
/** App id (stringified) or GitHub login, depending on mode. */
|
|
531
|
+
identity: string;
|
|
532
|
+
mode: HandledCommentsProducerMode;
|
|
662
533
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
kind: "diverged";
|
|
668
|
-
liveHeadSha: string;
|
|
669
|
-
postProofCommits?: PostProofCommit[];
|
|
670
|
-
proofHeadSha: string;
|
|
671
|
-
};
|
|
672
|
-
type MergeGuardIdentity = MergeIdentityResult | {
|
|
673
|
-
kind: "live-head-invalid";
|
|
674
|
-
pr: number;
|
|
675
|
-
received: string;
|
|
676
|
-
} | {
|
|
677
|
-
kind: "ready-proof-missing";
|
|
678
|
-
errorDetail?: string;
|
|
679
|
-
readyProofPath: string;
|
|
680
|
-
} | {
|
|
681
|
-
kind: "ready-proof-pr-mismatch";
|
|
682
|
-
proofPr: number;
|
|
683
|
-
requestedPr: number;
|
|
684
|
-
} | {
|
|
685
|
-
kind: "ready-proof-not-ready";
|
|
686
|
-
blockingReasons: string[];
|
|
687
|
-
status: string;
|
|
688
|
-
};
|
|
689
|
-
declare const evaluateMergeIdentity: ({
|
|
690
|
-
liveHeadSha,
|
|
691
|
-
postProofCommits,
|
|
692
|
-
proofHeadSha
|
|
693
|
-
}: {
|
|
694
|
-
liveHeadSha: string;
|
|
695
|
-
postProofCommits?: PostProofCommit[];
|
|
696
|
-
proofHeadSha: string;
|
|
697
|
-
}) => MergeIdentityResult;
|
|
698
|
-
/**
|
|
699
|
-
* The live PR head as fetched from GitHub: either a validated 40-hex SHA or
|
|
700
|
-
* the raw (stringified) response that failed validation.
|
|
701
|
-
*/
|
|
702
|
-
type LiveHeadInput = {
|
|
703
|
-
headSha: string;
|
|
704
|
-
} | {
|
|
705
|
-
invalidResponse: string;
|
|
706
|
-
};
|
|
707
|
-
/**
|
|
708
|
-
* Single entry point that owns construction of every MergeGuardIdentity
|
|
709
|
-
* kind, so adding or changing a kind never requires coordinated edits in the
|
|
710
|
-
* command runner.
|
|
711
|
-
*/
|
|
712
|
-
declare const resolveMergeGuardIdentity: ({
|
|
713
|
-
commitsBetween,
|
|
714
|
-
liveHead,
|
|
715
|
-
pr,
|
|
716
|
-
readyProof,
|
|
717
|
-
readyProofError,
|
|
718
|
-
readyProofPath
|
|
719
|
-
}: {
|
|
720
|
-
commitsBetween?: (fromSha: string, toSha: string) => PostProofCommit[] | undefined;
|
|
721
|
-
liveHead: LiveHeadInput;
|
|
534
|
+
interface HandledCommentsCheckPayload {
|
|
535
|
+
clearedAt?: string;
|
|
536
|
+
handledCommentUrls: string[];
|
|
537
|
+
kind: typeof HANDLED_COMMENTS_PAYLOAD_KIND;
|
|
722
538
|
pr: number;
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
declare const
|
|
539
|
+
schemaVersion: 1;
|
|
540
|
+
sessionId?: string;
|
|
541
|
+
}
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/diff-classification.d.ts
|
|
544
|
+
declare const DIFF_CLASSIFICATIONS: readonly ["docs/process-only", "trivial", "non-trivial"];
|
|
545
|
+
type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
|
|
729
546
|
//#endregion
|
|
730
547
|
//#region src/profile.d.ts
|
|
731
548
|
declare const DEFAULT_FACTORY_REPOSITORY = "unknown/unknown";
|
|
@@ -762,12 +579,11 @@ declare const factoryProjectProfileSchema: z.ZodObject<{
|
|
|
762
579
|
}>;
|
|
763
580
|
name: z.ZodString;
|
|
764
581
|
scope: z.ZodOptional<z.ZodObject<{
|
|
765
|
-
classifications: z.
|
|
582
|
+
classifications: z.ZodArray<z.ZodEnum<{
|
|
766
583
|
trivial: "trivial";
|
|
767
584
|
"docs/process-only": "docs/process-only";
|
|
768
585
|
"non-trivial": "non-trivial";
|
|
769
|
-
}
|
|
770
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
586
|
+
}>>;
|
|
771
587
|
}, z.core.$strict>>;
|
|
772
588
|
}, z.core.$strict>>>;
|
|
773
589
|
review: z.ZodObject<{
|
|
@@ -817,138 +633,6 @@ interface LoadProjectProfileResult {
|
|
|
817
633
|
}
|
|
818
634
|
declare function loadProjectProfile(input?: LoadProjectProfileInput): LoadProjectProfileResult;
|
|
819
635
|
//#endregion
|
|
820
|
-
//#region src/review-rungs.d.ts
|
|
821
|
-
declare const EVIDENCE_REVIEW_RUNGS: readonly ["independent-model", "oracle", "human"];
|
|
822
|
-
type EvidenceReviewRung = (typeof EVIDENCE_REVIEW_RUNGS)[number];
|
|
823
|
-
//#endregion
|
|
824
|
-
//#region src/pr-merge-check.d.ts
|
|
825
|
-
interface PrMergeCheckArgs extends LoadProjectProfileInput {
|
|
826
|
-
epic?: number;
|
|
827
|
-
json?: boolean;
|
|
828
|
-
output?: string;
|
|
829
|
-
pr: number;
|
|
830
|
-
readyProof?: string;
|
|
831
|
-
}
|
|
832
|
-
interface PrMergeCheckProof {
|
|
833
|
-
schemaVersion: 1;
|
|
834
|
-
blockingReasons: string[];
|
|
835
|
-
boundary?: {
|
|
836
|
-
autoMerge: boolean;
|
|
837
|
-
epic: number;
|
|
838
|
-
review: EvidenceReviewRung;
|
|
839
|
-
wave: string;
|
|
840
|
-
};
|
|
841
|
-
command: "patronage-factory pr:merge-check";
|
|
842
|
-
/**
|
|
843
|
-
* Machine-safe arg array for the obvious next action (#523): on `pass`, the
|
|
844
|
-
* remote-only GitHub merge API invocation for this PR; on `fail`, the re-run that clears the
|
|
845
|
-
* block (`pr:ready`, or `pr:verify` then `pr:ready` after a head
|
|
846
|
-
* divergence). Same `argv` shape `factory:delegate --print` emits. Optional
|
|
847
|
-
* and purely additive — existing consumers ignore it.
|
|
848
|
-
*/
|
|
849
|
-
followUp?: FollowUpAction;
|
|
850
|
-
identity: MergeGuardIdentity;
|
|
851
|
-
/**
|
|
852
|
-
* The pushed PR head SHA fetched from GitHub at check time. Absent only
|
|
853
|
-
* when GitHub returned no usable 40-hex head (identity kind
|
|
854
|
-
* "live-head-invalid"), which is itself a fail-closed blocking state.
|
|
855
|
-
*/
|
|
856
|
-
liveHeadSha?: string;
|
|
857
|
-
/**
|
|
858
|
-
* Actionable operational notices that do not block the merge, e.g. a PR
|
|
859
|
-
* head branch held by a local worktree, which makes
|
|
860
|
-
* `gh pr merge --delete-branch` fail (patronage/internal#284).
|
|
861
|
-
*/
|
|
862
|
-
notices?: string[];
|
|
863
|
-
pr: number;
|
|
864
|
-
status: "pass" | "fail";
|
|
865
|
-
/**
|
|
866
|
-
* Demands that were in force, were NOT met, and were waived by the operator
|
|
867
|
-
* (#354). Each entry carries the demand's refusals verbatim, so a waived
|
|
868
|
-
* demand can never read as a met one; the merge proceeds on the recorded
|
|
869
|
-
* operator act, not on evidence.
|
|
870
|
-
*/
|
|
871
|
-
waivedDemands?: WaivedDemand[];
|
|
872
|
-
/** Present when the PR head branch is checked out in a local worktree. */
|
|
873
|
-
worktreeHeldBranch?: WorktreeHeldBranch;
|
|
874
|
-
/** All merge-relevant branches held by local worktrees (head and default). */
|
|
875
|
-
worktreeHeldBranches?: WorktreeHeldBranch[];
|
|
876
|
-
}
|
|
877
|
-
interface PrMergeCheckGitDependencies {
|
|
878
|
-
checkoutRepository: (cwd: string) => CheckoutRepository;
|
|
879
|
-
commitsBetween: (cwd: string, fromSha: string, toSha: string) => PostProofCommit[] | undefined;
|
|
880
|
-
worktreeListPorcelain: (cwd: string) => string | undefined;
|
|
881
|
-
showFileAtRef: (cwd: string, ref: string, absolutePath: string) => string | undefined;
|
|
882
|
-
objectIdAtRef: (cwd: string, ref: string, absolutePath: string) => string | undefined;
|
|
883
|
-
}
|
|
884
|
-
interface PrMergeCheckDependencies {
|
|
885
|
-
git?: Partial<PrMergeCheckGitDependencies>;
|
|
886
|
-
github?: {
|
|
887
|
-
fetchClosingPullRequests?: (input: {
|
|
888
|
-
issue: number;
|
|
889
|
-
owner: string;
|
|
890
|
-
repo: string;
|
|
891
|
-
}) => {
|
|
892
|
-
number: number;
|
|
893
|
-
}[];
|
|
894
|
-
fetchIssueBody?: (input: {
|
|
895
|
-
issue: number;
|
|
896
|
-
owner: string;
|
|
897
|
-
repo: string;
|
|
898
|
-
}) => string;
|
|
899
|
-
fetchPullRequestHead: (input: {
|
|
900
|
-
cwd: string;
|
|
901
|
-
owner: string;
|
|
902
|
-
pr: number;
|
|
903
|
-
repo: string;
|
|
904
|
-
}) => {
|
|
905
|
-
headRefName?: string;
|
|
906
|
-
headRefOid: string;
|
|
907
|
-
baseRefName?: string;
|
|
908
|
-
baseRefOid?: string;
|
|
909
|
-
mergedAt?: string | null;
|
|
910
|
-
remoteHeadRefExists?: boolean;
|
|
911
|
-
labels?: {
|
|
912
|
-
name: string;
|
|
913
|
-
}[];
|
|
914
|
-
};
|
|
915
|
-
fetchPullRequestReviews?: (input: {
|
|
916
|
-
owner: string;
|
|
917
|
-
pr: number;
|
|
918
|
-
repo: string;
|
|
919
|
-
}) => GithubPullRequestReview[];
|
|
920
|
-
};
|
|
921
|
-
mergeFreeze?: MergeFreezeStore;
|
|
922
|
-
}
|
|
923
|
-
declare function validatePrMergeCheckProof(value: unknown): PrMergeCheckProof;
|
|
924
|
-
declare function readPrMergeCheckProof(filePath: string): PrMergeCheckProof;
|
|
925
|
-
declare function runPrMergeCheck(args: PrMergeCheckArgs, dependencies?: PrMergeCheckDependencies): PrMergeCheckProof;
|
|
926
|
-
//#endregion
|
|
927
|
-
//#region src/pr-readiness/handled-human-comments.d.ts
|
|
928
|
-
declare const HANDLED_COMMENTS_PAYLOAD_KIND: "handled-human-comments";
|
|
929
|
-
/**
|
|
930
|
-
* Authenticated producer of the durable handled set. Recorded on the readiness
|
|
931
|
-
* ledger; unverifiable producers are ignored on read (fail closed).
|
|
932
|
-
*/
|
|
933
|
-
type HandledCommentsProducerMode = "app" | "commit-status";
|
|
934
|
-
interface HandledCommentsProducer {
|
|
935
|
-
/** App id (stringified) or GitHub login, depending on mode. */
|
|
936
|
-
identity: string;
|
|
937
|
-
mode: HandledCommentsProducerMode;
|
|
938
|
-
}
|
|
939
|
-
interface HandledCommentsCheckPayload {
|
|
940
|
-
clearedAt?: string;
|
|
941
|
-
handledCommentUrls: string[];
|
|
942
|
-
kind: typeof HANDLED_COMMENTS_PAYLOAD_KIND;
|
|
943
|
-
pr: number;
|
|
944
|
-
schemaVersion: 1;
|
|
945
|
-
sessionId?: string;
|
|
946
|
-
}
|
|
947
|
-
//#endregion
|
|
948
|
-
//#region src/diff-classification.d.ts
|
|
949
|
-
declare const DIFF_CLASSIFICATIONS: readonly ["docs/process-only", "trivial", "non-trivial"];
|
|
950
|
-
type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
|
|
951
|
-
//#endregion
|
|
952
636
|
//#region src/pr-verify-mode.d.ts
|
|
953
637
|
/**
|
|
954
638
|
* The verification mode `pr:verify` resolved for a run.
|
|
@@ -1074,6 +758,28 @@ interface CheckRunDependencies {
|
|
|
1074
758
|
* human-readable mirror, not a proof surface, so a caller that needs an
|
|
1075
759
|
* App-verified check run must be told plainly whether it got one. Returns
|
|
1076
760
|
* `true` only when the App-owned check run landed.
|
|
761
|
+
*
|
|
762
|
+
* "Landed" means GitHub serves it, not that the POST was accepted (#520). On
|
|
763
|
+
* PR #519 the POST was accepted, `pr:ready` reported ready and armed, and the
|
|
764
|
+
* source-pinned required check read `in_progress` across three runs — so GitHub
|
|
765
|
+
* never scheduled the merge and emitted no rollup row saying why. Arming
|
|
766
|
+
* already refuses to infer its outcome from the invocation and reads the pull
|
|
767
|
+
* request back (`arm-auto-merge.ts`); publication now does the same.
|
|
768
|
+
*
|
|
769
|
+
* "Landed" is judged against every run of the name from the pinned App, not
|
|
770
|
+
* against the one GitHub collapses to (#524): the newest must be *this* run, in
|
|
771
|
+
* the status and conclusion that were published, and no run of the name may
|
|
772
|
+
* still be unfinished. A surviving `in_progress` run blocks the required check
|
|
773
|
+
* on its own, so confirming past it would report success on a pull request
|
|
774
|
+
* GitHub will never merge. One read, no polling: an unconfirmed publication
|
|
775
|
+
* returns `false`, which `pr:ready` already turns into a notice and an
|
|
776
|
+
* idempotent re-dispatch.
|
|
777
|
+
*
|
|
778
|
+
* Confirmation is a point-in-time read, deliberately: a later publication for
|
|
779
|
+
* the same name changes the answer — a completed one by becoming the newest, an
|
|
780
|
+
* unfinished one by holding the check open beside this verdict rather than
|
|
781
|
+
* replacing it — and every remaining writer publishes once, as the last thing
|
|
782
|
+
* its invocation does. No retry, no poll, no re-confirm.
|
|
1077
783
|
*/
|
|
1078
784
|
declare function ensureFactoryCheckRunPublished(input: PublishFactoryCheckInput, dependencies?: CheckRunDependencies & {
|
|
1079
785
|
onDiagnostic?: (message: string) => void;
|
|
@@ -1087,6 +793,79 @@ interface PublishHandledCommentsCheckInput {
|
|
|
1087
793
|
sha: string;
|
|
1088
794
|
}
|
|
1089
795
|
//#endregion
|
|
796
|
+
//#region src/merge-freeze.d.ts
|
|
797
|
+
declare const MERGE_FREEZE_CHECK_NAME = "patronage-factory/merge-freeze";
|
|
798
|
+
declare const MERGE_FREEZE_APP_SLUG = "patronage-factory";
|
|
799
|
+
declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
800
|
+
active: z.ZodLiteral<true>;
|
|
801
|
+
generationId: z.ZodNumber;
|
|
802
|
+
headSha: z.ZodString;
|
|
803
|
+
outcome: z.ZodEnum<{
|
|
804
|
+
active: "active";
|
|
805
|
+
stale: "stale";
|
|
806
|
+
}>;
|
|
807
|
+
reason: z.ZodString;
|
|
808
|
+
recordedAt: z.ZodISODateTime;
|
|
809
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
810
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
811
|
+
active: z.ZodLiteral<false>;
|
|
812
|
+
clearRationale: z.ZodOptional<z.ZodString>;
|
|
813
|
+
generationId: z.ZodNumber;
|
|
814
|
+
headSha: z.ZodString;
|
|
815
|
+
outcome: z.ZodLiteral<"inactive">;
|
|
816
|
+
reason: z.ZodString;
|
|
817
|
+
recordedAt: z.ZodISODateTime;
|
|
818
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
819
|
+
}, z.core.$strip>], "active">;
|
|
820
|
+
type MergeFreezeState = z.infer<typeof mergeFreezeStateSchema>;
|
|
821
|
+
/**
|
|
822
|
+
* The write side of this contract lives in the generated main-push verify
|
|
823
|
+
* workflow (#356, ADR 0016 as amended): it is the ONLY producer of
|
|
824
|
+
* `patronage-factory/merge-freeze` generations. Its emitted `output.text`
|
|
825
|
+
* payload must parse under this exact reader schema, which is what the
|
|
826
|
+
* workflow's own tests assert through this export.
|
|
827
|
+
*/
|
|
828
|
+
declare function validateMergeFreezeState(value: unknown): MergeFreezeState;
|
|
829
|
+
interface MergeFreezeStoreInput {
|
|
830
|
+
cwd: string;
|
|
831
|
+
headSha: string;
|
|
832
|
+
repository: CheckoutRepository;
|
|
833
|
+
}
|
|
834
|
+
interface MergeFreezeStore {
|
|
835
|
+
read: (input: MergeFreezeStoreInput) => unknown;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* The freeze generation as an arming decision needs to see it (#477).
|
|
839
|
+
*
|
|
840
|
+
* `read` above collapses three different situations into one refusal, because
|
|
841
|
+
* merge time treated all of them as "do not merge". Arming time distinguishes
|
|
842
|
+
* them: a settled generation is the writer's verdict, a **settling** one is the
|
|
843
|
+
* window between a merge landing and its main-push verify completing (a
|
|
844
|
+
* running generation, or a missing generation proven by the immediately prior
|
|
845
|
+
* settled tip plus a current source-pinned verify run), and an **unreadable**
|
|
846
|
+
* one is ambiguous, malformed, foreign-App, or unavailable state. Same
|
|
847
|
+
* selection, same pinned App, same `started_at` ordering — only the reporting
|
|
848
|
+
* is finer.
|
|
849
|
+
*/
|
|
850
|
+
type MergeFreezeGeneration = {
|
|
851
|
+
kind: "settled";
|
|
852
|
+
state: MergeFreezeState;
|
|
853
|
+
} | {
|
|
854
|
+
kind: "settling";
|
|
855
|
+
reason: string;
|
|
856
|
+
running?: {
|
|
857
|
+
headSha: string;
|
|
858
|
+
id: number;
|
|
859
|
+
};
|
|
860
|
+
} | {
|
|
861
|
+
kind: "unreadable";
|
|
862
|
+
reason: string;
|
|
863
|
+
};
|
|
864
|
+
/** A merge-freeze reader that can also report the settle window (#477). */
|
|
865
|
+
interface MergeFreezeAuthority extends MergeFreezeStore {
|
|
866
|
+
readGeneration: (input: MergeFreezeStoreInput) => MergeFreezeGeneration;
|
|
867
|
+
}
|
|
868
|
+
//#endregion
|
|
1090
869
|
//#region src/pr-proof-io.d.ts
|
|
1091
870
|
interface ProofDescriptor<T> {
|
|
1092
871
|
label: string;
|
|
@@ -1150,6 +929,10 @@ interface ReviewLadderPolicy {
|
|
|
1150
929
|
}
|
|
1151
930
|
declare const resolveReviewLadderPolicy: (profile: Pick<FactoryProjectProfile, "review">) => ReviewLadderPolicy;
|
|
1152
931
|
//#endregion
|
|
932
|
+
//#region src/review-rungs.d.ts
|
|
933
|
+
declare const EVIDENCE_REVIEW_RUNGS: readonly ["independent-model", "oracle", "human"];
|
|
934
|
+
type EvidenceReviewRung = (typeof EVIDENCE_REVIEW_RUNGS)[number];
|
|
935
|
+
//#endregion
|
|
1153
936
|
//#region src/review-ladder-ledger.d.ts
|
|
1154
937
|
type LadderCycleStage = "interior" | "gate";
|
|
1155
938
|
interface LadderCycleRef {
|
|
@@ -1436,12 +1219,11 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
|
|
|
1436
1219
|
name: z.ZodString;
|
|
1437
1220
|
reason: z.ZodOptional<z.ZodString>;
|
|
1438
1221
|
scope: z.ZodOptional<z.ZodObject<{
|
|
1439
|
-
classifications: z.
|
|
1222
|
+
classifications: z.ZodArray<z.ZodEnum<{
|
|
1440
1223
|
trivial: "trivial";
|
|
1441
1224
|
"docs/process-only": "docs/process-only";
|
|
1442
1225
|
"non-trivial": "non-trivial";
|
|
1443
|
-
}
|
|
1444
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1226
|
+
}>>;
|
|
1445
1227
|
}, z.core.$strict>>;
|
|
1446
1228
|
scopeReason: z.ZodString;
|
|
1447
1229
|
status: z.ZodEnum<{
|
|
@@ -1643,7 +1425,7 @@ type ReadinessStatus = "ready" | "blocked" | "slice-ready/not-final";
|
|
|
1643
1425
|
type ManagedReadinessLedger = z.infer<typeof managedReadinessLedgerSchema>;
|
|
1644
1426
|
declare function validateManagedReadinessLedger(value: unknown): ManagedReadinessLedger;
|
|
1645
1427
|
declare namespace status_check_rollup_d_exports {
|
|
1646
|
-
export { CheckState, StatusCheckRollup, isFactoryReadyCheck, statusCheckState };
|
|
1428
|
+
export { CheckState, HOSTED_VERIFY_CHECK_NAME, StatusCheckRollup, hostedVerifyCheckState, isFactoryReadyCheck, isHostedVerifyCheck, statusCheckState };
|
|
1647
1429
|
}
|
|
1648
1430
|
type CheckState = "passed" | "failed" | "pending" | "none" | "unknown";
|
|
1649
1431
|
interface StatusCheckRollup {
|
|
@@ -1658,6 +1440,38 @@ interface StatusCheckRollup {
|
|
|
1658
1440
|
workflowName?: string;
|
|
1659
1441
|
}
|
|
1660
1442
|
declare const isFactoryReadyCheck: (check: StatusCheckRollup) => boolean;
|
|
1443
|
+
/**
|
|
1444
|
+
* The hosted verification gate's context name — the branch ruleset's other
|
|
1445
|
+
* source-pinned required check, alongside `patronage-factory/pr-ready`. One
|
|
1446
|
+
* name across the fleet because one generator emits the workflow that posts
|
|
1447
|
+
* it (ADR 0016, 2026-07-31 amendment).
|
|
1448
|
+
*/
|
|
1449
|
+
declare const HOSTED_VERIFY_CHECK_NAME = "verify";
|
|
1450
|
+
/**
|
|
1451
|
+
* Is this rollup entry the hosted `verify` gate, from the producer the
|
|
1452
|
+
* ruleset pins it to?
|
|
1453
|
+
*
|
|
1454
|
+
* `workflowName` is the producer signal the rollup actually carries: GitHub
|
|
1455
|
+
* Actions check runs name their workflow, App-posted check runs come back with
|
|
1456
|
+
* an empty one, and a user-token commit status arrives as a `context` with no
|
|
1457
|
+
* `name` at all. Epic #473 wave 2 measured that a same-named check from the
|
|
1458
|
+
* wrong writer is as inert as no check at all, so matching the name alone
|
|
1459
|
+
* would accept exactly the thing the pin rejects.
|
|
1460
|
+
*/
|
|
1461
|
+
declare const isHostedVerifyCheck: (check: StatusCheckRollup) => boolean;
|
|
1462
|
+
/**
|
|
1463
|
+
* The hosted `verify` gate's state on this head, read by presence (#477).
|
|
1464
|
+
*
|
|
1465
|
+
* This is the one rollup question the rollup can answer honestly. Wave 2
|
|
1466
|
+
* measured that GitHub omits an *unsatisfied pinned requirement* from
|
|
1467
|
+
* `statusCheckRollup` entirely — there is no "expected" or "missing" row — so
|
|
1468
|
+
* a green rollup is not evidence of mergeability. What the rollup does report
|
|
1469
|
+
* faithfully is the checks that ran. Asking whether this specific check ran,
|
|
1470
|
+
* and passed, on this head turns the rollup's silence from a false green into
|
|
1471
|
+
* a named refusal: `"none"` means the pinned requirement is unsatisfied and
|
|
1472
|
+
* nothing else in the rollup would have said so.
|
|
1473
|
+
*/
|
|
1474
|
+
declare const hostedVerifyCheckState: (rollup: StatusCheckRollup[] | undefined) => CheckState;
|
|
1661
1475
|
declare const statusCheckState: (rollup: StatusCheckRollup[] | undefined, exclude?: (check: StatusCheckRollup) => boolean) => CheckState;
|
|
1662
1476
|
//#endregion
|
|
1663
1477
|
//#region src/pr-ready.d.ts
|
|
@@ -1676,6 +1490,21 @@ interface PrReadyArgs extends LoadProjectProfileInput {
|
|
|
1676
1490
|
verifyProof?: string;
|
|
1677
1491
|
}
|
|
1678
1492
|
interface GitHubPullRequest {
|
|
1493
|
+
/**
|
|
1494
|
+
* GitHub's live auto-merge enablement, or `null` when nothing is scheduled.
|
|
1495
|
+
*
|
|
1496
|
+
* Required, not optional (#515 review). `gh pr view --json autoMergeRequest`
|
|
1497
|
+
* always returns the key — explicitly `null` when nothing is scheduled — and
|
|
1498
|
+
* errors loudly on a field name it does not know, so there is no shape where
|
|
1499
|
+
* the real CLI omits it. But `fetchPullRequest` is injectable, and an
|
|
1500
|
+
* implementation that left the field out would silently disable the
|
|
1501
|
+
* `boundary-wave` refusal that stops an epicless run from greening a
|
|
1502
|
+
* candidate GitHub is already scheduled to merge. Requiring it makes the
|
|
1503
|
+
* compiler enforce what `gh` already promises.
|
|
1504
|
+
*/
|
|
1505
|
+
autoMergeRequest: {
|
|
1506
|
+
enabledAt?: string;
|
|
1507
|
+
} | null;
|
|
1679
1508
|
baseRefName: string;
|
|
1680
1509
|
baseRefOid: string;
|
|
1681
1510
|
body: string;
|
|
@@ -1691,9 +1520,6 @@ interface GitHubPullRequest {
|
|
|
1691
1520
|
}[];
|
|
1692
1521
|
headRefOid: string;
|
|
1693
1522
|
isDraft: boolean;
|
|
1694
|
-
labels?: {
|
|
1695
|
-
name: string;
|
|
1696
|
-
}[];
|
|
1697
1523
|
mergeStateStatus: string;
|
|
1698
1524
|
mergeable: string;
|
|
1699
1525
|
number: number;
|
|
@@ -1713,7 +1539,20 @@ interface GitHubPullRequest {
|
|
|
1713
1539
|
url: string;
|
|
1714
1540
|
}
|
|
1715
1541
|
interface PrReadyProof {
|
|
1716
|
-
schemaVersion:
|
|
1542
|
+
schemaVersion: 3;
|
|
1543
|
+
/**
|
|
1544
|
+
* What GitHub actually did when this run armed native auto-merge (#477).
|
|
1545
|
+
* Present exactly when readiness passed and the arming ran; read back from
|
|
1546
|
+
* the PR rather than inferred from the invocation, because `gh pr merge
|
|
1547
|
+
* --auto` arms, merges, or does nothing with the same exit code and the same
|
|
1548
|
+
* empty output. `not-armed` means the candidate is admitted but nothing will
|
|
1549
|
+
* merge it, and `followUp` carries the re-dispatch.
|
|
1550
|
+
*/
|
|
1551
|
+
arming?: {
|
|
1552
|
+
detail?: string;
|
|
1553
|
+
headSha: string;
|
|
1554
|
+
outcome: "armed" | "merged" | "not-armed";
|
|
1555
|
+
};
|
|
1717
1556
|
/**
|
|
1718
1557
|
* Why this run blocked, one entry per refusing demand (#391): `code` is the
|
|
1719
1558
|
* demand key from the resolver's vocabulary, `detail` the one-sentence
|
|
@@ -1726,11 +1565,12 @@ interface PrReadyProof {
|
|
|
1726
1565
|
humanBlockingReasons: string[];
|
|
1727
1566
|
command: "patronage-factory pr:ready";
|
|
1728
1567
|
/**
|
|
1729
|
-
* Machine-safe arg array for the obvious next action (#523): when `ready
|
|
1730
|
-
*
|
|
1731
|
-
*
|
|
1732
|
-
* pr:
|
|
1733
|
-
*
|
|
1568
|
+
* Machine-safe arg array for the obvious next action (#523): when `ready`
|
|
1569
|
+
* but arming did not take effect, a `pr:ready` re-dispatch (idempotent on
|
|
1570
|
+
* an unchanged head); otherwise the `gh pr ready` undraft repair or the
|
|
1571
|
+
* `pr:verify` re-run that the blocking reasons name (re-verify the head,
|
|
1572
|
+
* then re-run pr:ready). Same `argv` shape `factory:delegate --print`
|
|
1573
|
+
* emits. Optional and purely additive.
|
|
1734
1574
|
*/
|
|
1735
1575
|
followUp?: FollowUpAction;
|
|
1736
1576
|
/**
|
|
@@ -1740,6 +1580,12 @@ interface PrReadyProof {
|
|
|
1740
1580
|
* pushed HEAD, not a re-derivation. See the ledger schema.
|
|
1741
1581
|
*/
|
|
1742
1582
|
ledger: ManagedReadinessLedger;
|
|
1583
|
+
/**
|
|
1584
|
+
* Actionable facts that did not block (#477): a settling merge-freeze
|
|
1585
|
+
* generation that armed with a notice, and how each waived demand reads to a
|
|
1586
|
+
* human. Absent when there are none.
|
|
1587
|
+
*/
|
|
1588
|
+
notices?: string[];
|
|
1743
1589
|
/** Committed profile blob evaluated by readiness. Required for merge. */
|
|
1744
1590
|
profileBlobSha?: string;
|
|
1745
1591
|
/** Checkout-relative committed profile path evaluated by readiness. */
|
|
@@ -1748,9 +1594,22 @@ interface PrReadyProof {
|
|
|
1748
1594
|
/** Trusted checkout repository used for all GitHub reads and writes. */
|
|
1749
1595
|
repository?: string;
|
|
1750
1596
|
status: ReadinessStatus;
|
|
1597
|
+
/**
|
|
1598
|
+
* Demands that were in force, were NOT met, and were waived by the operator
|
|
1599
|
+
* (#354, moved here from the merge-time proof by #477). Each entry carries
|
|
1600
|
+
* the demand's refusals verbatim, so a waived demand can never read as a met
|
|
1601
|
+
* one; the arming proceeds on the recorded operator act, not on evidence.
|
|
1602
|
+
*/
|
|
1603
|
+
waivedDemands?: WaivedDemand[];
|
|
1751
1604
|
}
|
|
1752
1605
|
type PublishHandledCommentsResult = HandledCommentsProducer | Promise<HandledCommentsProducer | undefined> | undefined;
|
|
1753
1606
|
interface PrReadyDependencies {
|
|
1607
|
+
/**
|
|
1608
|
+
* Arms GitHub native auto-merge for a passing candidate (#477). Defaults to
|
|
1609
|
+
* the real `gh pr merge --auto` call plus the read-back that says what
|
|
1610
|
+
* actually happened.
|
|
1611
|
+
*/
|
|
1612
|
+
armAutoMerge?: (input: ArmAutoMergeInput) => ArmAutoMergeOutcome;
|
|
1754
1613
|
github?: {
|
|
1755
1614
|
fetchClosingPullRequests?: (input: {
|
|
1756
1615
|
issue: number;
|
|
@@ -1786,7 +1645,26 @@ interface PrReadyDependencies {
|
|
|
1786
1645
|
};
|
|
1787
1646
|
git?: PrReadyGitDependencies;
|
|
1788
1647
|
hq?: HqIngestDependencies;
|
|
1789
|
-
|
|
1648
|
+
/**
|
|
1649
|
+
* The authoritative merge-freeze reader (#477). Defaults to the pinned-App
|
|
1650
|
+
* GitHub check-run authority — readiness is a control, so an absent
|
|
1651
|
+
* dependency must not mean an unread freeze.
|
|
1652
|
+
*/
|
|
1653
|
+
mergeFreeze?: Pick<MergeFreezeAuthority, "readGeneration">;
|
|
1654
|
+
/**
|
|
1655
|
+
* Awaited publication of the branded check, which is a source-pinned
|
|
1656
|
+
* required check rather than a mirror (#477). Returns true only when the
|
|
1657
|
+
* App-owned run landed. Defaults to `ensureFactoryCheckRunPublished`.
|
|
1658
|
+
*
|
|
1659
|
+
* `pr:ready` has no other publication seam, and this one cannot express a
|
|
1660
|
+
* non-terminal run (#526): `status` is omitted from the input, so every run
|
|
1661
|
+
* readiness creates is completed with a conclusion. A `pr:ready` invocation
|
|
1662
|
+
* therefore cannot leave a run holding the source-pinned required check
|
|
1663
|
+
* open, which is a permanent block on the pull request (#524).
|
|
1664
|
+
*/
|
|
1665
|
+
publishFinalCheckRun?: (input: Omit<PublishFactoryCheckInput, "status"> & {
|
|
1666
|
+
conclusion: "failure" | "success";
|
|
1667
|
+
}) => Promise<boolean> | boolean;
|
|
1790
1668
|
/** Injectable delay for the UNKNOWN-mergeable brief poll (tests). */
|
|
1791
1669
|
sleep?: (ms: number) => Promise<void>;
|
|
1792
1670
|
/** Injectable clock for CLI handled-comment provenance (tests). */
|
|
@@ -1811,16 +1689,14 @@ declare function runPrReady(args: PrReadyArgs, dependencies?: PrReadyDependencie
|
|
|
1811
1689
|
declare const EVIDENCE_CHECK_TYPES: readonly ["review", "verify"];
|
|
1812
1690
|
type EvidenceCheckType = (typeof EVIDENCE_CHECK_TYPES)[number];
|
|
1813
1691
|
declare const requiredCheckScopeSchema: z.ZodObject<{
|
|
1814
|
-
classifications: z.
|
|
1692
|
+
classifications: z.ZodArray<z.ZodEnum<{
|
|
1815
1693
|
trivial: "trivial";
|
|
1816
1694
|
"docs/process-only": "docs/process-only";
|
|
1817
1695
|
"non-trivial": "non-trivial";
|
|
1818
|
-
}
|
|
1819
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1696
|
+
}>>;
|
|
1820
1697
|
}, z.core.$strict>;
|
|
1821
1698
|
type RequiredCheckScope = z.infer<typeof requiredCheckScopeSchema>;
|
|
1822
1699
|
interface RequiredCheckScopeContext {
|
|
1823
|
-
labels: string[] | undefined;
|
|
1824
1700
|
classification: DiffClassification | undefined;
|
|
1825
1701
|
}
|
|
1826
1702
|
interface ScopeDecision {
|
|
@@ -2571,9 +2447,6 @@ declare const runDemandWaive: (args: DemandWaiveArgs, dependencies?: DemandWaive
|
|
|
2571
2447
|
//#region src/commands/demand-waive.d.ts
|
|
2572
2448
|
type DemandWaiveAction = (args: DemandWaiveArgs) => DemandWaiver;
|
|
2573
2449
|
//#endregion
|
|
2574
|
-
//#region src/commands/pr-merge-check.d.ts
|
|
2575
|
-
type PrMergeCheckAction = (args: PrMergeCheckArgs) => PrMergeCheckProof;
|
|
2576
|
-
//#endregion
|
|
2577
2450
|
//#region src/hq-credentials.d.ts
|
|
2578
2451
|
/**
|
|
2579
2452
|
* Why a reference did not resolve. Each value names a different remedy, and
|
|
@@ -2703,6 +2576,14 @@ type FollowUpRunner = (followUp: FollowUpAction, cwd: string) => Promise<void> |
|
|
|
2703
2576
|
interface PrPublishHandoff {
|
|
2704
2577
|
humanActions: string[];
|
|
2705
2578
|
routeOwnedRepairs: ReadinessRepair[];
|
|
2579
|
+
/**
|
|
2580
|
+
* Whether the merge is actually on GitHub's schedule (#477, #515 review).
|
|
2581
|
+
* An admitted candidate is not a handed-off one: `pr:ready` arms only when a
|
|
2582
|
+
* boundary wave authorized it, and the arming can fail to take effect. A
|
|
2583
|
+
* readiness status of `ready` says the candidate passed, never that anything
|
|
2584
|
+
* will merge it — so publish reads this before claiming nothing is owed.
|
|
2585
|
+
*/
|
|
2586
|
+
scheduled: boolean;
|
|
2706
2587
|
status: PrReadyProof["status"];
|
|
2707
2588
|
}
|
|
2708
2589
|
type PrPublishFollowUpOutcome = {
|
|
@@ -3857,7 +3738,7 @@ declare const scanFactoryTraceDiagnostics: ({
|
|
|
3857
3738
|
//#endregion
|
|
3858
3739
|
//#region src/interior-telemetry/gate-timing.d.ts
|
|
3859
3740
|
declare const GATE_TIMING_SCHEMA_VERSION = 1;
|
|
3860
|
-
type FactoryGateName = "boundary:check" | "factory:closeout" | "pr:
|
|
3741
|
+
type FactoryGateName = "boundary:check" | "factory:closeout" | "pr:ready" | "pr:review" | "pr:verify";
|
|
3861
3742
|
type GateTimingOutcome = "fail" | "pass";
|
|
3862
3743
|
interface GateTimingRecord {
|
|
3863
3744
|
agentRunId: string;
|
|
@@ -4042,8 +3923,8 @@ type WorktreeRootLister = (worktreePath: string) => string[] | undefined;
|
|
|
4042
3923
|
declare function checkWorktreeScratchFiles(worktreePath?: string, listRootEntries?: WorktreeRootLister): WorktreeScratchFileCheck;
|
|
4043
3924
|
/**
|
|
4044
3925
|
* Human-readable one-line summary of a scratch-file check, owned beside the
|
|
4045
|
-
* detection logic
|
|
4046
|
-
*
|
|
3926
|
+
* detection logic so planner output, docs, and future surfaces cannot drift
|
|
3927
|
+
* apart.
|
|
4047
3928
|
*/
|
|
4048
3929
|
declare function formatScratchFileCheckSummary(check: WorktreeScratchFileCheck): string;
|
|
4049
3930
|
declare namespace pr_body_metadata_d_exports {
|
|
@@ -4292,6 +4173,8 @@ interface EvaluationInput {
|
|
|
4292
4173
|
reviews?: PrReadinessReview[];
|
|
4293
4174
|
unresolvedReviewThreads: number;
|
|
4294
4175
|
requiredChecks: CheckState;
|
|
4176
|
+
hostedVerifyCheck?: CheckState;
|
|
4177
|
+
autoMergeEnabled?: boolean;
|
|
4295
4178
|
draft: boolean;
|
|
4296
4179
|
currentWithBase: boolean;
|
|
4297
4180
|
mergeable: string;
|
|
@@ -4306,7 +4189,6 @@ interface EvaluationInput {
|
|
|
4306
4189
|
evidenceEnvelopes?: LoadedEvidenceEnvelope[];
|
|
4307
4190
|
mergeBaseSha?: string;
|
|
4308
4191
|
authoringSessionIds?: string[];
|
|
4309
|
-
prLabels?: string[];
|
|
4310
4192
|
priorLedger?: Pick<ManagedReadinessLedger, "reviewRuns">;
|
|
4311
4193
|
handledCommentUrls?: string[];
|
|
4312
4194
|
checkRunHandledCommentUrls?: string[];
|
|
@@ -4316,7 +4198,12 @@ interface EvaluationInput {
|
|
|
4316
4198
|
};
|
|
4317
4199
|
handledCommentSessionId?: string;
|
|
4318
4200
|
handledCommentClearedAt?: string;
|
|
4319
|
-
waveReviewDemand?: Pick<WaveReviewDemand, "review" | "wave">;
|
|
4201
|
+
waveReviewDemand?: Pick<WaveReviewDemand, "autoMerge" | "review" | "wave">;
|
|
4202
|
+
mergeFreeze?: {
|
|
4203
|
+
blockingReasons: string[];
|
|
4204
|
+
notices: string[];
|
|
4205
|
+
};
|
|
4206
|
+
waivers?: DemandWaiver[];
|
|
4320
4207
|
}
|
|
4321
4208
|
declare const evaluateReadiness: (input: EvaluationInput) => {
|
|
4322
4209
|
blockedReasons: {
|
|
@@ -4382,8 +4269,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
|
|
|
4382
4269
|
status: "satisfied" | "unmet" | "out-of-scope";
|
|
4383
4270
|
reason?: string | undefined;
|
|
4384
4271
|
scope?: {
|
|
4385
|
-
classifications
|
|
4386
|
-
labels?: string[] | undefined;
|
|
4272
|
+
classifications: ("trivial" | "docs/process-only" | "non-trivial")[];
|
|
4387
4273
|
} | undefined;
|
|
4388
4274
|
}[] | undefined;
|
|
4389
4275
|
handledCommentsProducer?: {
|
|
@@ -4452,12 +4338,19 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
|
|
|
4452
4338
|
reviewRuns?: PrReviewResult[] | undefined;
|
|
4453
4339
|
reviewTerminalState?: "blocked" | "accepted-with-findings" | "clean" | undefined;
|
|
4454
4340
|
};
|
|
4341
|
+
/**
|
|
4342
|
+
* Facts a reader needs that are not refusals (#477): the settle-window
|
|
4343
|
+
* arming notice, and every waived demand rendered so it can never read as
|
|
4344
|
+
* a met one.
|
|
4345
|
+
*/
|
|
4346
|
+
notices: string[];
|
|
4455
4347
|
repairs: {
|
|
4456
4348
|
action: string;
|
|
4457
4349
|
code: "undraft-pr" | "render-pr-body-sections" | "await-post-undraft-checks";
|
|
4458
4350
|
command: string;
|
|
4459
4351
|
}[];
|
|
4460
|
-
status: ReadinessStatus;
|
|
4352
|
+
status: ReadinessStatus; /** Demands that were in force, were NOT met, and the operator waived. */
|
|
4353
|
+
waivedDemands: WaivedDemand[];
|
|
4461
4354
|
};
|
|
4462
4355
|
//#endregion
|
|
4463
4356
|
//#region src/evidence-emit.d.ts
|
|
@@ -4798,7 +4691,6 @@ interface CreateProgramOptions {
|
|
|
4798
4691
|
actions?: {
|
|
4799
4692
|
boundaryCheck?: BoundaryCheckAction;
|
|
4800
4693
|
demandWaive?: DemandWaiveAction;
|
|
4801
|
-
prMergeCheck?: PrMergeCheckAction;
|
|
4802
4694
|
prPublish?: PrPublishAction;
|
|
4803
4695
|
prReady?: PrReadyAction;
|
|
4804
4696
|
prReview?: PrReviewAction;
|
|
@@ -4809,4 +4701,4 @@ interface CreateProgramOptions {
|
|
|
4809
4701
|
declare function createProgram(options?: CreateProgramOptions): Command;
|
|
4810
4702
|
declare function run(argv?: string[]): Promise<void>;
|
|
4811
4703
|
//#endregion
|
|
4812
|
-
export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type BuildRetroEnvelopeInput, type CloudflareAccessServiceToken, CreateProgramOptions, DEFAULT_DEMAND_WAIVER_PATH, DEFAULT_FACTORY_REPOSITORY, type DagDocument, type DemandWaiveArgs, type DemandWaiveDependencies, DemandWaiveRefusalError, type DemandWaiver, type DemandWaiverStore, EPIC_STRUCTURE_NODE_STATUSES, EPIC_STRUCTURE_SCHEMA_VERSION, type EpicStructureEvent, type EpicStructureGraphPayload, type EpicStructureNodeStatus, EpicStructureValidationError, type EvidenceEmitArgs, type EvidenceEmitDependencies, type EvidenceEmitResult, type FactoryCliInvocation, FactoryCliInvocationSchema, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FindingDisposition, type FindingLedgerEntry, type FollowUpAction, FollowUpActionSchema, type IssueReviewFocus, type LadderDispositionDeclaration, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeState, type ParsedRetroEnvelope, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, RETRO_ENVELOPE_SCHEMA_VERSION, RETRO_ENVELOPE_VALIDATORS, REVIEW_FOCUS_SECTION, type RetroEnvelope, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, type ReviewLadderCycle, type ReviewLadderEvaluation, type ReviewLadderPolicy, type ReviewLadderStageEvent, type ReviewLadderTraceIdentity, type ReviewPromptSection, type ReviewPromptSectionProvenance, SUPPORTED_RETRO_ENVELOPE_SCHEMA_VERSIONS, type ScanFactoryTraceDiagnosticsOptions, type ScanFactoryTraceOptions, type ScanFactoryTraceResult, type TraceMirrorDiagnostic, type TraceSink, type TraceWriteResult, type TraceWriteSinks, type VerificationReuse, type WaivedDemand, WorkerCheckoutGuardError, type WorkerCloseoutLessonsTraceEvent, appendReviewLadderStageTraceEvent, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertWorkerCheckoutAllowed, authorizeDemandWaiver, blockingLadderFindings, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildRetroEnvelope, buildReviewGateNotRequiredTraceEvent, buildReviewLadderStageTraceEvent, comment_provenance_d_exports as commentProvenance, createLocalJsonlTraceSink, createProgram, doctorProjectProfile, epicStructureEventId, evaluateReviewLadder, evidenceEnvelopeFilename, findingKey, followUpFromArgv, inferFixedInThreadDispositions, isProductionHqUrl, isRetroEnvelopeWireComplete, loadProjectProfile, normalizeIssueComments, openLadderFindings, parseRetroEnvelope, planPublishFollowUp,
|
|
4704
|
+
export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type BuildRetroEnvelopeInput, type CloudflareAccessServiceToken, CreateProgramOptions, DEFAULT_DEMAND_WAIVER_PATH, DEFAULT_FACTORY_REPOSITORY, type DagDocument, type DemandWaiveArgs, type DemandWaiveDependencies, DemandWaiveRefusalError, type DemandWaiver, type DemandWaiverStore, EPIC_STRUCTURE_NODE_STATUSES, EPIC_STRUCTURE_SCHEMA_VERSION, type EpicStructureEvent, type EpicStructureGraphPayload, type EpicStructureNodeStatus, EpicStructureValidationError, type EvidenceEmitArgs, type EvidenceEmitDependencies, type EvidenceEmitResult, type FactoryCliInvocation, FactoryCliInvocationSchema, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FindingDisposition, type FindingLedgerEntry, type FollowUpAction, FollowUpActionSchema, type IssueReviewFocus, type LadderDispositionDeclaration, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeState, type ParsedRetroEnvelope, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, RETRO_ENVELOPE_SCHEMA_VERSION, RETRO_ENVELOPE_VALIDATORS, REVIEW_FOCUS_SECTION, type RetroEnvelope, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, type ReviewLadderCycle, type ReviewLadderEvaluation, type ReviewLadderPolicy, type ReviewLadderStageEvent, type ReviewLadderTraceIdentity, type ReviewPromptSection, type ReviewPromptSectionProvenance, SUPPORTED_RETRO_ENVELOPE_SCHEMA_VERSIONS, type ScanFactoryTraceDiagnosticsOptions, type ScanFactoryTraceOptions, type ScanFactoryTraceResult, type TraceMirrorDiagnostic, type TraceSink, type TraceWriteResult, type TraceWriteSinks, type VerificationReuse, type WaivedDemand, WorkerCheckoutGuardError, type WorkerCloseoutLessonsTraceEvent, appendReviewLadderStageTraceEvent, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertWorkerCheckoutAllowed, authorizeDemandWaiver, blockingLadderFindings, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildRetroEnvelope, buildReviewGateNotRequiredTraceEvent, buildReviewLadderStageTraceEvent, comment_provenance_d_exports as commentProvenance, createLocalJsonlTraceSink, createProgram, doctorProjectProfile, epicStructureEventId, evaluateReviewLadder, evidenceEnvelopeFilename, findingKey, followUpFromArgv, inferFixedInThreadDispositions, isProductionHqUrl, isRetroEnvelopeWireComplete, loadProjectProfile, normalizeIssueComments, openLadderFindings, parseRetroEnvelope, planPublishFollowUp, pr_body_metadata_d_exports as prReadinessBodyMetadata, readiness_evaluation_d_exports as prReadinessEvaluation, external_evidence_d_exports as prReadinessExternalEvidence, post_readiness_comments_d_exports as prReadinessPostComments, 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, publishEpicStructure, readDemandWaivers, readPrReadyProof, readPrReviewProof, resolveFactoryRepository, resolveFindingBlocking, resolveReviewFindingCategory, resolveReviewFindingSeverity, resolveReviewLadderPolicy, resolveTraceWriteSinks, retroEnvelopeSchemaVersionOf, retroEnvelopeV1Schema, retroEpicReference, 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 };
|