--- name: ship description: Land completed Fallow work after review, run pre-push parity, monitor merged-commit CI, and leave repositories clean. Use when asked to ship, merge, or move approved work to main. --- # Ship 1. Search for a competing pull request before the merge. A contributor can open one for a new issue within an hour, also while your branch is in review. Run `gh pr list --state open --search " OR "`, with the key terms of the change, because a pull request can have no link to the issue. When a pull request of another author makes the same change, do not merge yours. Report both pull requests to the maintainer with a recommendation. A pull request that came first gets the credit: recommend to review it and build on it. A pull request of this objective does not count. Confirm the branch and diff exactly match the reviewed scope. Then run `node scripts/ship-rebase.mjs --pr --if-needed --push`, also for one pull request. Do not rebase by hand. The required checks of `main` do not require an up-to-date branch, so a rebase is only necessary when a squash merge is not safe as it is. With `--if-needed`, the script rebases only when the merge into `main` conflicts, when the branch and `main` both change a generated file, or when the merge loses a version bump of the branch. Otherwise it prints the merge command for the current head, and no new CI run is necessary. The checks of the pull request then ran against an older `main`. A change on `main` that breaks the branch without a text conflict shows only in steps 6 and 7. After a rebase, the script compares the result with a merge and checks each version constant. A failed manual `rebase --continue` leaves commits on a detached HEAD. For a stacked branch after a squash merge of its parent, add `--upstream` (see "Serial merge of many pull requests"). When GitHub rejects a push with a server error (for example HTTP 500 or `fatal error in commit_refs`) after the pre-push hooks passed, retry once with `HK=0 git push`. The hooks already passed for the same commits. Then compare `git ls-remote origin ` with the local head, because the first push can land in spite of the error. 2. Re-run the required checks from `docs/development/quality-gates.md`. 3. Verify that public contracts and generated files are pushed. Merge each companion change into the default branch of its repository (for example fallow-docs `main`). A pushed feature branch is not enough: the release then must merge it. When the merged change touches `npm/fallow/skills`, the Skills companion sync workflow opens a `sync-fallow-skills` pull request in fallow-skills a few minutes after the merge. Merge that pull request. Run `node scripts/sync-skills-companion.mjs --pin ` by hand only when no such pull request opens, because a hand run next to it makes a second pull request with the same content. `ship-wait-checks.mjs --commit` names the sync pull request, or gives the hand-run command when it finds none. 4. Create signed conventional commits only. 5. Merge with pinned auto-merge after steps 1 to 4. Arm it before any CI wait, except in a serial merge (see "Serial merge of many pull requests"). Do not keep the merge for a later step of the session: when the session stops, an unarmed pull request stays open. Do not wait for the checks in the foreground: ```bash gh pr merge --auto --squash --match-head-commit --subject ": (#)" ``` GitHub merges when the last required check passes. The pin stops the merge when someone pushes a commit that you did not review. After each own push that you reviewed, run the command again with the new head. When all required checks already passed, the same command merges at once. `--admin` does not skip a required check, because the branch protection of `main` applies to administrators too. A pull request that lands on `main` after the `--if-needed` run can make the same version bump. Git merges two equal edits without a conflict, so step 7 checks the version constants of the merge. 6. Monitor the merged commit until required CI completes. Use `node scripts/ship-wait-checks.mjs --commit --follow-main`. Do not give `--min-checks`: path filters decide which workflows a push starts, so the run count of another push is not the count of this commit. The script takes the runs that GitHub created for the commit, and stops when all of them are complete for a short time. A newer push to `main` cancels the runs of the merged commit. With `--follow-main`, the script then waits for the newest commit of `origin/main` that contains the merged commit, and prints one line for each move. On a busy `main`, new pushes can cancel each long run, and the wait can time out with pending runs. Then do not start the same wait again. For each workflow without a pass, watch its newest in-progress run on a commit that contains the merged commit (`gh run watch --exit-status`). Before you retry a failed job, confirm that the branch contains the current base (`git merge-base --is-ancestor origin/main HEAD`). A second identical failure is a defect, not a flake: diagnose it instead of a third retry. The script compares each failed run with the same workflow on the commits before the merged commit. A run that also failed there gets the line `FAIL (also on main )`. When all failed runs failed before, the script stops with exit code 4: the failure does not come from your merge, so do not report it as yours. Exit code 1 means that at least one failure is new. 7. Inspect the merged tree for conflict markers and generated drift. Then run `git diff `. Then run `node scripts/check-version-bumps.mjs --base ^ --head `. A failure means that `main` made the same version bump before the merge. Set the constant above the value of `main` in a follow-up pull request. A pull request that merged after your last rebase shows there, also when it did not conflict. Read each hunk in a file that your pull request changed. Such a merge can make your code, a comment or a doc wrong without a text conflict. Fix that in a follow-up pull request. 8. Return every touched checkout to a clean, synchronized state. Keep `.plans/.md`, because `sweep` reads it and deletes it at the end. 9. Run the `sweep` skill as the last step of the objective. Do not wait for a prompt from the maintainer, and do not end the turn before it. 10. Start the final report with one status line: - `DONE`: every pull request is merged and the merged-commit CI is green. - `BLOCKED: : `: the work waits on a person or an external system. - `RUNNING: , expected