@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.mjs
CHANGED
|
@@ -4285,7 +4285,17 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
4285
4285
|
" `status:ready`.",
|
|
4286
4286
|
"- **Automated flag** \u2192 add `status:needs-attention` (do not remove existing",
|
|
4287
4287
|
" status). Never auto-reset a `status:needs-attention` issue back to ready;",
|
|
4288
|
-
" a human must decide.",
|
|
4288
|
+
" a human must decide. The flag is **additive**: apply it with `--add-label`",
|
|
4289
|
+
" alone \u2014 never pair it with a `--remove-label` that strips the base",
|
|
4290
|
+
" `status:*` label. A flag that swaps out the base status (e.g. scope-gate",
|
|
4291
|
+
" or worker-failure paths removing `status:ready` / `status:in-progress`)",
|
|
4292
|
+
" leaves the issue with no base status \u2014 invisible to every status-driven",
|
|
4293
|
+
" query and to the queue, and unrecoverable once the flag is cleared.",
|
|
4294
|
+
"- **Automated-flag clear** \u2192 when `status:needs-attention` is cleared, if the",
|
|
4295
|
+
" issue carries no base `status:*` label (a legacy issue flagged before the",
|
|
4296
|
+
" additive-flag rule, whose base status was stripped at flag time), restore",
|
|
4297
|
+
" `status:ready` \u2014 or `status:blocked` if the body still declares an open",
|
|
4298
|
+
" `Depends on:` dependency \u2014 in the same edit so it re-enters the workflow.",
|
|
4289
4299
|
"- **PR CI failure** \u2192 add `status:needs-attention` to the associated PR (and",
|
|
4290
4300
|
" its linked issue) when CI fails in a **permanent** state \u2014 i.e. the failure",
|
|
4291
4301
|
" persists after a rerun, or the failure is clearly not a flake (compile",
|
|
@@ -14079,8 +14089,19 @@ function renderScopeGateSection(gate, excludeBundles = []) {
|
|
|
14079
14089
|
"",
|
|
14080
14090
|
"When the classifier returns `large`:",
|
|
14081
14091
|
"",
|
|
14082
|
-
"1.
|
|
14083
|
-
" `
|
|
14092
|
+
"1. **Add** the `status:needs-attention` label to the issue with",
|
|
14093
|
+
" `--add-label` alone. Leave the existing base `status:*` label",
|
|
14094
|
+
" (`status:ready`) in place \u2014 `status:needs-attention` is",
|
|
14095
|
+
" **additive**, so a flagged issue reads `status:ready` +",
|
|
14096
|
+
" `status:needs-attention`. Do **not** remove the base status:",
|
|
14097
|
+
" stripping it leaves the issue with no base `status:*` label,",
|
|
14098
|
+
" invisible to every status-driven query and to the queue itself,",
|
|
14099
|
+
" and a later flag-clear can never restore dispatchability. The",
|
|
14100
|
+
" `status:needs-attention` label already keeps the issue out of",
|
|
14101
|
+
" the dispatch queue, so the base label safely stays:",
|
|
14102
|
+
" ```bash",
|
|
14103
|
+
' gh issue edit <number> --add-label "status:needs-attention"',
|
|
14104
|
+
" ```",
|
|
14084
14105
|
"2. Post the decomposition-proposal comment (see template below),",
|
|
14085
14106
|
" with `<AC_COUNT>` / `<SOURCES_COUNT>` substituted from the",
|
|
14086
14107
|
" classification and `<AC_LIMIT>` / `<SOURCES_LIMIT>` set to",
|
|
@@ -14101,7 +14122,12 @@ function renderScopeGateSection(gate, excludeBundles = []) {
|
|
|
14101
14122
|
"4. **Auto-file is OFF.** Stop after posting the comment. A human",
|
|
14102
14123
|
" reviews the proposal, files the phased sub-issues manually,",
|
|
14103
14124
|
" and clears `status:needs-attention` when the decomposition",
|
|
14104
|
-
" is in place."
|
|
14125
|
+
" is in place. When clearing the flag, if the issue carries **no**",
|
|
14126
|
+
" base `status:*` label \u2014 a legacy issue flagged before the",
|
|
14127
|
+
" additive-flag fix, whose base status was stripped at flag time \u2014",
|
|
14128
|
+
" also add `status:ready` (or `status:blocked` when the body still",
|
|
14129
|
+
" declares an open `Depends on:` dependency) in the same edit so",
|
|
14130
|
+
" the issue re-enters the queue instead of going invisible."
|
|
14105
14131
|
);
|
|
14106
14132
|
}
|
|
14107
14133
|
const overrideEntries = Object.entries(gate.bundleOverrides).filter(
|
|
@@ -16466,7 +16492,7 @@ var orchestratorSubAgent = {
|
|
|
16466
16492
|
"### Step 3 \u2014 failure semantics",
|
|
16467
16493
|
"",
|
|
16468
16494
|
"A single PR's worker failure (missing or malformed `WORKER_*` final",
|
|
16469
|
-
"line, sub-agent error, unresolvable
|
|
16495
|
+
"line, sub-agent error, unresolvable merge conflict) **never stops",
|
|
16470
16496
|
"the drain**. Log the failure as",
|
|
16471
16497
|
"`WORKER_FAILED pr:#<n> reason:<observed>` and continue to the next",
|
|
16472
16498
|
"`PR_DRAIN` line. The next orchestrator invocation re-runs",
|
|
@@ -16656,9 +16682,16 @@ var orchestratorSubAgent = {
|
|
|
16656
16682
|
"",
|
|
16657
16683
|
"If the scope is `large`, **do not dispatch**. Instead:",
|
|
16658
16684
|
"",
|
|
16659
|
-
"1.
|
|
16685
|
+
"1. **Add** `status:needs-attention` with `--add-label` alone \u2014",
|
|
16686
|
+
" leave the base `status:*` label (`status:ready`) in place.",
|
|
16687
|
+
" `status:needs-attention` is **additive**; pairing it with a",
|
|
16688
|
+
' `--remove-label "status:ready"` strips the base status and',
|
|
16689
|
+
" leaves the issue with no `status:*` label at all, invisible to",
|
|
16690
|
+
" the queue and unrecoverable when the flag is later cleared. The",
|
|
16691
|
+
" `status:needs-attention` label already keeps the issue out of",
|
|
16692
|
+
" dispatch, so the base label stays:",
|
|
16660
16693
|
" ```bash",
|
|
16661
|
-
' gh issue edit <number> --
|
|
16694
|
+
' gh issue edit <number> --add-label "status:needs-attention"',
|
|
16662
16695
|
" ```",
|
|
16663
16696
|
"2. Post the decomposition-proposal comment (see the **Scope gate**",
|
|
16664
16697
|
" section in `CLAUDE.md` for the template). Substitute the",
|
|
@@ -16756,7 +16789,9 @@ var orchestratorSubAgent = {
|
|
|
16756
16789
|
"5. **Priority order:** critical > high > medium > low > trivial, then **funnel tier asc** (lower tier wins ties), then FIFO by issue number.",
|
|
16757
16790
|
"6. **Never dispatch a `large` issue.** Always run the scope check",
|
|
16758
16791
|
" on the top `PICK` line before reporting `NEXT_WORK_ITEM`. A",
|
|
16759
|
-
" `large` issue must be flagged
|
|
16792
|
+
" `large` issue must be flagged by **adding** `status:needs-attention`",
|
|
16793
|
+
" (additive \u2014 leave the base `status:*` label in place; never pair",
|
|
16794
|
+
" the flag with a `--remove-label` that strips the base status) and",
|
|
16760
16795
|
" handed a decomposition proposal \u2014 never claimed, never branched,",
|
|
16761
16796
|
" never delegated to the `issue-worker`.",
|
|
16762
16797
|
"7. **Sweep dependents whenever you apply `status:done`.** Every",
|
|
@@ -17074,43 +17109,55 @@ var issueWorkerSubAgent = {
|
|
|
17074
17109
|
" reviewer's signal that the PR's head branch is BEHIND the default",
|
|
17075
17110
|
" branch with merge conflicts that `gh pr update-branch` could not",
|
|
17076
17111
|
" resolve. For either item the work is **not** an editorial change",
|
|
17077
|
-
" \u2014 it is a
|
|
17078
|
-
" different recipes:",
|
|
17112
|
+
" \u2014 it is a merge of the default branch into the PR branch plus",
|
|
17113
|
+
" conflict resolution. The two ids select different recipes:",
|
|
17079
17114
|
"",
|
|
17080
17115
|
" - `synthetic:rebase-behind-main` \u2014 generic conflict. Resolve",
|
|
17081
17116
|
" each conflicting file by hand (read both sides, reconcile,",
|
|
17082
|
-
" stage), then `git
|
|
17083
|
-
"
|
|
17117
|
+
" stage), then `git commit --no-edit` to complete the merge",
|
|
17118
|
+
" commit.",
|
|
17084
17119
|
" - `synthetic:rebase-shared-index` \u2014 every conflicting file is a",
|
|
17085
17120
|
" row-insert race on a shared-index file (registry / index /",
|
|
17086
17121
|
" feature-matrix under a Starlight content root). Apply the",
|
|
17087
17122
|
" explicit re-insert recipe carried in the item's `instruction`",
|
|
17088
17123
|
" field \u2014 do **not** hand-merge.",
|
|
17089
17124
|
"",
|
|
17125
|
+
" **Marker name vs. operation.** The `comment_id` values keep their",
|
|
17126
|
+
" historical `rebase` spelling as a **stable identifier** the",
|
|
17127
|
+
" reviewer and worker agree on across sessions \u2014 the operation they",
|
|
17128
|
+
" select is a **merge** of the default branch into the PR branch,",
|
|
17129
|
+
" **not** a rebase. The PR branch is already pushed and diverged,",
|
|
17130
|
+
" so a rebase would rewrite its published history and require a",
|
|
17131
|
+
" `--force-with-lease` push that rule 8 forbids. A merge commit is",
|
|
17132
|
+
" fast-forward-pushable with a plain `git push`.",
|
|
17133
|
+
"",
|
|
17090
17134
|
" **For `synthetic:rebase-behind-main`.** Run the following",
|
|
17091
17135
|
" sequence:",
|
|
17092
17136
|
"",
|
|
17093
17137
|
" ```bash",
|
|
17094
17138
|
" git fetch origin",
|
|
17095
|
-
" git
|
|
17139
|
+
" git merge --no-edit origin/{{repository.defaultBranch}}",
|
|
17096
17140
|
" ```",
|
|
17097
17141
|
"",
|
|
17098
|
-
" When the
|
|
17099
|
-
" in turn (read both sides
|
|
17100
|
-
"
|
|
17101
|
-
"
|
|
17102
|
-
"
|
|
17103
|
-
"
|
|
17104
|
-
"
|
|
17105
|
-
"
|
|
17106
|
-
"
|
|
17107
|
-
"
|
|
17108
|
-
"",
|
|
17109
|
-
"
|
|
17110
|
-
"
|
|
17111
|
-
"
|
|
17112
|
-
"
|
|
17113
|
-
"
|
|
17142
|
+
" When the merge produces conflicts, resolve each conflicting file",
|
|
17143
|
+
" in turn (read both sides \u2014 `<<<<<<< HEAD` is this PR's change,",
|
|
17144
|
+
" `>>>>>>> origin/{{repository.defaultBranch}}` is the default",
|
|
17145
|
+
" branch's \u2014 reconcile, stage), then run `git commit --no-edit` to",
|
|
17146
|
+
" complete the merge commit. Do not run `git merge --abort` to give",
|
|
17147
|
+
" up casually \u2014 aborting drops the work the reviewer delegated.",
|
|
17148
|
+
" Abort **only** as the failure path: if you genuinely cannot",
|
|
17149
|
+
" resolve a conflict (the change is editorial enough that it",
|
|
17150
|
+
" requires human judgement, or the conflict touches a generated",
|
|
17151
|
+
" file you should not hand-edit), record the item as `failed` with",
|
|
17152
|
+
" a clear reason, run `git merge --abort`, and proceed to the",
|
|
17153
|
+
" report step. Do not force-push.",
|
|
17154
|
+
"",
|
|
17155
|
+
" When the merge completes cleanly, treat the merge commit itself",
|
|
17156
|
+
" as the deliverable. Skip the conventional commit step in Phase 6",
|
|
17157
|
+
" for this item \u2014 the merge already produced the commit. Push with",
|
|
17158
|
+
" a regular non-force `git push origin <branch>` (the merge commit",
|
|
17159
|
+
" is fast-forward-pushable, so no force-push is needed) and report",
|
|
17160
|
+
" the merged head SHA as the worker's commit.",
|
|
17114
17161
|
"",
|
|
17115
17162
|
" **For `synthetic:rebase-shared-index`.** Apply the typed",
|
|
17116
17163
|
" re-insert recipe step-by-step. Read the recipe verbatim from the",
|
|
@@ -17118,11 +17165,11 @@ var issueWorkerSubAgent = {
|
|
|
17118
17165
|
" contract the reviewer encodes and the precondition guards you",
|
|
17119
17166
|
" must enforce:",
|
|
17120
17167
|
"",
|
|
17121
|
-
" 1. **
|
|
17168
|
+
" 1. **Fetch and merge** the default branch into the PR branch:",
|
|
17122
17169
|
"",
|
|
17123
17170
|
" ```bash",
|
|
17124
17171
|
" git fetch origin",
|
|
17125
|
-
" git
|
|
17172
|
+
" git merge --no-edit origin/{{repository.defaultBranch}}",
|
|
17126
17173
|
" ```",
|
|
17127
17174
|
"",
|
|
17128
17175
|
" 2. **For each conflicting file**, inspect the conflict markers",
|
|
@@ -17139,18 +17186,20 @@ var issueWorkerSubAgent = {
|
|
|
17139
17186
|
" the frontmatter (lines between the opening / closing `---`",
|
|
17140
17187
|
" fences), the page H1, surrounding prose paragraphs, the",
|
|
17141
17188
|
" table header row, or the separator row, **stop**, run",
|
|
17142
|
-
" `git
|
|
17189
|
+
" `git merge --abort`, and record the item as `failed` with",
|
|
17143
17190
|
" the structured marker `BLOCKED <reason>` (e.g.",
|
|
17144
17191
|
" `BLOCKED conflict touches table header in <path>`). Do not",
|
|
17145
17192
|
" hand-merge \u2014 the typed recipe applies only to pure",
|
|
17146
17193
|
" row-insert races.",
|
|
17147
17194
|
"",
|
|
17148
|
-
" When the guards pass,
|
|
17149
|
-
"
|
|
17150
|
-
"
|
|
17151
|
-
"
|
|
17152
|
-
"
|
|
17153
|
-
"
|
|
17195
|
+
" When the guards pass, resolve the conflict in place: the",
|
|
17196
|
+
" `<<<<<<< HEAD` side carries this PR's row and the",
|
|
17197
|
+
" `>>>>>>> origin/{{repository.defaultBranch}}` side carries",
|
|
17198
|
+
" the other PR's row. Extract this PR's row and re-insert",
|
|
17199
|
+
" that row in declared sort order alongside the other PR's row",
|
|
17200
|
+
" using the file's documented sort key (alphabetical on the",
|
|
17201
|
+
" first column by default) so both rows survive, remove the",
|
|
17202
|
+
" conflict markers, and stage the file:",
|
|
17154
17203
|
"",
|
|
17155
17204
|
" ```bash",
|
|
17156
17205
|
" git add <path>",
|
|
@@ -17166,16 +17215,17 @@ var issueWorkerSubAgent = {
|
|
|
17166
17215
|
' [ "$count" = "1" ] || { echo "BLOCKED verification failed for <path>"; exit 1; }',
|
|
17167
17216
|
" ```",
|
|
17168
17217
|
"",
|
|
17169
|
-
" 4. **
|
|
17170
|
-
" every file is staged and verified
|
|
17218
|
+
" 4. **Complete the merge and push** with a plain non-force push",
|
|
17219
|
+
" once every file is staged and verified (the merge commit is",
|
|
17220
|
+
" fast-forward-pushable, so no force-push is needed):",
|
|
17171
17221
|
"",
|
|
17172
17222
|
" ```bash",
|
|
17173
|
-
" git
|
|
17223
|
+
" git commit --no-edit",
|
|
17174
17224
|
" git push origin <branch>",
|
|
17175
17225
|
" ```",
|
|
17176
17226
|
"",
|
|
17177
17227
|
" On any `BLOCKED` precondition failure, exit non-zero with the",
|
|
17178
|
-
" `BLOCKED <reason>` line, run `git
|
|
17228
|
+
" `BLOCKED <reason>` line, run `git merge --abort`, record the",
|
|
17179
17229
|
" item as `failed`, and proceed to the report step. The reviewer",
|
|
17180
17230
|
" will see the `failed` outcome on the next pass and fall through",
|
|
17181
17231
|
" to the human-required hand-off via `review:awaiting-human`. Do",
|
|
@@ -17242,20 +17292,21 @@ var issueWorkerSubAgent = {
|
|
|
17242
17292
|
"git push origin <branch-name>",
|
|
17243
17293
|
"```",
|
|
17244
17294
|
"",
|
|
17245
|
-
"**Synthetic
|
|
17295
|
+
"**Synthetic rebase items skip the `fix(review)` commit.** When the",
|
|
17246
17296
|
"fix-list contained a `comment_id` of `synthetic:rebase-behind-main`",
|
|
17247
|
-
"or `synthetic:rebase-shared-index` and you completed the
|
|
17248
|
-
"Phase 4, the
|
|
17249
|
-
"
|
|
17250
|
-
"commit
|
|
17251
|
-
|
|
17297
|
+
"or `synthetic:rebase-shared-index` and you completed the merge in",
|
|
17298
|
+
"Phase 4, the merge commit is itself the deliverable \u2014 there is no",
|
|
17299
|
+
"per-item editorial change to wrap in a `fix(review)` commit. The",
|
|
17300
|
+
"merge commit already exists from Phase 4, so skip the `git add` /",
|
|
17301
|
+
'`git commit -m "fix(review)..."` / `git pull --rebase` editorial',
|
|
17302
|
+
"steps for that item and push the merged branch directly:",
|
|
17252
17303
|
"",
|
|
17253
17304
|
"```bash",
|
|
17254
17305
|
"git push origin <branch-name>",
|
|
17255
17306
|
"```",
|
|
17256
17307
|
"",
|
|
17257
|
-
"If the fix-list mixed a synthetic
|
|
17258
|
-
"perform the editorial commit first (the
|
|
17308
|
+
"If the fix-list mixed a synthetic rebase item with editorial items,",
|
|
17309
|
+
"perform the editorial commit first (the merge already preceded it",
|
|
17259
17310
|
"in Phase 4), then push once at the end.",
|
|
17260
17311
|
"",
|
|
17261
17312
|
"**Normal mode:** Use conventional commit messages and push with `-u`",
|
|
@@ -17284,8 +17335,8 @@ var issueWorkerSubAgent = {
|
|
|
17284
17335
|
"",
|
|
17285
17336
|
"**This is the FIRST action after a successful push** \u2014 before any",
|
|
17286
17337
|
"summary, log line, or secondary step. Call the deterministic procedure",
|
|
17287
|
-
"with the PR number, the commit SHA you pushed (or the
|
|
17288
|
-
"for a synthetic
|
|
17338
|
+
"with the PR number, the commit SHA you pushed (or the merged head SHA",
|
|
17339
|
+
"for a synthetic rebase item), and the per-item outcomes JSON array:",
|
|
17289
17340
|
"",
|
|
17290
17341
|
"```bash",
|
|
17291
17342
|
".claude/procedures/complete-feedback-handoff.sh <pr-number> <commit-sha> '<items-json>'",
|
|
@@ -17424,9 +17475,17 @@ var issueWorkerSubAgent = {
|
|
|
17424
17475
|
" downstream agents (notably the `pr-reviewer`) can identify",
|
|
17425
17476
|
" bot-authored PRs. Pass `--label 'origin:issue-worker'` on every",
|
|
17426
17477
|
" `gh pr create` call.",
|
|
17427
|
-
"7. **On failure:** If you cannot complete the issue
|
|
17478
|
+
"7. **On failure:** If you cannot complete the issue (including a",
|
|
17479
|
+
" wrong-agent / routing mismatch), flag it for human triage and",
|
|
17480
|
+
" leave a comment. **Add** `status:needs-attention` with",
|
|
17481
|
+
" `--add-label` alone \u2014 do **not** remove the base",
|
|
17482
|
+
" `status:in-progress` label. `status:needs-attention` is",
|
|
17483
|
+
" additive, so the flagged issue reads `status:in-progress` +",
|
|
17484
|
+
" `status:needs-attention` and keeps a base status a human can act",
|
|
17485
|
+
" on; stripping it leaves the issue with no base `status:*` label,",
|
|
17486
|
+
" invisible to every status-driven query:",
|
|
17428
17487
|
" ```bash",
|
|
17429
|
-
' gh issue edit <number> --
|
|
17488
|
+
' gh issue edit <number> --add-label "status:needs-attention"',
|
|
17430
17489
|
' gh issue comment <number> --body "Worker could not complete: <reason>"',
|
|
17431
17490
|
" ```",
|
|
17432
17491
|
"8. **Never force-push in feedback mode.** If a `git pull --rebase`",
|
|
@@ -19028,22 +19087,22 @@ var prReviewerSubAgent = {
|
|
|
19028
19087
|
"Delegation** section. It evaluates the guards (auto-merge mode, the",
|
|
19029
19088
|
"delegation invocation guard, a free `review:fixing` lease, no",
|
|
19030
19089
|
"generated / projen / lockfile conflicts), classifies the conflicting",
|
|
19031
|
-
"files, and either delegates a
|
|
19032
|
-
"through to its own fallback. Invoke it with this entry
|
|
19033
|
-
"parameters:",
|
|
19090
|
+
"files, and either delegates a conflict resolution to `issue-worker`",
|
|
19091
|
+
"or falls through to its own fallback. Invoke it with this entry",
|
|
19092
|
+
"point's parameters:",
|
|
19034
19093
|
"",
|
|
19035
19094
|
"- **Entry point:** `already-conflicting`. There is no failed",
|
|
19036
19095
|
" `gh pr update-branch` to read conflicting paths from \u2014 identify",
|
|
19037
19096
|
" the conflicting files from the PR's merge state as documented in",
|
|
19038
|
-
" the shared procedure's entry-point step (a local
|
|
19097
|
+
" the shared procedure's entry-point step (a local merge attempt",
|
|
19039
19098
|
" whose `<<<<<<<` / `=======` / `>>>>>>>` markers name the",
|
|
19040
19099
|
" conflicting files). The guards and classification are identical to",
|
|
19041
19100
|
" the Phase 4 entry point.",
|
|
19042
|
-
"- **On the procedure returning `delegated`:** a
|
|
19043
|
-
" durably queued for `issue-worker` (the PR now carries",
|
|
19101
|
+
"- **On the procedure returning `delegated`:** a conflict resolution",
|
|
19102
|
+
" has been durably queued for `issue-worker` (the PR now carries",
|
|
19044
19103
|
" `review:needs-worker` and the `review:fixing` lease); stop this",
|
|
19045
19104
|
" pass. A top-level `issue-worker` session pulls the marker and",
|
|
19046
|
-
" pushes the
|
|
19105
|
+
" pushes the merged branch, then a follow-up reviewer pass confirms",
|
|
19047
19106
|
" the result and releases the lease \u2014 no human re-invocation is",
|
|
19048
19107
|
" required for the loop to complete.",
|
|
19049
19108
|
"- **On the procedure returning `skipped` (a guard denied delegation",
|
|
@@ -20002,13 +20061,13 @@ var prReviewerSubAgent = {
|
|
|
20002
20061
|
" with `gh pr view <pr-number> --json files`).",
|
|
20003
20062
|
"- **`already-conflicting`** \u2014 there is no failed `update-branch` to",
|
|
20004
20063
|
" read conflicting paths from. Identify the conflicting files from",
|
|
20005
|
-
" the PR's merge state instead: attempt a local
|
|
20006
|
-
" branch
|
|
20064
|
+
" the PR's merge state instead: attempt a local merge of the default",
|
|
20065
|
+
" branch into the head branch in a scratch checkout (or read the",
|
|
20007
20066
|
" conflicting paths git reports) and collect the files that carry",
|
|
20008
20067
|
" `<<<<<<<` / `=======` / `>>>>>>>` conflict markers. Use that set",
|
|
20009
20068
|
" as the conflicting-file list. The reviewer inspects these markers",
|
|
20010
20069
|
" read-only to classify; it does **not** stage, commit, or push any",
|
|
20011
|
-
" resolution \u2014 the actual
|
|
20070
|
+
" resolution \u2014 the actual merge-and-resolve is delegated to",
|
|
20012
20071
|
" `issue-worker` exactly as in the other entry point.",
|
|
20013
20072
|
"",
|
|
20014
20073
|
"### Guards",
|
|
@@ -20023,8 +20082,10 @@ var prReviewerSubAgent = {
|
|
|
20023
20082
|
" the human reviewer's consent. (Unlike the `update-branch` step,",
|
|
20024
20083
|
" which permits a size-only `human-required` carve-out, the",
|
|
20025
20084
|
" conflict-resolution delegation flow is auto-merge-only across",
|
|
20026
|
-
" the board: a worker
|
|
20027
|
-
"
|
|
20085
|
+
" the board: a worker's conflict-resolution merge reconciles both",
|
|
20086
|
+
" sides of each conflict into the branch, a stronger change to the",
|
|
20087
|
+
" reviewed diff than the clean merge-commit `gh pr update-branch`",
|
|
20088
|
+
" performs on a no-conflict branch.)",
|
|
20028
20089
|
"2. **Delegation invocation guard permits the hand-off** \u2014 the PR",
|
|
20029
20090
|
" carries the `origin:issue-worker` label, **or** the reviewer was",
|
|
20030
20091
|
" invoked with `--allow-human-author`. The same guard used for the",
|
|
@@ -20054,7 +20115,7 @@ var prReviewerSubAgent = {
|
|
|
20054
20115
|
"before composing the fix-list. The classification picks one of two",
|
|
20055
20116
|
"typed recipes \u2014 a precise `shared-index` resolver when every",
|
|
20056
20117
|
"conflict is a row-insert race on a registry / index / feature-matrix",
|
|
20057
|
-
"file, or the generic
|
|
20118
|
+
"file, or the generic conflict-resolution recipe in every other case.",
|
|
20058
20119
|
"",
|
|
20059
20120
|
"**Classification step.** For each conflicting path, decide whether",
|
|
20060
20121
|
"the file is `shared-index` or `generic` against these criteria (the",
|
|
@@ -20088,12 +20149,23 @@ var prReviewerSubAgent = {
|
|
|
20088
20149
|
' fix-list item with `comment_id: "synthetic:rebase-shared-index"`',
|
|
20089
20150
|
" carrying the explicit re-insert recipe (see step 3 below). The",
|
|
20090
20151
|
" worker mechanically re-inserts each row in declared sort order",
|
|
20091
|
-
" against the
|
|
20152
|
+
" against the merged file.",
|
|
20092
20153
|
"- **Any conflicting file is `generic`** \u2014 emit the existing generic",
|
|
20093
20154
|
' fix-list item with `comment_id: "synthetic:rebase-behind-main"`',
|
|
20094
20155
|
" (see step 3 below). The worker performs a hand-merge of the",
|
|
20095
20156
|
" conflict markers.",
|
|
20096
20157
|
"",
|
|
20158
|
+
"**Marker name vs. operation.** The two `comment_id` values retain",
|
|
20159
|
+
"their historical `rebase` spelling as a **stable cross-session",
|
|
20160
|
+
"identifier** \u2014 a fix-list posted by an older reviewer and consumed",
|
|
20161
|
+
"by a newer worker still matches. The operation they now select is a",
|
|
20162
|
+
"**merge** of the default branch into the PR branch, **not** a",
|
|
20163
|
+
"rebase: the PR branch is already pushed and diverged, so a rebase",
|
|
20164
|
+
"would rewrite its published history and force the worker into a",
|
|
20165
|
+
"`--force-with-lease` push that the never-force-push rule forbids. A",
|
|
20166
|
+
"merge commit is fast-forward-pushable with a plain `git push`, so",
|
|
20167
|
+
"the recipe stays publishable.",
|
|
20168
|
+
"",
|
|
20097
20169
|
"### Hand off to `issue-worker`",
|
|
20098
20170
|
"",
|
|
20099
20171
|
"Hand off to `issue-worker` with the chosen single synthetic",
|
|
@@ -20116,14 +20188,15 @@ var prReviewerSubAgent = {
|
|
|
20116
20188
|
" ```",
|
|
20117
20189
|
"",
|
|
20118
20190
|
"3. **Post a fix-list comment** containing exactly one synthetic item",
|
|
20119
|
-
" describing the
|
|
20120
|
-
" recipe
|
|
20191
|
+
" describing the conflict resolution. The `comment_id` field selects",
|
|
20192
|
+
" the typed recipe (both perform a **merge** of the default branch",
|
|
20193
|
+
" into the PR branch \u2014 see the marker-name note above):",
|
|
20121
20194
|
"",
|
|
20122
20195
|
" - `synthetic:rebase-behind-main` \u2014 generic conflict; the worker",
|
|
20123
20196
|
" resolves conflicting hunks by hand.",
|
|
20124
20197
|
" - `synthetic:rebase-shared-index` \u2014 every conflict is a pure",
|
|
20125
20198
|
" row-insert race on a shared-index file; the worker re-inserts",
|
|
20126
|
-
" each row in declared sort order against the
|
|
20199
|
+
" each row in declared sort order against the merged file.",
|
|
20127
20200
|
"",
|
|
20128
20201
|
" The next reviewer pass identifies the item by its `comment_id`.",
|
|
20129
20202
|
"",
|
|
@@ -20132,7 +20205,7 @@ var prReviewerSubAgent = {
|
|
|
20132
20205
|
" ```markdown",
|
|
20133
20206
|
" ## Reviewer: fix list for @issue-worker",
|
|
20134
20207
|
"",
|
|
20135
|
-
" - [ ] @reviewer \u2014
|
|
20208
|
+
" - [ ] @reviewer \u2014 merge origin/<default-branch> into the PR branch and resolve conflicts in: <space-separated list of conflicting files>",
|
|
20136
20209
|
"",
|
|
20137
20210
|
" ```json fix-list",
|
|
20138
20211
|
" {",
|
|
@@ -20140,7 +20213,7 @@ var prReviewerSubAgent = {
|
|
|
20140
20213
|
' "branch": "<head-ref-name>",',
|
|
20141
20214
|
' "generated_at": "<ISO-8601 timestamp>",',
|
|
20142
20215
|
' "items": [',
|
|
20143
|
-
' {"comment_id": "synthetic:rebase-behind-main", "author": "reviewer", "file": "<first-conflicting-file>", "instruction": "Branch is BEHIND default-branch with merge conflicts.
|
|
20216
|
+
' {"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."}',
|
|
20144
20217
|
" ]",
|
|
20145
20218
|
" }",
|
|
20146
20219
|
" ```",
|
|
@@ -20153,7 +20226,7 @@ var prReviewerSubAgent = {
|
|
|
20153
20226
|
" ```markdown",
|
|
20154
20227
|
" ## Reviewer: fix list for @issue-worker",
|
|
20155
20228
|
"",
|
|
20156
|
-
" - [ ] @reviewer \u2014
|
|
20229
|
+
" - [ ] @reviewer \u2014 merge origin/<default-branch> into the PR branch and re-insert shared-index rows in: <space-separated list of conflicting files>",
|
|
20157
20230
|
"",
|
|
20158
20231
|
" ```json fix-list",
|
|
20159
20232
|
" {",
|
|
@@ -20161,7 +20234,7 @@ var prReviewerSubAgent = {
|
|
|
20161
20234
|
' "branch": "<head-ref-name>",',
|
|
20162
20235
|
' "generated_at": "<ISO-8601 timestamp>",',
|
|
20163
20236
|
' "items": [',
|
|
20164
|
-
' {"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
|
|
20237
|
+
' {"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."}',
|
|
20165
20238
|
" ]",
|
|
20166
20239
|
" }",
|
|
20167
20240
|
" ```",
|
|
@@ -20189,7 +20262,7 @@ var prReviewerSubAgent = {
|
|
|
20189
20262
|
" The worker runs in its own top-level session; a **subsequent**",
|
|
20190
20263
|
" reviewer pass detects the worker finished (PR carries",
|
|
20191
20264
|
" `review:fixing` but **not** `review:needs-worker`), reacts on the",
|
|
20192
|
-
" source comment, re-evaluates AC/CI against the
|
|
20265
|
+
" source comment, re-evaluates AC/CI against the merged branch,",
|
|
20193
20266
|
" re-enables auto-merge, and releases the `review:fixing` lease. See",
|
|
20194
20267
|
" the **Confirm pass** section below.",
|
|
20195
20268
|
"",
|
|
@@ -20208,7 +20281,7 @@ var prReviewerSubAgent = {
|
|
|
20208
20281
|
"and return `skipped` to the caller.",
|
|
20209
20282
|
"",
|
|
20210
20283
|
"```bash",
|
|
20211
|
-
"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
|
|
20284
|
+
"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.'",
|
|
20212
20285
|
"```",
|
|
20213
20286
|
"",
|
|
20214
20287
|
"## Shared Procedure: Confirm a Completed Delegation",
|
|
@@ -20218,7 +20291,8 @@ var prReviewerSubAgent = {
|
|
|
20218
20291
|
"the fix-list, acquires the `review:fixing` lease, applies the durable",
|
|
20219
20292
|
"`review:needs-worker` marker, and exits returning `delegated`. A",
|
|
20220
20293
|
"**separate** top-level `issue-worker` session then discovers the",
|
|
20221
|
-
"marker, applies the fix-list (an editorial fix or a
|
|
20294
|
+
"marker, applies the fix-list (an editorial fix or a conflict-resolution",
|
|
20295
|
+
"merge), pushes,",
|
|
20222
20296
|
"writes a structured worker-report comment, and **clears**",
|
|
20223
20297
|
"`review:needs-worker` \u2014 leaving `review:fixing` in place for the",
|
|
20224
20298
|
"reviewer to release. The confirm pass below is how a later reviewer",
|
|
@@ -20257,12 +20331,12 @@ var prReviewerSubAgent = {
|
|
|
20257
20331
|
" used to perform.",
|
|
20258
20332
|
"2. **React on the source comments.** For each item:",
|
|
20259
20333
|
" - **`handled`** \u2014 react `rocket` on the original source comment",
|
|
20260
|
-
" (the fix-list comment for a synthetic
|
|
20261
|
-
" accepted change has landed.",
|
|
20334
|
+
" (the fix-list comment for a synthetic conflict-resolution item)",
|
|
20335
|
+
" to signal the accepted change has landed.",
|
|
20262
20336
|
" - **`failed`** \u2014 react `thinking_face` (`content=confused`) on the",
|
|
20263
20337
|
" source comment and post a reply citing the worker's failure",
|
|
20264
20338
|
" reason.",
|
|
20265
|
-
"3. **Re-evaluate AC/CI against the
|
|
20339
|
+
"3. **Re-evaluate AC/CI against the merged branch.** Re-run the Phase",
|
|
20266
20340
|
" 3 acceptance-criteria comparison and the **CI Verification** check",
|
|
20267
20341
|
" against the **updated** head SHA the worker pushed \u2014 do not reuse",
|
|
20268
20342
|
" any pre-delegation result.",
|
|
@@ -20389,8 +20463,9 @@ var prReviewerSubAgent = {
|
|
|
20389
20463
|
"been applied in this pass. `delegated` is never a terminal",
|
|
20390
20464
|
"completion: the loop closes only when a top-level worker consumes the",
|
|
20391
20465
|
"marker and a later reviewer confirm pass releases the lease. Likewise",
|
|
20392
|
-
"`Branch updated: delegated (PR #<n>)` records that a
|
|
20393
|
-
"queued for the worker, not that the branch is already
|
|
20466
|
+
"`Branch updated: delegated (PR #<n>)` records that a conflict",
|
|
20467
|
+
"resolution was queued for the worker, not that the branch is already",
|
|
20468
|
+
"current.",
|
|
20394
20469
|
"",
|
|
20395
20470
|
"---",
|
|
20396
20471
|
"",
|
|
@@ -20473,11 +20548,13 @@ var prReviewerSubAgent = {
|
|
|
20473
20548
|
" issue type) continue to block `update-branch`: pushing main into",
|
|
20474
20549
|
" those PRs expands the diff under review without the human",
|
|
20475
20550
|
" reviewer's consent. The same restriction applies to delegating",
|
|
20476
|
-
" conflict resolution to `issue-worker`: never delegate a
|
|
20477
|
-
" on a `human-required` PR regardless of
|
|
20478
|
-
" typed-recipe delegation flow stays
|
|
20479
|
-
"
|
|
20480
|
-
"
|
|
20551
|
+
" conflict resolution to `issue-worker`: never delegate a",
|
|
20552
|
+
" conflict resolution on a `human-required` PR regardless of",
|
|
20553
|
+
" `matched_rule` \u2014 the typed-recipe delegation flow stays",
|
|
20554
|
+
" auto-merge-only because a worker's merge injects reconciled",
|
|
20555
|
+
" content into a human-required branch, expanding the reviewed",
|
|
20556
|
+
" diff more than the clean merge-commit `gh pr update-branch`",
|
|
20557
|
+
" performs.",
|
|
20481
20558
|
"16. **Never delegate conflict resolution involving generated or",
|
|
20482
20559
|
" projen-managed files.** When `gh pr update-branch` fails on a",
|
|
20483
20560
|
" BEHIND PR with conflicts and any conflicting path is a lockfile,",
|