@codedrifters/configulator 0.0.223 → 0.0.225
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 +176 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +176 -4
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -4222,7 +4222,7 @@ var issueWorkerSubAgent = {
|
|
|
4222
4222
|
name: "issue-worker",
|
|
4223
4223
|
description: "Selects the next ready issue from the queue, claims it, and implements the change end-to-end following repository conventions",
|
|
4224
4224
|
model: AGENT_MODEL.POWERFUL,
|
|
4225
|
-
maxTurns:
|
|
4225
|
+
maxTurns: 100,
|
|
4226
4226
|
canDelegateToAgents: [],
|
|
4227
4227
|
platforms: { cursor: { exclude: true } },
|
|
4228
4228
|
prompt: [
|
|
@@ -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 = {
|