Skip to content

Commit 422f81a

Browse files
committed
fix(ship-skill,babysit): clean rebase can still hide drift, fixed temp-branch name blocks recovery
- A clean git rebase can replay stray commits with zero conflicts, so 'rebase succeeded' was being treated as sufficient — now the log is always re-checked after rebasing, clean or not, before trusting it - The recovery text told the agent to 'pick another name' if ship-sync-tmp was taken but then hardcoded that literal name anyway; now it just deletes the leftover (disposable, single-purpose) branch instead of introducing a naming scheme - babysit's step 5 pointed at re-running the log check alone; it now points at the full /ship step 2 recovery flow, since a review loop spanning a long session is exactly where drift compounds silently
1 parent 59ed18a commit 422f81a

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

.agents/skills/babysit/SKILL.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ round. Always check both conditions freshly after every push.
7272
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "<threadId>"}) { thread { isResolved } } }'
7373
```
7474

75-
5. **Before pushing, re-run the sync check** from `/ship` step 2
76-
(`git fetch origin staging && git log --oneline origin/staging..HEAD` should list only this
77-
session's commits) — a babysit loop that runs over a long session is exactly the scenario
78-
where a branch can drift. Then run the repo's lint/typecheck/boundary-validation gates the
79-
same way `/ship` does before committing.
75+
5. **Before pushing, re-run the full sync check from `/ship` step 2** — not just the log command,
76+
the whole check-and-recover flow (stash WIP if needed, rebase, verify the rebase didn't just
77+
cleanly replay stray commits, cherry-pick rebuild if it did or if it conflicted). A babysit
78+
loop spanning a long session is exactly the scenario where a branch can drift, and pushing
79+
review fixes on top of undetected drift is how an oversized PR happens even after the branch
80+
was fixed once. Then run the repo's lint/typecheck/boundary-validation gates the same way
81+
`/ship` does before committing.
8082

8183
6. **Commit and push** the round's fixes as one commit (`--force-with-lease` only if step 5's
8284
sync check required a rebuild).

.agents/skills/ship/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ When the user runs `/ship`:
1616
- If it shows commits you don't recognize, fix it now, **before** staging/committing any new work (step 7 hasn't run yet):
1717
- If the working tree has uncommitted changes, stash them first — `git stash push -u -m ship-sync-fix` — so the rebase below isn't blocked by dirty state. Restore with `git stash pop` once the branch is fixed.
1818
- Try `git rebase origin/staging` first.
19-
- If that walks through unrelated history and conflicts on commits you don't recognize, `git rebase --abort` and rebuild instead: pick a temp branch name that isn't already in use (`git branch --list ship-sync-tmp`; if it exists, delete it or pick another name), `git checkout -b ship-sync-tmp origin/staging`, `git cherry-pick <your-sha(s)>`, resolve conflicts, then `git branch -f <original-branch> HEAD`, `git checkout <original-branch>`, and delete the temp branch.
20-
- Re-verify with `git log --oneline origin/staging..HEAD` — it should list only commits you recognize.
19+
- **A rebase finishing without conflicts does NOT by itself mean the branch is clean** — it can replay stray commits onto the new base with no conflict at all. After the rebase (clean or not), re-run `git log --oneline origin/staging..HEAD` and re-check the commit list against what you recognize.
20+
- If the rebase conflicted on commits you don't recognize, OR it finished cleanly but the re-checked log still shows commits you don't recognize, abandon that result (`git rebase --abort` if still mid-rebase) and rebuild instead: delete any leftover `ship-sync-tmp` branch from an earlier attempt (`git branch -D ship-sync-tmp` — safe, it's disposable), `git checkout -b ship-sync-tmp origin/staging`, `git cherry-pick <only the sha(s) you actually authored this session>`, resolve conflicts, then `git branch -f <original-branch> HEAD`, `git checkout <original-branch>`, and delete `ship-sync-tmp`.
21+
- Re-verify with `git log --oneline origin/staging..HEAD` — it must list only commits you recognize before you proceed to committing new work.
2122
3. **Generate a commit message** following this format: `type(scope): description`
2223
- Types: `fix`, `feat`, `improvement`, `chore`
2324
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)

.cursor/commands/babysit.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ round. Always check both conditions freshly after every push.
6666
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "<threadId>"}) { thread { isResolved } } }'
6767
```
6868

69-
5. **Before pushing, re-run the sync check** from `/ship` step 2
70-
(`git fetch origin staging && git log --oneline origin/staging..HEAD` should list only this
71-
session's commits) — a babysit loop that runs over a long session is exactly the scenario
72-
where a branch can drift. Then run the repo's lint/typecheck/boundary-validation gates the
73-
same way `/ship` does before committing.
69+
5. **Before pushing, re-run the full sync check from `/ship` step 2** — not just the log command,
70+
the whole check-and-recover flow (stash WIP if needed, rebase, verify the rebase didn't just
71+
cleanly replay stray commits, cherry-pick rebuild if it did or if it conflicted). A babysit
72+
loop spanning a long session is exactly the scenario where a branch can drift, and pushing
73+
review fixes on top of undetected drift is how an oversized PR happens even after the branch
74+
was fixed once. Then run the repo's lint/typecheck/boundary-validation gates the same way
75+
`/ship` does before committing.
7476

7577
6. **Commit and push** the round's fixes as one commit (`--force-with-lease` only if step 5's
7678
sync check required a rebuild).

.cursor/commands/ship.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ When the user runs `/ship`:
1111
- If it shows commits you don't recognize, fix it now, **before** staging/committing any new work (step 5 hasn't run yet):
1212
- If the working tree has uncommitted changes, stash them first — `git stash push -u -m ship-sync-fix` — so the rebase below isn't blocked by dirty state. Restore with `git stash pop` once the branch is fixed.
1313
- Try `git rebase origin/staging` first.
14-
- If that walks through unrelated history and conflicts on commits you don't recognize, `git rebase --abort` and rebuild instead: pick a temp branch name that isn't already in use (`git branch --list ship-sync-tmp`; if it exists, delete it or pick another name), `git checkout -b ship-sync-tmp origin/staging`, `git cherry-pick <your-sha(s)>`, resolve conflicts, then `git branch -f <original-branch> HEAD`, `git checkout <original-branch>`, and delete the temp branch.
15-
- Re-verify with `git log --oneline origin/staging..HEAD` — it should list only commits you recognize.
14+
- **A rebase finishing without conflicts does NOT by itself mean the branch is clean** — it can replay stray commits onto the new base with no conflict at all. After the rebase (clean or not), re-run `git log --oneline origin/staging..HEAD` and re-check the commit list against what you recognize.
15+
- If the rebase conflicted on commits you don't recognize, OR it finished cleanly but the re-checked log still shows commits you don't recognize, abandon that result (`git rebase --abort` if still mid-rebase) and rebuild instead: delete any leftover `ship-sync-tmp` branch from an earlier attempt (`git branch -D ship-sync-tmp` — safe, it's disposable), `git checkout -b ship-sync-tmp origin/staging`, `git cherry-pick <only the sha(s) you actually authored this session>`, resolve conflicts, then `git branch -f <original-branch> HEAD`, `git checkout <original-branch>`, and delete `ship-sync-tmp`.
16+
- Re-verify with `git log --oneline origin/staging..HEAD` — it must list only commits you recognize before you proceed to committing new work.
1617
3. **Generate a commit message** following this format: `type(scope): description`
1718
- Types: `fix`, `feat`, `improvement`, `chore`
1819
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)

0 commit comments

Comments
 (0)