@codedrifters/configulator 0.0.222 → 0.0.224
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 +522 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +522 -4
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -4236,7 +4236,10 @@ var issueWorkerSubAgent = {
|
|
|
4236
4236
|
"",
|
|
4237
4237
|
"## Invocation Mode",
|
|
4238
4238
|
"",
|
|
4239
|
-
"You operate in one of two modes
|
|
4239
|
+
"You operate in one of two **invocation modes** (interactive vs scheduled)",
|
|
4240
|
+
"and one of two **work modes** (normal vs feedback).",
|
|
4241
|
+
"",
|
|
4242
|
+
"### Interactive vs Scheduled",
|
|
4240
4243
|
"",
|
|
4241
4244
|
"- **Interactive mode (default):** A human invoked you directly. You must",
|
|
4242
4245
|
" pause and request explicit user approval before committing code (Phase 6).",
|
|
@@ -4249,11 +4252,52 @@ var issueWorkerSubAgent = {
|
|
|
4249
4252
|
"doubt, treat the session as interactive \u2014 pausing for approval is always",
|
|
4250
4253
|
"safe; committing without approval is not.",
|
|
4251
4254
|
"",
|
|
4255
|
+
"### Normal vs Feedback",
|
|
4256
|
+
"",
|
|
4257
|
+
"- **Normal mode (default):** You select an issue from the queue (or use a",
|
|
4258
|
+
" provided issue number), create a new branch, implement the change, and",
|
|
4259
|
+
" open a new PR. Phases 1\u20139 all run.",
|
|
4260
|
+
"- **Feedback mode:** You are given an existing PR number and asked to",
|
|
4261
|
+
" apply reviewer-requested fixes to the PR's existing branch. You do",
|
|
4262
|
+
" **not** create a new branch and you do **not** open a new PR \u2014 you",
|
|
4263
|
+
" push additional commits to the same branch.",
|
|
4264
|
+
"",
|
|
4265
|
+
"**You are in feedback mode if and only if the invocation prompt that",
|
|
4266
|
+
"started this session contains the literal phrase `feedback mode: PR #<n>`",
|
|
4267
|
+
"(where `<n>` is the PR number).** This mirrors the `scheduled mode` /",
|
|
4268
|
+
"`non-interactive` string-match convention above. Otherwise, default to",
|
|
4269
|
+
"normal mode.",
|
|
4270
|
+
"",
|
|
4271
|
+
"Interactive vs scheduled and normal vs feedback are independent axes.",
|
|
4272
|
+
"Feedback mode can run interactively (a human asks you to fix a PR) or",
|
|
4273
|
+
"on a schedule (the pr-reviewer hands off the PR). The interactive",
|
|
4274
|
+
"pause-before-commit rule (Phase 6) applies in either work mode.",
|
|
4275
|
+
"",
|
|
4276
|
+
"When in feedback mode, the per-phase behaviour changes as documented",
|
|
4277
|
+
"in each phase below. In summary:",
|
|
4278
|
+
"",
|
|
4279
|
+
"| Phase | Normal mode | Feedback mode |",
|
|
4280
|
+
"|-------|-------------|---------------|",
|
|
4281
|
+
"| 1. Select an Issue | Pick from queue or use provided issue number | **Skip.** Use the PR number from the invocation prompt. |",
|
|
4282
|
+
"| 2. Claim the Issue | Toggle status labels on the issue | **Skip.** The issue is already `status:in-progress`. |",
|
|
4283
|
+
"| 3. Set Up | Checkout default branch, create new branch | Checkout the existing PR branch via `gh pr view` and `git checkout <headRefName>`. |",
|
|
4284
|
+
"| 4. Implement | Read issue AC, implement | Read most-recent reviewer-authored fix-list comment on the PR, parse JSON, apply each item. |",
|
|
4285
|
+
"| 5. Verify | Unchanged | Unchanged. |",
|
|
4286
|
+
"| 6. Commit and Push | Conventional commit, interactive pause | Commit message `fix(review): <summary> (PR #<n>)`. Pause behaviour unchanged. `git push` (no `-u`). |",
|
|
4287
|
+
"| 7. Open a PR | Open a new PR | **Skip.** |",
|
|
4288
|
+
"| 8. Update Status | Set issue to `status:ready-for-review` | **Skip.** PR is still open; issue stays `status:in-progress`. |",
|
|
4289
|
+
"| 9. Branch Cleanup | Poll for merge, delete branch | **Skip.** Return control to the pr-reviewer without polling. |",
|
|
4290
|
+
"",
|
|
4252
4291
|
"---",
|
|
4253
4292
|
"",
|
|
4254
4293
|
...PROJECT_CONTEXT_READER_SECTION,
|
|
4255
4294
|
"## Phase 1: Select an Issue",
|
|
4256
4295
|
"",
|
|
4296
|
+
"**Feedback mode:** Skip this phase entirely. Extract the PR number from",
|
|
4297
|
+
"the `feedback mode: PR #<n>` phrase in your invocation prompt and use",
|
|
4298
|
+
"it for the rest of the workflow.",
|
|
4299
|
+
"",
|
|
4300
|
+
"**Normal mode:**",
|
|
4257
4301
|
"If an issue number was provided in your instructions, use that issue.",
|
|
4258
4302
|
"Otherwise, find the next issue to work on:",
|
|
4259
4303
|
"",
|
|
@@ -4270,6 +4314,12 @@ var issueWorkerSubAgent = {
|
|
|
4270
4314
|
"",
|
|
4271
4315
|
"## Phase 2: Claim the Issue",
|
|
4272
4316
|
"",
|
|
4317
|
+
"**Feedback mode:** Skip this phase entirely. The issue linked to the PR",
|
|
4318
|
+
"is already in `status:in-progress` from when the original PR was opened.",
|
|
4319
|
+
"Do not toggle any status labels on the issue.",
|
|
4320
|
+
"",
|
|
4321
|
+
"**Normal mode:**",
|
|
4322
|
+
"",
|
|
4273
4323
|
"```bash",
|
|
4274
4324
|
'gh issue edit <number> --remove-label "status:ready" --add-label "status:in-progress"',
|
|
4275
4325
|
"```",
|
|
@@ -4281,6 +4331,31 @@ var issueWorkerSubAgent = {
|
|
|
4281
4331
|
"",
|
|
4282
4332
|
"## Phase 3: Set Up",
|
|
4283
4333
|
"",
|
|
4334
|
+
"**Feedback mode:** Do **not** check out the default branch and do **not**",
|
|
4335
|
+
"create a new branch. Instead, look up the PR's head branch and check it out:",
|
|
4336
|
+
"",
|
|
4337
|
+
"```bash",
|
|
4338
|
+
"gh pr view <pr-number> --json state,headRefName,baseRefName,author",
|
|
4339
|
+
"```",
|
|
4340
|
+
"",
|
|
4341
|
+
"First verify the PR `state` is `OPEN`. If the state is `MERGED` or",
|
|
4342
|
+
"`CLOSED`, abort immediately \u2014 do not modify the branch. Report the",
|
|
4343
|
+
"state to the caller and stop.",
|
|
4344
|
+
"",
|
|
4345
|
+
"Then fetch and check out the existing branch:",
|
|
4346
|
+
"",
|
|
4347
|
+
"```bash",
|
|
4348
|
+
"git fetch origin",
|
|
4349
|
+
"git checkout <headRefName>",
|
|
4350
|
+
"git pull --rebase origin <headRefName>",
|
|
4351
|
+
"```",
|
|
4352
|
+
"",
|
|
4353
|
+
"If the rebase produces a conflict, abort and report failure \u2014 do not",
|
|
4354
|
+
"force-push and do not attempt to resolve conflicts in feedback mode.",
|
|
4355
|
+
"Skip the remainder of this phase (no new branch, no status comment).",
|
|
4356
|
+
"",
|
|
4357
|
+
"**Normal mode:**",
|
|
4358
|
+
"",
|
|
4284
4359
|
"```bash",
|
|
4285
4360
|
"git checkout {{repository.defaultBranch}} && git pull origin {{repository.defaultBranch}}",
|
|
4286
4361
|
"```",
|
|
@@ -4312,6 +4387,52 @@ var issueWorkerSubAgent = {
|
|
|
4312
4387
|
"",
|
|
4313
4388
|
"## Phase 4: Implement",
|
|
4314
4389
|
"",
|
|
4390
|
+
"**Feedback mode:** Read PR comments and apply the reviewer's fix list.",
|
|
4391
|
+
"",
|
|
4392
|
+
"1. List the PR's issue comments newest-first and pick the **most recent**",
|
|
4393
|
+
" comment authored by the reviewer account that contains a fenced",
|
|
4394
|
+
" code block with the language tag `fix-list`:",
|
|
4395
|
+
"",
|
|
4396
|
+
" ```bash",
|
|
4397
|
+
" gh pr view <pr-number> --json comments",
|
|
4398
|
+
" ```",
|
|
4399
|
+
"",
|
|
4400
|
+
"2. Extract the JSON body of the ` ```json fix-list ` block. The reviewer",
|
|
4401
|
+
" writes the comment in this exact shape:",
|
|
4402
|
+
"",
|
|
4403
|
+
" ````markdown",
|
|
4404
|
+
" ## Reviewer: fix list for @issue-worker",
|
|
4405
|
+
"",
|
|
4406
|
+
" - [ ] @<author> \u2014 <instruction summary> (<file>:<line>)",
|
|
4407
|
+
"",
|
|
4408
|
+
" ```json fix-list",
|
|
4409
|
+
" {",
|
|
4410
|
+
' "pr": 123,',
|
|
4411
|
+
' "branch": "feat/42-add-foo",',
|
|
4412
|
+
' "generated_at": "2026-04-16T14:02:00Z",',
|
|
4413
|
+
' "items": [',
|
|
4414
|
+
' {"comment_id": "IC_abc", "author": "alice", "file": "src/foo.ts", "line": 42, "instruction": "rename getFoo to fetchFoo"},',
|
|
4415
|
+
' {"comment_id": "IC_def", "author": "bob", "file": "src/foo.test.ts", "instruction": "add a test for the null branch"}',
|
|
4416
|
+
" ]",
|
|
4417
|
+
" }",
|
|
4418
|
+
" ```",
|
|
4419
|
+
" ````",
|
|
4420
|
+
"",
|
|
4421
|
+
" The JSON block is the **authoritative** list of work \u2014 the checkbox",
|
|
4422
|
+
" summary above it is for humans only and must be ignored. If multiple",
|
|
4423
|
+
" reviewer-authored fix-list comments exist, use the most recent one.",
|
|
4424
|
+
" If the JSON cannot be parsed, abort and report failure.",
|
|
4425
|
+
"",
|
|
4426
|
+
"3. Apply each `items[].instruction` in order. Each item references a",
|
|
4427
|
+
" `file` (and optional `line`). Track `comment_id` per item so you can",
|
|
4428
|
+
" report which items were handled and which (if any) failed.",
|
|
4429
|
+
"",
|
|
4430
|
+
"4. When complete, prepare a short structured report (PR number, commit",
|
|
4431
|
+
" SHAs you will push, items handled by `comment_id`, items that failed",
|
|
4432
|
+
" to apply) \u2014 you will return this after Phase 6.",
|
|
4433
|
+
"",
|
|
4434
|
+
"**Normal mode:**",
|
|
4435
|
+
"",
|
|
4315
4436
|
"Read the issue body carefully. Understand the acceptance criteria.",
|
|
4316
4437
|
"",
|
|
4317
4438
|
"Implement the change following these guidelines based on issue type:",
|
|
@@ -4353,7 +4474,23 @@ var issueWorkerSubAgent = {
|
|
|
4353
4474
|
"",
|
|
4354
4475
|
"**If you are in scheduled mode, skip the pause and proceed directly.**",
|
|
4355
4476
|
"",
|
|
4356
|
-
"Use
|
|
4477
|
+
"**Feedback mode:** Use a `fix(review)` commit message that references",
|
|
4478
|
+
"the PR number, and push to the existing branch **without** `-u` (the",
|
|
4479
|
+
"branch is already tracking origin). Before pushing, re-run",
|
|
4480
|
+
"`git pull --rebase origin <branch-name>` to incorporate any commits",
|
|
4481
|
+
"that landed on the branch while you were working. **Never force-push.**",
|
|
4482
|
+
"If the rebase conflicts, abort and report failure.",
|
|
4483
|
+
"",
|
|
4484
|
+
"```bash",
|
|
4485
|
+
"git add <files>",
|
|
4486
|
+
'git commit -m "fix(review): <summary> (PR #<pr-number>)"',
|
|
4487
|
+
"git pull --rebase origin <branch-name>",
|
|
4488
|
+
"git push origin <branch-name>",
|
|
4489
|
+
"```",
|
|
4490
|
+
"",
|
|
4491
|
+
"**Normal mode:** Use conventional commit messages and push with `-u`",
|
|
4492
|
+
"to set up branch tracking:",
|
|
4493
|
+
"",
|
|
4357
4494
|
"```bash",
|
|
4358
4495
|
"git add <files>",
|
|
4359
4496
|
'git commit -m "<type>: <description>"',
|
|
@@ -4362,6 +4499,12 @@ var issueWorkerSubAgent = {
|
|
|
4362
4499
|
"",
|
|
4363
4500
|
"## Phase 7: Open a PR",
|
|
4364
4501
|
"",
|
|
4502
|
+
"**Feedback mode:** Skip this phase entirely. The PR already exists; you",
|
|
4503
|
+
"have pushed additional commits to its existing branch. Do not open a new",
|
|
4504
|
+
"PR.",
|
|
4505
|
+
"",
|
|
4506
|
+
"**Normal mode:**",
|
|
4507
|
+
"",
|
|
4365
4508
|
"Every PR you open must carry the `origin:issue-worker` label so downstream",
|
|
4366
4509
|
"agents can identify bot-authored PRs. Always include",
|
|
4367
4510
|
"`--label 'origin:issue-worker'` in the `gh pr create` invocation:",
|
|
@@ -4383,6 +4526,12 @@ var issueWorkerSubAgent = {
|
|
|
4383
4526
|
"",
|
|
4384
4527
|
"## Phase 8: Update Status",
|
|
4385
4528
|
"",
|
|
4529
|
+
"**Feedback mode:** Skip this phase entirely. The linked issue stays in",
|
|
4530
|
+
"`status:in-progress` while the PR is still open \u2014 do not toggle any",
|
|
4531
|
+
"labels.",
|
|
4532
|
+
"",
|
|
4533
|
+
"**Normal mode:**",
|
|
4534
|
+
"",
|
|
4386
4535
|
"After the PR is created, transition the issue to the review phase:",
|
|
4387
4536
|
"```bash",
|
|
4388
4537
|
'gh issue edit <number> --remove-label "status:in-progress" --add-label "status:ready-for-review"',
|
|
@@ -4393,6 +4542,13 @@ var issueWorkerSubAgent = {
|
|
|
4393
4542
|
"",
|
|
4394
4543
|
"## Phase 9: Branch Cleanup",
|
|
4395
4544
|
"",
|
|
4545
|
+
"**Feedback mode:** Skip this phase entirely. Do not poll the PR state",
|
|
4546
|
+
"and do not delete the local branch. Return control to the pr-reviewer",
|
|
4547
|
+
"with the structured report from Phase 4 (PR number, commit SHAs pushed,",
|
|
4548
|
+
"items handled by `comment_id`, items that failed to apply).",
|
|
4549
|
+
"",
|
|
4550
|
+
"**Normal mode:**",
|
|
4551
|
+
"",
|
|
4396
4552
|
"The PR will not auto-merge until the `pr-reviewer` enables it. Poll the PR",
|
|
4397
4553
|
"state up to 10 times, waiting 30 seconds between polls, until it either",
|
|
4398
4554
|
"merges, closes, or the timeout is reached:",
|
|
@@ -4430,7 +4586,23 @@ var issueWorkerSubAgent = {
|
|
|
4430
4586
|
" ```bash",
|
|
4431
4587
|
' gh issue edit <number> --remove-label "status:in-progress" --add-label "status:needs-attention"',
|
|
4432
4588
|
' gh issue comment <number> --body "Worker could not complete: <reason>"',
|
|
4433
|
-
" ```"
|
|
4589
|
+
" ```",
|
|
4590
|
+
"8. **Never force-push in feedback mode.** If a `git pull --rebase`",
|
|
4591
|
+
" produces conflicts, abort and report failure. Do not pass",
|
|
4592
|
+
" `--force` or `--force-with-lease` to `git push`.",
|
|
4593
|
+
"9. **Abort if the PR is not OPEN in feedback mode.** Before checking",
|
|
4594
|
+
" out the head branch, verify `gh pr view <pr> --json state` returns",
|
|
4595
|
+
" `OPEN`. If the state is `MERGED` or `CLOSED`, stop immediately \u2014",
|
|
4596
|
+
" do not modify the branch.",
|
|
4597
|
+
"10. **Use the most-recent reviewer-authored fix-list comment.** If",
|
|
4598
|
+
" multiple `fix-list` comments exist on the PR, use the most recent",
|
|
4599
|
+
" one authored by the reviewer account. Ignore older fix-list",
|
|
4600
|
+
" comments and any fix-list comments authored by other accounts.",
|
|
4601
|
+
"11. **Never create a new branch in feedback mode.** Always check out",
|
|
4602
|
+
" the existing PR head branch returned by `gh pr view`. Do not run",
|
|
4603
|
+
" `git checkout -b` while in feedback mode.",
|
|
4604
|
+
"12. **Never `git push -u` in feedback mode.** The existing PR branch",
|
|
4605
|
+
" already tracks origin. Use plain `git push origin <branch-name>`."
|
|
4434
4606
|
].join("\n")
|
|
4435
4607
|
};
|
|
4436
4608
|
var orchestratorBundle = {
|
|
@@ -5377,6 +5549,81 @@ var prReviewerSubAgent = {
|
|
|
5377
5549
|
"gh issue view <issue-number> --json number,title,body,labels,state,issueType",
|
|
5378
5550
|
"```",
|
|
5379
5551
|
"",
|
|
5552
|
+
"## Phase 2.5: Gather Comments",
|
|
5553
|
+
"",
|
|
5554
|
+
"Before deciding review mode, collect every human comment on the PR so",
|
|
5555
|
+
"that Phase 3.5 can classify each one and Phase 4.5 can render the",
|
|
5556
|
+
"sticky **Reviewer notes** summary. GitHub exposes PR comments across",
|
|
5557
|
+
"three distinct endpoints; the reviewer merges all three into a single",
|
|
5558
|
+
"queue.",
|
|
5559
|
+
"",
|
|
5560
|
+
"### Step 1: Fetch all three comment sources",
|
|
5561
|
+
"",
|
|
5562
|
+
"```bash",
|
|
5563
|
+
"# PR-level issue comments (top-level discussion thread)",
|
|
5564
|
+
"gh pr view <pr-number> --json comments",
|
|
5565
|
+
"",
|
|
5566
|
+
"# Inline code-review comments (line-anchored in the diff)",
|
|
5567
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/pulls/<pr-number>/comments",
|
|
5568
|
+
"",
|
|
5569
|
+
"# Formal review bodies and their APPROVED / CHANGES_REQUESTED / COMMENTED state",
|
|
5570
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/pulls/<pr-number>/reviews",
|
|
5571
|
+
"```",
|
|
5572
|
+
"",
|
|
5573
|
+
"For each item, capture: the comment id, author login, body, creation",
|
|
5574
|
+
"time, the URL, and any reactions already present (including which",
|
|
5575
|
+
"reactions the reviewer itself has previously applied). For inline",
|
|
5576
|
+
"review comments, also capture the thread / conversation resolution",
|
|
5577
|
+
"state so Step 2 can drop resolved threads.",
|
|
5578
|
+
"",
|
|
5579
|
+
"### Step 2: Apply filtering rules",
|
|
5580
|
+
"",
|
|
5581
|
+
"Drop a comment from classification when **any** of the following hold:",
|
|
5582
|
+
"",
|
|
5583
|
+
"1. **Reviewer's own comments.** The author login matches the invoking",
|
|
5584
|
+
" agent identity (for example, the bot account used to post prior",
|
|
5585
|
+
" reviewer replies, sticky summaries, or fix-list comments). The",
|
|
5586
|
+
" reviewer never classifies or reacts to its own output.",
|
|
5587
|
+
"2. **Bot authors.** The author login matches `*[bot]` \u2014 CI bots,",
|
|
5588
|
+
" Dependabot, CodeRabbit, GitHub Actions, and similar automation.",
|
|
5589
|
+
"3. **Terminal reviewer reactions already present.** The comment",
|
|
5590
|
+
" already carries a reaction **authored by the reviewer** in the set",
|
|
5591
|
+
" `+1` (accepted), `rocket` (landed), or `-1` (declined as",
|
|
5592
|
+
" out-of-scope). These signal the item has reached a terminal state",
|
|
5593
|
+
" on a previous pass and requires no further action.",
|
|
5594
|
+
"4. **Resolved threads.** Inline comments belonging to a conversation",
|
|
5595
|
+
" that GitHub marks as resolved.",
|
|
5596
|
+
"",
|
|
5597
|
+
"A comment whose only reviewer-authored reaction is `eyes` is **not**",
|
|
5598
|
+
'terminal. `eyes` means "seen on a previous pass but not yet resolved"',
|
|
5599
|
+
"\u2014 keep it in the queue so Phase 3.5 can re-evaluate and possibly",
|
|
5600
|
+
"promote it to a terminal state once the corresponding action",
|
|
5601
|
+
"completes.",
|
|
5602
|
+
"",
|
|
5603
|
+
"A comment whose only reviewer-authored reaction is `thinking_face` is",
|
|
5604
|
+
"also **not** terminal \u2014 it indicates an open dispute the reviewer",
|
|
5605
|
+
"raised on a prior pass that has not yet been resolved by the human.",
|
|
5606
|
+
"Phase 4 uses the presence of unresolved `thinking_face` reactions as",
|
|
5607
|
+
"the pushback gate.",
|
|
5608
|
+
"",
|
|
5609
|
+
"### Step 3: Record the gathered set",
|
|
5610
|
+
"",
|
|
5611
|
+
"Persist the filtered comment list in memory for Phase 3.5 and Phase",
|
|
5612
|
+
"4.5. For each surviving comment record at minimum:",
|
|
5613
|
+
"",
|
|
5614
|
+
"```",
|
|
5615
|
+
"- id: <comment or review id>",
|
|
5616
|
+
" source: <pr-comment | inline-comment | review-body>",
|
|
5617
|
+
" author: <login>",
|
|
5618
|
+
" url: <html_url>",
|
|
5619
|
+
" body: <text>",
|
|
5620
|
+
" reactions: <list of reactions with authors>",
|
|
5621
|
+
"```",
|
|
5622
|
+
"",
|
|
5623
|
+
"If there are no unhandled comments after filtering, record that fact",
|
|
5624
|
+
"and proceed \u2014 Phase 3.5 will short-circuit, and the Phase 4.5 sticky",
|
|
5625
|
+
"summary will simply list no outstanding items.",
|
|
5626
|
+
"",
|
|
5380
5627
|
"## Phase 2.75: Determine Review Mode",
|
|
5381
5628
|
"",
|
|
5382
5629
|
"Before comparing the diff to the acceptance criteria, evaluate the PR",
|
|
@@ -5465,8 +5712,175 @@ var prReviewerSubAgent = {
|
|
|
5465
5712
|
"- **CI status** \u2014 `gh pr checks` reports all required checks passing",
|
|
5466
5713
|
"- **Scope creep** \u2014 diff stays within the issue's stated scope",
|
|
5467
5714
|
"",
|
|
5715
|
+
"## Phase 3.5: Classify Comments",
|
|
5716
|
+
"",
|
|
5717
|
+
"For every comment that survived Phase 2.5 filtering, assign exactly",
|
|
5718
|
+
"one classification and take the corresponding action. The reviewer",
|
|
5719
|
+
"acts only on unhandled comments; anything already in a terminal state",
|
|
5720
|
+
"was dropped in Phase 2.5 and is left alone.",
|
|
5721
|
+
"",
|
|
5722
|
+
"### Classifications",
|
|
5723
|
+
"",
|
|
5724
|
+
"#### `in-scope`",
|
|
5725
|
+
"",
|
|
5726
|
+
"The comment requests a change that falls **inside** the linked",
|
|
5727
|
+
"issue's acceptance criteria (or is an obvious defect in code the PR",
|
|
5728
|
+
"itself introduced).",
|
|
5729
|
+
"",
|
|
5730
|
+
"Action on this pass:",
|
|
5731
|
+
"",
|
|
5732
|
+
"- React `eyes` on the comment to mark it seen.",
|
|
5733
|
+
"- Queue the comment for later delegation. **Delegation wiring is out",
|
|
5734
|
+
" of scope for this phase** \u2014 the fix-list comment and the",
|
|
5735
|
+
" issue-worker hand-off land in a follow-up issue. For now, record",
|
|
5736
|
+
" the queued items in memory so Phase 4.5 can list them as",
|
|
5737
|
+
" outstanding.",
|
|
5738
|
+
"- Do **not** apply `+1` or `rocket` yet. Those are terminal",
|
|
5739
|
+
" reactions reserved for later passes once the fix has been accepted",
|
|
5740
|
+
" into the PR (`+1`) and actually landed on the branch (`rocket`).",
|
|
5741
|
+
"",
|
|
5742
|
+
"```bash",
|
|
5743
|
+
"# React eyes on a PR-level issue comment",
|
|
5744
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<comment-id>/reactions \\",
|
|
5745
|
+
" -X POST -f content=eyes",
|
|
5746
|
+
"",
|
|
5747
|
+
"# React eyes on an inline code-review comment",
|
|
5748
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/pulls/comments/<comment-id>/reactions \\",
|
|
5749
|
+
" -X POST -f content=eyes",
|
|
5750
|
+
"```",
|
|
5751
|
+
"",
|
|
5752
|
+
"#### `out-of-scope`",
|
|
5753
|
+
"",
|
|
5754
|
+
"The comment requests work that falls **outside** the linked issue's",
|
|
5755
|
+
"acceptance criteria \u2014 new functionality, a refactor that would",
|
|
5756
|
+
"expand the diff, a cleanup in a neighbouring module, and so on. It",
|
|
5757
|
+
"is a legitimate request, just not for this PR.",
|
|
5758
|
+
"",
|
|
5759
|
+
"Action:",
|
|
5760
|
+
"",
|
|
5761
|
+
"1. Create a new tracking issue following the `Create Issue Workflow`",
|
|
5762
|
+
" in CLAUDE.md. Derive the title prefix (`feat:`, `fix:`, `chore:`,",
|
|
5763
|
+
" etc.) from the content of the comment. Apply the correct",
|
|
5764
|
+
" `type:*`, `priority:*`, and `status:*` labels and assign the",
|
|
5765
|
+
" GitHub issue type via the documented GraphQL mutation.",
|
|
5766
|
+
"2. Reply to the original comment with a link to the new issue:",
|
|
5767
|
+
" `Tracked separately in #<new-issue>.`",
|
|
5768
|
+
"3. React `-1` on the original comment. `-1` is the terminal",
|
|
5769
|
+
" reaction for out-of-scope and is only applied **after** the new",
|
|
5770
|
+
" issue has been successfully created and the reply posted.",
|
|
5771
|
+
"",
|
|
5772
|
+
"```bash",
|
|
5773
|
+
"# Reply on the same thread",
|
|
5774
|
+
"gh pr comment <pr-number> --body 'Tracked separately in #<new-issue>.'",
|
|
5775
|
+
"",
|
|
5776
|
+
"# React -1 on the original comment once the new issue exists",
|
|
5777
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<comment-id>/reactions \\",
|
|
5778
|
+
" -X POST -f content=-1",
|
|
5779
|
+
"```",
|
|
5780
|
+
"",
|
|
5781
|
+
"#### `dispute`",
|
|
5782
|
+
"",
|
|
5783
|
+
"The comment conflicts with an acceptance criterion, a documented",
|
|
5784
|
+
"CLAUDE.md convention, or the project-context doc; or it is ambiguous",
|
|
5785
|
+
"enough that implementation would require guessing at intent. The",
|
|
5786
|
+
"reviewer pushes back rather than silently complying.",
|
|
5787
|
+
"",
|
|
5788
|
+
"Action:",
|
|
5789
|
+
"",
|
|
5790
|
+
"1. React `thinking_face` on the comment to mark it as disputed.",
|
|
5791
|
+
" This reaction is **not** terminal \u2014 it persists until the human",
|
|
5792
|
+
" resolves the dispute.",
|
|
5793
|
+
"2. Post a reply on the same thread explaining the pushback. Cite",
|
|
5794
|
+
" the specific acceptance criterion, convention, or project-context",
|
|
5795
|
+
" section that the comment conflicts with, or name the ambiguity",
|
|
5796
|
+
" that needs resolution.",
|
|
5797
|
+
"3. The presence of an unresolved `thinking_face` reaction by the",
|
|
5798
|
+
" reviewer blocks auto-merge in Phase 4 regardless of the review",
|
|
5799
|
+
" mode decided in Phase 2.75.",
|
|
5800
|
+
"",
|
|
5801
|
+
"```bash",
|
|
5802
|
+
"# React thinking_face on the disputed comment",
|
|
5803
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<comment-id>/reactions \\",
|
|
5804
|
+
" -X POST -f content=confused",
|
|
5805
|
+
"",
|
|
5806
|
+
"# Post the pushback reply",
|
|
5807
|
+
"gh pr comment <pr-number> --body '<pushback explanation>'",
|
|
5808
|
+
"```",
|
|
5809
|
+
"",
|
|
5810
|
+
"Note: GitHub's reactions API uses `confused` as the content string",
|
|
5811
|
+
"for the `thinking_face` reaction; use `content=confused` when",
|
|
5812
|
+
"POSTing the reaction.",
|
|
5813
|
+
"",
|
|
5814
|
+
"#### `nit` / `question`",
|
|
5815
|
+
"",
|
|
5816
|
+
"The comment is a minor stylistic preference, a clarifying question",
|
|
5817
|
+
"with a short answer, or a drive-by note that does not request a",
|
|
5818
|
+
"code change.",
|
|
5819
|
+
"",
|
|
5820
|
+
"Action:",
|
|
5821
|
+
"",
|
|
5822
|
+
"- React `eyes` to mark the comment seen.",
|
|
5823
|
+
"- Optionally post a brief reply when the question has a short,",
|
|
5824
|
+
" factual answer. Skip the reply when there is nothing useful to",
|
|
5825
|
+
" add \u2014 an `eyes` reaction alone is sufficient.",
|
|
5826
|
+
"- Never apply `+1`, `rocket`, or `-1` to a `nit` / `question`",
|
|
5827
|
+
" comment; those reactions are reserved for their documented",
|
|
5828
|
+
" terminal meanings.",
|
|
5829
|
+
"",
|
|
5830
|
+
"### Reaction protocol summary",
|
|
5831
|
+
"",
|
|
5832
|
+
"| Reaction | Meaning | Terminal? |",
|
|
5833
|
+
"|----------|---------|-----------|",
|
|
5834
|
+
"| `eyes` | Seen by reviewer; awaiting further action | No |",
|
|
5835
|
+
"| `thinking_face` (`confused`) | Reviewer disputes this comment | No |",
|
|
5836
|
+
"| `+1` | Reviewer accepts the comment's request | **Yes** |",
|
|
5837
|
+
"| `rocket` | The accepted change has landed on the branch | **Yes** |",
|
|
5838
|
+
"| `-1` | Reviewer declined as out-of-scope; tracked in a new issue | **Yes** |",
|
|
5839
|
+
"",
|
|
5840
|
+
"Terminal reactions (`+1`, `rocket`, `-1`) **must only be applied**",
|
|
5841
|
+
"when the corresponding action is truly complete:",
|
|
5842
|
+
"",
|
|
5843
|
+
"- `+1` \u2014 only after the reviewer has confirmed the comment's",
|
|
5844
|
+
" request is in-scope and the fix has been accepted for this PR.",
|
|
5845
|
+
"- `rocket` \u2014 only after the accepted fix has actually landed on the",
|
|
5846
|
+
" PR's branch (a commit addressing the comment is present).",
|
|
5847
|
+
"- `-1` \u2014 only after a new tracking issue has been successfully",
|
|
5848
|
+
" created for the out-of-scope request and the reply linking to it",
|
|
5849
|
+
" has been posted.",
|
|
5850
|
+
"",
|
|
5851
|
+
"Never pre-emptively apply a terminal reaction. Applying one signals",
|
|
5852
|
+
"to humans and to future reviewer passes that the item is closed;",
|
|
5853
|
+
"applying it early creates a false record of completion.",
|
|
5854
|
+
"",
|
|
5468
5855
|
"## Phase 4: Decide and Act",
|
|
5469
5856
|
"",
|
|
5857
|
+
"### Pushback gate (runs before every merge decision)",
|
|
5858
|
+
"",
|
|
5859
|
+
"Before taking any merge-enabling action in this phase, verify that no",
|
|
5860
|
+
"**unresolved `thinking_face` reactions by the reviewer** remain on",
|
|
5861
|
+
"any comment gathered in Phase 2.5.",
|
|
5862
|
+
"",
|
|
5863
|
+
"A `thinking_face` reaction is considered **unresolved** when:",
|
|
5864
|
+
"",
|
|
5865
|
+
"- The reviewer applied it on this pass or a prior pass, and",
|
|
5866
|
+
"- The underlying comment has not since received a resolution signal",
|
|
5867
|
+
" from the human \u2014 for example, the comment has not been withdrawn,",
|
|
5868
|
+
" the human has not posted a clarifying reply that the reviewer has",
|
|
5869
|
+
" since marked `+1`, and no `review:auto-ok` label has been applied",
|
|
5870
|
+
" to the PR as an explicit override.",
|
|
5871
|
+
"",
|
|
5872
|
+
"If any unresolved `thinking_face` reaction exists, **do not enable",
|
|
5873
|
+
"auto-merge** and **do not apply `review:awaiting-human` as a success",
|
|
5874
|
+
"hand-off**. This gate fires regardless of the review mode decided in",
|
|
5875
|
+
"Phase 2.75 \u2014 pushback blocks the merge pathway even when the mode is",
|
|
5876
|
+
"`auto-merge`. Skip straight to Phase 4.5 to update the sticky summary",
|
|
5877
|
+
"with the outstanding pushbacks, then stop. A downstream issue",
|
|
5878
|
+
"refines this gate further; for now, pushback simply blocks the",
|
|
5879
|
+
"merge pathway.",
|
|
5880
|
+
"",
|
|
5881
|
+
"If no unresolved `thinking_face` reactions exist, proceed with the",
|
|
5882
|
+
"branches below based on the review mode decided in Phase 2.75.",
|
|
5883
|
+
"",
|
|
5470
5884
|
"### If all acceptance criteria are met and CI is green",
|
|
5471
5885
|
"",
|
|
5472
5886
|
"Branch on the **review mode** decided in Phase 2.75:",
|
|
@@ -5524,6 +5938,82 @@ var prReviewerSubAgent = {
|
|
|
5524
5938
|
"--request-changes`: it is lighter-weight, doesn't require the author to",
|
|
5525
5939
|
"dismiss a formal review, and composes cleanly with the multi-PR loop.",
|
|
5526
5940
|
"",
|
|
5941
|
+
"## Phase 4.5: Update Sticky Summary",
|
|
5942
|
+
"",
|
|
5943
|
+
"On **every pass**, create or update a single **`## Reviewer notes`**",
|
|
5944
|
+
"comment on the PR. This sticky comment is the human-facing single",
|
|
5945
|
+
"source of truth for the PR's state \u2014 one comment per PR, edited in",
|
|
5946
|
+
"place across passes, never duplicated. Do not post a fresh",
|
|
5947
|
+
'"pass N summary" on each iteration.',
|
|
5948
|
+
"",
|
|
5949
|
+
"### Step 1: Find the existing sticky comment (if any)",
|
|
5950
|
+
"",
|
|
5951
|
+
"List PR-level comments and look for one authored by the reviewer",
|
|
5952
|
+
"whose body starts with `## Reviewer notes`:",
|
|
5953
|
+
"",
|
|
5954
|
+
"```bash",
|
|
5955
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/<pr-number>/comments",
|
|
5956
|
+
"```",
|
|
5957
|
+
"",
|
|
5958
|
+
"If multiple candidates exist (an older run double-posted before this",
|
|
5959
|
+
"phase existed), keep the earliest and plan to delete the duplicates",
|
|
5960
|
+
"on a later pass. Never delete another author's comment.",
|
|
5961
|
+
"",
|
|
5962
|
+
"### Step 2: Compose the sticky body",
|
|
5963
|
+
"",
|
|
5964
|
+
"The body uses the following shape:",
|
|
5965
|
+
"",
|
|
5966
|
+
"```",
|
|
5967
|
+
"## Reviewer notes",
|
|
5968
|
+
"",
|
|
5969
|
+
"**Mode:** auto-merge | human-required \u2014 <reason from Phase 2.75>",
|
|
5970
|
+
"**AC status:** <met / partial / missing> (evidence links)",
|
|
5971
|
+
"**CI status:** green | pending | red",
|
|
5972
|
+
"**Outstanding:** <list of comments still open with their classification and author>",
|
|
5973
|
+
"**Pushbacks:** <list of disputes with reasons>",
|
|
5974
|
+
"**Last pass:** <ISO timestamp>",
|
|
5975
|
+
"```",
|
|
5976
|
+
"",
|
|
5977
|
+
"Populate each field from the phases above:",
|
|
5978
|
+
"",
|
|
5979
|
+
"- **Mode / reason** \u2014 the mode and reason recorded in Phase 2.75.",
|
|
5980
|
+
"- **AC status** \u2014 the checklist produced in Phase 3 (met, partial,",
|
|
5981
|
+
" or missing), with links to the files or tests that provide the",
|
|
5982
|
+
" evidence.",
|
|
5983
|
+
"- **CI status** \u2014 derived from `gh pr checks`.",
|
|
5984
|
+
"- **Outstanding** \u2014 the comments still carrying a non-terminal",
|
|
5985
|
+
" reviewer reaction from Phase 3.5 (typically `eyes` for queued",
|
|
5986
|
+
" in-scope items and `nit` / `question` items that remain open).",
|
|
5987
|
+
" List each as `<classification>: <author> \u2014 <short summary> (<url>)`.",
|
|
5988
|
+
"- **Pushbacks** \u2014 every comment the reviewer reacted",
|
|
5989
|
+
" `thinking_face` to on this or any prior pass, with the reason",
|
|
5990
|
+
" captured in the pushback reply. Empty list when there are none.",
|
|
5991
|
+
"- **Last pass** \u2014 the ISO 8601 timestamp of this run.",
|
|
5992
|
+
"",
|
|
5993
|
+
"### Step 3: Create or edit in place",
|
|
5994
|
+
"",
|
|
5995
|
+
"If no existing sticky comment was found in Step 1, create one:",
|
|
5996
|
+
"",
|
|
5997
|
+
"```bash",
|
|
5998
|
+
"gh pr comment <pr-number> --body '<sticky body>'",
|
|
5999
|
+
"```",
|
|
6000
|
+
"",
|
|
6001
|
+
"If an existing sticky comment was found, edit it in place using the",
|
|
6002
|
+
"comment id. Do not delete and re-create \u2014 editing preserves the",
|
|
6003
|
+
"comment's URL and any reactions humans have added to the summary:",
|
|
6004
|
+
"",
|
|
6005
|
+
"```bash",
|
|
6006
|
+
"gh api repos/{{repository.owner}}/{{repository.name}}/issues/comments/<sticky-comment-id> \\",
|
|
6007
|
+
" -X PATCH -f body='<sticky body>'",
|
|
6008
|
+
"```",
|
|
6009
|
+
"",
|
|
6010
|
+
"The sticky summary must be updated on every pass through Phase 4.5,",
|
|
6011
|
+
"including passes that ended in a pushback-gated skip, a",
|
|
6012
|
+
"`NEEDS_CHANGES` findings comment, or the `human-required` hand-off.",
|
|
6013
|
+
"Humans rely on the sticky comment to see the current state of the",
|
|
6014
|
+
"PR at a glance \u2014 it must never go stale while the reviewer is",
|
|
6015
|
+
"actively processing the PR.",
|
|
6016
|
+
"",
|
|
5527
6017
|
"## Phase 5: Branch Cleanup and Issue Closure Verification",
|
|
5528
6018
|
"",
|
|
5529
6019
|
"Skip this phase entirely when the review mode from Phase 2.75 is",
|
|
@@ -5618,7 +6108,35 @@ var prReviewerSubAgent = {
|
|
|
5618
6108
|
"8. **In loop mode (`/review-prs`), never stop early.** If any review",
|
|
5619
6109
|
" fails, comment and move to the next PR. Only abort the loop on a",
|
|
5620
6110
|
" fatal error (e.g. `gh` auth failure, network outage).",
|
|
5621
|
-
"9. **Follow CLAUDE.md conventions** for all `git` and `gh` operations."
|
|
6111
|
+
"9. **Follow CLAUDE.md conventions** for all `git` and `gh` operations.",
|
|
6112
|
+
"10. **Follow the reaction protocol.** Use `eyes` to mark a comment",
|
|
6113
|
+
" seen, `thinking_face` (`confused`) to dispute it, `+1` to accept",
|
|
6114
|
+
" its request, `rocket` when the accepted change has landed, and",
|
|
6115
|
+
" `-1` when the request is out-of-scope and has been tracked in a",
|
|
6116
|
+
" new issue. Apply reactions on the same comment endpoint the",
|
|
6117
|
+
" comment came from (`issues/comments/...` for PR-level, ",
|
|
6118
|
+
" `pulls/comments/...` for inline).",
|
|
6119
|
+
"11. **Terminal reactions require completed actions.** `+1`, `rocket`,",
|
|
6120
|
+
" and `-1` must only be applied once the corresponding action is",
|
|
6121
|
+
" truly complete (respectively: the fix accepted, the fix landed,",
|
|
6122
|
+
" or the new out-of-scope issue created and linked in a reply).",
|
|
6123
|
+
" Never apply a terminal reaction pre-emptively; doing so falsely",
|
|
6124
|
+
" signals to humans and to future reviewer passes that the item",
|
|
6125
|
+
" is closed.",
|
|
6126
|
+
"12. **Maintain one sticky `## Reviewer notes` comment per PR.** On",
|
|
6127
|
+
" each pass, find the existing sticky comment authored by the",
|
|
6128
|
+
" reviewer and edit it in place with `gh api ... -X PATCH`;",
|
|
6129
|
+
" create it only when none exists. Never post per-pass summary",
|
|
6130
|
+
" comments alongside the sticky \u2014 the sticky is the single",
|
|
6131
|
+
" human-facing source of truth for PR state.",
|
|
6132
|
+
"13. **Pushback blocks auto-merge.** Any unresolved `thinking_face`",
|
|
6133
|
+
" reaction authored by the reviewer on any comment must prevent",
|
|
6134
|
+
" Phase 4 from enabling auto-merge, regardless of the review mode",
|
|
6135
|
+
" decided in Phase 2.75. The gate clears only when the human has",
|
|
6136
|
+
" resolved the dispute \u2014 by withdrawing the comment, by replying",
|
|
6137
|
+
" in a way that satisfies the reviewer (who then replaces the",
|
|
6138
|
+
" `thinking_face` with `+1`), or by applying the `review:auto-ok`",
|
|
6139
|
+
" label as an explicit override."
|
|
5622
6140
|
].join("\n")
|
|
5623
6141
|
};
|
|
5624
6142
|
var reviewPrSkill = {
|