@codedrifters/configulator 0.0.225 → 0.0.227
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 +430 -17
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +430 -17
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -5566,10 +5566,11 @@ var prReviewerSubAgent = {
|
|
|
5566
5566
|
" PRs are also eligible for this invocation only. The flag does **not**",
|
|
5567
5567
|
" persist across invocations.",
|
|
5568
5568
|
"",
|
|
5569
|
-
"
|
|
5570
|
-
"
|
|
5571
|
-
"
|
|
5572
|
-
"
|
|
5569
|
+
"Phase 4's invocation guard enforces the bot-only default and the",
|
|
5570
|
+
"`--allow-human-author` opt-out. PRs without the `origin:issue-worker`",
|
|
5571
|
+
"label are still classified, commented on, reacted to, and (in",
|
|
5572
|
+
"`auto-merge` mode) auto-merged when the AC/CI checks pass \u2014 only the",
|
|
5573
|
+
"delegation hand-off to `issue-worker` is gated.",
|
|
5573
5574
|
"",
|
|
5574
5575
|
"---",
|
|
5575
5576
|
"",
|
|
@@ -5807,14 +5808,18 @@ var prReviewerSubAgent = {
|
|
|
5807
5808
|
"Action on this pass:",
|
|
5808
5809
|
"",
|
|
5809
5810
|
"- React `eyes` on the comment to mark it seen.",
|
|
5810
|
-
"- Queue the comment for
|
|
5811
|
-
"
|
|
5812
|
-
"
|
|
5813
|
-
"
|
|
5814
|
-
"
|
|
5811
|
+
"- Queue the comment for delegation in the Phase 4 delegation flow.",
|
|
5812
|
+
" When the invocation guard permits delegation, Phase 4 builds a",
|
|
5813
|
+
" fix-list comment from the queued items and hands the work off to",
|
|
5814
|
+
" `issue-worker` in feedback mode. When delegation is denied",
|
|
5815
|
+
" (human-authored PR with no `--allow-human-author` opt-in), the",
|
|
5816
|
+
" queued items remain `eyes`-only and Phase 4.5 lists them as",
|
|
5817
|
+
" outstanding for the human to resolve.",
|
|
5815
5818
|
"- Do **not** apply `+1` or `rocket` yet. Those are terminal",
|
|
5816
5819
|
" reactions reserved for later passes once the fix has been accepted",
|
|
5817
|
-
" into the PR (`+1`) and actually landed on the branch (`rocket`
|
|
5820
|
+
" into the PR (`+1`) and actually landed on the branch (`rocket` \u2014",
|
|
5821
|
+
" applied by Phase 4 step (f) once the worker reports the item",
|
|
5822
|
+
" handled).",
|
|
5818
5823
|
"",
|
|
5819
5824
|
"```bash",
|
|
5820
5825
|
"# React eyes on a PR-level issue comment",
|
|
@@ -5931,6 +5936,28 @@ var prReviewerSubAgent = {
|
|
|
5931
5936
|
"",
|
|
5932
5937
|
"## Phase 4: Decide and Act",
|
|
5933
5938
|
"",
|
|
5939
|
+
"### Invocation guard (runs before any delegation in this phase)",
|
|
5940
|
+
"",
|
|
5941
|
+
"Before delegating any in-scope fix to `issue-worker`, verify the",
|
|
5942
|
+
"delegation is permitted by author identity:",
|
|
5943
|
+
"",
|
|
5944
|
+
"- If the PR carries the `origin:issue-worker` label, delegation is",
|
|
5945
|
+
" permitted.",
|
|
5946
|
+
"- If the invocation prompt contains the literal flag",
|
|
5947
|
+
" `--allow-human-author`, delegation is permitted for this invocation",
|
|
5948
|
+
" only.",
|
|
5949
|
+
"- Otherwise (human-authored PR with no opt-in flag) the reviewer",
|
|
5950
|
+
" **must not delegate**. It still classifies comments (Phase 3.5),",
|
|
5951
|
+
" posts replies, applies reactions, updates the sticky summary, and",
|
|
5952
|
+
" (when in `auto-merge` mode and the AC/CI checks pass) enables",
|
|
5953
|
+
" auto-merge. Fix-list production and the issue-worker invocation are",
|
|
5954
|
+
" left to the human PR author. Record the reason in the Phase 4.5",
|
|
5955
|
+
" sticky summary as `delegation skipped: human-authored PR`.",
|
|
5956
|
+
"",
|
|
5957
|
+
"Skip the entire delegation flow below when the invocation guard",
|
|
5958
|
+
"denies delegation. The pushback gate, the AC/CI evaluation, and the",
|
|
5959
|
+
"Phase 4.5 sticky update still run.",
|
|
5960
|
+
"",
|
|
5934
5961
|
"### Pushback gate (runs before every merge decision)",
|
|
5935
5962
|
"",
|
|
5936
5963
|
"Before taking any merge-enabling action in this phase, verify that no",
|
|
@@ -5958,6 +5985,212 @@ var prReviewerSubAgent = {
|
|
|
5958
5985
|
"If no unresolved `thinking_face` reactions exist, proceed with the",
|
|
5959
5986
|
"branches below based on the review mode decided in Phase 2.75.",
|
|
5960
5987
|
"",
|
|
5988
|
+
"### Delegation flow (in-scope fixes)",
|
|
5989
|
+
"",
|
|
5990
|
+
"When the invocation guard above permits delegation **and** Phase 3.5",
|
|
5991
|
+
"queued one or more `in-scope` items, the reviewer hands the fix work",
|
|
5992
|
+
"off to `issue-worker` in feedback mode. The reviewer never edits the",
|
|
5993
|
+
"PR's branch itself.",
|
|
5994
|
+
"",
|
|
5995
|
+
"Run the steps below in order. Steps (a) through (g) apply in **both**",
|
|
5996
|
+
"`auto-merge` and `human-required` review modes. Step (h) is",
|
|
5997
|
+
"auto-merge-only \u2014 in `human-required` mode the reviewer skips it,",
|
|
5998
|
+
"leaves `review:awaiting-human` applied, and lets the human own the",
|
|
5999
|
+
"final merge.",
|
|
6000
|
+
"",
|
|
6001
|
+
"#### a. Handle AC drift first",
|
|
6002
|
+
"",
|
|
6003
|
+
"For every queued `in-scope` item, re-check whether the comment is",
|
|
6004
|
+
"actually a request to **change the linked issue's acceptance",
|
|
6005
|
+
"criteria** rather than to change code that already meets the AC. If",
|
|
6006
|
+
"it is AC drift, do **not** delegate the item:",
|
|
6007
|
+
"",
|
|
6008
|
+
"1. Reply on the PR thread the comment came from with the exact text:",
|
|
6009
|
+
" `This belongs in #<issue> \u2014 please update the issue's acceptance criteria first.`",
|
|
6010
|
+
"2. Post a second comment on the **linked issue** with a concrete",
|
|
6011
|
+
" suggested edit to its Acceptance Criteria section that captures",
|
|
6012
|
+
" what the PR comment is asking for.",
|
|
6013
|
+
"3. React `thinking_face` (`content=confused`) on the original PR",
|
|
6014
|
+
" comment. AC-drift items count as pushbacks and the standing",
|
|
6015
|
+
" pushback gate above will block any later auto-merge re-enable.",
|
|
6016
|
+
"4. Drop the item from the delegation fix-list \u2014 only non-AC-drift",
|
|
6017
|
+
" in-scope items proceed to step (b) onwards.",
|
|
6018
|
+
"",
|
|
6019
|
+
"```bash",
|
|
6020
|
+
"# Reply on the PR thread",
|
|
6021
|
+
`gh pr comment <pr-number> --body "This belongs in #<issue> \u2014 please update the issue's acceptance criteria first."`,
|
|
6022
|
+
"",
|
|
6023
|
+
"# Suggest the AC edit on the linked issue",
|
|
6024
|
+
"gh issue comment <issue-number> --body '<concrete suggested AC edit>'",
|
|
6025
|
+
"",
|
|
6026
|
+
"# React thinking_face on the PR comment (treats as pushback)",
|
|
6027
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<comment-id>/reactions \\",
|
|
6028
|
+
" -X POST -f content=confused",
|
|
6029
|
+
"```",
|
|
6030
|
+
"",
|
|
6031
|
+
"If **every** queued in-scope item is AC drift, the delegation",
|
|
6032
|
+
"fix-list is empty \u2014 skip to Phase 4.5 to record the state and stop.",
|
|
6033
|
+
"Do not invoke issue-worker with an empty list.",
|
|
6034
|
+
"",
|
|
6035
|
+
"#### b. Disable auto-merge",
|
|
6036
|
+
"",
|
|
6037
|
+
"Before mutating the PR, disable any pending auto-merge so a fast CI",
|
|
6038
|
+
"pass cannot land the PR mid-delegation. The command is idempotent \u2014",
|
|
6039
|
+
"running it when auto-merge was never enabled is a safe no-op.",
|
|
6040
|
+
"",
|
|
6041
|
+
"```bash",
|
|
6042
|
+
"gh pr merge <pr-number> --disable-auto",
|
|
6043
|
+
"```",
|
|
6044
|
+
"",
|
|
6045
|
+
"#### c. Acquire the `review:fixing` lease",
|
|
6046
|
+
"",
|
|
6047
|
+
"Add the `review:fixing` label to the PR. The label is a mutual",
|
|
6048
|
+
"exclusion lease \u2014 only one delegation may be in flight against a",
|
|
6049
|
+
"given PR at a time:",
|
|
6050
|
+
"",
|
|
6051
|
+
"```bash",
|
|
6052
|
+
"gh pr edit <pr-number> --add-label 'review:fixing'",
|
|
6053
|
+
"```",
|
|
6054
|
+
"",
|
|
6055
|
+
"Before adding the label, list the PR's existing labels. If",
|
|
6056
|
+
"`review:fixing` is **already present**, another delegation is",
|
|
6057
|
+
"in-flight (or a previous delegation crashed without releasing the",
|
|
6058
|
+
"lease). Stop immediately, log the contention to the sticky summary,",
|
|
6059
|
+
"and exit. Do not invoke issue-worker, do not write a fix-list, and do",
|
|
6060
|
+
"not remove the existing label \u2014 a human must investigate and clear",
|
|
6061
|
+
"the lease manually.",
|
|
6062
|
+
"",
|
|
6063
|
+
"#### d. Write the fix-list comment",
|
|
6064
|
+
"",
|
|
6065
|
+
"Post a single PR-level comment whose body matches the format the",
|
|
6066
|
+
"issue-worker feedback mode parses. The comment must contain a human",
|
|
6067
|
+
"checkbox summary followed by a fenced ```json fix-list``` block. The",
|
|
6068
|
+
"JSON block is the **authoritative** list of work \u2014 the checkbox",
|
|
6069
|
+
"summary is for humans only.",
|
|
6070
|
+
"",
|
|
6071
|
+
"```markdown",
|
|
6072
|
+
"## Reviewer: fix list for @issue-worker",
|
|
6073
|
+
"",
|
|
6074
|
+
"- [ ] @<author> \u2014 <instruction summary> (<file>:<line>)",
|
|
6075
|
+
"",
|
|
6076
|
+
"```json fix-list",
|
|
6077
|
+
"{",
|
|
6078
|
+
' "pr": <pr-number>,',
|
|
6079
|
+
' "branch": "<head-ref-name>",',
|
|
6080
|
+
' "generated_at": "<ISO-8601 timestamp>",',
|
|
6081
|
+
' "items": [',
|
|
6082
|
+
' {"comment_id": "<id>", "author": "<login>", "file": "<path>", "line": <n>, "instruction": "<imperative instruction>"}',
|
|
6083
|
+
" ]",
|
|
6084
|
+
"}",
|
|
6085
|
+
"```",
|
|
6086
|
+
"```",
|
|
6087
|
+
"",
|
|
6088
|
+
"Each `items[]` entry corresponds to one queued in-scope comment that",
|
|
6089
|
+
"survived AC-drift handling. Preserve `comment_id` exactly as returned",
|
|
6090
|
+
"by the GitHub API in Phase 2.5 \u2014 issue-worker reports back using the",
|
|
6091
|
+
"same id so the reviewer can react on the correct source comment in",
|
|
6092
|
+
"step (f).",
|
|
6093
|
+
"",
|
|
6094
|
+
"Post the comment via `gh pr comment <pr-number> --body-file <path>`",
|
|
6095
|
+
"(or `--body` if the body is short). Capture the resulting comment id",
|
|
6096
|
+
"in memory so Phase 4.5 can cite the fix-list URL in the sticky.",
|
|
6097
|
+
"",
|
|
6098
|
+
"#### e. Invoke `issue-worker` in feedback mode",
|
|
6099
|
+
"",
|
|
6100
|
+
"Hand the fix work off to the `issue-worker` sub-agent. The invocation",
|
|
6101
|
+
"prompt **must** contain the literal phrase `feedback mode: PR #<n>`",
|
|
6102
|
+
"(with the actual PR number substituted) so the worker enters its",
|
|
6103
|
+
"feedback-mode branch instead of selecting a new issue. The prompt",
|
|
6104
|
+
"must also include the repository (`{{repository.owner}}/{{repository.name}}`)",
|
|
6105
|
+
"and the PR number explicitly \u2014 do not rely on the worker inferring",
|
|
6106
|
+
"either from context.",
|
|
6107
|
+
"",
|
|
6108
|
+
"Wait for the worker to return its structured report. The report",
|
|
6109
|
+
"lists, per item, the `comment_id` and a status of `handled` or",
|
|
6110
|
+
"`failed` (with a short failure reason for the latter). If the worker",
|
|
6111
|
+
"errors out without returning a report, treat **every** item as failed",
|
|
6112
|
+
"and proceed to step (f) so source comments still get a reaction.",
|
|
6113
|
+
"",
|
|
6114
|
+
"#### f. Process the worker's report",
|
|
6115
|
+
"",
|
|
6116
|
+
"For every item the worker reports:",
|
|
6117
|
+
"",
|
|
6118
|
+
"- **`handled`** \u2014 react `rocket` on the original source comment to",
|
|
6119
|
+
" signal the accepted change has landed. Use the same comment",
|
|
6120
|
+
" endpoint the comment originated from (`issues/comments/...` for",
|
|
6121
|
+
" PR-level, `pulls/comments/...` for inline).",
|
|
6122
|
+
"- **`failed`** \u2014 react `thinking_face` (`content=confused`) on the",
|
|
6123
|
+
" original source comment **and** post a reply on the same thread",
|
|
6124
|
+
" explaining why the fix could not be applied (cite the failure",
|
|
6125
|
+
" reason returned by the worker).",
|
|
6126
|
+
"",
|
|
6127
|
+
"```bash",
|
|
6128
|
+
"# Rocket reaction on a successfully handled PR-level comment",
|
|
6129
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<comment-id>/reactions \\",
|
|
6130
|
+
" -X POST -f content=rocket",
|
|
6131
|
+
"",
|
|
6132
|
+
"# thinking_face + reply on a failed item",
|
|
6133
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<comment-id>/reactions \\",
|
|
6134
|
+
" -X POST -f content=confused",
|
|
6135
|
+
"gh pr comment <pr-number> --body '<failure explanation citing the worker report>'",
|
|
6136
|
+
"```",
|
|
6137
|
+
"",
|
|
6138
|
+
"#### g. Release the `review:fixing` lease",
|
|
6139
|
+
"",
|
|
6140
|
+
"Remove the lease label so the PR is open for the next delegation",
|
|
6141
|
+
"pass. Always run this step \u2014 even when the worker reported every",
|
|
6142
|
+
"item as failed:",
|
|
6143
|
+
"",
|
|
6144
|
+
"```bash",
|
|
6145
|
+
"gh pr edit <pr-number> --remove-label 'review:fixing'",
|
|
6146
|
+
"```",
|
|
6147
|
+
"",
|
|
6148
|
+
"#### h. Conditionally re-enable auto-merge (auto-merge mode only)",
|
|
6149
|
+
"",
|
|
6150
|
+
"Re-enable squash auto-merge **only if all four** of the following",
|
|
6151
|
+
"conditions hold. If any condition fails, leave auto-merge disabled",
|
|
6152
|
+
"and let the next reviewer pass re-evaluate:",
|
|
6153
|
+
"",
|
|
6154
|
+
"1. The review mode decided in Phase 2.75 is still `auto-merge`",
|
|
6155
|
+
" (re-evaluate against the current PR labels in case a maintainer",
|
|
6156
|
+
" added `review:human-required` between passes).",
|
|
6157
|
+
"2. **All** acceptance criteria are met against the **updated** diff",
|
|
6158
|
+
" produced by the worker \u2014 re-run the Phase 3 comparison; do not",
|
|
6159
|
+
" reuse the pre-delegation result.",
|
|
6160
|
+
"3. **No** unresolved `thinking_face` reactions authored by the",
|
|
6161
|
+
" reviewer remain on any PR comment \u2014 including the AC-drift",
|
|
6162
|
+
" pushbacks added in step (a) and the failure pushbacks added in",
|
|
6163
|
+
" step (f).",
|
|
6164
|
+
"4. CI is green or still pending (any failing required check",
|
|
6165
|
+
" disqualifies re-enablement).",
|
|
6166
|
+
"",
|
|
6167
|
+
"When all four hold, re-enable auto-merge with the same command used",
|
|
6168
|
+
"in the auto-merge branch below:",
|
|
6169
|
+
"",
|
|
6170
|
+
"```bash",
|
|
6171
|
+
"gh pr merge <pr-number> --auto --squash --delete-branch \\",
|
|
6172
|
+
" --subject '<conventional-commit-title>' \\",
|
|
6173
|
+
" --body '<extended-description>'",
|
|
6174
|
+
"```",
|
|
6175
|
+
"",
|
|
6176
|
+
"In `human-required` mode, **skip step (h) entirely**. The",
|
|
6177
|
+
"`review:awaiting-human` label stays applied (re-add it if a previous",
|
|
6178
|
+
"step removed it), and the human reviewer owns the final merge",
|
|
6179
|
+
"decision.",
|
|
6180
|
+
"",
|
|
6181
|
+
"#### i. Update the sticky summary",
|
|
6182
|
+
"",
|
|
6183
|
+
"After step (g) (and step (h) when applicable) completes, fall through",
|
|
6184
|
+
"to Phase 4.5 to update the sticky `## Reviewer notes` comment with",
|
|
6185
|
+
"the new state. Cite at minimum:",
|
|
6186
|
+
"",
|
|
6187
|
+
"- The fix-list comment URL produced in step (d).",
|
|
6188
|
+
"- The commit SHAs the worker pushed (from its structured report).",
|
|
6189
|
+
"- Per-item outcome (`handled` / `failed`) with the source comment URL.",
|
|
6190
|
+
"- The auto-merge re-enablement decision and reason (which of the",
|
|
6191
|
+
" four conditions, if any, blocked it).",
|
|
6192
|
+
"- The next-step the human or the next reviewer pass should take.",
|
|
6193
|
+
"",
|
|
5961
6194
|
"### If all acceptance criteria are met and CI is green",
|
|
5962
6195
|
"",
|
|
5963
6196
|
"Branch on the **review mode** decided in Phase 2.75:",
|
|
@@ -6177,11 +6410,10 @@ var prReviewerSubAgent = {
|
|
|
6177
6410
|
" to `human-required`, Phase 4 applies `review:awaiting-human` and",
|
|
6178
6411
|
" exits. Even if every acceptance criterion is met and CI is green,",
|
|
6179
6412
|
" `gh pr merge --auto` is forbidden in that mode.",
|
|
6180
|
-
"6. **
|
|
6181
|
-
"
|
|
6182
|
-
"
|
|
6183
|
-
" comment and stop \u2014 do not attempt to fix it yourself.
|
|
6184
|
-
" owns the branch; pushing to someone else's branch is out of scope.",
|
|
6413
|
+
"6. **Never push commits to the PR's branch yourself.** The reviewer is a decision-maker and orchestrator, not an implementer. When in-scope review comments require code changes **and** the PR carries the `origin:issue-worker` label (or the invocation prompt explicitly allows human-authored PRs via `--allow-human-author`), delegate the fix by posting a fix-list comment on the PR and invoking `issue-worker` in feedback mode. You must never call `git commit`, `git push`, `git rebase`, or `gh pr edit` against the head branch from this agent \u2014 all branch mutations belong to `issue-worker`.",
|
|
6414
|
+
"7. **Do not implement code.** You review, decide, and orchestrate. If",
|
|
6415
|
+
" the PR needs code changes and delegation is not permitted by Rule",
|
|
6416
|
+
" #6, comment and stop \u2014 do not attempt to fix it yourself.",
|
|
6185
6417
|
"8. **In loop mode (`/review-prs`), never stop early.** If any review",
|
|
6186
6418
|
" fails, comment and move to the next PR. Only abort the loop on a",
|
|
6187
6419
|
" fatal error (e.g. `gh` auth failure, network outage).",
|
|
@@ -6213,7 +6445,16 @@ var prReviewerSubAgent = {
|
|
|
6213
6445
|
" resolved the dispute \u2014 by withdrawing the comment, by replying",
|
|
6214
6446
|
" in a way that satisfies the reviewer (who then replaces the",
|
|
6215
6447
|
" `thinking_face` with `+1`), or by applying the `review:auto-ok`",
|
|
6216
|
-
" label as an explicit override."
|
|
6448
|
+
" label as an explicit override.",
|
|
6449
|
+
"14. **Never re-enable auto-merge while disputes or human-required",
|
|
6450
|
+
" hand-offs are still in flight.** After delegating fixes via the",
|
|
6451
|
+
" Phase 4 flow, the reviewer may only run `gh pr merge --auto`",
|
|
6452
|
+
" again when **no** unresolved `thinking_face` reactions authored",
|
|
6453
|
+
" by the reviewer remain on any PR comment **and** the",
|
|
6454
|
+
" `review:awaiting-human` label is **not** present on the PR. Any",
|
|
6455
|
+
" AC-drift pushback, any failed-fix pushback, and any human-required",
|
|
6456
|
+
" hand-off all keep auto-merge disabled until the human resolves",
|
|
6457
|
+
" the underlying state."
|
|
6217
6458
|
].join("\n")
|
|
6218
6459
|
};
|
|
6219
6460
|
var reviewPrSkill = {
|
|
@@ -6503,7 +6744,179 @@ var prReviewBundle = {
|
|
|
6503
6744
|
"to a PR's branch \u2014 it only reviews, decides, and orchestrates merge",
|
|
6504
6745
|
"or comment. In loop mode, a failed review for one PR never stops",
|
|
6505
6746
|
"the loop; the reviewer comments and moves on. See the `pr-reviewer`",
|
|
6506
|
-
"agent definition for the full phase-by-phase contract."
|
|
6747
|
+
"agent definition for the full phase-by-phase contract.",
|
|
6748
|
+
"",
|
|
6749
|
+
"## Human-in-the-Loop Feedback Protocol",
|
|
6750
|
+
"",
|
|
6751
|
+
"The PR review pipeline is a **human-in-the-loop feedback loop**.",
|
|
6752
|
+
"Reviewers (human or agent) leave comments on the PR; the",
|
|
6753
|
+
"`pr-reviewer` sub-agent classifies each comment, reacts to it,",
|
|
6754
|
+
"delegates in-scope fixes to `issue-worker`, and updates a single",
|
|
6755
|
+
"sticky `## Reviewer notes` comment that is the canonical record of",
|
|
6756
|
+
"PR state. The sections below document the conventions humans need",
|
|
6757
|
+
"to read and drive that loop.",
|
|
6758
|
+
"",
|
|
6759
|
+
"### Trigger Model: Human-Triggered, Single-Pass",
|
|
6760
|
+
"",
|
|
6761
|
+
"Each reviewer pass runs exactly once and does not self-chain. A",
|
|
6762
|
+
"human re-invokes `/review-pr <n>` (or `/review-prs`) whenever the",
|
|
6763
|
+
"PR state changes enough to warrant another look \u2014 a new comment,",
|
|
6764
|
+
"a new commit, a resolved pushback, a label flip. The reviewer",
|
|
6765
|
+
"never reschedules itself and never loops back after handing off to",
|
|
6766
|
+
"`issue-worker`: the worker's run is the terminal step of that",
|
|
6767
|
+
"pass, and a human must re-invoke the reviewer to see the follow-up",
|
|
6768
|
+
"reactions and the auto-merge re-enablement decision.",
|
|
6769
|
+
"",
|
|
6770
|
+
"This keeps the loop cheap to reason about: every agent action is",
|
|
6771
|
+
"traceable to a specific human invocation, and there is no",
|
|
6772
|
+
"background automation to pause or cancel.",
|
|
6773
|
+
"",
|
|
6774
|
+
"### Reaction State Machine",
|
|
6775
|
+
"",
|
|
6776
|
+
"The reviewer signals its disposition toward each human comment via",
|
|
6777
|
+
"GitHub reactions on that comment. Five reactions carry meaning in",
|
|
6778
|
+
"this workflow; every other reaction is ignored.",
|
|
6779
|
+
"",
|
|
6780
|
+
"| Reaction | Meaning | Terminal? |",
|
|
6781
|
+
"|----------|---------|-----------|",
|
|
6782
|
+
"| `eyes` | Seen by reviewer; no terminal decision yet. Queued for processing on this or a later pass. | No |",
|
|
6783
|
+
"| `+1` | Reviewer accepted the comment's request; a fix has been queued or has already landed. | **Yes** |",
|
|
6784
|
+
"| `rocket` | The accepted fix has landed on the branch. The reviewer's reply cites the commit SHA that applied it. | **Yes** |",
|
|
6785
|
+
"| `thinking_face` | Reviewer pushback \u2014 the comment conflicts with an acceptance criterion, a CLAUDE.md convention, the project-context doc, or is ambiguous. **Blocks auto-merge** until resolved. | No |",
|
|
6786
|
+
"| `-1` | Declined as out-of-scope. A separate tracking issue was created; the reviewer's reply links to it. | **Yes** |",
|
|
6787
|
+
"",
|
|
6788
|
+
"Terminal reactions (`+1`, `rocket`, `-1`) are applied **only after**",
|
|
6789
|
+
"the corresponding action has truly completed \u2014 the fix accepted,",
|
|
6790
|
+
"the commit landed on the branch, or the out-of-scope tracking",
|
|
6791
|
+
"issue created and linked in a reply. The reviewer never applies a",
|
|
6792
|
+
"terminal reaction pre-emptively.",
|
|
6793
|
+
"",
|
|
6794
|
+
"A comment carrying only `eyes` or `thinking_face` from the",
|
|
6795
|
+
"reviewer is **non-terminal** and will be re-evaluated on the next",
|
|
6796
|
+
"pass. A comment carrying any terminal reaction authored by the",
|
|
6797
|
+
"reviewer is dropped from future classification.",
|
|
6798
|
+
"",
|
|
6799
|
+
"GitHub's reactions API uses `confused` as the content string for",
|
|
6800
|
+
"the `thinking_face` reaction (`content=confused` when POSTing).",
|
|
6801
|
+
"",
|
|
6802
|
+
"### Resolving a Pushback",
|
|
6803
|
+
"",
|
|
6804
|
+
"When the reviewer pushes back on a comment with `thinking_face`,",
|
|
6805
|
+
"auto-merge is blocked until the dispute is resolved. Humans have",
|
|
6806
|
+
"three ways to clear a pushback:",
|
|
6807
|
+
"",
|
|
6808
|
+
"1. **Withdraw the comment.** Delete the comment, or edit out the",
|
|
6809
|
+
" disputed request, then re-invoke `/review-pr <n>`. The reviewer",
|
|
6810
|
+
" drops the withdrawn item from its queue on the next pass.",
|
|
6811
|
+
"2. **Reply with clarification.** Post a reply on the same thread",
|
|
6812
|
+
" that addresses the reviewer's objection (cite the acceptance",
|
|
6813
|
+
" criterion you meant, supply the missing context, or concede the",
|
|
6814
|
+
" point). Re-invoke `/review-pr <n>` \u2014 the reviewer re-classifies",
|
|
6815
|
+
" the thread and may promote `thinking_face` to `+1` if the",
|
|
6816
|
+
" clarification satisfies it.",
|
|
6817
|
+
"3. **Force through with `review:auto-ok`.** Apply the",
|
|
6818
|
+
" `review:auto-ok` label to the PR as an explicit maintainer",
|
|
6819
|
+
" override. The reviewer will log the override in the sticky",
|
|
6820
|
+
" `## Reviewer notes` comment and proceed with auto-merge even",
|
|
6821
|
+
" though the dispute was never resolved by reply or withdrawal.",
|
|
6822
|
+
"",
|
|
6823
|
+
"### Fix-List Comment Format",
|
|
6824
|
+
"",
|
|
6825
|
+
"When Phase 4 delegates in-scope fixes to `issue-worker`, it posts",
|
|
6826
|
+
"a single PR-level comment whose body carries both a human-readable",
|
|
6827
|
+
"checkbox summary and a fenced ```json fix-list``` block. The JSON",
|
|
6828
|
+
"block is the authoritative payload the worker parses; the",
|
|
6829
|
+
"checkbox list is for humans reading the PR.",
|
|
6830
|
+
"",
|
|
6831
|
+
"```markdown",
|
|
6832
|
+
"## Reviewer: fix list for @issue-worker",
|
|
6833
|
+
"",
|
|
6834
|
+
"- [ ] @<author> \u2014 <instruction summary> (<file>:<line>)",
|
|
6835
|
+
"",
|
|
6836
|
+
"```json fix-list",
|
|
6837
|
+
"{",
|
|
6838
|
+
' "pr": <pr-number>,',
|
|
6839
|
+
' "branch": "<head-ref-name>",',
|
|
6840
|
+
' "generated_at": "<ISO-8601 timestamp>",',
|
|
6841
|
+
' "items": [',
|
|
6842
|
+
' {"comment_id": "<id>", "author": "<login>", "file": "<path>", "line": <n>, "instruction": "<imperative instruction>"}',
|
|
6843
|
+
" ]",
|
|
6844
|
+
"}",
|
|
6845
|
+
"```",
|
|
6846
|
+
"```",
|
|
6847
|
+
"",
|
|
6848
|
+
"Each `items[]` entry corresponds to one in-scope comment the",
|
|
6849
|
+
"reviewer queued on this pass. The `comment_id` is preserved",
|
|
6850
|
+
"exactly as returned by the GitHub API so that `issue-worker` can",
|
|
6851
|
+
"report per-item outcomes and the reviewer can apply `rocket` or",
|
|
6852
|
+
"`thinking_face` to the correct source comment on the next pass.",
|
|
6853
|
+
"",
|
|
6854
|
+
"### Sticky `## Reviewer notes` Comment",
|
|
6855
|
+
"",
|
|
6856
|
+
"Every PR has **one** canonical reviewer-notes comment. The",
|
|
6857
|
+
"reviewer creates it on the first pass, then **edits it in place**",
|
|
6858
|
+
"on every subsequent pass via",
|
|
6859
|
+
"`gh api .../issues/comments/<id> -X PATCH`. It is never",
|
|
6860
|
+
"duplicated and never replaced by a fresh per-pass summary.",
|
|
6861
|
+
"",
|
|
6862
|
+
"This sticky comment is the **single human-facing source of truth**",
|
|
6863
|
+
"for the PR's current state. Humans scanning the PR should read",
|
|
6864
|
+
"the sticky first, before scrolling back through individual threads.",
|
|
6865
|
+
"It carries, at a minimum:",
|
|
6866
|
+
"",
|
|
6867
|
+
"- **Mode** \u2014 `auto-merge` or `human-required`, with the Phase 2.75",
|
|
6868
|
+
" reason that chose that mode.",
|
|
6869
|
+
"- **AC status** \u2014 met, partial, or missing, with evidence links",
|
|
6870
|
+
" to files or tests.",
|
|
6871
|
+
"- **CI status** \u2014 green, pending, or red.",
|
|
6872
|
+
"- **Outstanding** \u2014 comments still carrying a non-terminal",
|
|
6873
|
+
" reviewer reaction (`eyes`, open `thinking_face`).",
|
|
6874
|
+
"- **Pushbacks** \u2014 every unresolved `thinking_face` the reviewer",
|
|
6875
|
+
" has left, with the reason captured in its pushback reply.",
|
|
6876
|
+
"- **Last pass** \u2014 the ISO 8601 timestamp of the most recent run.",
|
|
6877
|
+
"",
|
|
6878
|
+
"The sticky is updated on every pass \u2014 including passes that ended",
|
|
6879
|
+
"in a pushback-gated skip, a `NEEDS_CHANGES` findings comment, or",
|
|
6880
|
+
"a `human-required` hand-off \u2014 so it never goes stale while the",
|
|
6881
|
+
"reviewer is actively processing the PR.",
|
|
6882
|
+
"",
|
|
6883
|
+
"### Label Glossary",
|
|
6884
|
+
"",
|
|
6885
|
+
"Five review-workflow labels drive the feedback loop. Consumers",
|
|
6886
|
+
"that adopt this workflow are responsible for creating them in",
|
|
6887
|
+
"their own repos (the same way they create `priority:*` and",
|
|
6888
|
+
"`status:*` labels).",
|
|
6889
|
+
"",
|
|
6890
|
+
"| Label | Purpose |",
|
|
6891
|
+
"|-------|---------|",
|
|
6892
|
+
"| `origin:issue-worker` | PR was opened by the `issue-worker` agent. Eligible for auto-delegation of in-scope fixes. Human-authored PRs lack this label and will not trigger delegation unless the reviewer is invoked with `--allow-human-author`. |",
|
|
6893
|
+
"| `review:human-required` | Force human review regardless of what the policy would otherwise decide. The reviewer never enables auto-merge on a PR carrying this label. |",
|
|
6894
|
+
"| `review:auto-ok` | Force auto-merge regardless of what the policy would otherwise decide. **Also resolves outstanding `thinking_face` pushbacks** as an explicit maintainer override; the reviewer logs the override in the sticky summary. |",
|
|
6895
|
+
"| `review:awaiting-human` | Set by the reviewer when it completes its work on a `human-required` PR and is handing off the final merge decision. Cleared by a human (or by `review:auto-ok` flipping the PR back to `auto-merge` mode). |",
|
|
6896
|
+
"| `review:fixing` | Short-lived lease held by the reviewer while an `issue-worker` feedback-mode delegation is mid-run. Released automatically at the end of Phase 4 step (g). Contention on this label means a prior delegation crashed without releasing it and needs human investigation. |",
|
|
6897
|
+
"",
|
|
6898
|
+
"### Reviewing Human-Authored PRs: the `--allow-human-author` Flag",
|
|
6899
|
+
"",
|
|
6900
|
+
"By default the reviewer only **delegates** in-scope fixes on",
|
|
6901
|
+
"bot-authored PRs \u2014 those carrying the `origin:issue-worker`",
|
|
6902
|
+
"label. Running `/review-pr <n>` or `/review-prs` on a",
|
|
6903
|
+
"human-authored PR still produces a full review (reactions,",
|
|
6904
|
+
"replies, sticky summary, and auto-merge when the policy allows",
|
|
6905
|
+
"it) but skips the delegation hand-off to `issue-worker` \u2014 the",
|
|
6906
|
+
"human author is expected to apply the fixes themselves.",
|
|
6907
|
+
"",
|
|
6908
|
+
"Pass `--allow-human-author` to opt into delegation on",
|
|
6909
|
+
"human-authored PRs for a single invocation:",
|
|
6910
|
+
"",
|
|
6911
|
+
"```",
|
|
6912
|
+
"/review-pr <pr-number> --allow-human-author",
|
|
6913
|
+
"/review-prs --allow-human-author",
|
|
6914
|
+
"```",
|
|
6915
|
+
"",
|
|
6916
|
+
"The flag does **not** persist across invocations. Subsequent",
|
|
6917
|
+
"invocations return to the bot-only default and require the flag",
|
|
6918
|
+
"to be re-supplied if delegation on a human-authored PR is desired",
|
|
6919
|
+
"again."
|
|
6507
6920
|
].join("\n"),
|
|
6508
6921
|
platforms: {
|
|
6509
6922
|
cursor: { exclude: true }
|