docs(AGENTS.md): require fresh branch off origin/master per batch (#750)

* docs(AGENTS.md): require fresh branch off origin/master per batch

Add a "Starting the next batch" subsection to the reverse-DNS-maps
workflow. Each batch must start from a fresh checkout of origin/master,
not from the previous batch's branch.

The trap: if the previous batch's commit has already merged via a PR
pushed from elsewhere (a co-worker's session, an unsynced laptop, an
earlier session), the local copy of that commit still sits on the old
branch. Stacking new work on top makes the new PR conflict with master,
because the merged commit and the local copy insert identical map rows
at identical sorted positions and the same lines collide.

Hit live this batch (PR #749) and recovered via
`git rebase --onto origin/master <stale-commit> <branch>` plus a
force-push, then a PR-description trim. Documenting the failure mode
and the recovery so the next contributor avoids the trap entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(AGENTS.md): also check for open map PRs before starting a batch

Add a pre-flight `gh pr list --search` step ahead of the branch-fresh-
off-master rule. Same scenario in mind: a previous batch's PR is still
in flight, started from a different machine or session, and starting
a new batch in parallel duplicates effort or splits attention across
two competing PRs touching the same files.

Cheap one-liner; cost of forgetting it is the kind of conflict #749
already documented at the branch-hygiene level.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Sean Whalen <seanthegeek@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sean Whalen
2026-05-05 21:14:26 -04:00
committed by GitHub
parent 7ef31f8083
commit bf526f4e12
+28
View File
@@ -288,6 +288,34 @@ load_psl_overrides(offline=True)
assert get_base_domain("host01.netlify.app") == "netlify.app"
```
### Starting the next batch
Before starting a new batch, **check for open PRs that already touch the maps**. Someone else (or another session) may already have a pending batch in flight; running a fresh batch on top duplicates work and splits attention across two competing PRs.
```bash
gh pr list --state open --search 'base_reverse_dns OR "reverse DNS map"'
```
If anything comes back, read its diff before starting — wait for it to merge, or coordinate with whoever opened it. Only proceed once the queue is clear.
Each batch then gets its own branch off `origin/master`:
```bash
git fetch origin
git checkout -b <new-batch-name> origin/master
```
Do not reuse a previous batch's branch — even if it looks like the previous batch is "still pending". If the previous batch's commit has already merged via a PR pushed from elsewhere (a co-worker's session, an unsynced laptop, an earlier Claude session), your local copy of that commit is still sitting on the old branch, and stacking new commits on top makes the new PR conflict with master: the merged commit and your local copy both insert the same map rows at the same sorted positions, so the same lines collide.
If you discover this after the fact (PR shows conflicts and `git diff <local-stale-commit> <upstream-merged-commit> --stat` is empty), recover with:
```bash
git rebase --onto origin/master <stale-commit> <branch>
git push --force-with-lease
```
then trim the PR title and description to reflect just the surviving batch.
### After a batch merge
- Re-sort `base_reverse_dns_map.csv` alphabetically (case-insensitive) by the first column and write it out with CRLF line endings.