Skip to content

Commit ddecf19

Browse files
committed
ship: iteration 6 rebase and raise lane cap
1 parent fcf7cd4 commit ddecf19

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

.claude/commands/shipLane.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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)'
44
---
55

66
# Ship Lane Command
@@ -89,6 +89,8 @@ ScheduleWakeup({
8989

9090
Pass `$ARGUMENTS` through so a PR-number argument is preserved across wake-ups.
9191

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+
9294
Do NOT schedule a wake if `status` is `done-clean`, `done-max`, or `blocked` — print the summary and stop.
9395

9496
---

.claude/scheduled_tasks.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"sessionId":"bab81aa2-1bdb-495e-9bf6-3d87ede93f1f","pid":85962,"procStart":"Thu Apr 23 05:29:47 2026","acquiredAt":1776922287064}
1+
{"sessionId":"5364eda2-5696-4227-b94c-5f2678de1f2e","pid":64448,"procStart":"Thu Apr 23 18:51:52 2026","acquiredAt":1776973376438}

docs/playbooks/ship-lane.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ Run this playbook once per lane, when the code on the branch is done (or nearly
1515
## Execution contract
1616

1717
- **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.
1919
- **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.
2021
- **Idempotent resume.** All state lives in `.ade/shipLane/<branch>.json`. A re-invocation reads that file and picks up where it left off.
2122

2223
## Concurrency model
@@ -29,6 +30,8 @@ Pick the richest available and **use it fully**:
2930

3031
**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.
3132

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+
3235
## State file
3336

3437
Path: `.ade/shipLane/<sanitized-branch>.json` (sanitize by replacing `/` with `__`).
@@ -142,11 +145,13 @@ Then schedule the first wake-up (see Phase 5).
142145

143146
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.
144147

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.
149+
145150
### 1.1 PR and CI state
146151

147152
```bash
148153
gh pr view "$PR_NUMBER" --json state,mergeable,mergeStateStatus,headRefOid,baseRefOid,isDraft
149-
gh pr checks "$PR_NUMBER" --json name,state,conclusion,link
154+
gh pr checks "$PR_NUMBER" --watch=false --json name,state,conclusion,link
150155
```
151156

152157
If any check's `state` is `IN_PROGRESS` or `QUEUED`, note CI as still running.
@@ -321,7 +326,7 @@ git commit -m "ship: iteration $N — fix $CI_JOBS, address #$COMMENT_IDS"
321326
git push
322327
```
323328

324-
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.
325330

326331
---
327332

@@ -363,7 +368,7 @@ These are separate comments (not a single body) so each bot handler parses its o
363368

364369
### 5.2 Decide exit vs next wake
365370

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.
367372
- `merged == true` (observed during this iteration) → set `status: done-clean`, exit.
368373
- Otherwise → schedule next wake.
369374

@@ -376,7 +381,7 @@ Agent-CLI-agnostic guidance (Claude Code maps this to `ScheduleWakeup`; other CL
376381
- CI done, waiting on human review → **1800 seconds** (30 min; cost-efficient)
377382
- Unknown → **720 seconds** default
378383

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.
380385

381386
---
382387

@@ -385,7 +390,7 @@ The cadence is a hint, not a contract. If the agent knows CI finishes faster, wa
385390
| status | meaning | next action |
386391
| --- | --- | --- |
387392
| `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 |
389394
| `blocked` | Unrecoverable conflict, gate failure, or API error | leave state file; post PR comment with reason |
390395

391396
## Summary output (always print on exit)

0 commit comments

Comments
 (0)