claude-dev-env 1.34.0 → 1.34.1
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/package.json +1 -1
- package/skills/pr-converge/SKILL.md +169 -167
package/package.json
CHANGED
|
@@ -1,218 +1,220 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pr-converge
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
fetches
|
|
7
|
-
tick, replies inline, and re-triggers the
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
Drives the current PR to convergence by alternating Cursor Bugbot and the
|
|
5
|
+
in-house bugteam audit. Each invocation runs one tick of work in the main
|
|
6
|
+
session: fetches the latest reviewer state, applies TDD fixes for any
|
|
7
|
+
findings, pushes one commit per tick, replies inline, and re-triggers the
|
|
8
|
+
reviewer. To loop automatically, invoke as `/loop /pr-converge` — the /loop
|
|
9
|
+
skill self-paces re-entry via ScheduleWakeup. Convergence requires a
|
|
10
|
+
back-to-back clean cycle (bugbot CLEAN immediately followed by bugteam CLEAN
|
|
11
|
+
with no intervening fixes), at which point the PR is flipped to ready for
|
|
12
|
+
review and the loop terminates. Triggers: '/pr-converge', 'drive PR to
|
|
11
13
|
convergence', 'loop bugbot and bugteam', 'babysit bugbot and bugteam',
|
|
12
14
|
'until both are clean', 'converge this PR'.
|
|
13
15
|
---
|
|
14
16
|
|
|
15
17
|
# PR Converge
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Runs one tick of the bugbot ↔ bugteam convergence loop in the main session. Designed to be invoked under `/loop /pr-converge` so the parent's ScheduleWakeup paces re-entry. Self-terminates the loop on convergence (back-to-back clean) by flipping the PR to ready for review and omitting the next ScheduleWakeup.
|
|
20
|
+
|
|
21
|
+
## Why the work runs in the main session, not a background subagent
|
|
22
|
+
|
|
23
|
+
`ScheduleWakeup` is a primitive of the parent harness; it is not exposed to `general-purpose` subagents. A prior version of this skill spawned a background subagent and instructed it to call `ScheduleWakeup` at the end of each tick. The subagent's tool registry returned "No matching deferred tools found" for `ScheduleWakeup`, so the loop could never self-perpetuate — it ran exactly one tick and stalled. Running the loop in the main session via `/loop /pr-converge` puts the work on the same harness that owns `ScheduleWakeup`, eliminating that failure mode.
|
|
18
24
|
|
|
19
25
|
## When this skill applies
|
|
20
26
|
|
|
21
|
-
The user is on a PR branch and wants both reviewers — Cursor's Bugbot AND the in-house `/bugteam` audit — to keep re-reviewing after each push, with findings auto-addressed between ticks. The PR stays in draft until convergence; on convergence the
|
|
27
|
+
The user is on a PR branch and wants both reviewers — Cursor's Bugbot AND the in-house `/bugteam` audit — to keep re-reviewing after each push, with findings auto-addressed between ticks. The PR stays in draft until convergence; on convergence the skill flips it to ready for review.
|
|
28
|
+
|
|
29
|
+
## Invocation modes
|
|
30
|
+
|
|
31
|
+
- **`/loop /pr-converge`** (recommended): loops automatically. The /loop skill runs each tick and uses ScheduleWakeup to pace re-entry. Termination on convergence is automatic; the skill omits the next wakeup at the convergence tick.
|
|
32
|
+
- **`/pr-converge`** (manual): runs exactly one tick and returns. Useful for ad-hoc state checks or for advancing the loop one step manually. The user re-runs the skill (or wraps it in `/loop`) to continue.
|
|
33
|
+
|
|
34
|
+
## State across ticks
|
|
35
|
+
|
|
36
|
+
Track the following in plain text in the assistant's response so subsequent ticks can re-read it from conversation context:
|
|
22
37
|
|
|
23
|
-
|
|
38
|
+
- `phase`: `BUGBOT` or `BUGTEAM`. Start in `BUGBOT` on the first tick of a fresh loop.
|
|
39
|
+
- `bugbot_clean_at`: the HEAD SHA at which bugbot last reported clean, or `null`. Reset to `null` whenever a new commit is pushed.
|
|
40
|
+
- `inline_lag_streak`: integer counter, initialized to `0`. Tracks consecutive ticks where bugbot's review body indicates findings against `current_head` but the inline-comments API returns zero matching comments. Reset to `0` on any other branch outcome.
|
|
41
|
+
- `tick_count`: integer, initialized to `0`. Increment on every tick to enforce the safety cap.
|
|
24
42
|
|
|
25
|
-
|
|
43
|
+
Each tick begins by reading the prior tick's state line from the most recent assistant message and ends by emitting the updated state line.
|
|
26
44
|
|
|
27
|
-
|
|
45
|
+
## Per-tick work
|
|
46
|
+
|
|
47
|
+
### Step 1: Resolve current HEAD and PR context
|
|
48
|
+
|
|
49
|
+
Read the prior tick's state line from the most recent assistant message (or initialize all fields if none). **Increment `tick_count` by 1.** This is the increment referenced in the **State across ticks** section; without it the safety cap (Step 3.5, §Safety cap) never fires.
|
|
28
50
|
|
|
29
51
|
```bash
|
|
30
52
|
gh pr view --json number,url,headRefOid,baseRefName,headRefName,isDraft
|
|
31
53
|
```
|
|
32
54
|
|
|
33
|
-
Capture `number
|
|
34
|
-
|
|
35
|
-
### Step 2:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
> **Stop conditions:**
|
|
151
|
-
>
|
|
152
|
-
> - **Convergence** (back-to-back clean as defined in step 2.d BUGTEAM second branch — `bugteam reports convergence AND bugbot_clean_at == current_head` with no push during this tick): mark PR ready for review, report one-sentence summary to parent, terminate.
|
|
153
|
-
> - **Hard blocker:** API auth failure persists across two ticks, a CI regression whose root cause falls outside this PR, a hook rejection investigated through three commits and still unresolved, `inline_lag_streak >= 3`, or `/bugteam` itself reports a stuck state. Report the specific blocker and your diagnosis to the parent, then terminate; skip scheduling the next wakeup.
|
|
154
|
-
> - **Parent sends `TaskStop`:** terminate immediately.
|
|
155
|
-
>
|
|
156
|
-
> **Safety cap:** when 30 ticks elapse before convergence, stop and report. That many rounds means something structural is wrong with the loop. (Higher than copilot-review's 20-tick cap because two reviewers run sequentially per round.)
|
|
157
|
-
|
|
158
|
-
### Step 4: Report back to the user
|
|
159
|
-
|
|
160
|
-
After spawning, tell the user in one or two lines: subagent ID, PR URL, that it will alternate bugbot and bugteam and notify on convergence or blocker. Nothing else.
|
|
161
|
-
|
|
162
|
-
## Stopping the subagent
|
|
163
|
-
|
|
164
|
-
- Convergence → subagent stops itself, marks PR ready for review.
|
|
165
|
-
- Blocker → subagent reports and stops.
|
|
166
|
-
- User says stop → `TaskStop <agent_id>`.
|
|
167
|
-
- User asks what loops are running → `TaskList`.
|
|
168
|
-
|
|
169
|
-
## Ground rules (for the subagent)
|
|
55
|
+
Capture `number` (`<NUMBER>`), `headRefOid` (`current_head`), owner/repo (from `url`), branch name (`<BRANCH>`).
|
|
56
|
+
|
|
57
|
+
### Step 2: Branch on `phase`
|
|
58
|
+
|
|
59
|
+
#### `phase == BUGBOT`
|
|
60
|
+
|
|
61
|
+
a. Fetch the latest Cursor Bugbot review:
|
|
62
|
+
```bash
|
|
63
|
+
gh api repos/<OWNER>/<REPO>/pulls/<NUMBER>/reviews \
|
|
64
|
+
--jq '[.[] | select(.user.login=="cursor[bot]")] | sort_by(.submitted_at) | last'
|
|
65
|
+
```
|
|
66
|
+
Capture `commit_id`, `state`, `submitted_at`, and the body. Bugbot's body contains either `Cursor Bugbot has reviewed your changes and found <N> potential issue` (findings exist) or text indicating no issues found.
|
|
67
|
+
|
|
68
|
+
b. Fetch unaddressed inline comments from `cursor[bot]` on `current_head`:
|
|
69
|
+
```bash
|
|
70
|
+
gh api repos/<OWNER>/<REPO>/pulls/<NUMBER>/comments \
|
|
71
|
+
--jq "[.[] | select(.user.login==\"cursor[bot]\") | select(.commit_id==\"$current_head\")]"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
c. Decide (the four branches below cover every input combination — match the first branch whose predicate holds):
|
|
75
|
+
- **No bugbot review yet, OR latest bugbot review's `commit_id` differs from `current_head`:** Re-trigger bugbot (Step 3), set `bugbot_clean_at = null`, reset `inline_lag_streak = 0`, schedule next wakeup, return.
|
|
76
|
+
- **Latest review's `commit_id == current_head` AND zero unaddressed inline findings AND review body indicates clean:** Set `bugbot_clean_at = current_head`. Reset `inline_lag_streak = 0`. Transition `phase = BUGTEAM`. Continue to bugteam branch in this same tick — back-to-back convergence requires bugteam to run against the same HEAD before the next wakeup is scheduled.
|
|
77
|
+
- **Latest review's `commit_id == current_head` with unaddressed inline findings (review body indicates findings):** Apply the **Fix protocol** below to address them. Reset `inline_lag_streak = 0`. The fix protocol pushes a new commit, which sets `current_head` to the new SHA, sets `bugbot_clean_at = null`, replies inline on each thread, and re-triggers bugbot. Schedule next wakeup, return.
|
|
78
|
+
- **Latest review's `commit_id == current_head` AND review body indicates findings AND inline-comments API returns zero matching comments for `current_head`:** Treat as transient API propagation lag — bugbot publishes the review body and inline comments through separate API operations and the two writes can briefly desync. Increment `inline_lag_streak`. When `inline_lag_streak >= 3`, escalate as a hard blocker (bugbot review is structurally inconsistent — body claims findings while inline anchors stay empty across three consecutive ticks); report and terminate. Otherwise schedule next wakeup at `delaySeconds: 60` (lag is short-lived) and return; the inline comments should appear on the next tick.
|
|
79
|
+
|
|
80
|
+
#### `phase == BUGTEAM`
|
|
81
|
+
|
|
82
|
+
a. Run the in-house bugteam audit on the current PR by invoking the `Skill` tool in the main session:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
Skill({skill: "bugteam", args: "https://github.com/<OWNER>/<REPO>/pull/<NUMBER>"})
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The main session is the team lead, so `TeamCreate` fires from the orchestrator and `/bugteam` emits its CODE_RULES gate output, teammate spawn lines, and audit progress as expected. The skill audits the current PR against CODE_RULES, posts review threads, and converges or stops at its own internal cap. Wait for it to complete; capture exit and final summary.
|
|
89
|
+
|
|
90
|
+
b. **Re-resolve current HEAD now** because `/bugteam` may have pushed commits during its run. The `current_head` from Step 1 is potentially stale at this point:
|
|
91
|
+
```bash
|
|
92
|
+
new_head=$(gh api repos/<OWNER>/<REPO>/pulls/<NUMBER> --jq '.head.sha')
|
|
93
|
+
```
|
|
94
|
+
If `new_head != current_head`, set `current_head = new_head` AND set `bugbot_clean_at = null`. The new commits from bugteam invalidate bugbot's prior clean.
|
|
95
|
+
|
|
96
|
+
c. Inspect bugteam's output. Bugteam reports either `convergence (zero findings)` or a list of unfixed findings with file:line.
|
|
97
|
+
|
|
98
|
+
d. Decide based on the (post-bugteam) state — order matters; check pushed-during-bugteam FIRST so a convergence report against a stale HEAD never falsely terminates:
|
|
99
|
+
- **bugteam pushed during this tick (i.e., `bugbot_clean_at` was just reset to `null` in step b):** Re-trigger bugbot in this same tick (Step 3) so the new HEAD enters bugbot's queue immediately, transition `phase = BUGBOT`, schedule next wakeup, return. The new commit needs a fresh bugbot review before convergence can be claimed.
|
|
100
|
+
- **bugteam reports convergence AND `bugbot_clean_at == current_head` (no push during this tick):** This is back-to-back clean. Mark the PR ready for review:
|
|
101
|
+
```bash
|
|
102
|
+
gh pr ready <NUMBER> --repo <OWNER>/<REPO>
|
|
103
|
+
```
|
|
104
|
+
Report to the user in one sentence: "PR #<NUMBER> converged: bugbot CLEAN at <SHA>, bugteam CLEAN at <SHA>; marked ready for review." **Omit the next ScheduleWakeup call** — this terminates the /loop.
|
|
105
|
+
- **bugteam reports convergence BUT `bugbot_clean_at != current_head` (no push during this tick):** Bugteam reached zero findings without committing, yet bugbot still needs re-confirmation against this HEAD. This branch is reachable only when state diverged BETWEEN ticks — for example, the user pushed a manual commit between two wakeups, leaving `current_head` ahead of the SHA bugbot last cleaned. Transition `phase = BUGBOT`, schedule next wakeup, return.
|
|
106
|
+
- **bugteam reports findings without committing fixes:** apply the **Fix protocol** below (which always re-triggers bugbot after the push), transition `phase = BUGBOT`, schedule next wakeup, return.
|
|
107
|
+
|
|
108
|
+
### Step 3: Re-trigger bugbot
|
|
109
|
+
|
|
110
|
+
Used in Step 2 BUGBOT branch 1, in Step 2 BUGTEAM branch 1, and in the Fix protocol. Post a literal `bugbot run` PR comment. Write the body via the Write tool to a temp file, then pass it with `--body-file` (per the gh-body-file rule):
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
gh pr comment <NUMBER> --repo <OWNER>/<REPO> --body-file <path/to/bugbot_run.md>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The body file contains exactly the literal phrase `bugbot run` followed by a newline. Use that phrase exactly — empirically the only re-trigger Cursor Bugbot recognizes; alternative phrasings (`re-review`, `bugbot please`, etc.) silently no-op.
|
|
117
|
+
|
|
118
|
+
### Step 3.5: Enforce the safety cap
|
|
119
|
+
|
|
120
|
+
Before scheduling the next wakeup, evaluate `tick_count`. When `tick_count >= 30`, stop and report per the **Stop conditions** safety-cap branch (§Safety cap) — **omit Step 4 entirely**. Reaching this many rounds means something structural is wrong with the loop and continuing wastes work. Otherwise proceed to Step 4.
|
|
121
|
+
|
|
122
|
+
### Step 4: Schedule the next wakeup (only when invoked under `/loop`)
|
|
123
|
+
|
|
124
|
+
**Skip this step entirely when the skill was invoked as bare `/pr-converge`** (manual mode). Manual mode runs exactly one tick and returns without scheduling — the user re-runs the skill or wraps it in `/loop` to continue. References elsewhere in this document to "schedule next wakeup, return" mean Step 4 below; under manual mode every such reference becomes "return" only.
|
|
125
|
+
|
|
126
|
+
Detect manual mode by inspecting the conversation context: when the most recent user message that triggered this run was `/pr-converge` (no `/loop` prefix and no prior `ScheduleWakeup` chain entry that fired with `prompt: "/loop /pr-converge"`), this is manual mode. When the run was triggered by the parent's /loop wakeup chain or the user typed `/loop /pr-converge`, this is loop mode.
|
|
127
|
+
|
|
128
|
+
In **loop mode**, call `ScheduleWakeup` with:
|
|
129
|
+
|
|
130
|
+
- `delaySeconds: 270` whenever bugbot was just re-triggered (whether by Step 3 directly, by the Fix protocol's mandatory re-trigger, or by BUGTEAM branch 1's same-tick re-trigger). Bugbot finishes a review in 1–4 minutes, so 270s stays under the 5-minute prompt-cache TTL while giving a margin past bugbot's typical upper bound. The single exception is the BUGBOT inline-lag branch, which uses `delaySeconds: 60` because no re-trigger fired and the only thing being awaited is GitHub's inline-comments API catching up.
|
|
131
|
+
- `reason`: one short sentence on what is being awaited, including the current `phase` and `bugbot_clean_at` SHA when set.
|
|
132
|
+
- `prompt: "/loop /pr-converge"` — re-enters this skill via /loop on the next firing.
|
|
133
|
+
|
|
134
|
+
**On convergence (loop mode):** omit the ScheduleWakeup call entirely. The /loop terminates because no next wakeup was scheduled.
|
|
135
|
+
|
|
136
|
+
## Fix protocol
|
|
137
|
+
|
|
138
|
+
Used by both phases when findings exist:
|
|
139
|
+
|
|
140
|
+
- Read each referenced file:line.
|
|
141
|
+
- Write a failing test first when the finding has behavior to test. For pure doc, comment, or naming nits with no behavior, go straight to the fix.
|
|
142
|
+
- Implement the fix.
|
|
143
|
+
- Stage the affected files and create one new commit on the existing branch:
|
|
144
|
+
```bash
|
|
145
|
+
git add <files> && git commit -m "fix(review): <brief summary>"
|
|
146
|
+
```
|
|
147
|
+
Honor pre-commit and pre-push hooks; when a hook rejects, read its message, fix the underlying issue, retry. Hook rejections flag real underlying issues worth investigating.
|
|
148
|
+
- Push the new commit:
|
|
149
|
+
```bash
|
|
150
|
+
git push origin <BRANCH>
|
|
151
|
+
```
|
|
152
|
+
Capture the new HEAD SHA. Set `current_head` to it. Set `bugbot_clean_at = null`.
|
|
153
|
+
- Reply inline on each addressed comment thread using `--body-file` (per gh-body-file rule):
|
|
154
|
+
```bash
|
|
155
|
+
gh api -X POST repos/<OWNER>/<REPO>/pulls/<NUMBER>/comments/<comment_id>/replies \
|
|
156
|
+
--field body=@<path/to/reply.md>
|
|
157
|
+
```
|
|
158
|
+
- **Always re-trigger bugbot (Step 3 above) after pushing a fix**, regardless of which phase originated the findings. Any new commit invalidates bugbot's prior clean by definition, so bugbot must re-review the new HEAD before convergence can be claimed. Re-triggering in the same tick saves a full wakeup cycle compared to deferring the trigger to the next tick.
|
|
159
|
+
|
|
160
|
+
## Stop conditions
|
|
161
|
+
|
|
162
|
+
- **Convergence** (back-to-back clean as defined in Step 2 BUGTEAM second branch — `bugteam reports convergence AND bugbot_clean_at == current_head` with no push during this tick): mark PR ready for review, report one-sentence summary, omit ScheduleWakeup.
|
|
163
|
+
- **Hard blocker:** API auth failure persists across two ticks, a CI regression whose root cause falls outside this PR, a hook rejection investigated through three commits and still unresolved, `inline_lag_streak >= 3`, or `/bugteam` itself reports a stuck state. Report the specific blocker and the diagnosis, then omit ScheduleWakeup.
|
|
164
|
+
- **User stops the loop:** user says "stop the converge loop" → omit ScheduleWakeup on the next tick.
|
|
165
|
+
- **Safety cap:** `tick_count >= 30` (evaluated in Step 3.5) → omit ScheduleWakeup, report the cap was hit. See §Safety cap below for rationale.
|
|
166
|
+
|
|
167
|
+
## Safety cap
|
|
168
|
+
|
|
169
|
+
When `tick_count >= 30`, stop and report. That many rounds means something structural is wrong with the loop. (Higher than copilot-review's 20-tick cap because two reviewers run sequentially per round.) The increment lives in Step 1; the evaluation lives in Step 3.5.
|
|
170
|
+
|
|
171
|
+
## Ground rules
|
|
170
172
|
|
|
171
173
|
- **Append commits.** Each tick adds at most one new fix commit. Multiple findings within one tick collapse into a single commit; the next tick handles the next round.
|
|
172
174
|
- **`bugbot_clean_at` resets on every push.** A new commit invalidates bugbot's prior clean by definition — bugbot must re-review the new HEAD before convergence can be claimed.
|
|
173
175
|
- **Back-to-back clean is the ONLY termination criterion.** Convergence requires both reviewers clean against the same HEAD with no intervening fixes; either reviewer clean alone counts as in-progress.
|
|
174
|
-
- **The `bugbot run` comment is load-bearing.** Use the literal phrase `bugbot run` exactly — empirically the only re-trigger Cursor Bugbot recognizes; alternative phrasings
|
|
175
|
-
- **`gh pr ready` is the convergence action.** Mark the PR ready for review and stop there. Merge, additional reviewers, title, and body remain the user's decisions; the
|
|
176
|
+
- **The `bugbot run` comment is load-bearing.** Use the literal phrase `bugbot run` exactly — empirically the only re-trigger Cursor Bugbot recognizes; alternative phrasings silently no-op.
|
|
177
|
+
- **`gh pr ready` is the convergence action.** Mark the PR ready for review and stop there. Merge, additional reviewers, title, and body remain the user's decisions; the skill's contract ends at "ready for review."
|
|
176
178
|
- **Honor pre-push and pre-commit hooks.** When a hook rejects the change, read its output, fix the underlying issue (the failing test, the missing constant, the broken import), and retry.
|
|
177
179
|
|
|
178
180
|
## Examples
|
|
179
181
|
|
|
180
182
|
<example>
|
|
181
|
-
User: `/pr-converge`
|
|
182
|
-
Claude: [reads PR context,
|
|
183
|
+
User: `/loop /pr-converge`
|
|
184
|
+
Claude: [reads PR context, runs one tick of bugbot phase, schedules next wakeup at 270s with prompt `/loop /pr-converge`, returns]
|
|
183
185
|
</example>
|
|
184
186
|
|
|
185
187
|
<example>
|
|
186
|
-
User:
|
|
187
|
-
Claude: [
|
|
188
|
+
User: `/pr-converge`
|
|
189
|
+
Claude: [runs one tick manually, reports state, does NOT schedule a wakeup; user re-runs to advance]
|
|
188
190
|
</example>
|
|
189
191
|
|
|
190
192
|
<example>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
Tick fires in BUGBOT phase, latest bugbot review is against an older commit.
|
|
194
|
+
Claude: [posts `bugbot run` comment, sets `bugbot_clean_at = null`, schedules next wakeup at 270s, returns]
|
|
193
195
|
</example>
|
|
194
196
|
|
|
195
197
|
<example>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
+
Tick fires in BUGBOT phase, bugbot has 2 unaddressed findings on HEAD.
|
|
199
|
+
Claude: [TDD-fixes both, one commit, pushes, replies inline on both threads, posts `bugbot run`, schedules next wakeup at 270s, returns]
|
|
198
200
|
</example>
|
|
199
201
|
|
|
200
202
|
<example>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
+
Tick fires in BUGBOT phase, bugbot is clean against HEAD.
|
|
204
|
+
Claude: [sets `bugbot_clean_at = HEAD`, transitions `phase = BUGTEAM`, runs `/bugteam` in the same tick]
|
|
203
205
|
</example>
|
|
204
206
|
|
|
205
207
|
<example>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
In BUGTEAM phase, /bugteam reports convergence and `bugbot_clean_at == current_head`.
|
|
209
|
+
Claude: [runs `gh pr ready <NUMBER>`, reports "PR converged: bugbot CLEAN at <SHA>, bugteam CLEAN at <SHA>; marked ready for review", omits ScheduleWakeup, terminates the /loop]
|
|
208
210
|
</example>
|
|
209
211
|
|
|
210
212
|
<example>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
+
In BUGTEAM phase, /bugteam pushed a fix commit during its run.
|
|
214
|
+
Claude: [re-resolves HEAD, sets `bugbot_clean_at = null`, posts `bugbot run` in this same tick, transitions `phase = BUGBOT`, schedules next wakeup at 270s]
|
|
213
215
|
</example>
|
|
214
216
|
|
|
215
217
|
<example>
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
Tick fires in BUGBOT phase, bugbot review body says "found 3 potential issues" against HEAD but the inline-comments API returns zero matching comments for `current_head`.
|
|
219
|
+
Claude: [increments `inline_lag_streak` to 1, schedules next wakeup at 60s, returns; expects inline comments to appear by the next tick]
|
|
218
220
|
</example>
|