@codedrifters/configulator 0.0.352 → 0.0.353
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/lib/index.js +260 -156
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +260 -156
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -17787,7 +17787,11 @@ var prReviewerSubAgent = {
|
|
|
17787
17787
|
"",
|
|
17788
17788
|
"The PR is **eligible** only when **all** of the following hold:",
|
|
17789
17789
|
"",
|
|
17790
|
-
'1. `mergeable == "MERGEABLE"` (no merge conflicts).',
|
|
17790
|
+
'1. `mergeable == "MERGEABLE"` (no merge conflicts). A',
|
|
17791
|
+
' `mergeable == "CONFLICTING"` PR is **not** an automatic',
|
|
17792
|
+
" disqualification \u2014 see the **already-`CONFLICTING` handling**",
|
|
17793
|
+
" below, which may auto-correct it via delegation before falling",
|
|
17794
|
+
" back to a hard reject.",
|
|
17791
17795
|
"2. No **failing** required checks in `statusCheckRollup` \u2014 CI must be",
|
|
17792
17796
|
" green or still pending. Any `FAILURE`, `TIMED_OUT`, `CANCELLED`, or",
|
|
17793
17797
|
" `ERROR` conclusion on a required check disqualifies the PR. If the",
|
|
@@ -17799,8 +17803,9 @@ var prReviewerSubAgent = {
|
|
|
17799
17803
|
"3. The PR body contains a linked issue via one of the closing keywords:",
|
|
17800
17804
|
" `Closes #N`, `Fixes #N`, or `Resolves #N` (case-insensitive).",
|
|
17801
17805
|
"",
|
|
17802
|
-
"If **
|
|
17803
|
-
"stop. Do not proceed to
|
|
17806
|
+
"If the **CI** check (2) or the **linked-issue** check (3) fails, post",
|
|
17807
|
+
"a short comment explaining the reason and stop. Do not proceed to",
|
|
17808
|
+
"full review.",
|
|
17804
17809
|
"",
|
|
17805
17810
|
"```bash",
|
|
17806
17811
|
"gh pr comment <pr-number> --body '<reason>'",
|
|
@@ -17808,10 +17813,50 @@ var prReviewerSubAgent = {
|
|
|
17808
17813
|
"",
|
|
17809
17814
|
"Typical reasons:",
|
|
17810
17815
|
"",
|
|
17811
|
-
"- `Not reviewable: merge conflicts \u2014 please rebase onto the default branch.`",
|
|
17812
17816
|
"- `Not reviewable: required CI check <name> is failing.`",
|
|
17813
17817
|
"- `Not reviewable: PR body is missing a linked issue (Closes #N / Fixes #N / Resolves #N).`",
|
|
17814
17818
|
"",
|
|
17819
|
+
"### Already-`CONFLICTING` handling (auto-correct, then reject)",
|
|
17820
|
+
"",
|
|
17821
|
+
'When the merge check (1) reports `mergeable == "CONFLICTING"`, do',
|
|
17822
|
+
"**not** unconditionally reject. A bot-authored PR that is already",
|
|
17823
|
+
"conflicting when the orchestrator finds it is exactly the case the",
|
|
17824
|
+
"conflict-resolution delegation flow exists to auto-correct \u2014 there",
|
|
17825
|
+
"is no reason to make a human rebase it by hand when `issue-worker`",
|
|
17826
|
+
"can. Before rejecting, evaluate checks (2) and (3) above first: a",
|
|
17827
|
+
"`CONFLICTING` PR that **also** has failing CI or no linked issue is",
|
|
17828
|
+
"rejected for that reason via the comment-and-stop path above, since",
|
|
17829
|
+
"the delegation cannot succeed without a linked issue and green-able",
|
|
17830
|
+
"CI anyway.",
|
|
17831
|
+
"",
|
|
17832
|
+
"Otherwise, hand off to the **Shared Procedure: Conflict-Resolution",
|
|
17833
|
+
"Delegation** section. It evaluates the guards (auto-merge mode, the",
|
|
17834
|
+
"delegation invocation guard, a free `review:fixing` lease, no",
|
|
17835
|
+
"generated / projen / lockfile conflicts), classifies the conflicting",
|
|
17836
|
+
"files, and either delegates a rebase to `issue-worker` or falls",
|
|
17837
|
+
"through to its own fallback. Invoke it with this entry point's",
|
|
17838
|
+
"parameters:",
|
|
17839
|
+
"",
|
|
17840
|
+
"- **Entry point:** `already-conflicting`. There is no failed",
|
|
17841
|
+
" `gh pr update-branch` to read conflicting paths from \u2014 identify",
|
|
17842
|
+
" the conflicting files from the PR's merge state as documented in",
|
|
17843
|
+
" the shared procedure's entry-point step (a local rebase attempt",
|
|
17844
|
+
" whose `<<<<<<<` / `=======` / `>>>>>>>` markers name the",
|
|
17845
|
+
" conflicting files). The guards and classification are identical to",
|
|
17846
|
+
" the Phase 4 entry point.",
|
|
17847
|
+
"- **On the procedure returning `delegated`:** a rebase has been",
|
|
17848
|
+
" delegated to `issue-worker`; stop this pass. A human re-invokes",
|
|
17849
|
+
" the reviewer once the worker pushes the rebased branch.",
|
|
17850
|
+
"- **On the procedure returning `skipped` (a guard denied delegation",
|
|
17851
|
+
" or the guards failed):** fall back to the original hard reject \u2014",
|
|
17852
|
+
" post the merge-conflict rejection comment and stop. Use this",
|
|
17853
|
+
" comment **only** in the skipped case, never before the shared",
|
|
17854
|
+
" procedure has had its chance to auto-correct:",
|
|
17855
|
+
"",
|
|
17856
|
+
"```bash",
|
|
17857
|
+
"gh pr comment <pr-number> --body 'Not reviewable: merge conflicts \u2014 please rebase onto the default branch.'",
|
|
17858
|
+
"```",
|
|
17859
|
+
"",
|
|
17815
17860
|
"## Phase 2: Gather Context",
|
|
17816
17861
|
"",
|
|
17817
17862
|
"```bash",
|
|
@@ -18513,37 +18558,215 @@ var prReviewerSubAgent = {
|
|
|
18513
18558
|
"##### Conflict-resolution delegation (BEHIND + conflicts)",
|
|
18514
18559
|
"",
|
|
18515
18560
|
"When `gh pr update-branch <pr-number>` fails because the merge would",
|
|
18516
|
-
"produce conflicts,
|
|
18517
|
-
"
|
|
18518
|
-
"
|
|
18519
|
-
"
|
|
18520
|
-
"`
|
|
18561
|
+
"produce conflicts, hand off to the **Shared Procedure:",
|
|
18562
|
+
"Conflict-Resolution Delegation** section below. That procedure owns",
|
|
18563
|
+
"the guards, the `shared-index` vs `generic` classification, the two",
|
|
18564
|
+
"typed recipes, and the fallback \u2014 defined once and shared with the",
|
|
18565
|
+
"Phase 1.5 already-`CONFLICTING` entry point. Invoke it with this",
|
|
18566
|
+
"entry point's parameters:",
|
|
18567
|
+
"",
|
|
18568
|
+
"- **Entry point:** `update-branch-conflict`. The set of conflicting",
|
|
18569
|
+
" files is the list reported by the failed `gh pr update-branch`",
|
|
18570
|
+
" (cross-referenced with `gh pr view <pr-number> --json files`).",
|
|
18571
|
+
"- **On the procedure returning `delegated`:** record",
|
|
18572
|
+
" `Branch updated: delegated (PR #<n>)` for the per-PR report.",
|
|
18573
|
+
"- **On the procedure returning `skipped` (a guard denied delegation",
|
|
18574
|
+
" or the guards failed):** the procedure has already posted the",
|
|
18575
|
+
" fallback comment and recorded",
|
|
18576
|
+
" `Branch updated: failed (conflicts; <short reason>)`. Stop.",
|
|
18577
|
+
"",
|
|
18578
|
+
"#### Mode `human-required`",
|
|
18579
|
+
"",
|
|
18580
|
+
"Do **not** run `gh pr merge --auto`. Instead, hand the PR off to a",
|
|
18581
|
+
"human reviewer:",
|
|
18582
|
+
"",
|
|
18583
|
+
"1. Apply the `review:awaiting-human` label so the PR is discoverable",
|
|
18584
|
+
" in the human-review queue:",
|
|
18585
|
+
"",
|
|
18586
|
+
" ```bash",
|
|
18587
|
+
" gh pr edit <pr-number> --add-label 'review:awaiting-human'",
|
|
18588
|
+
" ```",
|
|
18589
|
+
"",
|
|
18590
|
+
"2. **If `matched_rule == 6`** (size threshold was the sole trigger),",
|
|
18591
|
+
" run the `Update the branch when `mergeStateStatus` is `BEHIND``",
|
|
18592
|
+
" step from the `Mode auto-merge` branch above before exiting. The",
|
|
18593
|
+
" eligibility gate documented in that sub-section explicitly permits",
|
|
18594
|
+
" `gh pr update-branch` on size-only human-required PRs so the bot",
|
|
18595
|
+
" keeps the branch fresh against the default branch while the human",
|
|
18596
|
+
" reviews. Skip this sub-step for `matched_rule` in 2\u20135 \u2014 the gate",
|
|
18597
|
+
" denies `update-branch` there and the human owns branch-lifecycle.",
|
|
18598
|
+
"",
|
|
18599
|
+
"3. Exit cleanly after the acceptance-criteria check completes and any",
|
|
18600
|
+
" summary comment the reviewer posts. Proceed to Phase 5 only if a",
|
|
18601
|
+
" merge occurred \u2014 in `human-required` mode the reviewer stops at",
|
|
18602
|
+
" the hand-off and does not poll for merge.",
|
|
18603
|
+
"",
|
|
18604
|
+
"The reason captured in Phase 2.75 should be included in any summary",
|
|
18605
|
+
"comment so maintainers know why human review was required (path hit,",
|
|
18606
|
+
"issue type, size threshold, label, or default).",
|
|
18607
|
+
"",
|
|
18608
|
+
"### If any criterion is missing, partial, or CI is failing",
|
|
18609
|
+
"",
|
|
18610
|
+
"Post a plain comment (not a formal review block) with grouped findings:",
|
|
18611
|
+
"",
|
|
18612
|
+
"```bash",
|
|
18613
|
+
"gh pr comment <pr-number> --body '<grouped findings>'",
|
|
18614
|
+
"```",
|
|
18615
|
+
"",
|
|
18616
|
+
"Group findings by severity (**Blocking** / **Suggested** / **Nitpick**).",
|
|
18617
|
+
"For each blocking finding, cite the unmet acceptance criterion and the",
|
|
18618
|
+
"file or function the gap lives in. Do **not** merge, and do **not** push",
|
|
18619
|
+
"any commits to the PR's branch.",
|
|
18620
|
+
"",
|
|
18621
|
+
"Rationale for using a plain comment rather than `gh pr review",
|
|
18622
|
+
"--request-changes`: it is lighter-weight, doesn't require the author to",
|
|
18623
|
+
"dismiss a formal review, and composes cleanly with the multi-PR loop.",
|
|
18624
|
+
"",
|
|
18625
|
+
"## Phase 4.5: Update Sticky Summary",
|
|
18626
|
+
"",
|
|
18627
|
+
"On **every pass**, create or update a single **`## Reviewer notes`**",
|
|
18628
|
+
"comment on the PR. This sticky comment is the human-facing single",
|
|
18629
|
+
"source of truth for the PR's state \u2014 one comment per PR, edited in",
|
|
18630
|
+
"place across passes, never duplicated. Do not post a fresh",
|
|
18631
|
+
'"pass N summary" on each iteration.',
|
|
18632
|
+
"",
|
|
18633
|
+
"### Step 1: Find the existing sticky comment (if any)",
|
|
18634
|
+
"",
|
|
18635
|
+
"List PR-level comments and look for one authored by the reviewer",
|
|
18636
|
+
"whose body starts with `## Reviewer notes`:",
|
|
18637
|
+
"",
|
|
18638
|
+
"```bash",
|
|
18639
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/<pr-number>/comments",
|
|
18640
|
+
"```",
|
|
18641
|
+
"",
|
|
18642
|
+
"If multiple candidates exist (an older run double-posted before this",
|
|
18643
|
+
"phase existed), keep the earliest and plan to delete the duplicates",
|
|
18644
|
+
"on a later pass. Never delete another author's comment.",
|
|
18645
|
+
"",
|
|
18646
|
+
"### Step 2: Compose the sticky body",
|
|
18647
|
+
"",
|
|
18648
|
+
"The body uses the following shape:",
|
|
18649
|
+
"",
|
|
18650
|
+
"```",
|
|
18651
|
+
"## Reviewer notes",
|
|
18652
|
+
"",
|
|
18653
|
+
"**Mode:** auto-merge | human-required \u2014 <reason from Phase 2.75>",
|
|
18654
|
+
"**AC status:** <met / partial / missing> (evidence links)",
|
|
18655
|
+
"**CI status:** green | pending | red",
|
|
18656
|
+
"**Outstanding:** <list of comments still open with their classification and author>",
|
|
18657
|
+
"**Pushbacks:** <list of disputes with reasons>",
|
|
18658
|
+
"**Last pass:** <ISO timestamp>",
|
|
18659
|
+
"```",
|
|
18660
|
+
"",
|
|
18661
|
+
"Populate each field from the phases above:",
|
|
18662
|
+
"",
|
|
18663
|
+
"- **Mode / reason** \u2014 the mode and reason recorded in Phase 2.75.",
|
|
18664
|
+
"- **AC status** \u2014 the checklist produced in Phase 3 (met, partial,",
|
|
18665
|
+
" or missing), with links to the files or tests that provide the",
|
|
18666
|
+
" evidence.",
|
|
18667
|
+
"- **CI status** \u2014 the verdict from the **CI Verification** section",
|
|
18668
|
+
" (primary check-runs read, or the Actions-runs fallback when",
|
|
18669
|
+
" check-runs returns a fine-grained-PAT 403).",
|
|
18670
|
+
"- **Outstanding** \u2014 the comments still carrying a non-terminal",
|
|
18671
|
+
" reviewer reaction from Phase 3.5 (typically `eyes` for queued",
|
|
18672
|
+
" in-scope items and `nit` / `question` items that remain open).",
|
|
18673
|
+
" List each as `<classification>: <author> \u2014 <short summary> (<url>)`.",
|
|
18674
|
+
"- **Pushbacks** \u2014 every comment the reviewer reacted",
|
|
18675
|
+
" `thinking_face` to on this or any prior pass, with the reason",
|
|
18676
|
+
" captured in the pushback reply. Empty list when there are none.",
|
|
18677
|
+
"- **Last pass** \u2014 the ISO 8601 timestamp of this run.",
|
|
18678
|
+
"",
|
|
18679
|
+
"### Step 3: Create or edit in place",
|
|
18680
|
+
"",
|
|
18681
|
+
"If no existing sticky comment was found in Step 1, create one:",
|
|
18682
|
+
"",
|
|
18683
|
+
"```bash",
|
|
18684
|
+
"gh pr comment <pr-number> --body '<sticky body>'",
|
|
18685
|
+
"```",
|
|
18686
|
+
"",
|
|
18687
|
+
"If an existing sticky comment was found, edit it in place using the",
|
|
18688
|
+
"comment id. Do not delete and re-create \u2014 editing preserves the",
|
|
18689
|
+
"comment's URL and any reactions humans have added to the summary:",
|
|
18690
|
+
"",
|
|
18691
|
+
"```bash",
|
|
18692
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<sticky-comment-id> \\",
|
|
18693
|
+
" -X PATCH -f body='<sticky body>'",
|
|
18694
|
+
"```",
|
|
18695
|
+
"",
|
|
18696
|
+
"The sticky summary must be updated on every pass through Phase 4.5,",
|
|
18697
|
+
"including passes that ended in a pushback-gated skip, a",
|
|
18698
|
+
"`NEEDS_CHANGES` findings comment, or the `human-required` hand-off.",
|
|
18699
|
+
"Humans rely on the sticky comment to see the current state of the",
|
|
18700
|
+
"PR at a glance \u2014 it must never go stale while the reviewer is",
|
|
18701
|
+
"actively processing the PR.",
|
|
18702
|
+
"",
|
|
18703
|
+
"## Shared Procedure: Conflict-Resolution Delegation",
|
|
18704
|
+
"",
|
|
18705
|
+
"This procedure resolves a PR that cannot land because its head",
|
|
18706
|
+
"branch conflicts with the default branch. It is invoked from **two**",
|
|
18707
|
+
"entry points, both of which reuse the identical guards,",
|
|
18708
|
+
"classification, typed recipes, and fallback defined here \u2014 the flow",
|
|
18709
|
+
"is defined **once** and shared:",
|
|
18710
|
+
"",
|
|
18711
|
+
"- **Phase 4 `update-branch-conflict`** \u2014 a PR that was MERGEABLE at",
|
|
18712
|
+
" Phase 1.5 went BEHIND, and `gh pr update-branch` then failed",
|
|
18713
|
+
" because the merge would conflict.",
|
|
18714
|
+
"- **Phase 1.5 `already-conflicting`** \u2014 the orchestrator handed the",
|
|
18715
|
+
" reviewer a PR that is **already** `CONFLICTING` (its",
|
|
18716
|
+
' `mergeable == "CONFLICTING"`) before any review work began.',
|
|
18717
|
+
"",
|
|
18718
|
+
"The reviewer **may** delegate conflict resolution to `issue-worker`",
|
|
18719
|
+
"via the feedback-mode delegation contract (the same path Phase 4's",
|
|
18720
|
+
"in-scope-fix delegation uses). The reviewer never hand-resolves",
|
|
18721
|
+
"conflicts itself \u2014 branch mutations always belong to `issue-worker`.",
|
|
18722
|
+
"",
|
|
18723
|
+
"### Entry-point parameters",
|
|
18724
|
+
"",
|
|
18725
|
+
"The caller supplies which entry point it is and how the conflicting",
|
|
18726
|
+
"files are identified. Everything after this step is identical across",
|
|
18727
|
+
"both entry points.",
|
|
18728
|
+
"",
|
|
18729
|
+
"- **`update-branch-conflict`** \u2014 the conflicting-file set is the",
|
|
18730
|
+
" list reported by the failed `gh pr update-branch` (cross-referenced",
|
|
18731
|
+
" with `gh pr view <pr-number> --json files`).",
|
|
18732
|
+
"- **`already-conflicting`** \u2014 there is no failed `update-branch` to",
|
|
18733
|
+
" read conflicting paths from. Identify the conflicting files from",
|
|
18734
|
+
" the PR's merge state instead: attempt a local rebase of the head",
|
|
18735
|
+
" branch onto the default branch in a scratch checkout (or read the",
|
|
18736
|
+
" conflicting paths git reports) and collect the files that carry",
|
|
18737
|
+
" `<<<<<<<` / `=======` / `>>>>>>>` conflict markers. Use that set",
|
|
18738
|
+
" as the conflicting-file list. The reviewer inspects these markers",
|
|
18739
|
+
" read-only to classify; it does **not** stage, commit, or push any",
|
|
18740
|
+
" resolution \u2014 the actual rebase-and-resolve is delegated to",
|
|
18741
|
+
" `issue-worker` exactly as in the other entry point.",
|
|
18742
|
+
"",
|
|
18743
|
+
"### Guards",
|
|
18521
18744
|
"",
|
|
18522
18745
|
"Delegate **only when all** of the following hold. If any guard fails,",
|
|
18523
|
-
"fall through to the
|
|
18746
|
+
"fall through to the **Fallback** at the end of this procedure and",
|
|
18747
|
+
"return `skipped`.",
|
|
18524
18748
|
"",
|
|
18525
18749
|
"1. **Review mode is `auto-merge`.** Never delegate conflict",
|
|
18526
18750
|
" resolution on `human-required` PRs \u2014 pushing worker-resolved",
|
|
18527
18751
|
" merge content into them expands the diff under review without",
|
|
18528
|
-
" the human reviewer's consent. (Unlike the `update-branch` step",
|
|
18529
|
-
"
|
|
18752
|
+
" the human reviewer's consent. (Unlike the `update-branch` step,",
|
|
18753
|
+
" which permits a size-only `human-required` carve-out, the",
|
|
18530
18754
|
" conflict-resolution delegation flow is auto-merge-only across",
|
|
18531
18755
|
" the board: a worker rebase push is a stronger branch mutation",
|
|
18532
18756
|
" than the merge-commit `gh pr update-branch` performs.)",
|
|
18533
18757
|
"2. **Delegation invocation guard permits the hand-off** \u2014 the PR",
|
|
18534
18758
|
" carries the `origin:issue-worker` label, **or** the reviewer was",
|
|
18535
18759
|
" invoked with `--allow-human-author`. The same guard used for the",
|
|
18536
|
-
" in-scope-fix delegation flow
|
|
18760
|
+
" in-scope-fix delegation flow applies here unchanged.",
|
|
18537
18761
|
"3. **The `review:fixing` lease is currently free.** If",
|
|
18538
18762
|
" `review:fixing` is already on the PR, another delegation is",
|
|
18539
18763
|
" in-flight; skip conflict-resolution delegation, log the contention",
|
|
18540
18764
|
" to the sticky summary, and fall through to the fallback.",
|
|
18541
|
-
"4. **No conflicting file is generated or projen-managed.**
|
|
18542
|
-
"
|
|
18543
|
-
"
|
|
18544
|
-
"
|
|
18545
|
-
"
|
|
18546
|
-
" and the reviewer must skip delegation:",
|
|
18765
|
+
"4. **No conflicting file is generated or projen-managed.** Inspect",
|
|
18766
|
+
" the conflicting paths from the entry-point step above. If **any**",
|
|
18767
|
+
" conflicting path matches one of the following globs, the conflict",
|
|
18768
|
+
" is unsafe to resolve mechanically and the reviewer must skip",
|
|
18769
|
+
" delegation:",
|
|
18547
18770
|
" - `**/*.lock` and `pnpm-lock.yaml` / `yarn.lock` / `package-lock.json`",
|
|
18548
18771
|
" - `**/.projen/**`",
|
|
18549
18772
|
" - any file whose first 5 lines contain the marker",
|
|
@@ -18554,17 +18777,18 @@ var prReviewerSubAgent = {
|
|
|
18554
18777
|
" and conflicts there should be resolved by re-running synth, not by",
|
|
18555
18778
|
" merging the conflict markers.",
|
|
18556
18779
|
"",
|
|
18780
|
+
"### Classify each conflicting file",
|
|
18781
|
+
"",
|
|
18557
18782
|
"When every guard above passes, **classify each conflicting file**",
|
|
18558
18783
|
"before composing the fix-list. The classification picks one of two",
|
|
18559
18784
|
"typed recipes \u2014 a precise `shared-index` resolver when every",
|
|
18560
18785
|
"conflict is a row-insert race on a registry / index / feature-matrix",
|
|
18561
18786
|
"file, or the generic rebase recipe in every other case.",
|
|
18562
18787
|
"",
|
|
18563
|
-
"**Classification step.** For each conflicting path
|
|
18564
|
-
"
|
|
18565
|
-
"
|
|
18566
|
-
"
|
|
18567
|
-
"`shared-editing.ts` for the canonical constant):",
|
|
18788
|
+
"**Classification step.** For each conflicting path, decide whether",
|
|
18789
|
+
"the file is `shared-index` or `generic` against these criteria (the",
|
|
18790
|
+
"shared-index glob set comes from the `shared-editing-safety` rule \u2014",
|
|
18791
|
+
"see the bundle's `shared-editing.ts` for the canonical constant):",
|
|
18568
18792
|
"",
|
|
18569
18793
|
"- `shared-index` \u2014 the path matches one of the shared-editing glob",
|
|
18570
18794
|
" patterns:",
|
|
@@ -18599,6 +18823,8 @@ var prReviewerSubAgent = {
|
|
|
18599
18823
|
" (see step 3 below). The worker performs a hand-merge of the",
|
|
18600
18824
|
" conflict markers.",
|
|
18601
18825
|
"",
|
|
18826
|
+
"### Hand off to `issue-worker`",
|
|
18827
|
+
"",
|
|
18602
18828
|
"Hand off to `issue-worker` with the chosen single synthetic",
|
|
18603
18829
|
"fix-list item:",
|
|
18604
18830
|
"",
|
|
@@ -18686,147 +18912,25 @@ var prReviewerSubAgent = {
|
|
|
18686
18912
|
"",
|
|
18687
18913
|
"7. **Do not re-enable auto-merge in the same pass.** After delegation,",
|
|
18688
18914
|
" exit and let a human re-invoke the reviewer. The next pass will",
|
|
18689
|
-
" re-evaluate `mergeStateStatus` against the
|
|
18690
|
-
" re-enable auto-merge through the normal flow
|
|
18915
|
+
" re-evaluate `mergeStateStatus` (or `mergeable`) against the",
|
|
18916
|
+
" rebased branch and re-enable auto-merge through the normal flow.",
|
|
18691
18917
|
"",
|
|
18692
|
-
"
|
|
18693
|
-
"
|
|
18694
|
-
"
|
|
18918
|
+
"Return `delegated` to the caller when delegation completes",
|
|
18919
|
+
"(regardless of the worker's outcome \u2014 the delegation itself is the",
|
|
18920
|
+
"action taken).",
|
|
18921
|
+
"",
|
|
18922
|
+
"### Fallback",
|
|
18695
18923
|
"",
|
|
18696
18924
|
"**Fallback when delegation is not permitted or guards fail.** Post a",
|
|
18697
18925
|
"short comment explaining why the branch could not be updated",
|
|
18698
18926
|
"automatically and stop. Do not push commits, do not force, do not",
|
|
18699
|
-
"retry. Record `Branch updated: failed (conflicts; <short reason>)
|
|
18927
|
+
"retry. Record `Branch updated: failed (conflicts; <short reason>)`",
|
|
18928
|
+
"and return `skipped` to the caller.",
|
|
18700
18929
|
"",
|
|
18701
18930
|
"```bash",
|
|
18702
|
-
"gh pr comment <pr-number> --body '
|
|
18931
|
+
"gh pr comment <pr-number> --body 'Branch is BEHIND <default-branch> with conflicts. <short reason delegation was skipped \u2014 e.g. human-required mode, generated-file conflicts, or in-flight review:fixing lease>. A human (or the next reviewer pass after rebase) will need to resolve.'",
|
|
18703
18932
|
"```",
|
|
18704
18933
|
"",
|
|
18705
|
-
"#### Mode `human-required`",
|
|
18706
|
-
"",
|
|
18707
|
-
"Do **not** run `gh pr merge --auto`. Instead, hand the PR off to a",
|
|
18708
|
-
"human reviewer:",
|
|
18709
|
-
"",
|
|
18710
|
-
"1. Apply the `review:awaiting-human` label so the PR is discoverable",
|
|
18711
|
-
" in the human-review queue:",
|
|
18712
|
-
"",
|
|
18713
|
-
" ```bash",
|
|
18714
|
-
" gh pr edit <pr-number> --add-label 'review:awaiting-human'",
|
|
18715
|
-
" ```",
|
|
18716
|
-
"",
|
|
18717
|
-
"2. **If `matched_rule == 6`** (size threshold was the sole trigger),",
|
|
18718
|
-
" run the `Update the branch when `mergeStateStatus` is `BEHIND``",
|
|
18719
|
-
" step from the `Mode auto-merge` branch above before exiting. The",
|
|
18720
|
-
" eligibility gate documented in that sub-section explicitly permits",
|
|
18721
|
-
" `gh pr update-branch` on size-only human-required PRs so the bot",
|
|
18722
|
-
" keeps the branch fresh against the default branch while the human",
|
|
18723
|
-
" reviews. Skip this sub-step for `matched_rule` in 2\u20135 \u2014 the gate",
|
|
18724
|
-
" denies `update-branch` there and the human owns branch-lifecycle.",
|
|
18725
|
-
"",
|
|
18726
|
-
"3. Exit cleanly after the acceptance-criteria check completes and any",
|
|
18727
|
-
" summary comment the reviewer posts. Proceed to Phase 5 only if a",
|
|
18728
|
-
" merge occurred \u2014 in `human-required` mode the reviewer stops at",
|
|
18729
|
-
" the hand-off and does not poll for merge.",
|
|
18730
|
-
"",
|
|
18731
|
-
"The reason captured in Phase 2.75 should be included in any summary",
|
|
18732
|
-
"comment so maintainers know why human review was required (path hit,",
|
|
18733
|
-
"issue type, size threshold, label, or default).",
|
|
18734
|
-
"",
|
|
18735
|
-
"### If any criterion is missing, partial, or CI is failing",
|
|
18736
|
-
"",
|
|
18737
|
-
"Post a plain comment (not a formal review block) with grouped findings:",
|
|
18738
|
-
"",
|
|
18739
|
-
"```bash",
|
|
18740
|
-
"gh pr comment <pr-number> --body '<grouped findings>'",
|
|
18741
|
-
"```",
|
|
18742
|
-
"",
|
|
18743
|
-
"Group findings by severity (**Blocking** / **Suggested** / **Nitpick**).",
|
|
18744
|
-
"For each blocking finding, cite the unmet acceptance criterion and the",
|
|
18745
|
-
"file or function the gap lives in. Do **not** merge, and do **not** push",
|
|
18746
|
-
"any commits to the PR's branch.",
|
|
18747
|
-
"",
|
|
18748
|
-
"Rationale for using a plain comment rather than `gh pr review",
|
|
18749
|
-
"--request-changes`: it is lighter-weight, doesn't require the author to",
|
|
18750
|
-
"dismiss a formal review, and composes cleanly with the multi-PR loop.",
|
|
18751
|
-
"",
|
|
18752
|
-
"## Phase 4.5: Update Sticky Summary",
|
|
18753
|
-
"",
|
|
18754
|
-
"On **every pass**, create or update a single **`## Reviewer notes`**",
|
|
18755
|
-
"comment on the PR. This sticky comment is the human-facing single",
|
|
18756
|
-
"source of truth for the PR's state \u2014 one comment per PR, edited in",
|
|
18757
|
-
"place across passes, never duplicated. Do not post a fresh",
|
|
18758
|
-
'"pass N summary" on each iteration.',
|
|
18759
|
-
"",
|
|
18760
|
-
"### Step 1: Find the existing sticky comment (if any)",
|
|
18761
|
-
"",
|
|
18762
|
-
"List PR-level comments and look for one authored by the reviewer",
|
|
18763
|
-
"whose body starts with `## Reviewer notes`:",
|
|
18764
|
-
"",
|
|
18765
|
-
"```bash",
|
|
18766
|
-
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/<pr-number>/comments",
|
|
18767
|
-
"```",
|
|
18768
|
-
"",
|
|
18769
|
-
"If multiple candidates exist (an older run double-posted before this",
|
|
18770
|
-
"phase existed), keep the earliest and plan to delete the duplicates",
|
|
18771
|
-
"on a later pass. Never delete another author's comment.",
|
|
18772
|
-
"",
|
|
18773
|
-
"### Step 2: Compose the sticky body",
|
|
18774
|
-
"",
|
|
18775
|
-
"The body uses the following shape:",
|
|
18776
|
-
"",
|
|
18777
|
-
"```",
|
|
18778
|
-
"## Reviewer notes",
|
|
18779
|
-
"",
|
|
18780
|
-
"**Mode:** auto-merge | human-required \u2014 <reason from Phase 2.75>",
|
|
18781
|
-
"**AC status:** <met / partial / missing> (evidence links)",
|
|
18782
|
-
"**CI status:** green | pending | red",
|
|
18783
|
-
"**Outstanding:** <list of comments still open with their classification and author>",
|
|
18784
|
-
"**Pushbacks:** <list of disputes with reasons>",
|
|
18785
|
-
"**Last pass:** <ISO timestamp>",
|
|
18786
|
-
"```",
|
|
18787
|
-
"",
|
|
18788
|
-
"Populate each field from the phases above:",
|
|
18789
|
-
"",
|
|
18790
|
-
"- **Mode / reason** \u2014 the mode and reason recorded in Phase 2.75.",
|
|
18791
|
-
"- **AC status** \u2014 the checklist produced in Phase 3 (met, partial,",
|
|
18792
|
-
" or missing), with links to the files or tests that provide the",
|
|
18793
|
-
" evidence.",
|
|
18794
|
-
"- **CI status** \u2014 the verdict from the **CI Verification** section",
|
|
18795
|
-
" (primary check-runs read, or the Actions-runs fallback when",
|
|
18796
|
-
" check-runs returns a fine-grained-PAT 403).",
|
|
18797
|
-
"- **Outstanding** \u2014 the comments still carrying a non-terminal",
|
|
18798
|
-
" reviewer reaction from Phase 3.5 (typically `eyes` for queued",
|
|
18799
|
-
" in-scope items and `nit` / `question` items that remain open).",
|
|
18800
|
-
" List each as `<classification>: <author> \u2014 <short summary> (<url>)`.",
|
|
18801
|
-
"- **Pushbacks** \u2014 every comment the reviewer reacted",
|
|
18802
|
-
" `thinking_face` to on this or any prior pass, with the reason",
|
|
18803
|
-
" captured in the pushback reply. Empty list when there are none.",
|
|
18804
|
-
"- **Last pass** \u2014 the ISO 8601 timestamp of this run.",
|
|
18805
|
-
"",
|
|
18806
|
-
"### Step 3: Create or edit in place",
|
|
18807
|
-
"",
|
|
18808
|
-
"If no existing sticky comment was found in Step 1, create one:",
|
|
18809
|
-
"",
|
|
18810
|
-
"```bash",
|
|
18811
|
-
"gh pr comment <pr-number> --body '<sticky body>'",
|
|
18812
|
-
"```",
|
|
18813
|
-
"",
|
|
18814
|
-
"If an existing sticky comment was found, edit it in place using the",
|
|
18815
|
-
"comment id. Do not delete and re-create \u2014 editing preserves the",
|
|
18816
|
-
"comment's URL and any reactions humans have added to the summary:",
|
|
18817
|
-
"",
|
|
18818
|
-
"```bash",
|
|
18819
|
-
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<sticky-comment-id> \\",
|
|
18820
|
-
" -X PATCH -f body='<sticky body>'",
|
|
18821
|
-
"```",
|
|
18822
|
-
"",
|
|
18823
|
-
"The sticky summary must be updated on every pass through Phase 4.5,",
|
|
18824
|
-
"including passes that ended in a pushback-gated skip, a",
|
|
18825
|
-
"`NEEDS_CHANGES` findings comment, or the `human-required` hand-off.",
|
|
18826
|
-
"Humans rely on the sticky comment to see the current state of the",
|
|
18827
|
-
"PR at a glance \u2014 it must never go stale while the reviewer is",
|
|
18828
|
-
"actively processing the PR.",
|
|
18829
|
-
"",
|
|
18830
18934
|
"## Phase 5: Branch Cleanup and Issue Closure Verification",
|
|
18831
18935
|
"",
|
|
18832
18936
|
"Skip this phase entirely when the review mode from Phase 2.75 is",
|