You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/commands/shipLane.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: shipLane
3
-
description: 'Autonomously drive a lane through CI + review until merged (automate → finalize → poll/fix loop, self-paced wake-ups, max 5 iterations)'
3
+
description: 'Autonomously drive a lane through CI + review until merged (automate → finalize → poll/fix loop, self-paced wake-ups, max 10 iterations)'
4
4
---
5
5
6
6
# Ship Lane Command
@@ -89,6 +89,8 @@ ScheduleWakeup({
89
89
90
90
Pass `$ARGUMENTS` through so a PR-number argument is preserved across wake-ups.
91
91
92
+
Waiting must be token-idle. After scheduling a wake-up, stop the active agent turn completely and let the scheduler re-invoke this command later. Do not keep agents alive in polling loops, do not run `--watch` commands, and do not ask sub-agents to sleep while holding context. Poll only once per scheduled invocation, then either fix, exit, or schedule the next wake.
93
+
92
94
Do NOT schedule a wake if `status` is `done-clean`, `done-max`, or `blocked` — print the summary and stop.
Copy file name to clipboardExpand all lines: docs/playbooks/ship-lane.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,9 @@ Run this playbook once per lane, when the code on the branch is done (or nearly
15
15
## Execution contract
16
16
17
17
-**Autonomous.** Do not pause for user confirmation mid-loop.
18
-
-**Bounded.** Hard cap: 5 iterations. Exit earlier if clean or blocked.
18
+
-**Bounded.** Hard cap: 10 iterations. Exit earlier if clean or blocked.
19
19
-**Scoped checks.** Never run the full test suite between iterations — only failing test files and touched shards.
20
+
-**Token-idle waits.** Waiting is done by scheduler/resume, not by live polling loops. Between wake-ups, agents should be asleep, not consuming model context or tokens.
20
21
-**Idempotent resume.** All state lives in `.ade/shipLane/<branch>.json`. A re-invocation reads that file and picks up where it left off.
21
22
22
23
## Concurrency model
@@ -29,6 +30,8 @@ Pick the richest available and **use it fully**:
29
30
30
31
**Rule:** the lead reads poll-agent summaries, not raw API output. Fix agents receive minimum scope (failing test paths + error snippets, or comment bodies + file anchors) and return patches or direct edits. The lead commits and pushes; fix agents do not.
31
32
33
+
**Waiting rule:** agents never stay alive just to wait. A poll-agent performs one bounded poll and exits. Fix agents perform one bounded fix task and exit. The lead schedules a wake-up or records a blocked/done state, then exits the active turn.
34
+
32
35
## State file
33
36
34
37
Path: `.ade/shipLane/<sanitized-branch>.json` (sanitize by replacing `/` with `__`).
@@ -142,11 +145,13 @@ Then schedule the first wake-up (see Phase 5).
142
145
143
146
Runs on every wake-up. Delegate to a **poll-agent** so the lead's context stays clean. The poll-agent runs these calls and returns a single structured summary.
144
147
148
+
This is a one-shot poll. Do not use `gh pr checks --watch`, shell `while` loops, repeated sleeps, or minute-by-minute status checks. If CI/review is still pending, return `ciRunning: true` or no actionable comments, then let Phase 5 schedule the next wake.
Post bot pings (Phase 4), update state (Phase 5), restart Phase 1 immediately.
329
+
Post bot pings (Phase 4), update state (Phase 5), and schedule the next wake. Do not restart Phase 1 immediately after a push; give CI and review bots time to run while the agent is asleep.
325
330
326
331
---
327
332
@@ -363,7 +368,7 @@ These are separate comments (not a single body) so each bot handler parses its o
363
368
364
369
### 5.2 Decide exit vs next wake
365
370
366
-
-`iteration >= 5` → set `status: done-max`, `exitReason: "iteration-cap-reached"`, post a PR comment listing remaining unaddressed items, exit.
371
+
-`iteration >= 10` → set `status: done-max`, `exitReason: "iteration-cap-reached"`, post a PR comment listing remaining unaddressed items, exit.
367
372
-`merged == true` (observed during this iteration) → set `status: done-clean`, exit.
368
373
- Otherwise → schedule next wake.
369
374
@@ -376,7 +381,7 @@ Agent-CLI-agnostic guidance (Claude Code maps this to `ScheduleWakeup`; other CL
376
381
- CI done, waiting on human review → **1800 seconds** (30 min; cost-efficient)
377
382
- Unknown → **720 seconds** default
378
383
379
-
The cadence is a hint, not a contract. If the agent knows CI finishes faster, wake sooner; if reviewers are slow, wake later.
384
+
The cadence is a hint, not a live polling budget. Prefer longer sleeps over frequent checks. If the environment has a real scheduler/resume primitive, use it and end the active turn. If no scheduler exists, write the updated state file and stop with a summary that names the next intended wake time; an external runner or human can re-invoke the playbook later. Do not emulate scheduling with an active model loop.
380
385
381
386
---
382
387
@@ -385,7 +390,7 @@ The cadence is a hint, not a contract. If the agent knows CI finishes faster, wa
385
390
| status | meaning | next action |
386
391
| --- | --- | --- |
387
392
|`done-clean`| PR merged OR green + no unaddressed comments | clear state file; print summary |
388
-
|`done-max`|5 iterations exhausted | leave state file; post PR comment to human |
393
+
|`done-max`|10 iterations exhausted | leave state file; post PR comment to human |
389
394
|`blocked`| Unrecoverable conflict, gate failure, or API error | leave state file; post PR comment with reason |
0 commit comments