@codedrifters/configulator 0.0.352 → 0.0.354
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 +290 -163
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +290 -163
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -18124,7 +18124,11 @@ var prReviewerSubAgent = {
|
|
|
18124
18124
|
"",
|
|
18125
18125
|
"The PR is **eligible** only when **all** of the following hold:",
|
|
18126
18126
|
"",
|
|
18127
|
-
'1. `mergeable == "MERGEABLE"` (no merge conflicts).',
|
|
18127
|
+
'1. `mergeable == "MERGEABLE"` (no merge conflicts). A',
|
|
18128
|
+
' `mergeable == "CONFLICTING"` PR is **not** an automatic',
|
|
18129
|
+
" disqualification \u2014 see the **already-`CONFLICTING` handling**",
|
|
18130
|
+
" below, which may auto-correct it via delegation before falling",
|
|
18131
|
+
" back to a hard reject.",
|
|
18128
18132
|
"2. No **failing** required checks in `statusCheckRollup` \u2014 CI must be",
|
|
18129
18133
|
" green or still pending. Any `FAILURE`, `TIMED_OUT`, `CANCELLED`, or",
|
|
18130
18134
|
" `ERROR` conclusion on a required check disqualifies the PR. If the",
|
|
@@ -18136,8 +18140,9 @@ var prReviewerSubAgent = {
|
|
|
18136
18140
|
"3. The PR body contains a linked issue via one of the closing keywords:",
|
|
18137
18141
|
" `Closes #N`, `Fixes #N`, or `Resolves #N` (case-insensitive).",
|
|
18138
18142
|
"",
|
|
18139
|
-
"If **
|
|
18140
|
-
"stop. Do not proceed to
|
|
18143
|
+
"If the **CI** check (2) or the **linked-issue** check (3) fails, post",
|
|
18144
|
+
"a short comment explaining the reason and stop. Do not proceed to",
|
|
18145
|
+
"full review.",
|
|
18141
18146
|
"",
|
|
18142
18147
|
"```bash",
|
|
18143
18148
|
"gh pr comment <pr-number> --body '<reason>'",
|
|
@@ -18145,10 +18150,50 @@ var prReviewerSubAgent = {
|
|
|
18145
18150
|
"",
|
|
18146
18151
|
"Typical reasons:",
|
|
18147
18152
|
"",
|
|
18148
|
-
"- `Not reviewable: merge conflicts \u2014 please rebase onto the default branch.`",
|
|
18149
18153
|
"- `Not reviewable: required CI check <name> is failing.`",
|
|
18150
18154
|
"- `Not reviewable: PR body is missing a linked issue (Closes #N / Fixes #N / Resolves #N).`",
|
|
18151
18155
|
"",
|
|
18156
|
+
"### Already-`CONFLICTING` handling (auto-correct, then reject)",
|
|
18157
|
+
"",
|
|
18158
|
+
'When the merge check (1) reports `mergeable == "CONFLICTING"`, do',
|
|
18159
|
+
"**not** unconditionally reject. A bot-authored PR that is already",
|
|
18160
|
+
"conflicting when the orchestrator finds it is exactly the case the",
|
|
18161
|
+
"conflict-resolution delegation flow exists to auto-correct \u2014 there",
|
|
18162
|
+
"is no reason to make a human rebase it by hand when `issue-worker`",
|
|
18163
|
+
"can. Before rejecting, evaluate checks (2) and (3) above first: a",
|
|
18164
|
+
"`CONFLICTING` PR that **also** has failing CI or no linked issue is",
|
|
18165
|
+
"rejected for that reason via the comment-and-stop path above, since",
|
|
18166
|
+
"the delegation cannot succeed without a linked issue and green-able",
|
|
18167
|
+
"CI anyway.",
|
|
18168
|
+
"",
|
|
18169
|
+
"Otherwise, hand off to the **Shared Procedure: Conflict-Resolution",
|
|
18170
|
+
"Delegation** section. It evaluates the guards (auto-merge mode, the",
|
|
18171
|
+
"delegation invocation guard, a free `review:fixing` lease, no",
|
|
18172
|
+
"generated / projen / lockfile conflicts), classifies the conflicting",
|
|
18173
|
+
"files, and either delegates a rebase to `issue-worker` or falls",
|
|
18174
|
+
"through to its own fallback. Invoke it with this entry point's",
|
|
18175
|
+
"parameters:",
|
|
18176
|
+
"",
|
|
18177
|
+
"- **Entry point:** `already-conflicting`. There is no failed",
|
|
18178
|
+
" `gh pr update-branch` to read conflicting paths from \u2014 identify",
|
|
18179
|
+
" the conflicting files from the PR's merge state as documented in",
|
|
18180
|
+
" the shared procedure's entry-point step (a local rebase attempt",
|
|
18181
|
+
" whose `<<<<<<<` / `=======` / `>>>>>>>` markers name the",
|
|
18182
|
+
" conflicting files). The guards and classification are identical to",
|
|
18183
|
+
" the Phase 4 entry point.",
|
|
18184
|
+
"- **On the procedure returning `delegated`:** a rebase has been",
|
|
18185
|
+
" delegated to `issue-worker`; stop this pass. A human re-invokes",
|
|
18186
|
+
" the reviewer once the worker pushes the rebased branch.",
|
|
18187
|
+
"- **On the procedure returning `skipped` (a guard denied delegation",
|
|
18188
|
+
" or the guards failed):** fall back to the original hard reject \u2014",
|
|
18189
|
+
" post the merge-conflict rejection comment and stop. Use this",
|
|
18190
|
+
" comment **only** in the skipped case, never before the shared",
|
|
18191
|
+
" procedure has had its chance to auto-correct:",
|
|
18192
|
+
"",
|
|
18193
|
+
"```bash",
|
|
18194
|
+
"gh pr comment <pr-number> --body 'Not reviewable: merge conflicts \u2014 please rebase onto the default branch.'",
|
|
18195
|
+
"```",
|
|
18196
|
+
"",
|
|
18152
18197
|
"## Phase 2: Gather Context",
|
|
18153
18198
|
"",
|
|
18154
18199
|
"```bash",
|
|
@@ -18282,7 +18327,12 @@ var prReviewerSubAgent = {
|
|
|
18282
18327
|
" `review:human-required` label, set `mode = human-required`.",
|
|
18283
18328
|
"3. **Labels that force human** \u2014 if the PR carries any label listed",
|
|
18284
18329
|
" under `human-required.labels-that-force-human` (e.g.",
|
|
18285
|
-
" `
|
|
18330
|
+
" `review:human-required`), set `mode = human-required`. Evaluate",
|
|
18331
|
+
" the PR's **own** labels only \u2014 rules 1\u20133 never traverse the",
|
|
18332
|
+
" `Closes #N` link to read the linked issue's labels. `priority:*`",
|
|
18333
|
+
" and `status:*` are issue-triage labels for the orchestrator's",
|
|
18334
|
+
" scheduling queue, not merge-risk signals, and are never listed",
|
|
18335
|
+
" here.",
|
|
18286
18336
|
"4. **Path globs** \u2014 if any file in the PR diff matches any glob in",
|
|
18287
18337
|
" `human-required.paths`, set `mode = human-required`. Record the",
|
|
18288
18338
|
" first matching path + glob pair as the reason.",
|
|
@@ -18800,7 +18850,7 @@ var prReviewerSubAgent = {
|
|
|
18800
18850
|
"when the mode is `human-required` and any of the following fired:",
|
|
18801
18851
|
"",
|
|
18802
18852
|
"- rule 2 (`review:human-required` label),",
|
|
18803
|
-
"- rule 3 (any `labels-that-force-human` label
|
|
18853
|
+
"- rule 3 (any `labels-that-force-human` label),",
|
|
18804
18854
|
"- rule 4 (`human-required.paths` glob match), or",
|
|
18805
18855
|
"- rule 5 (`human-required.issue-types` match).",
|
|
18806
18856
|
"",
|
|
@@ -18850,37 +18900,215 @@ var prReviewerSubAgent = {
|
|
|
18850
18900
|
"##### Conflict-resolution delegation (BEHIND + conflicts)",
|
|
18851
18901
|
"",
|
|
18852
18902
|
"When `gh pr update-branch <pr-number>` fails because the merge would",
|
|
18853
|
-
"produce conflicts,
|
|
18854
|
-
"
|
|
18855
|
-
"
|
|
18856
|
-
"
|
|
18857
|
-
"`
|
|
18903
|
+
"produce conflicts, hand off to the **Shared Procedure:",
|
|
18904
|
+
"Conflict-Resolution Delegation** section below. That procedure owns",
|
|
18905
|
+
"the guards, the `shared-index` vs `generic` classification, the two",
|
|
18906
|
+
"typed recipes, and the fallback \u2014 defined once and shared with the",
|
|
18907
|
+
"Phase 1.5 already-`CONFLICTING` entry point. Invoke it with this",
|
|
18908
|
+
"entry point's parameters:",
|
|
18909
|
+
"",
|
|
18910
|
+
"- **Entry point:** `update-branch-conflict`. The set of conflicting",
|
|
18911
|
+
" files is the list reported by the failed `gh pr update-branch`",
|
|
18912
|
+
" (cross-referenced with `gh pr view <pr-number> --json files`).",
|
|
18913
|
+
"- **On the procedure returning `delegated`:** record",
|
|
18914
|
+
" `Branch updated: delegated (PR #<n>)` for the per-PR report.",
|
|
18915
|
+
"- **On the procedure returning `skipped` (a guard denied delegation",
|
|
18916
|
+
" or the guards failed):** the procedure has already posted the",
|
|
18917
|
+
" fallback comment and recorded",
|
|
18918
|
+
" `Branch updated: failed (conflicts; <short reason>)`. Stop.",
|
|
18919
|
+
"",
|
|
18920
|
+
"#### Mode `human-required`",
|
|
18921
|
+
"",
|
|
18922
|
+
"Do **not** run `gh pr merge --auto`. Instead, hand the PR off to a",
|
|
18923
|
+
"human reviewer:",
|
|
18924
|
+
"",
|
|
18925
|
+
"1. Apply the `review:awaiting-human` label so the PR is discoverable",
|
|
18926
|
+
" in the human-review queue:",
|
|
18927
|
+
"",
|
|
18928
|
+
" ```bash",
|
|
18929
|
+
" gh pr edit <pr-number> --add-label 'review:awaiting-human'",
|
|
18930
|
+
" ```",
|
|
18931
|
+
"",
|
|
18932
|
+
"2. **If `matched_rule == 6`** (size threshold was the sole trigger),",
|
|
18933
|
+
" run the `Update the branch when `mergeStateStatus` is `BEHIND``",
|
|
18934
|
+
" step from the `Mode auto-merge` branch above before exiting. The",
|
|
18935
|
+
" eligibility gate documented in that sub-section explicitly permits",
|
|
18936
|
+
" `gh pr update-branch` on size-only human-required PRs so the bot",
|
|
18937
|
+
" keeps the branch fresh against the default branch while the human",
|
|
18938
|
+
" reviews. Skip this sub-step for `matched_rule` in 2\u20135 \u2014 the gate",
|
|
18939
|
+
" denies `update-branch` there and the human owns branch-lifecycle.",
|
|
18940
|
+
"",
|
|
18941
|
+
"3. Exit cleanly after the acceptance-criteria check completes and any",
|
|
18942
|
+
" summary comment the reviewer posts. Proceed to Phase 5 only if a",
|
|
18943
|
+
" merge occurred \u2014 in `human-required` mode the reviewer stops at",
|
|
18944
|
+
" the hand-off and does not poll for merge.",
|
|
18945
|
+
"",
|
|
18946
|
+
"The reason captured in Phase 2.75 should be included in any summary",
|
|
18947
|
+
"comment so maintainers know why human review was required (path hit,",
|
|
18948
|
+
"issue type, size threshold, label, or default).",
|
|
18949
|
+
"",
|
|
18950
|
+
"### If any criterion is missing, partial, or CI is failing",
|
|
18951
|
+
"",
|
|
18952
|
+
"Post a plain comment (not a formal review block) with grouped findings:",
|
|
18953
|
+
"",
|
|
18954
|
+
"```bash",
|
|
18955
|
+
"gh pr comment <pr-number> --body '<grouped findings>'",
|
|
18956
|
+
"```",
|
|
18957
|
+
"",
|
|
18958
|
+
"Group findings by severity (**Blocking** / **Suggested** / **Nitpick**).",
|
|
18959
|
+
"For each blocking finding, cite the unmet acceptance criterion and the",
|
|
18960
|
+
"file or function the gap lives in. Do **not** merge, and do **not** push",
|
|
18961
|
+
"any commits to the PR's branch.",
|
|
18962
|
+
"",
|
|
18963
|
+
"Rationale for using a plain comment rather than `gh pr review",
|
|
18964
|
+
"--request-changes`: it is lighter-weight, doesn't require the author to",
|
|
18965
|
+
"dismiss a formal review, and composes cleanly with the multi-PR loop.",
|
|
18966
|
+
"",
|
|
18967
|
+
"## Phase 4.5: Update Sticky Summary",
|
|
18968
|
+
"",
|
|
18969
|
+
"On **every pass**, create or update a single **`## Reviewer notes`**",
|
|
18970
|
+
"comment on the PR. This sticky comment is the human-facing single",
|
|
18971
|
+
"source of truth for the PR's state \u2014 one comment per PR, edited in",
|
|
18972
|
+
"place across passes, never duplicated. Do not post a fresh",
|
|
18973
|
+
'"pass N summary" on each iteration.',
|
|
18974
|
+
"",
|
|
18975
|
+
"### Step 1: Find the existing sticky comment (if any)",
|
|
18976
|
+
"",
|
|
18977
|
+
"List PR-level comments and look for one authored by the reviewer",
|
|
18978
|
+
"whose body starts with `## Reviewer notes`:",
|
|
18979
|
+
"",
|
|
18980
|
+
"```bash",
|
|
18981
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/<pr-number>/comments",
|
|
18982
|
+
"```",
|
|
18983
|
+
"",
|
|
18984
|
+
"If multiple candidates exist (an older run double-posted before this",
|
|
18985
|
+
"phase existed), keep the earliest and plan to delete the duplicates",
|
|
18986
|
+
"on a later pass. Never delete another author's comment.",
|
|
18987
|
+
"",
|
|
18988
|
+
"### Step 2: Compose the sticky body",
|
|
18989
|
+
"",
|
|
18990
|
+
"The body uses the following shape:",
|
|
18991
|
+
"",
|
|
18992
|
+
"```",
|
|
18993
|
+
"## Reviewer notes",
|
|
18994
|
+
"",
|
|
18995
|
+
"**Mode:** auto-merge | human-required \u2014 <reason from Phase 2.75>",
|
|
18996
|
+
"**AC status:** <met / partial / missing> (evidence links)",
|
|
18997
|
+
"**CI status:** green | pending | red",
|
|
18998
|
+
"**Outstanding:** <list of comments still open with their classification and author>",
|
|
18999
|
+
"**Pushbacks:** <list of disputes with reasons>",
|
|
19000
|
+
"**Last pass:** <ISO timestamp>",
|
|
19001
|
+
"```",
|
|
19002
|
+
"",
|
|
19003
|
+
"Populate each field from the phases above:",
|
|
19004
|
+
"",
|
|
19005
|
+
"- **Mode / reason** \u2014 the mode and reason recorded in Phase 2.75.",
|
|
19006
|
+
"- **AC status** \u2014 the checklist produced in Phase 3 (met, partial,",
|
|
19007
|
+
" or missing), with links to the files or tests that provide the",
|
|
19008
|
+
" evidence.",
|
|
19009
|
+
"- **CI status** \u2014 the verdict from the **CI Verification** section",
|
|
19010
|
+
" (primary check-runs read, or the Actions-runs fallback when",
|
|
19011
|
+
" check-runs returns a fine-grained-PAT 403).",
|
|
19012
|
+
"- **Outstanding** \u2014 the comments still carrying a non-terminal",
|
|
19013
|
+
" reviewer reaction from Phase 3.5 (typically `eyes` for queued",
|
|
19014
|
+
" in-scope items and `nit` / `question` items that remain open).",
|
|
19015
|
+
" List each as `<classification>: <author> \u2014 <short summary> (<url>)`.",
|
|
19016
|
+
"- **Pushbacks** \u2014 every comment the reviewer reacted",
|
|
19017
|
+
" `thinking_face` to on this or any prior pass, with the reason",
|
|
19018
|
+
" captured in the pushback reply. Empty list when there are none.",
|
|
19019
|
+
"- **Last pass** \u2014 the ISO 8601 timestamp of this run.",
|
|
19020
|
+
"",
|
|
19021
|
+
"### Step 3: Create or edit in place",
|
|
19022
|
+
"",
|
|
19023
|
+
"If no existing sticky comment was found in Step 1, create one:",
|
|
19024
|
+
"",
|
|
19025
|
+
"```bash",
|
|
19026
|
+
"gh pr comment <pr-number> --body '<sticky body>'",
|
|
19027
|
+
"```",
|
|
19028
|
+
"",
|
|
19029
|
+
"If an existing sticky comment was found, edit it in place using the",
|
|
19030
|
+
"comment id. Do not delete and re-create \u2014 editing preserves the",
|
|
19031
|
+
"comment's URL and any reactions humans have added to the summary:",
|
|
19032
|
+
"",
|
|
19033
|
+
"```bash",
|
|
19034
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<sticky-comment-id> \\",
|
|
19035
|
+
" -X PATCH -f body='<sticky body>'",
|
|
19036
|
+
"```",
|
|
19037
|
+
"",
|
|
19038
|
+
"The sticky summary must be updated on every pass through Phase 4.5,",
|
|
19039
|
+
"including passes that ended in a pushback-gated skip, a",
|
|
19040
|
+
"`NEEDS_CHANGES` findings comment, or the `human-required` hand-off.",
|
|
19041
|
+
"Humans rely on the sticky comment to see the current state of the",
|
|
19042
|
+
"PR at a glance \u2014 it must never go stale while the reviewer is",
|
|
19043
|
+
"actively processing the PR.",
|
|
19044
|
+
"",
|
|
19045
|
+
"## Shared Procedure: Conflict-Resolution Delegation",
|
|
19046
|
+
"",
|
|
19047
|
+
"This procedure resolves a PR that cannot land because its head",
|
|
19048
|
+
"branch conflicts with the default branch. It is invoked from **two**",
|
|
19049
|
+
"entry points, both of which reuse the identical guards,",
|
|
19050
|
+
"classification, typed recipes, and fallback defined here \u2014 the flow",
|
|
19051
|
+
"is defined **once** and shared:",
|
|
19052
|
+
"",
|
|
19053
|
+
"- **Phase 4 `update-branch-conflict`** \u2014 a PR that was MERGEABLE at",
|
|
19054
|
+
" Phase 1.5 went BEHIND, and `gh pr update-branch` then failed",
|
|
19055
|
+
" because the merge would conflict.",
|
|
19056
|
+
"- **Phase 1.5 `already-conflicting`** \u2014 the orchestrator handed the",
|
|
19057
|
+
" reviewer a PR that is **already** `CONFLICTING` (its",
|
|
19058
|
+
' `mergeable == "CONFLICTING"`) before any review work began.',
|
|
19059
|
+
"",
|
|
19060
|
+
"The reviewer **may** delegate conflict resolution to `issue-worker`",
|
|
19061
|
+
"via the feedback-mode delegation contract (the same path Phase 4's",
|
|
19062
|
+
"in-scope-fix delegation uses). The reviewer never hand-resolves",
|
|
19063
|
+
"conflicts itself \u2014 branch mutations always belong to `issue-worker`.",
|
|
19064
|
+
"",
|
|
19065
|
+
"### Entry-point parameters",
|
|
19066
|
+
"",
|
|
19067
|
+
"The caller supplies which entry point it is and how the conflicting",
|
|
19068
|
+
"files are identified. Everything after this step is identical across",
|
|
19069
|
+
"both entry points.",
|
|
19070
|
+
"",
|
|
19071
|
+
"- **`update-branch-conflict`** \u2014 the conflicting-file set is the",
|
|
19072
|
+
" list reported by the failed `gh pr update-branch` (cross-referenced",
|
|
19073
|
+
" with `gh pr view <pr-number> --json files`).",
|
|
19074
|
+
"- **`already-conflicting`** \u2014 there is no failed `update-branch` to",
|
|
19075
|
+
" read conflicting paths from. Identify the conflicting files from",
|
|
19076
|
+
" the PR's merge state instead: attempt a local rebase of the head",
|
|
19077
|
+
" branch onto the default branch in a scratch checkout (or read the",
|
|
19078
|
+
" conflicting paths git reports) and collect the files that carry",
|
|
19079
|
+
" `<<<<<<<` / `=======` / `>>>>>>>` conflict markers. Use that set",
|
|
19080
|
+
" as the conflicting-file list. The reviewer inspects these markers",
|
|
19081
|
+
" read-only to classify; it does **not** stage, commit, or push any",
|
|
19082
|
+
" resolution \u2014 the actual rebase-and-resolve is delegated to",
|
|
19083
|
+
" `issue-worker` exactly as in the other entry point.",
|
|
19084
|
+
"",
|
|
19085
|
+
"### Guards",
|
|
18858
19086
|
"",
|
|
18859
19087
|
"Delegate **only when all** of the following hold. If any guard fails,",
|
|
18860
|
-
"fall through to the
|
|
19088
|
+
"fall through to the **Fallback** at the end of this procedure and",
|
|
19089
|
+
"return `skipped`.",
|
|
18861
19090
|
"",
|
|
18862
19091
|
"1. **Review mode is `auto-merge`.** Never delegate conflict",
|
|
18863
19092
|
" resolution on `human-required` PRs \u2014 pushing worker-resolved",
|
|
18864
19093
|
" merge content into them expands the diff under review without",
|
|
18865
|
-
" the human reviewer's consent. (Unlike the `update-branch` step",
|
|
18866
|
-
"
|
|
19094
|
+
" the human reviewer's consent. (Unlike the `update-branch` step,",
|
|
19095
|
+
" which permits a size-only `human-required` carve-out, the",
|
|
18867
19096
|
" conflict-resolution delegation flow is auto-merge-only across",
|
|
18868
19097
|
" the board: a worker rebase push is a stronger branch mutation",
|
|
18869
19098
|
" than the merge-commit `gh pr update-branch` performs.)",
|
|
18870
19099
|
"2. **Delegation invocation guard permits the hand-off** \u2014 the PR",
|
|
18871
19100
|
" carries the `origin:issue-worker` label, **or** the reviewer was",
|
|
18872
19101
|
" invoked with `--allow-human-author`. The same guard used for the",
|
|
18873
|
-
" in-scope-fix delegation flow
|
|
19102
|
+
" in-scope-fix delegation flow applies here unchanged.",
|
|
18874
19103
|
"3. **The `review:fixing` lease is currently free.** If",
|
|
18875
19104
|
" `review:fixing` is already on the PR, another delegation is",
|
|
18876
19105
|
" in-flight; skip conflict-resolution delegation, log the contention",
|
|
18877
19106
|
" to the sticky summary, and fall through to the fallback.",
|
|
18878
|
-
"4. **No conflicting file is generated or projen-managed.**
|
|
18879
|
-
"
|
|
18880
|
-
"
|
|
18881
|
-
"
|
|
18882
|
-
"
|
|
18883
|
-
" and the reviewer must skip delegation:",
|
|
19107
|
+
"4. **No conflicting file is generated or projen-managed.** Inspect",
|
|
19108
|
+
" the conflicting paths from the entry-point step above. If **any**",
|
|
19109
|
+
" conflicting path matches one of the following globs, the conflict",
|
|
19110
|
+
" is unsafe to resolve mechanically and the reviewer must skip",
|
|
19111
|
+
" delegation:",
|
|
18884
19112
|
" - `**/*.lock` and `pnpm-lock.yaml` / `yarn.lock` / `package-lock.json`",
|
|
18885
19113
|
" - `**/.projen/**`",
|
|
18886
19114
|
" - any file whose first 5 lines contain the marker",
|
|
@@ -18891,17 +19119,18 @@ var prReviewerSubAgent = {
|
|
|
18891
19119
|
" and conflicts there should be resolved by re-running synth, not by",
|
|
18892
19120
|
" merging the conflict markers.",
|
|
18893
19121
|
"",
|
|
19122
|
+
"### Classify each conflicting file",
|
|
19123
|
+
"",
|
|
18894
19124
|
"When every guard above passes, **classify each conflicting file**",
|
|
18895
19125
|
"before composing the fix-list. The classification picks one of two",
|
|
18896
19126
|
"typed recipes \u2014 a precise `shared-index` resolver when every",
|
|
18897
19127
|
"conflict is a row-insert race on a registry / index / feature-matrix",
|
|
18898
19128
|
"file, or the generic rebase recipe in every other case.",
|
|
18899
19129
|
"",
|
|
18900
|
-
"**Classification step.** For each conflicting path
|
|
18901
|
-
"
|
|
18902
|
-
"
|
|
18903
|
-
"
|
|
18904
|
-
"`shared-editing.ts` for the canonical constant):",
|
|
19130
|
+
"**Classification step.** For each conflicting path, decide whether",
|
|
19131
|
+
"the file is `shared-index` or `generic` against these criteria (the",
|
|
19132
|
+
"shared-index glob set comes from the `shared-editing-safety` rule \u2014",
|
|
19133
|
+
"see the bundle's `shared-editing.ts` for the canonical constant):",
|
|
18905
19134
|
"",
|
|
18906
19135
|
"- `shared-index` \u2014 the path matches one of the shared-editing glob",
|
|
18907
19136
|
" patterns:",
|
|
@@ -18936,6 +19165,8 @@ var prReviewerSubAgent = {
|
|
|
18936
19165
|
" (see step 3 below). The worker performs a hand-merge of the",
|
|
18937
19166
|
" conflict markers.",
|
|
18938
19167
|
"",
|
|
19168
|
+
"### Hand off to `issue-worker`",
|
|
19169
|
+
"",
|
|
18939
19170
|
"Hand off to `issue-worker` with the chosen single synthetic",
|
|
18940
19171
|
"fix-list item:",
|
|
18941
19172
|
"",
|
|
@@ -19023,147 +19254,25 @@ var prReviewerSubAgent = {
|
|
|
19023
19254
|
"",
|
|
19024
19255
|
"7. **Do not re-enable auto-merge in the same pass.** After delegation,",
|
|
19025
19256
|
" exit and let a human re-invoke the reviewer. The next pass will",
|
|
19026
|
-
" re-evaluate `mergeStateStatus` against the
|
|
19027
|
-
" re-enable auto-merge through the normal flow
|
|
19257
|
+
" re-evaluate `mergeStateStatus` (or `mergeable`) against the",
|
|
19258
|
+
" rebased branch and re-enable auto-merge through the normal flow.",
|
|
19259
|
+
"",
|
|
19260
|
+
"Return `delegated` to the caller when delegation completes",
|
|
19261
|
+
"(regardless of the worker's outcome \u2014 the delegation itself is the",
|
|
19262
|
+
"action taken).",
|
|
19028
19263
|
"",
|
|
19029
|
-
"
|
|
19030
|
-
"when delegation completes (regardless of the worker's outcome \u2014 the",
|
|
19031
|
-
"delegation itself is the action taken).",
|
|
19264
|
+
"### Fallback",
|
|
19032
19265
|
"",
|
|
19033
19266
|
"**Fallback when delegation is not permitted or guards fail.** Post a",
|
|
19034
19267
|
"short comment explaining why the branch could not be updated",
|
|
19035
19268
|
"automatically and stop. Do not push commits, do not force, do not",
|
|
19036
|
-
"retry. Record `Branch updated: failed (conflicts; <short reason>)
|
|
19269
|
+
"retry. Record `Branch updated: failed (conflicts; <short reason>)`",
|
|
19270
|
+
"and return `skipped` to the caller.",
|
|
19037
19271
|
"",
|
|
19038
19272
|
"```bash",
|
|
19039
|
-
"gh pr comment <pr-number> --body '
|
|
19273
|
+
"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.'",
|
|
19040
19274
|
"```",
|
|
19041
19275
|
"",
|
|
19042
|
-
"#### Mode `human-required`",
|
|
19043
|
-
"",
|
|
19044
|
-
"Do **not** run `gh pr merge --auto`. Instead, hand the PR off to a",
|
|
19045
|
-
"human reviewer:",
|
|
19046
|
-
"",
|
|
19047
|
-
"1. Apply the `review:awaiting-human` label so the PR is discoverable",
|
|
19048
|
-
" in the human-review queue:",
|
|
19049
|
-
"",
|
|
19050
|
-
" ```bash",
|
|
19051
|
-
" gh pr edit <pr-number> --add-label 'review:awaiting-human'",
|
|
19052
|
-
" ```",
|
|
19053
|
-
"",
|
|
19054
|
-
"2. **If `matched_rule == 6`** (size threshold was the sole trigger),",
|
|
19055
|
-
" run the `Update the branch when `mergeStateStatus` is `BEHIND``",
|
|
19056
|
-
" step from the `Mode auto-merge` branch above before exiting. The",
|
|
19057
|
-
" eligibility gate documented in that sub-section explicitly permits",
|
|
19058
|
-
" `gh pr update-branch` on size-only human-required PRs so the bot",
|
|
19059
|
-
" keeps the branch fresh against the default branch while the human",
|
|
19060
|
-
" reviews. Skip this sub-step for `matched_rule` in 2\u20135 \u2014 the gate",
|
|
19061
|
-
" denies `update-branch` there and the human owns branch-lifecycle.",
|
|
19062
|
-
"",
|
|
19063
|
-
"3. Exit cleanly after the acceptance-criteria check completes and any",
|
|
19064
|
-
" summary comment the reviewer posts. Proceed to Phase 5 only if a",
|
|
19065
|
-
" merge occurred \u2014 in `human-required` mode the reviewer stops at",
|
|
19066
|
-
" the hand-off and does not poll for merge.",
|
|
19067
|
-
"",
|
|
19068
|
-
"The reason captured in Phase 2.75 should be included in any summary",
|
|
19069
|
-
"comment so maintainers know why human review was required (path hit,",
|
|
19070
|
-
"issue type, size threshold, label, or default).",
|
|
19071
|
-
"",
|
|
19072
|
-
"### If any criterion is missing, partial, or CI is failing",
|
|
19073
|
-
"",
|
|
19074
|
-
"Post a plain comment (not a formal review block) with grouped findings:",
|
|
19075
|
-
"",
|
|
19076
|
-
"```bash",
|
|
19077
|
-
"gh pr comment <pr-number> --body '<grouped findings>'",
|
|
19078
|
-
"```",
|
|
19079
|
-
"",
|
|
19080
|
-
"Group findings by severity (**Blocking** / **Suggested** / **Nitpick**).",
|
|
19081
|
-
"For each blocking finding, cite the unmet acceptance criterion and the",
|
|
19082
|
-
"file or function the gap lives in. Do **not** merge, and do **not** push",
|
|
19083
|
-
"any commits to the PR's branch.",
|
|
19084
|
-
"",
|
|
19085
|
-
"Rationale for using a plain comment rather than `gh pr review",
|
|
19086
|
-
"--request-changes`: it is lighter-weight, doesn't require the author to",
|
|
19087
|
-
"dismiss a formal review, and composes cleanly with the multi-PR loop.",
|
|
19088
|
-
"",
|
|
19089
|
-
"## Phase 4.5: Update Sticky Summary",
|
|
19090
|
-
"",
|
|
19091
|
-
"On **every pass**, create or update a single **`## Reviewer notes`**",
|
|
19092
|
-
"comment on the PR. This sticky comment is the human-facing single",
|
|
19093
|
-
"source of truth for the PR's state \u2014 one comment per PR, edited in",
|
|
19094
|
-
"place across passes, never duplicated. Do not post a fresh",
|
|
19095
|
-
'"pass N summary" on each iteration.',
|
|
19096
|
-
"",
|
|
19097
|
-
"### Step 1: Find the existing sticky comment (if any)",
|
|
19098
|
-
"",
|
|
19099
|
-
"List PR-level comments and look for one authored by the reviewer",
|
|
19100
|
-
"whose body starts with `## Reviewer notes`:",
|
|
19101
|
-
"",
|
|
19102
|
-
"```bash",
|
|
19103
|
-
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/<pr-number>/comments",
|
|
19104
|
-
"```",
|
|
19105
|
-
"",
|
|
19106
|
-
"If multiple candidates exist (an older run double-posted before this",
|
|
19107
|
-
"phase existed), keep the earliest and plan to delete the duplicates",
|
|
19108
|
-
"on a later pass. Never delete another author's comment.",
|
|
19109
|
-
"",
|
|
19110
|
-
"### Step 2: Compose the sticky body",
|
|
19111
|
-
"",
|
|
19112
|
-
"The body uses the following shape:",
|
|
19113
|
-
"",
|
|
19114
|
-
"```",
|
|
19115
|
-
"## Reviewer notes",
|
|
19116
|
-
"",
|
|
19117
|
-
"**Mode:** auto-merge | human-required \u2014 <reason from Phase 2.75>",
|
|
19118
|
-
"**AC status:** <met / partial / missing> (evidence links)",
|
|
19119
|
-
"**CI status:** green | pending | red",
|
|
19120
|
-
"**Outstanding:** <list of comments still open with their classification and author>",
|
|
19121
|
-
"**Pushbacks:** <list of disputes with reasons>",
|
|
19122
|
-
"**Last pass:** <ISO timestamp>",
|
|
19123
|
-
"```",
|
|
19124
|
-
"",
|
|
19125
|
-
"Populate each field from the phases above:",
|
|
19126
|
-
"",
|
|
19127
|
-
"- **Mode / reason** \u2014 the mode and reason recorded in Phase 2.75.",
|
|
19128
|
-
"- **AC status** \u2014 the checklist produced in Phase 3 (met, partial,",
|
|
19129
|
-
" or missing), with links to the files or tests that provide the",
|
|
19130
|
-
" evidence.",
|
|
19131
|
-
"- **CI status** \u2014 the verdict from the **CI Verification** section",
|
|
19132
|
-
" (primary check-runs read, or the Actions-runs fallback when",
|
|
19133
|
-
" check-runs returns a fine-grained-PAT 403).",
|
|
19134
|
-
"- **Outstanding** \u2014 the comments still carrying a non-terminal",
|
|
19135
|
-
" reviewer reaction from Phase 3.5 (typically `eyes` for queued",
|
|
19136
|
-
" in-scope items and `nit` / `question` items that remain open).",
|
|
19137
|
-
" List each as `<classification>: <author> \u2014 <short summary> (<url>)`.",
|
|
19138
|
-
"- **Pushbacks** \u2014 every comment the reviewer reacted",
|
|
19139
|
-
" `thinking_face` to on this or any prior pass, with the reason",
|
|
19140
|
-
" captured in the pushback reply. Empty list when there are none.",
|
|
19141
|
-
"- **Last pass** \u2014 the ISO 8601 timestamp of this run.",
|
|
19142
|
-
"",
|
|
19143
|
-
"### Step 3: Create or edit in place",
|
|
19144
|
-
"",
|
|
19145
|
-
"If no existing sticky comment was found in Step 1, create one:",
|
|
19146
|
-
"",
|
|
19147
|
-
"```bash",
|
|
19148
|
-
"gh pr comment <pr-number> --body '<sticky body>'",
|
|
19149
|
-
"```",
|
|
19150
|
-
"",
|
|
19151
|
-
"If an existing sticky comment was found, edit it in place using the",
|
|
19152
|
-
"comment id. Do not delete and re-create \u2014 editing preserves the",
|
|
19153
|
-
"comment's URL and any reactions humans have added to the summary:",
|
|
19154
|
-
"",
|
|
19155
|
-
"```bash",
|
|
19156
|
-
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<sticky-comment-id> \\",
|
|
19157
|
-
" -X PATCH -f body='<sticky body>'",
|
|
19158
|
-
"```",
|
|
19159
|
-
"",
|
|
19160
|
-
"The sticky summary must be updated on every pass through Phase 4.5,",
|
|
19161
|
-
"including passes that ended in a pushback-gated skip, a",
|
|
19162
|
-
"`NEEDS_CHANGES` findings comment, or the `human-required` hand-off.",
|
|
19163
|
-
"Humans rely on the sticky comment to see the current state of the",
|
|
19164
|
-
"PR at a glance \u2014 it must never go stale while the reviewer is",
|
|
19165
|
-
"actively processing the PR.",
|
|
19166
|
-
"",
|
|
19167
19276
|
"## Phase 5: Branch Cleanup and Issue Closure Verification",
|
|
19168
19277
|
"",
|
|
19169
19278
|
"Skip this phase entirely when the review mode from Phase 2.75 is",
|
|
@@ -19554,7 +19663,6 @@ function buildPrReviewBundle(policy = resolvePrReviewPolicy()) {
|
|
|
19554
19663
|
" insertions: 500",
|
|
19555
19664
|
" labels-that-force-human:",
|
|
19556
19665
|
' - "review:human-required"',
|
|
19557
|
-
' - "priority:critical"',
|
|
19558
19666
|
"",
|
|
19559
19667
|
"auto-merge:",
|
|
19560
19668
|
" labels-that-force-auto:",
|
|
@@ -19585,8 +19693,9 @@ function buildPrReviewBundle(policy = resolvePrReviewPolicy()) {
|
|
|
19585
19693
|
"2. **`review:human-required` label** \u2014 reserved force-human label;",
|
|
19586
19694
|
" if present (and no force-auto label beat it in step 1), the mode",
|
|
19587
19695
|
" is `human-required`.",
|
|
19588
|
-
"3. **`human-required.labels-that-force-human`** \u2014
|
|
19589
|
-
"
|
|
19696
|
+
"3. **`human-required.labels-that-force-human`** \u2014 if the PR",
|
|
19697
|
+
" carries any label listed here (e.g. `review:human-required`),",
|
|
19698
|
+
" the mode is `human-required`.",
|
|
19590
19699
|
"4. **`human-required.paths`** \u2014 if any file in the PR diff matches",
|
|
19591
19700
|
" any glob here, the mode is `human-required`. Matching uses",
|
|
19592
19701
|
" standard glob semantics (`**` for recursive directories,",
|
|
@@ -19607,6 +19716,24 @@ function buildPrReviewBundle(policy = resolvePrReviewPolicy()) {
|
|
|
19607
19716
|
"7. **`default`** \u2014 applied only when no rule above matched",
|
|
19608
19717
|
" (normally `auto-merge`).",
|
|
19609
19718
|
"",
|
|
19719
|
+
"**Label-check scope.** All label checks in rules 1\u20133 evaluate",
|
|
19720
|
+
"the PR's **own** labels only. Never traverse the `Closes #N`",
|
|
19721
|
+
"link to read the linked issue's labels for a label rule. Rule 5",
|
|
19722
|
+
"is the only rule that reads the linked issue, and it reads the",
|
|
19723
|
+
"issue **type**, not its labels.",
|
|
19724
|
+
"",
|
|
19725
|
+
"**`priority:*` / `status:*` are not merge-risk signals.**",
|
|
19726
|
+
"`priority:*` and `status:*` are issue-triage labels consumed by",
|
|
19727
|
+
"the orchestrator for scheduling \u2014 `priority:*` sequences the",
|
|
19728
|
+
"work queue and `status:*` tracks workflow position. They say",
|
|
19729
|
+
"nothing about a PR's merge risk and must never appear in any",
|
|
19730
|
+
"`labels-that-force-*` list. Gating merge on `priority:critical`",
|
|
19731
|
+
"in particular inverts the intended behaviour: the most urgent",
|
|
19732
|
+
"work would wait the longest for a human merge. Merge risk is",
|
|
19733
|
+
"already covered by the path globs (rule 4), the",
|
|
19734
|
+
"`release` / `hotfix` issue-types (rule 5), and the size",
|
|
19735
|
+
"thresholds (rule 6).",
|
|
19736
|
+
"",
|
|
19610
19737
|
"The `auto-merge.paths-exempt-from-size` carve-out exists so",
|
|
19611
19738
|
"**doc-only PRs** that routinely exceed the 500-insertion size",
|
|
19612
19739
|
"threshold (large migrations, bulk additions, refresh passes)",
|
|
@@ -19638,8 +19765,8 @@ function buildPrReviewBundle(policy = resolvePrReviewPolicy()) {
|
|
|
19638
19765
|
"The exception is keyed on the matched-rule index recorded in",
|
|
19639
19766
|
"Phase 2.75. All other `human-required` triggers \u2014 rule 2",
|
|
19640
19767
|
"(`review:human-required` label), rule 3 (any",
|
|
19641
|
-
"`labels-that-force-human` label
|
|
19642
|
-
"
|
|
19768
|
+
"`labels-that-force-human` label), rule 4",
|
|
19769
|
+
"(`human-required.paths` glob match), and rule 5",
|
|
19643
19770
|
"(`human-required.issue-types` match) \u2014 continue to block",
|
|
19644
19771
|
"`update-branch` because each one signals a human reviewer who",
|
|
19645
19772
|
"has explicit ownership of the branch's lifecycle.",
|