@codedrifters/configulator 0.0.223 → 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 +175 -3
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +175 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -4313,7 +4313,10 @@ var issueWorkerSubAgent = {
|
|
|
4313
4313
|
"",
|
|
4314
4314
|
"## Invocation Mode",
|
|
4315
4315
|
"",
|
|
4316
|
-
"You operate in one of two modes
|
|
4316
|
+
"You operate in one of two **invocation modes** (interactive vs scheduled)",
|
|
4317
|
+
"and one of two **work modes** (normal vs feedback).",
|
|
4318
|
+
"",
|
|
4319
|
+
"### Interactive vs Scheduled",
|
|
4317
4320
|
"",
|
|
4318
4321
|
"- **Interactive mode (default):** A human invoked you directly. You must",
|
|
4319
4322
|
" pause and request explicit user approval before committing code (Phase 6).",
|
|
@@ -4326,11 +4329,52 @@ var issueWorkerSubAgent = {
|
|
|
4326
4329
|
"doubt, treat the session as interactive \u2014 pausing for approval is always",
|
|
4327
4330
|
"safe; committing without approval is not.",
|
|
4328
4331
|
"",
|
|
4332
|
+
"### Normal vs Feedback",
|
|
4333
|
+
"",
|
|
4334
|
+
"- **Normal mode (default):** You select an issue from the queue (or use a",
|
|
4335
|
+
" provided issue number), create a new branch, implement the change, and",
|
|
4336
|
+
" open a new PR. Phases 1\u20139 all run.",
|
|
4337
|
+
"- **Feedback mode:** You are given an existing PR number and asked to",
|
|
4338
|
+
" apply reviewer-requested fixes to the PR's existing branch. You do",
|
|
4339
|
+
" **not** create a new branch and you do **not** open a new PR \u2014 you",
|
|
4340
|
+
" push additional commits to the same branch.",
|
|
4341
|
+
"",
|
|
4342
|
+
"**You are in feedback mode if and only if the invocation prompt that",
|
|
4343
|
+
"started this session contains the literal phrase `feedback mode: PR #<n>`",
|
|
4344
|
+
"(where `<n>` is the PR number).** This mirrors the `scheduled mode` /",
|
|
4345
|
+
"`non-interactive` string-match convention above. Otherwise, default to",
|
|
4346
|
+
"normal mode.",
|
|
4347
|
+
"",
|
|
4348
|
+
"Interactive vs scheduled and normal vs feedback are independent axes.",
|
|
4349
|
+
"Feedback mode can run interactively (a human asks you to fix a PR) or",
|
|
4350
|
+
"on a schedule (the pr-reviewer hands off the PR). The interactive",
|
|
4351
|
+
"pause-before-commit rule (Phase 6) applies in either work mode.",
|
|
4352
|
+
"",
|
|
4353
|
+
"When in feedback mode, the per-phase behaviour changes as documented",
|
|
4354
|
+
"in each phase below. In summary:",
|
|
4355
|
+
"",
|
|
4356
|
+
"| Phase | Normal mode | Feedback mode |",
|
|
4357
|
+
"|-------|-------------|---------------|",
|
|
4358
|
+
"| 1. Select an Issue | Pick from queue or use provided issue number | **Skip.** Use the PR number from the invocation prompt. |",
|
|
4359
|
+
"| 2. Claim the Issue | Toggle status labels on the issue | **Skip.** The issue is already `status:in-progress`. |",
|
|
4360
|
+
"| 3. Set Up | Checkout default branch, create new branch | Checkout the existing PR branch via `gh pr view` and `git checkout <headRefName>`. |",
|
|
4361
|
+
"| 4. Implement | Read issue AC, implement | Read most-recent reviewer-authored fix-list comment on the PR, parse JSON, apply each item. |",
|
|
4362
|
+
"| 5. Verify | Unchanged | Unchanged. |",
|
|
4363
|
+
"| 6. Commit and Push | Conventional commit, interactive pause | Commit message `fix(review): <summary> (PR #<n>)`. Pause behaviour unchanged. `git push` (no `-u`). |",
|
|
4364
|
+
"| 7. Open a PR | Open a new PR | **Skip.** |",
|
|
4365
|
+
"| 8. Update Status | Set issue to `status:ready-for-review` | **Skip.** PR is still open; issue stays `status:in-progress`. |",
|
|
4366
|
+
"| 9. Branch Cleanup | Poll for merge, delete branch | **Skip.** Return control to the pr-reviewer without polling. |",
|
|
4367
|
+
"",
|
|
4329
4368
|
"---",
|
|
4330
4369
|
"",
|
|
4331
4370
|
...PROJECT_CONTEXT_READER_SECTION,
|
|
4332
4371
|
"## Phase 1: Select an Issue",
|
|
4333
4372
|
"",
|
|
4373
|
+
"**Feedback mode:** Skip this phase entirely. Extract the PR number from",
|
|
4374
|
+
"the `feedback mode: PR #<n>` phrase in your invocation prompt and use",
|
|
4375
|
+
"it for the rest of the workflow.",
|
|
4376
|
+
"",
|
|
4377
|
+
"**Normal mode:**",
|
|
4334
4378
|
"If an issue number was provided in your instructions, use that issue.",
|
|
4335
4379
|
"Otherwise, find the next issue to work on:",
|
|
4336
4380
|
"",
|
|
@@ -4347,6 +4391,12 @@ var issueWorkerSubAgent = {
|
|
|
4347
4391
|
"",
|
|
4348
4392
|
"## Phase 2: Claim the Issue",
|
|
4349
4393
|
"",
|
|
4394
|
+
"**Feedback mode:** Skip this phase entirely. The issue linked to the PR",
|
|
4395
|
+
"is already in `status:in-progress` from when the original PR was opened.",
|
|
4396
|
+
"Do not toggle any status labels on the issue.",
|
|
4397
|
+
"",
|
|
4398
|
+
"**Normal mode:**",
|
|
4399
|
+
"",
|
|
4350
4400
|
"```bash",
|
|
4351
4401
|
'gh issue edit <number> --remove-label "status:ready" --add-label "status:in-progress"',
|
|
4352
4402
|
"```",
|
|
@@ -4358,6 +4408,31 @@ var issueWorkerSubAgent = {
|
|
|
4358
4408
|
"",
|
|
4359
4409
|
"## Phase 3: Set Up",
|
|
4360
4410
|
"",
|
|
4411
|
+
"**Feedback mode:** Do **not** check out the default branch and do **not**",
|
|
4412
|
+
"create a new branch. Instead, look up the PR's head branch and check it out:",
|
|
4413
|
+
"",
|
|
4414
|
+
"```bash",
|
|
4415
|
+
"gh pr view <pr-number> --json state,headRefName,baseRefName,author",
|
|
4416
|
+
"```",
|
|
4417
|
+
"",
|
|
4418
|
+
"First verify the PR `state` is `OPEN`. If the state is `MERGED` or",
|
|
4419
|
+
"`CLOSED`, abort immediately \u2014 do not modify the branch. Report the",
|
|
4420
|
+
"state to the caller and stop.",
|
|
4421
|
+
"",
|
|
4422
|
+
"Then fetch and check out the existing branch:",
|
|
4423
|
+
"",
|
|
4424
|
+
"```bash",
|
|
4425
|
+
"git fetch origin",
|
|
4426
|
+
"git checkout <headRefName>",
|
|
4427
|
+
"git pull --rebase origin <headRefName>",
|
|
4428
|
+
"```",
|
|
4429
|
+
"",
|
|
4430
|
+
"If the rebase produces a conflict, abort and report failure \u2014 do not",
|
|
4431
|
+
"force-push and do not attempt to resolve conflicts in feedback mode.",
|
|
4432
|
+
"Skip the remainder of this phase (no new branch, no status comment).",
|
|
4433
|
+
"",
|
|
4434
|
+
"**Normal mode:**",
|
|
4435
|
+
"",
|
|
4361
4436
|
"```bash",
|
|
4362
4437
|
"git checkout {{repository.defaultBranch}} && git pull origin {{repository.defaultBranch}}",
|
|
4363
4438
|
"```",
|
|
@@ -4389,6 +4464,52 @@ var issueWorkerSubAgent = {
|
|
|
4389
4464
|
"",
|
|
4390
4465
|
"## Phase 4: Implement",
|
|
4391
4466
|
"",
|
|
4467
|
+
"**Feedback mode:** Read PR comments and apply the reviewer's fix list.",
|
|
4468
|
+
"",
|
|
4469
|
+
"1. List the PR's issue comments newest-first and pick the **most recent**",
|
|
4470
|
+
" comment authored by the reviewer account that contains a fenced",
|
|
4471
|
+
" code block with the language tag `fix-list`:",
|
|
4472
|
+
"",
|
|
4473
|
+
" ```bash",
|
|
4474
|
+
" gh pr view <pr-number> --json comments",
|
|
4475
|
+
" ```",
|
|
4476
|
+
"",
|
|
4477
|
+
"2. Extract the JSON body of the ` ```json fix-list ` block. The reviewer",
|
|
4478
|
+
" writes the comment in this exact shape:",
|
|
4479
|
+
"",
|
|
4480
|
+
" ````markdown",
|
|
4481
|
+
" ## Reviewer: fix list for @issue-worker",
|
|
4482
|
+
"",
|
|
4483
|
+
" - [ ] @<author> \u2014 <instruction summary> (<file>:<line>)",
|
|
4484
|
+
"",
|
|
4485
|
+
" ```json fix-list",
|
|
4486
|
+
" {",
|
|
4487
|
+
' "pr": 123,',
|
|
4488
|
+
' "branch": "feat/42-add-foo",',
|
|
4489
|
+
' "generated_at": "2026-04-16T14:02:00Z",',
|
|
4490
|
+
' "items": [',
|
|
4491
|
+
' {"comment_id": "IC_abc", "author": "alice", "file": "src/foo.ts", "line": 42, "instruction": "rename getFoo to fetchFoo"},',
|
|
4492
|
+
' {"comment_id": "IC_def", "author": "bob", "file": "src/foo.test.ts", "instruction": "add a test for the null branch"}',
|
|
4493
|
+
" ]",
|
|
4494
|
+
" }",
|
|
4495
|
+
" ```",
|
|
4496
|
+
" ````",
|
|
4497
|
+
"",
|
|
4498
|
+
" The JSON block is the **authoritative** list of work \u2014 the checkbox",
|
|
4499
|
+
" summary above it is for humans only and must be ignored. If multiple",
|
|
4500
|
+
" reviewer-authored fix-list comments exist, use the most recent one.",
|
|
4501
|
+
" If the JSON cannot be parsed, abort and report failure.",
|
|
4502
|
+
"",
|
|
4503
|
+
"3. Apply each `items[].instruction` in order. Each item references a",
|
|
4504
|
+
" `file` (and optional `line`). Track `comment_id` per item so you can",
|
|
4505
|
+
" report which items were handled and which (if any) failed.",
|
|
4506
|
+
"",
|
|
4507
|
+
"4. When complete, prepare a short structured report (PR number, commit",
|
|
4508
|
+
" SHAs you will push, items handled by `comment_id`, items that failed",
|
|
4509
|
+
" to apply) \u2014 you will return this after Phase 6.",
|
|
4510
|
+
"",
|
|
4511
|
+
"**Normal mode:**",
|
|
4512
|
+
"",
|
|
4392
4513
|
"Read the issue body carefully. Understand the acceptance criteria.",
|
|
4393
4514
|
"",
|
|
4394
4515
|
"Implement the change following these guidelines based on issue type:",
|
|
@@ -4430,7 +4551,23 @@ var issueWorkerSubAgent = {
|
|
|
4430
4551
|
"",
|
|
4431
4552
|
"**If you are in scheduled mode, skip the pause and proceed directly.**",
|
|
4432
4553
|
"",
|
|
4433
|
-
"Use
|
|
4554
|
+
"**Feedback mode:** Use a `fix(review)` commit message that references",
|
|
4555
|
+
"the PR number, and push to the existing branch **without** `-u` (the",
|
|
4556
|
+
"branch is already tracking origin). Before pushing, re-run",
|
|
4557
|
+
"`git pull --rebase origin <branch-name>` to incorporate any commits",
|
|
4558
|
+
"that landed on the branch while you were working. **Never force-push.**",
|
|
4559
|
+
"If the rebase conflicts, abort and report failure.",
|
|
4560
|
+
"",
|
|
4561
|
+
"```bash",
|
|
4562
|
+
"git add <files>",
|
|
4563
|
+
'git commit -m "fix(review): <summary> (PR #<pr-number>)"',
|
|
4564
|
+
"git pull --rebase origin <branch-name>",
|
|
4565
|
+
"git push origin <branch-name>",
|
|
4566
|
+
"```",
|
|
4567
|
+
"",
|
|
4568
|
+
"**Normal mode:** Use conventional commit messages and push with `-u`",
|
|
4569
|
+
"to set up branch tracking:",
|
|
4570
|
+
"",
|
|
4434
4571
|
"```bash",
|
|
4435
4572
|
"git add <files>",
|
|
4436
4573
|
'git commit -m "<type>: <description>"',
|
|
@@ -4439,6 +4576,12 @@ var issueWorkerSubAgent = {
|
|
|
4439
4576
|
"",
|
|
4440
4577
|
"## Phase 7: Open a PR",
|
|
4441
4578
|
"",
|
|
4579
|
+
"**Feedback mode:** Skip this phase entirely. The PR already exists; you",
|
|
4580
|
+
"have pushed additional commits to its existing branch. Do not open a new",
|
|
4581
|
+
"PR.",
|
|
4582
|
+
"",
|
|
4583
|
+
"**Normal mode:**",
|
|
4584
|
+
"",
|
|
4442
4585
|
"Every PR you open must carry the `origin:issue-worker` label so downstream",
|
|
4443
4586
|
"agents can identify bot-authored PRs. Always include",
|
|
4444
4587
|
"`--label 'origin:issue-worker'` in the `gh pr create` invocation:",
|
|
@@ -4460,6 +4603,12 @@ var issueWorkerSubAgent = {
|
|
|
4460
4603
|
"",
|
|
4461
4604
|
"## Phase 8: Update Status",
|
|
4462
4605
|
"",
|
|
4606
|
+
"**Feedback mode:** Skip this phase entirely. The linked issue stays in",
|
|
4607
|
+
"`status:in-progress` while the PR is still open \u2014 do not toggle any",
|
|
4608
|
+
"labels.",
|
|
4609
|
+
"",
|
|
4610
|
+
"**Normal mode:**",
|
|
4611
|
+
"",
|
|
4463
4612
|
"After the PR is created, transition the issue to the review phase:",
|
|
4464
4613
|
"```bash",
|
|
4465
4614
|
'gh issue edit <number> --remove-label "status:in-progress" --add-label "status:ready-for-review"',
|
|
@@ -4470,6 +4619,13 @@ var issueWorkerSubAgent = {
|
|
|
4470
4619
|
"",
|
|
4471
4620
|
"## Phase 9: Branch Cleanup",
|
|
4472
4621
|
"",
|
|
4622
|
+
"**Feedback mode:** Skip this phase entirely. Do not poll the PR state",
|
|
4623
|
+
"and do not delete the local branch. Return control to the pr-reviewer",
|
|
4624
|
+
"with the structured report from Phase 4 (PR number, commit SHAs pushed,",
|
|
4625
|
+
"items handled by `comment_id`, items that failed to apply).",
|
|
4626
|
+
"",
|
|
4627
|
+
"**Normal mode:**",
|
|
4628
|
+
"",
|
|
4473
4629
|
"The PR will not auto-merge until the `pr-reviewer` enables it. Poll the PR",
|
|
4474
4630
|
"state up to 10 times, waiting 30 seconds between polls, until it either",
|
|
4475
4631
|
"merges, closes, or the timeout is reached:",
|
|
@@ -4507,7 +4663,23 @@ var issueWorkerSubAgent = {
|
|
|
4507
4663
|
" ```bash",
|
|
4508
4664
|
' gh issue edit <number> --remove-label "status:in-progress" --add-label "status:needs-attention"',
|
|
4509
4665
|
' gh issue comment <number> --body "Worker could not complete: <reason>"',
|
|
4510
|
-
" ```"
|
|
4666
|
+
" ```",
|
|
4667
|
+
"8. **Never force-push in feedback mode.** If a `git pull --rebase`",
|
|
4668
|
+
" produces conflicts, abort and report failure. Do not pass",
|
|
4669
|
+
" `--force` or `--force-with-lease` to `git push`.",
|
|
4670
|
+
"9. **Abort if the PR is not OPEN in feedback mode.** Before checking",
|
|
4671
|
+
" out the head branch, verify `gh pr view <pr> --json state` returns",
|
|
4672
|
+
" `OPEN`. If the state is `MERGED` or `CLOSED`, stop immediately \u2014",
|
|
4673
|
+
" do not modify the branch.",
|
|
4674
|
+
"10. **Use the most-recent reviewer-authored fix-list comment.** If",
|
|
4675
|
+
" multiple `fix-list` comments exist on the PR, use the most recent",
|
|
4676
|
+
" one authored by the reviewer account. Ignore older fix-list",
|
|
4677
|
+
" comments and any fix-list comments authored by other accounts.",
|
|
4678
|
+
"11. **Never create a new branch in feedback mode.** Always check out",
|
|
4679
|
+
" the existing PR head branch returned by `gh pr view`. Do not run",
|
|
4680
|
+
" `git checkout -b` while in feedback mode.",
|
|
4681
|
+
"12. **Never `git push -u` in feedback mode.** The existing PR branch",
|
|
4682
|
+
" already tracks origin. Use plain `git push origin <branch-name>`."
|
|
4511
4683
|
].join("\n")
|
|
4512
4684
|
};
|
|
4513
4685
|
var orchestratorBundle = {
|