@codedrifters/configulator 0.0.394 → 0.0.396
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 +165 -88
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +165 -88
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -4633,7 +4633,17 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
4633
4633
|
" `status:ready`.",
|
|
4634
4634
|
"- **Automated flag** \u2192 add `status:needs-attention` (do not remove existing",
|
|
4635
4635
|
" status). Never auto-reset a `status:needs-attention` issue back to ready;",
|
|
4636
|
-
" a human must decide.",
|
|
4636
|
+
" a human must decide. The flag is **additive**: apply it with `--add-label`",
|
|
4637
|
+
" alone \u2014 never pair it with a `--remove-label` that strips the base",
|
|
4638
|
+
" `status:*` label. A flag that swaps out the base status (e.g. scope-gate",
|
|
4639
|
+
" or worker-failure paths removing `status:ready` / `status:in-progress`)",
|
|
4640
|
+
" leaves the issue with no base status \u2014 invisible to every status-driven",
|
|
4641
|
+
" query and to the queue, and unrecoverable once the flag is cleared.",
|
|
4642
|
+
"- **Automated-flag clear** \u2192 when `status:needs-attention` is cleared, if the",
|
|
4643
|
+
" issue carries no base `status:*` label (a legacy issue flagged before the",
|
|
4644
|
+
" additive-flag rule, whose base status was stripped at flag time), restore",
|
|
4645
|
+
" `status:ready` \u2014 or `status:blocked` if the body still declares an open",
|
|
4646
|
+
" `Depends on:` dependency \u2014 in the same edit so it re-enters the workflow.",
|
|
4637
4647
|
"- **PR CI failure** \u2192 add `status:needs-attention` to the associated PR (and",
|
|
4638
4648
|
" its linked issue) when CI fails in a **permanent** state \u2014 i.e. the failure",
|
|
4639
4649
|
" persists after a rerun, or the failure is clearly not a flake (compile",
|
|
@@ -14427,8 +14437,19 @@ function renderScopeGateSection(gate, excludeBundles = []) {
|
|
|
14427
14437
|
"",
|
|
14428
14438
|
"When the classifier returns `large`:",
|
|
14429
14439
|
"",
|
|
14430
|
-
"1.
|
|
14431
|
-
" `
|
|
14440
|
+
"1. **Add** the `status:needs-attention` label to the issue with",
|
|
14441
|
+
" `--add-label` alone. Leave the existing base `status:*` label",
|
|
14442
|
+
" (`status:ready`) in place \u2014 `status:needs-attention` is",
|
|
14443
|
+
" **additive**, so a flagged issue reads `status:ready` +",
|
|
14444
|
+
" `status:needs-attention`. Do **not** remove the base status:",
|
|
14445
|
+
" stripping it leaves the issue with no base `status:*` label,",
|
|
14446
|
+
" invisible to every status-driven query and to the queue itself,",
|
|
14447
|
+
" and a later flag-clear can never restore dispatchability. The",
|
|
14448
|
+
" `status:needs-attention` label already keeps the issue out of",
|
|
14449
|
+
" the dispatch queue, so the base label safely stays:",
|
|
14450
|
+
" ```bash",
|
|
14451
|
+
' gh issue edit <number> --add-label "status:needs-attention"',
|
|
14452
|
+
" ```",
|
|
14432
14453
|
"2. Post the decomposition-proposal comment (see template below),",
|
|
14433
14454
|
" with `<AC_COUNT>` / `<SOURCES_COUNT>` substituted from the",
|
|
14434
14455
|
" classification and `<AC_LIMIT>` / `<SOURCES_LIMIT>` set to",
|
|
@@ -14449,7 +14470,12 @@ function renderScopeGateSection(gate, excludeBundles = []) {
|
|
|
14449
14470
|
"4. **Auto-file is OFF.** Stop after posting the comment. A human",
|
|
14450
14471
|
" reviews the proposal, files the phased sub-issues manually,",
|
|
14451
14472
|
" and clears `status:needs-attention` when the decomposition",
|
|
14452
|
-
" is in place."
|
|
14473
|
+
" is in place. When clearing the flag, if the issue carries **no**",
|
|
14474
|
+
" base `status:*` label \u2014 a legacy issue flagged before the",
|
|
14475
|
+
" additive-flag fix, whose base status was stripped at flag time \u2014",
|
|
14476
|
+
" also add `status:ready` (or `status:blocked` when the body still",
|
|
14477
|
+
" declares an open `Depends on:` dependency) in the same edit so",
|
|
14478
|
+
" the issue re-enters the queue instead of going invisible."
|
|
14453
14479
|
);
|
|
14454
14480
|
}
|
|
14455
14481
|
const overrideEntries = Object.entries(gate.bundleOverrides).filter(
|
|
@@ -16814,7 +16840,7 @@ var orchestratorSubAgent = {
|
|
|
16814
16840
|
"### Step 3 \u2014 failure semantics",
|
|
16815
16841
|
"",
|
|
16816
16842
|
"A single PR's worker failure (missing or malformed `WORKER_*` final",
|
|
16817
|
-
"line, sub-agent error, unresolvable
|
|
16843
|
+
"line, sub-agent error, unresolvable merge conflict) **never stops",
|
|
16818
16844
|
"the drain**. Log the failure as",
|
|
16819
16845
|
"`WORKER_FAILED pr:#<n> reason:<observed>` and continue to the next",
|
|
16820
16846
|
"`PR_DRAIN` line. The next orchestrator invocation re-runs",
|
|
@@ -17004,9 +17030,16 @@ var orchestratorSubAgent = {
|
|
|
17004
17030
|
"",
|
|
17005
17031
|
"If the scope is `large`, **do not dispatch**. Instead:",
|
|
17006
17032
|
"",
|
|
17007
|
-
"1.
|
|
17033
|
+
"1. **Add** `status:needs-attention` with `--add-label` alone \u2014",
|
|
17034
|
+
" leave the base `status:*` label (`status:ready`) in place.",
|
|
17035
|
+
" `status:needs-attention` is **additive**; pairing it with a",
|
|
17036
|
+
' `--remove-label "status:ready"` strips the base status and',
|
|
17037
|
+
" leaves the issue with no `status:*` label at all, invisible to",
|
|
17038
|
+
" the queue and unrecoverable when the flag is later cleared. The",
|
|
17039
|
+
" `status:needs-attention` label already keeps the issue out of",
|
|
17040
|
+
" dispatch, so the base label stays:",
|
|
17008
17041
|
" ```bash",
|
|
17009
|
-
' gh issue edit <number> --
|
|
17042
|
+
' gh issue edit <number> --add-label "status:needs-attention"',
|
|
17010
17043
|
" ```",
|
|
17011
17044
|
"2. Post the decomposition-proposal comment (see the **Scope gate**",
|
|
17012
17045
|
" section in `CLAUDE.md` for the template). Substitute the",
|
|
@@ -17104,7 +17137,9 @@ var orchestratorSubAgent = {
|
|
|
17104
17137
|
"5. **Priority order:** critical > high > medium > low > trivial, then **funnel tier asc** (lower tier wins ties), then FIFO by issue number.",
|
|
17105
17138
|
"6. **Never dispatch a `large` issue.** Always run the scope check",
|
|
17106
17139
|
" on the top `PICK` line before reporting `NEXT_WORK_ITEM`. A",
|
|
17107
|
-
" `large` issue must be flagged
|
|
17140
|
+
" `large` issue must be flagged by **adding** `status:needs-attention`",
|
|
17141
|
+
" (additive \u2014 leave the base `status:*` label in place; never pair",
|
|
17142
|
+
" the flag with a `--remove-label` that strips the base status) and",
|
|
17108
17143
|
" handed a decomposition proposal \u2014 never claimed, never branched,",
|
|
17109
17144
|
" never delegated to the `issue-worker`.",
|
|
17110
17145
|
"7. **Sweep dependents whenever you apply `status:done`.** Every",
|
|
@@ -17422,43 +17457,55 @@ var issueWorkerSubAgent = {
|
|
|
17422
17457
|
" reviewer's signal that the PR's head branch is BEHIND the default",
|
|
17423
17458
|
" branch with merge conflicts that `gh pr update-branch` could not",
|
|
17424
17459
|
" resolve. For either item the work is **not** an editorial change",
|
|
17425
|
-
" \u2014 it is a
|
|
17426
|
-
" different recipes:",
|
|
17460
|
+
" \u2014 it is a merge of the default branch into the PR branch plus",
|
|
17461
|
+
" conflict resolution. The two ids select different recipes:",
|
|
17427
17462
|
"",
|
|
17428
17463
|
" - `synthetic:rebase-behind-main` \u2014 generic conflict. Resolve",
|
|
17429
17464
|
" each conflicting file by hand (read both sides, reconcile,",
|
|
17430
|
-
" stage), then `git
|
|
17431
|
-
"
|
|
17465
|
+
" stage), then `git commit --no-edit` to complete the merge",
|
|
17466
|
+
" commit.",
|
|
17432
17467
|
" - `synthetic:rebase-shared-index` \u2014 every conflicting file is a",
|
|
17433
17468
|
" row-insert race on a shared-index file (registry / index /",
|
|
17434
17469
|
" feature-matrix under a Starlight content root). Apply the",
|
|
17435
17470
|
" explicit re-insert recipe carried in the item's `instruction`",
|
|
17436
17471
|
" field \u2014 do **not** hand-merge.",
|
|
17437
17472
|
"",
|
|
17473
|
+
" **Marker name vs. operation.** The `comment_id` values keep their",
|
|
17474
|
+
" historical `rebase` spelling as a **stable identifier** the",
|
|
17475
|
+
" reviewer and worker agree on across sessions \u2014 the operation they",
|
|
17476
|
+
" select is a **merge** of the default branch into the PR branch,",
|
|
17477
|
+
" **not** a rebase. The PR branch is already pushed and diverged,",
|
|
17478
|
+
" so a rebase would rewrite its published history and require a",
|
|
17479
|
+
" `--force-with-lease` push that rule 8 forbids. A merge commit is",
|
|
17480
|
+
" fast-forward-pushable with a plain `git push`.",
|
|
17481
|
+
"",
|
|
17438
17482
|
" **For `synthetic:rebase-behind-main`.** Run the following",
|
|
17439
17483
|
" sequence:",
|
|
17440
17484
|
"",
|
|
17441
17485
|
" ```bash",
|
|
17442
17486
|
" git fetch origin",
|
|
17443
|
-
" git
|
|
17487
|
+
" git merge --no-edit origin/{{repository.defaultBranch}}",
|
|
17444
17488
|
" ```",
|
|
17445
17489
|
"",
|
|
17446
|
-
" When the
|
|
17447
|
-
" in turn (read both sides
|
|
17448
|
-
"
|
|
17449
|
-
"
|
|
17450
|
-
"
|
|
17451
|
-
"
|
|
17452
|
-
"
|
|
17453
|
-
"
|
|
17454
|
-
"
|
|
17455
|
-
"
|
|
17456
|
-
"",
|
|
17457
|
-
"
|
|
17458
|
-
"
|
|
17459
|
-
"
|
|
17460
|
-
"
|
|
17461
|
-
"
|
|
17490
|
+
" When the merge produces conflicts, resolve each conflicting file",
|
|
17491
|
+
" in turn (read both sides \u2014 `<<<<<<< HEAD` is this PR's change,",
|
|
17492
|
+
" `>>>>>>> origin/{{repository.defaultBranch}}` is the default",
|
|
17493
|
+
" branch's \u2014 reconcile, stage), then run `git commit --no-edit` to",
|
|
17494
|
+
" complete the merge commit. Do not run `git merge --abort` to give",
|
|
17495
|
+
" up casually \u2014 aborting drops the work the reviewer delegated.",
|
|
17496
|
+
" Abort **only** as the failure path: if you genuinely cannot",
|
|
17497
|
+
" resolve a conflict (the change is editorial enough that it",
|
|
17498
|
+
" requires human judgement, or the conflict touches a generated",
|
|
17499
|
+
" file you should not hand-edit), record the item as `failed` with",
|
|
17500
|
+
" a clear reason, run `git merge --abort`, and proceed to the",
|
|
17501
|
+
" report step. Do not force-push.",
|
|
17502
|
+
"",
|
|
17503
|
+
" When the merge completes cleanly, treat the merge commit itself",
|
|
17504
|
+
" as the deliverable. Skip the conventional commit step in Phase 6",
|
|
17505
|
+
" for this item \u2014 the merge already produced the commit. Push with",
|
|
17506
|
+
" a regular non-force `git push origin <branch>` (the merge commit",
|
|
17507
|
+
" is fast-forward-pushable, so no force-push is needed) and report",
|
|
17508
|
+
" the merged head SHA as the worker's commit.",
|
|
17462
17509
|
"",
|
|
17463
17510
|
" **For `synthetic:rebase-shared-index`.** Apply the typed",
|
|
17464
17511
|
" re-insert recipe step-by-step. Read the recipe verbatim from the",
|
|
@@ -17466,11 +17513,11 @@ var issueWorkerSubAgent = {
|
|
|
17466
17513
|
" contract the reviewer encodes and the precondition guards you",
|
|
17467
17514
|
" must enforce:",
|
|
17468
17515
|
"",
|
|
17469
|
-
" 1. **
|
|
17516
|
+
" 1. **Fetch and merge** the default branch into the PR branch:",
|
|
17470
17517
|
"",
|
|
17471
17518
|
" ```bash",
|
|
17472
17519
|
" git fetch origin",
|
|
17473
|
-
" git
|
|
17520
|
+
" git merge --no-edit origin/{{repository.defaultBranch}}",
|
|
17474
17521
|
" ```",
|
|
17475
17522
|
"",
|
|
17476
17523
|
" 2. **For each conflicting file**, inspect the conflict markers",
|
|
@@ -17487,18 +17534,20 @@ var issueWorkerSubAgent = {
|
|
|
17487
17534
|
" the frontmatter (lines between the opening / closing `---`",
|
|
17488
17535
|
" fences), the page H1, surrounding prose paragraphs, the",
|
|
17489
17536
|
" table header row, or the separator row, **stop**, run",
|
|
17490
|
-
" `git
|
|
17537
|
+
" `git merge --abort`, and record the item as `failed` with",
|
|
17491
17538
|
" the structured marker `BLOCKED <reason>` (e.g.",
|
|
17492
17539
|
" `BLOCKED conflict touches table header in <path>`). Do not",
|
|
17493
17540
|
" hand-merge \u2014 the typed recipe applies only to pure",
|
|
17494
17541
|
" row-insert races.",
|
|
17495
17542
|
"",
|
|
17496
|
-
" When the guards pass,
|
|
17497
|
-
"
|
|
17498
|
-
"
|
|
17499
|
-
"
|
|
17500
|
-
"
|
|
17501
|
-
"
|
|
17543
|
+
" When the guards pass, resolve the conflict in place: the",
|
|
17544
|
+
" `<<<<<<< HEAD` side carries this PR's row and the",
|
|
17545
|
+
" `>>>>>>> origin/{{repository.defaultBranch}}` side carries",
|
|
17546
|
+
" the other PR's row. Extract this PR's row and re-insert",
|
|
17547
|
+
" that row in declared sort order alongside the other PR's row",
|
|
17548
|
+
" using the file's documented sort key (alphabetical on the",
|
|
17549
|
+
" first column by default) so both rows survive, remove the",
|
|
17550
|
+
" conflict markers, and stage the file:",
|
|
17502
17551
|
"",
|
|
17503
17552
|
" ```bash",
|
|
17504
17553
|
" git add <path>",
|
|
@@ -17514,16 +17563,17 @@ var issueWorkerSubAgent = {
|
|
|
17514
17563
|
' [ "$count" = "1" ] || { echo "BLOCKED verification failed for <path>"; exit 1; }',
|
|
17515
17564
|
" ```",
|
|
17516
17565
|
"",
|
|
17517
|
-
" 4. **
|
|
17518
|
-
" every file is staged and verified
|
|
17566
|
+
" 4. **Complete the merge and push** with a plain non-force push",
|
|
17567
|
+
" once every file is staged and verified (the merge commit is",
|
|
17568
|
+
" fast-forward-pushable, so no force-push is needed):",
|
|
17519
17569
|
"",
|
|
17520
17570
|
" ```bash",
|
|
17521
|
-
" git
|
|
17571
|
+
" git commit --no-edit",
|
|
17522
17572
|
" git push origin <branch>",
|
|
17523
17573
|
" ```",
|
|
17524
17574
|
"",
|
|
17525
17575
|
" On any `BLOCKED` precondition failure, exit non-zero with the",
|
|
17526
|
-
" `BLOCKED <reason>` line, run `git
|
|
17576
|
+
" `BLOCKED <reason>` line, run `git merge --abort`, record the",
|
|
17527
17577
|
" item as `failed`, and proceed to the report step. The reviewer",
|
|
17528
17578
|
" will see the `failed` outcome on the next pass and fall through",
|
|
17529
17579
|
" to the human-required hand-off via `review:awaiting-human`. Do",
|
|
@@ -17590,20 +17640,21 @@ var issueWorkerSubAgent = {
|
|
|
17590
17640
|
"git push origin <branch-name>",
|
|
17591
17641
|
"```",
|
|
17592
17642
|
"",
|
|
17593
|
-
"**Synthetic
|
|
17643
|
+
"**Synthetic rebase items skip the `fix(review)` commit.** When the",
|
|
17594
17644
|
"fix-list contained a `comment_id` of `synthetic:rebase-behind-main`",
|
|
17595
|
-
"or `synthetic:rebase-shared-index` and you completed the
|
|
17596
|
-
"Phase 4, the
|
|
17597
|
-
"
|
|
17598
|
-
"commit
|
|
17599
|
-
|
|
17645
|
+
"or `synthetic:rebase-shared-index` and you completed the merge in",
|
|
17646
|
+
"Phase 4, the merge commit is itself the deliverable \u2014 there is no",
|
|
17647
|
+
"per-item editorial change to wrap in a `fix(review)` commit. The",
|
|
17648
|
+
"merge commit already exists from Phase 4, so skip the `git add` /",
|
|
17649
|
+
'`git commit -m "fix(review)..."` / `git pull --rebase` editorial',
|
|
17650
|
+
"steps for that item and push the merged branch directly:",
|
|
17600
17651
|
"",
|
|
17601
17652
|
"```bash",
|
|
17602
17653
|
"git push origin <branch-name>",
|
|
17603
17654
|
"```",
|
|
17604
17655
|
"",
|
|
17605
|
-
"If the fix-list mixed a synthetic
|
|
17606
|
-
"perform the editorial commit first (the
|
|
17656
|
+
"If the fix-list mixed a synthetic rebase item with editorial items,",
|
|
17657
|
+
"perform the editorial commit first (the merge already preceded it",
|
|
17607
17658
|
"in Phase 4), then push once at the end.",
|
|
17608
17659
|
"",
|
|
17609
17660
|
"**Normal mode:** Use conventional commit messages and push with `-u`",
|
|
@@ -17632,8 +17683,8 @@ var issueWorkerSubAgent = {
|
|
|
17632
17683
|
"",
|
|
17633
17684
|
"**This is the FIRST action after a successful push** \u2014 before any",
|
|
17634
17685
|
"summary, log line, or secondary step. Call the deterministic procedure",
|
|
17635
|
-
"with the PR number, the commit SHA you pushed (or the
|
|
17636
|
-
"for a synthetic
|
|
17686
|
+
"with the PR number, the commit SHA you pushed (or the merged head SHA",
|
|
17687
|
+
"for a synthetic rebase item), and the per-item outcomes JSON array:",
|
|
17637
17688
|
"",
|
|
17638
17689
|
"```bash",
|
|
17639
17690
|
".claude/procedures/complete-feedback-handoff.sh <pr-number> <commit-sha> '<items-json>'",
|
|
@@ -17772,9 +17823,17 @@ var issueWorkerSubAgent = {
|
|
|
17772
17823
|
" downstream agents (notably the `pr-reviewer`) can identify",
|
|
17773
17824
|
" bot-authored PRs. Pass `--label 'origin:issue-worker'` on every",
|
|
17774
17825
|
" `gh pr create` call.",
|
|
17775
|
-
"7. **On failure:** If you cannot complete the issue
|
|
17826
|
+
"7. **On failure:** If you cannot complete the issue (including a",
|
|
17827
|
+
" wrong-agent / routing mismatch), flag it for human triage and",
|
|
17828
|
+
" leave a comment. **Add** `status:needs-attention` with",
|
|
17829
|
+
" `--add-label` alone \u2014 do **not** remove the base",
|
|
17830
|
+
" `status:in-progress` label. `status:needs-attention` is",
|
|
17831
|
+
" additive, so the flagged issue reads `status:in-progress` +",
|
|
17832
|
+
" `status:needs-attention` and keeps a base status a human can act",
|
|
17833
|
+
" on; stripping it leaves the issue with no base `status:*` label,",
|
|
17834
|
+
" invisible to every status-driven query:",
|
|
17776
17835
|
" ```bash",
|
|
17777
|
-
' gh issue edit <number> --
|
|
17836
|
+
' gh issue edit <number> --add-label "status:needs-attention"',
|
|
17778
17837
|
' gh issue comment <number> --body "Worker could not complete: <reason>"',
|
|
17779
17838
|
" ```",
|
|
17780
17839
|
"8. **Never force-push in feedback mode.** If a `git pull --rebase`",
|
|
@@ -19376,22 +19435,22 @@ var prReviewerSubAgent = {
|
|
|
19376
19435
|
"Delegation** section. It evaluates the guards (auto-merge mode, the",
|
|
19377
19436
|
"delegation invocation guard, a free `review:fixing` lease, no",
|
|
19378
19437
|
"generated / projen / lockfile conflicts), classifies the conflicting",
|
|
19379
|
-
"files, and either delegates a
|
|
19380
|
-
"through to its own fallback. Invoke it with this entry
|
|
19381
|
-
"parameters:",
|
|
19438
|
+
"files, and either delegates a conflict resolution to `issue-worker`",
|
|
19439
|
+
"or falls through to its own fallback. Invoke it with this entry",
|
|
19440
|
+
"point's parameters:",
|
|
19382
19441
|
"",
|
|
19383
19442
|
"- **Entry point:** `already-conflicting`. There is no failed",
|
|
19384
19443
|
" `gh pr update-branch` to read conflicting paths from \u2014 identify",
|
|
19385
19444
|
" the conflicting files from the PR's merge state as documented in",
|
|
19386
|
-
" the shared procedure's entry-point step (a local
|
|
19445
|
+
" the shared procedure's entry-point step (a local merge attempt",
|
|
19387
19446
|
" whose `<<<<<<<` / `=======` / `>>>>>>>` markers name the",
|
|
19388
19447
|
" conflicting files). The guards and classification are identical to",
|
|
19389
19448
|
" the Phase 4 entry point.",
|
|
19390
|
-
"- **On the procedure returning `delegated`:** a
|
|
19391
|
-
" durably queued for `issue-worker` (the PR now carries",
|
|
19449
|
+
"- **On the procedure returning `delegated`:** a conflict resolution",
|
|
19450
|
+
" has been durably queued for `issue-worker` (the PR now carries",
|
|
19392
19451
|
" `review:needs-worker` and the `review:fixing` lease); stop this",
|
|
19393
19452
|
" pass. A top-level `issue-worker` session pulls the marker and",
|
|
19394
|
-
" pushes the
|
|
19453
|
+
" pushes the merged branch, then a follow-up reviewer pass confirms",
|
|
19395
19454
|
" the result and releases the lease \u2014 no human re-invocation is",
|
|
19396
19455
|
" required for the loop to complete.",
|
|
19397
19456
|
"- **On the procedure returning `skipped` (a guard denied delegation",
|
|
@@ -20350,13 +20409,13 @@ var prReviewerSubAgent = {
|
|
|
20350
20409
|
" with `gh pr view <pr-number> --json files`).",
|
|
20351
20410
|
"- **`already-conflicting`** \u2014 there is no failed `update-branch` to",
|
|
20352
20411
|
" read conflicting paths from. Identify the conflicting files from",
|
|
20353
|
-
" the PR's merge state instead: attempt a local
|
|
20354
|
-
" branch
|
|
20412
|
+
" the PR's merge state instead: attempt a local merge of the default",
|
|
20413
|
+
" branch into the head branch in a scratch checkout (or read the",
|
|
20355
20414
|
" conflicting paths git reports) and collect the files that carry",
|
|
20356
20415
|
" `<<<<<<<` / `=======` / `>>>>>>>` conflict markers. Use that set",
|
|
20357
20416
|
" as the conflicting-file list. The reviewer inspects these markers",
|
|
20358
20417
|
" read-only to classify; it does **not** stage, commit, or push any",
|
|
20359
|
-
" resolution \u2014 the actual
|
|
20418
|
+
" resolution \u2014 the actual merge-and-resolve is delegated to",
|
|
20360
20419
|
" `issue-worker` exactly as in the other entry point.",
|
|
20361
20420
|
"",
|
|
20362
20421
|
"### Guards",
|
|
@@ -20371,8 +20430,10 @@ var prReviewerSubAgent = {
|
|
|
20371
20430
|
" the human reviewer's consent. (Unlike the `update-branch` step,",
|
|
20372
20431
|
" which permits a size-only `human-required` carve-out, the",
|
|
20373
20432
|
" conflict-resolution delegation flow is auto-merge-only across",
|
|
20374
|
-
" the board: a worker
|
|
20375
|
-
"
|
|
20433
|
+
" the board: a worker's conflict-resolution merge reconciles both",
|
|
20434
|
+
" sides of each conflict into the branch, a stronger change to the",
|
|
20435
|
+
" reviewed diff than the clean merge-commit `gh pr update-branch`",
|
|
20436
|
+
" performs on a no-conflict branch.)",
|
|
20376
20437
|
"2. **Delegation invocation guard permits the hand-off** \u2014 the PR",
|
|
20377
20438
|
" carries the `origin:issue-worker` label, **or** the reviewer was",
|
|
20378
20439
|
" invoked with `--allow-human-author`. The same guard used for the",
|
|
@@ -20402,7 +20463,7 @@ var prReviewerSubAgent = {
|
|
|
20402
20463
|
"before composing the fix-list. The classification picks one of two",
|
|
20403
20464
|
"typed recipes \u2014 a precise `shared-index` resolver when every",
|
|
20404
20465
|
"conflict is a row-insert race on a registry / index / feature-matrix",
|
|
20405
|
-
"file, or the generic
|
|
20466
|
+
"file, or the generic conflict-resolution recipe in every other case.",
|
|
20406
20467
|
"",
|
|
20407
20468
|
"**Classification step.** For each conflicting path, decide whether",
|
|
20408
20469
|
"the file is `shared-index` or `generic` against these criteria (the",
|
|
@@ -20436,12 +20497,23 @@ var prReviewerSubAgent = {
|
|
|
20436
20497
|
' fix-list item with `comment_id: "synthetic:rebase-shared-index"`',
|
|
20437
20498
|
" carrying the explicit re-insert recipe (see step 3 below). The",
|
|
20438
20499
|
" worker mechanically re-inserts each row in declared sort order",
|
|
20439
|
-
" against the
|
|
20500
|
+
" against the merged file.",
|
|
20440
20501
|
"- **Any conflicting file is `generic`** \u2014 emit the existing generic",
|
|
20441
20502
|
' fix-list item with `comment_id: "synthetic:rebase-behind-main"`',
|
|
20442
20503
|
" (see step 3 below). The worker performs a hand-merge of the",
|
|
20443
20504
|
" conflict markers.",
|
|
20444
20505
|
"",
|
|
20506
|
+
"**Marker name vs. operation.** The two `comment_id` values retain",
|
|
20507
|
+
"their historical `rebase` spelling as a **stable cross-session",
|
|
20508
|
+
"identifier** \u2014 a fix-list posted by an older reviewer and consumed",
|
|
20509
|
+
"by a newer worker still matches. The operation they now select is a",
|
|
20510
|
+
"**merge** of the default branch into the PR branch, **not** a",
|
|
20511
|
+
"rebase: the PR branch is already pushed and diverged, so a rebase",
|
|
20512
|
+
"would rewrite its published history and force the worker into a",
|
|
20513
|
+
"`--force-with-lease` push that the never-force-push rule forbids. A",
|
|
20514
|
+
"merge commit is fast-forward-pushable with a plain `git push`, so",
|
|
20515
|
+
"the recipe stays publishable.",
|
|
20516
|
+
"",
|
|
20445
20517
|
"### Hand off to `issue-worker`",
|
|
20446
20518
|
"",
|
|
20447
20519
|
"Hand off to `issue-worker` with the chosen single synthetic",
|
|
@@ -20464,14 +20536,15 @@ var prReviewerSubAgent = {
|
|
|
20464
20536
|
" ```",
|
|
20465
20537
|
"",
|
|
20466
20538
|
"3. **Post a fix-list comment** containing exactly one synthetic item",
|
|
20467
|
-
" describing the
|
|
20468
|
-
" recipe
|
|
20539
|
+
" describing the conflict resolution. The `comment_id` field selects",
|
|
20540
|
+
" the typed recipe (both perform a **merge** of the default branch",
|
|
20541
|
+
" into the PR branch \u2014 see the marker-name note above):",
|
|
20469
20542
|
"",
|
|
20470
20543
|
" - `synthetic:rebase-behind-main` \u2014 generic conflict; the worker",
|
|
20471
20544
|
" resolves conflicting hunks by hand.",
|
|
20472
20545
|
" - `synthetic:rebase-shared-index` \u2014 every conflict is a pure",
|
|
20473
20546
|
" row-insert race on a shared-index file; the worker re-inserts",
|
|
20474
|
-
" each row in declared sort order against the
|
|
20547
|
+
" each row in declared sort order against the merged file.",
|
|
20475
20548
|
"",
|
|
20476
20549
|
" The next reviewer pass identifies the item by its `comment_id`.",
|
|
20477
20550
|
"",
|
|
@@ -20480,7 +20553,7 @@ var prReviewerSubAgent = {
|
|
|
20480
20553
|
" ```markdown",
|
|
20481
20554
|
" ## Reviewer: fix list for @issue-worker",
|
|
20482
20555
|
"",
|
|
20483
|
-
" - [ ] @reviewer \u2014
|
|
20556
|
+
" - [ ] @reviewer \u2014 merge origin/<default-branch> into the PR branch and resolve conflicts in: <space-separated list of conflicting files>",
|
|
20484
20557
|
"",
|
|
20485
20558
|
" ```json fix-list",
|
|
20486
20559
|
" {",
|
|
@@ -20488,7 +20561,7 @@ var prReviewerSubAgent = {
|
|
|
20488
20561
|
' "branch": "<head-ref-name>",',
|
|
20489
20562
|
' "generated_at": "<ISO-8601 timestamp>",',
|
|
20490
20563
|
' "items": [',
|
|
20491
|
-
' {"comment_id": "synthetic:rebase-behind-main", "author": "reviewer", "file": "<first-conflicting-file>", "instruction": "Branch is BEHIND default-branch with merge conflicts.
|
|
20564
|
+
' {"comment_id": "synthetic:rebase-behind-main", "author": "reviewer", "file": "<first-conflicting-file>", "instruction": "Branch is BEHIND default-branch with merge conflicts. Fetch and merge the default branch into the PR branch: `git fetch origin && git merge --no-edit origin/<default-branch>`. Resolve the conflicts in <conflicting-files> by reconciling both sides (`<<<<<<< HEAD` is this PR\'s change), `git add` each resolved file, then `git commit --no-edit` to complete the merge commit. Push the merged branch with a plain non-force `git push origin <branch>` \u2014 the merge commit is fast-forward-pushable, so no force-push is needed \u2014 and report success."}',
|
|
20492
20565
|
" ]",
|
|
20493
20566
|
" }",
|
|
20494
20567
|
" ```",
|
|
@@ -20501,7 +20574,7 @@ var prReviewerSubAgent = {
|
|
|
20501
20574
|
" ```markdown",
|
|
20502
20575
|
" ## Reviewer: fix list for @issue-worker",
|
|
20503
20576
|
"",
|
|
20504
|
-
" - [ ] @reviewer \u2014
|
|
20577
|
+
" - [ ] @reviewer \u2014 merge origin/<default-branch> into the PR branch and re-insert shared-index rows in: <space-separated list of conflicting files>",
|
|
20505
20578
|
"",
|
|
20506
20579
|
" ```json fix-list",
|
|
20507
20580
|
" {",
|
|
@@ -20509,7 +20582,7 @@ var prReviewerSubAgent = {
|
|
|
20509
20582
|
' "branch": "<head-ref-name>",',
|
|
20510
20583
|
' "generated_at": "<ISO-8601 timestamp>",',
|
|
20511
20584
|
' "items": [',
|
|
20512
|
-
' {"comment_id": "synthetic:rebase-shared-index", "author": "reviewer", "file": "<first-conflicting-file>", "instruction": "Branch is BEHIND default-branch with shared-index row-insert conflicts only. Apply this recipe: (1) Fetch and
|
|
20585
|
+
' {"comment_id": "synthetic:rebase-shared-index", "author": "reviewer", "file": "<first-conflicting-file>", "instruction": "Branch is BEHIND default-branch with shared-index row-insert conflicts only. Apply this recipe: (1) Fetch and merge the default branch into the PR branch: `git fetch origin && git merge --no-edit origin/<default-branch>`. (2) For each conflicting shared-index file: the conflict has this PR\'s row on the `<<<<<<< HEAD` side and the other PR\'s row on the `>>>>>>> origin/<default-branch>` side \u2014 extract this PR\'s row and re-insert that row in declared sort order alongside the other PR\'s row using the file\'s documented sort key (alphabetical on the first column by default) so both rows survive, remove the conflict markers, stage the file with `git add <path>`. (3) Run the commit-path verification for each row: `count=$(git show :<path> | grep -Fc <row-unique-marker>) && [ \\"$count\\" = \\"1\\" ] || exit 1`. (4) Complete the merge with `git commit --no-edit` and push with a plain non-force `git push origin <branch>` \u2014 the merge commit is fast-forward-pushable, so no force-push is needed. (5) If any conflict marker touches the frontmatter, table header row, `|---|---|` separator, or surrounding prose, abort with `git merge --abort` and emit `BLOCKED <reason>` \u2014 the precondition guards from the reviewer\'s classification step were violated."}',
|
|
20513
20586
|
" ]",
|
|
20514
20587
|
" }",
|
|
20515
20588
|
" ```",
|
|
@@ -20537,7 +20610,7 @@ var prReviewerSubAgent = {
|
|
|
20537
20610
|
" The worker runs in its own top-level session; a **subsequent**",
|
|
20538
20611
|
" reviewer pass detects the worker finished (PR carries",
|
|
20539
20612
|
" `review:fixing` but **not** `review:needs-worker`), reacts on the",
|
|
20540
|
-
" source comment, re-evaluates AC/CI against the
|
|
20613
|
+
" source comment, re-evaluates AC/CI against the merged branch,",
|
|
20541
20614
|
" re-enables auto-merge, and releases the `review:fixing` lease. See",
|
|
20542
20615
|
" the **Confirm pass** section below.",
|
|
20543
20616
|
"",
|
|
@@ -20556,7 +20629,7 @@ var prReviewerSubAgent = {
|
|
|
20556
20629
|
"and return `skipped` to the caller.",
|
|
20557
20630
|
"",
|
|
20558
20631
|
"```bash",
|
|
20559
|
-
"gh pr comment <pr-number> --body 'Branch is BEHIND <default-branch> with conflicts. <short reason delegation was skipped \u2014 e.g. human-required mode, generated-file conflicts, or in-flight review:fixing lease>. A human (or the next reviewer pass after
|
|
20632
|
+
"gh pr comment <pr-number> --body 'Branch is BEHIND <default-branch> with conflicts. <short reason delegation was skipped \u2014 e.g. human-required mode, generated-file conflicts, or in-flight review:fixing lease>. A human (or the next reviewer pass after the branch is updated) will need to resolve.'",
|
|
20560
20633
|
"```",
|
|
20561
20634
|
"",
|
|
20562
20635
|
"## Shared Procedure: Confirm a Completed Delegation",
|
|
@@ -20566,7 +20639,8 @@ var prReviewerSubAgent = {
|
|
|
20566
20639
|
"the fix-list, acquires the `review:fixing` lease, applies the durable",
|
|
20567
20640
|
"`review:needs-worker` marker, and exits returning `delegated`. A",
|
|
20568
20641
|
"**separate** top-level `issue-worker` session then discovers the",
|
|
20569
|
-
"marker, applies the fix-list (an editorial fix or a
|
|
20642
|
+
"marker, applies the fix-list (an editorial fix or a conflict-resolution",
|
|
20643
|
+
"merge), pushes,",
|
|
20570
20644
|
"writes a structured worker-report comment, and **clears**",
|
|
20571
20645
|
"`review:needs-worker` \u2014 leaving `review:fixing` in place for the",
|
|
20572
20646
|
"reviewer to release. The confirm pass below is how a later reviewer",
|
|
@@ -20605,12 +20679,12 @@ var prReviewerSubAgent = {
|
|
|
20605
20679
|
" used to perform.",
|
|
20606
20680
|
"2. **React on the source comments.** For each item:",
|
|
20607
20681
|
" - **`handled`** \u2014 react `rocket` on the original source comment",
|
|
20608
|
-
" (the fix-list comment for a synthetic
|
|
20609
|
-
" accepted change has landed.",
|
|
20682
|
+
" (the fix-list comment for a synthetic conflict-resolution item)",
|
|
20683
|
+
" to signal the accepted change has landed.",
|
|
20610
20684
|
" - **`failed`** \u2014 react `thinking_face` (`content=confused`) on the",
|
|
20611
20685
|
" source comment and post a reply citing the worker's failure",
|
|
20612
20686
|
" reason.",
|
|
20613
|
-
"3. **Re-evaluate AC/CI against the
|
|
20687
|
+
"3. **Re-evaluate AC/CI against the merged branch.** Re-run the Phase",
|
|
20614
20688
|
" 3 acceptance-criteria comparison and the **CI Verification** check",
|
|
20615
20689
|
" against the **updated** head SHA the worker pushed \u2014 do not reuse",
|
|
20616
20690
|
" any pre-delegation result.",
|
|
@@ -20737,8 +20811,9 @@ var prReviewerSubAgent = {
|
|
|
20737
20811
|
"been applied in this pass. `delegated` is never a terminal",
|
|
20738
20812
|
"completion: the loop closes only when a top-level worker consumes the",
|
|
20739
20813
|
"marker and a later reviewer confirm pass releases the lease. Likewise",
|
|
20740
|
-
"`Branch updated: delegated (PR #<n>)` records that a
|
|
20741
|
-
"queued for the worker, not that the branch is already
|
|
20814
|
+
"`Branch updated: delegated (PR #<n>)` records that a conflict",
|
|
20815
|
+
"resolution was queued for the worker, not that the branch is already",
|
|
20816
|
+
"current.",
|
|
20742
20817
|
"",
|
|
20743
20818
|
"---",
|
|
20744
20819
|
"",
|
|
@@ -20821,11 +20896,13 @@ var prReviewerSubAgent = {
|
|
|
20821
20896
|
" issue type) continue to block `update-branch`: pushing main into",
|
|
20822
20897
|
" those PRs expands the diff under review without the human",
|
|
20823
20898
|
" reviewer's consent. The same restriction applies to delegating",
|
|
20824
|
-
" conflict resolution to `issue-worker`: never delegate a
|
|
20825
|
-
" on a `human-required` PR regardless of
|
|
20826
|
-
" typed-recipe delegation flow stays
|
|
20827
|
-
"
|
|
20828
|
-
"
|
|
20899
|
+
" conflict resolution to `issue-worker`: never delegate a",
|
|
20900
|
+
" conflict resolution on a `human-required` PR regardless of",
|
|
20901
|
+
" `matched_rule` \u2014 the typed-recipe delegation flow stays",
|
|
20902
|
+
" auto-merge-only because a worker's merge injects reconciled",
|
|
20903
|
+
" content into a human-required branch, expanding the reviewed",
|
|
20904
|
+
" diff more than the clean merge-commit `gh pr update-branch`",
|
|
20905
|
+
" performs.",
|
|
20829
20906
|
"16. **Never delegate conflict resolution involving generated or",
|
|
20830
20907
|
" projen-managed files.** When `gh pr update-branch` fails on a",
|
|
20831
20908
|
" BEHIND PR with conflicts and any conflicting path is a lockfile,",
|