Re-homing agent-ops in the Pullwright organisation — runbook
Status: completed on 2026-09-07 (#912); kept as the record of the cutover. The transfer has concluded. This document is the record of the plan that guided it and the order in which steps were executed. It is a historical record, not a planning document, and describes what was done and in what order.
Assessment this runbook condenses (2026-08-28, with its GitHub-documentation sources): https://claude.ai/code/artifact/e6519e84-d138-4ea4-8b6e-483e84d98e4b.
The decision
Section titled “The decision”Poetic-Poems/agent-ops — the repository, its history, its issues and pull
requests, its ruleset — is transferred to the Pullwright organisation and
becomes the product repository in place. It stays public: D5 (reaffirmed
2026-08-28, #909) makes the public code the marketing, and the private
option is what carried most of the cost — the Team-plan upgrade for a ruleset
on a private repository, a private registry with a login on every node, the
loss of code scanning (paid on private) and of the merge queue (Enterprise
Cloud only on private). None of that applies to a public organisation
repository.
This is one way of doing the Phase 1 D8 item, and the cheaper way. D8 said
“a new product repository holds the pipeline; agent-ops shrinks to Poetic’s
consumer configuration”. GitHub moves issues only within one owner, so
whichever direction the split runs, one class of issues is stranded — and
this repository’s issues are overwhelmingly the pipeline’s own. Moving the
repository keeps the pipeline with its issues, its D18 evidence and its
Approver; the small consumer half is extracted afterwards into a new,
differently named repository in Poetic-Poems (GitHub retires
Poetic-Poems/agent-ops on transfer, so the name cannot be reused). D8 is
amended to say so.
What the transfer carries, and what it does not
Section titled “What the transfer carries, and what it does not”GitHub transfers issues, pull requests, wiki, stars, watchers, releases and
settings (the default branch ruleset included), keeps every commit, and
redirects git clone/fetch/push and every web link from the old
location until something is created at it — which the retirement forbids.
The repository has no webhooks, no Actions secrets or variables, no deploy
keys, no Pages site; every workflow declares its own permissions: block,
so the receiving organisation’s default GITHUB_TOKEN policy does not
matter.
Three things do not follow a repository across an organisation boundary. Each touches the running fleet, which is why the move is a runbook and not a click.
- Every node’s
GH_TOKENis a fine-grained PAT, and a fine-grained PAT reaches exactly one owner. (“Each token is limited to access resources owned by a single user or organization.”) Reads of a public repository keep working; the branches, pull requests, issues, labels and comments the pipeline writes into agent-ops do not, and the same token still has to write topoetic,poetic-fiddleandagent-ops-statein Poetic-Poems. See “Credential model” below. - The image is the deployment artefact, and it lives in
ghcr.io/poetic-poems/./appinside it is agent-ops (.github/workflows/build-image.yml). GHCR packages belong to the organisation namespace, not the repository: on transfer the package’s link to the repository is removed and the transferred repository’s workflows lose access to it. Sobuild-image.ymlmust publish toghcr.io/pullwright/agent-ops, and every node’sAGENT_OPS_IMAGEmust follow — otherwise:latestin the old namespace goes stale and every node silently stops rolling, the failure modedeploy/docker/README.md’s “Is this node on the newest image” section exists for. Anonymous pulls keep working; no registry login is needed. - A GitHub App installation is per organisation, so the Approver’s own
installation does not follow the repository.
pullwright-approver-poeticis installed on Poetic-Poems; agent-ops leaves that installation’s scope on transfer. #913 (landed) resolved this ahead of the transfer:lib/approver-token.shnow resolves the installation id per repository owner (PULLWRIGHT_APPROVER_INSTALLATION_IDS, falling back to the scalarPULLWRIGHT_APPROVER_INSTALLATION_ID), andscripts/doctor.sh’s installation checks run once per distinct installation rather than assuming one covers every repository. What remains for this transfer is the owner act #913 left out of its own scope: installingpullwright-approver-poeticon Pullwright too (or transferring it there) withcontents: write,metadata: read,pull_requests: write, and recording the resulting installation id inPULLWRIGHT_APPROVER_INSTALLATION_IDSon every node.
Two lesser effects: the Priority issue field is organisation-scoped
(Pullwright already defines one with the same four options; whether values
survive a cross-organisation transfer is undocumented — the rehearsal below
answers it), and claims in the state repository are keyed by slug
(claims/Poetic-Poems__agent-ops/…), so the cutover happens with the fleet
stood down and any straggler ages out through claim_ttl_hours.
Every step is marked owner act (performed by @warwickallen, on GitHub or on a node) or fleet (an ordinary pull request the pipeline can build).
Rehearsal — owner act, 20 minutes, no fleet impact
Section titled “Rehearsal — owner act, 20 minutes, no fleet impact”- Create
Poetic-Poems/rehome-rehearsal, public. Open one issue and setPriority: High. Add a default-branch ruleset copyingdefault’s rules. - Transfer it to Pullwright. Check: is the Priority value still on the issue? Is the ruleset intact?
- Delete the repository. If the Priority value was lost, plan to re-band
agent-ops’s open issues after T0 (47 of 57 carried a band on 2026-08-28);
unbanded issues read as
Mediumand the Refiner’s ratchet rebuilds the rest over time.
Before T0
Section titled “Before T0”- The docs PR — this runbook and the D8 amendment. fleet or owner
- #913 — per-owner Approver installation. fleet
- Make
pullwright-approver-poeticinstallable outside its owner account (App settings → “Where can this GitHub App be installed?”), or transfer the App to the Pullwright organisation; install it on Pullwright withcontents: write,metadata: read,pull_requests: write; note the installation id. owner act - Mint four personal access tokens (classic) —
repo,workflow,read:org— one per node, each with an expiry; confirm Pullwright’s organisation settings allow classic tokens. Check the first one against “Credential model” below before minting the other three. owner act - The sweep PR (
chore: re-home under Pullwright — slug and image sweep): opened against the old slug, kept green, not merged. Itsconfig.jsonnames a repository that does not exist until T0, and itsbuild-image.ymlpublishes to a namespace the Poetic-Poems repository’sGITHUB_TOKENcannot push to. fleet keeps it rebased
T0 — owner act, about an hour with the fleet stood down
Section titled “T0 — owner act, about an hour with the fleet stood down”- Stand the fleet down and wait for the running cycles to finish:
Terminal window docker exec agent-ops-scheduler-1 /app/agent-cycle.sh --disable 'agent-ops re-homing' --for 3h# then, on each node, until it exits 0:docker exec agent-ops-scheduler-1 /app/deploy/docker/watchtower-pre-update.sh; echo $? - Transfer the repository: agent-ops → Settings → Danger zone → Transfer →
Pullwright. Confirm the redirect:gh repo view Poetic-Poems/agent-opsresolves toPullwright/agent-ops. - Merge the sweep PR (rebase first if
mainmoved; pushes to the old remote redirect). Watch “Build the node image” publishghcr.io/pullwright/agent-ops:latest. Open the new package’s settings: it is private by default when a package is first published by a workflow into a fresh namespace, and must be switched to public. (Note: GHCR returnsdeniedfor both a private package and a non-existent one, so ifdocker compose pullfails between the merge and the publish run finishing, check the “Publish to GHCR” workflow to tell whether:latestis not yet published or published-but-private — the workflow runs only onpushtorefs/heads/main, not on merge-queue runs, so:latestcan briefly not exist between a merge and the push-triggered publish completing. The repository link needs no action:build-image.ymlalready setsorg.opencontainers.image.source, which links the package automatically.) - On each node —
~/poetic-node-1(ockham-container),~/poetic-node-2(ockham-2),/opt/poetic-node(poetic-1),/opt/poetic-node-2(poetic-2). A running container keeps the.envit was created with, so the recreate is the step, not the edit:From the workstation,Terminal window $EDITOR .env # GH_TOKEN=<this node's classic token># AGENT_OPS_IMAGE=ghcr.io/pullwright/agent-ops:latest# the per-owner Approver installation variable #913 settles onuntil docker exec agent-ops-scheduler-1 /app/deploy/docker/watchtower-pre-update.sh >/dev/null 2>&1; do sleep 30; done# ⚠️ docker compose up -d reads .env only via interpolation (compose.yaml has no env_file:),# so a GH_TOKEN exported in the shell will override the .env value just edited.# Run this from a shell with no GH_TOKEN exported, or unset GH_TOKEN first.docker compose pull && docker compose up -ddocker compose ps -a --format "table {{.Name}}\t{{.Service}}\t{{.Status}}" # one row per profiled servicedocker exec agent-ops-scheduler-1 /app/scripts/doctor.sh # token writes to both owners; App covers agent-opshelper-scripts/env-key-hash.sh GH_TOKENmust show no node asSTALE. - Re-point the workstation clone:
git remote set-url origin https://github.com/Pullwright/agent-ops.git. --enable, and watch the first cycle on each node: it selects and clones under the new slug, the Approver reviews an agent-ops pull request, andfailed-runsis empty.
Aftercare
Section titled “Aftercare”- Release any claim still under
claims/Poetic-Poems__agent-ops/in the state repository, or leave it to expire. - Delete or leave
ghcr.io/poetic-poems/agent-ops— it is public and contains nothing the repository does not. -
Poetic-Poems/helper-scripts/count-autonomous-agent-prs.shreadsconfig.jsonfrom the old slug; one line. - Dashboard history keeps the old slug on pre-move records, so per-repo panels show two agent-ops rows for a while; cosmetic. The daily merge budget for agent-ops restarts.
- Tick #912 and amend this document where the rehearsal or the cutover overtook it.
Credential model
Section titled “Credential model”Until D25’s Forge App exists, each node’s GH_TOKEN becomes a personal
access token (classic) with repo, workflow and read:org. It reaches
every owner the fleet writes to, needs no code change, and keeps “one token
per node, so a single node can be revoked without disturbing the others”.
repo must be the full scope rather than public_repo: three of the four
repositories are public, but the state repository
Poetic-Poems/agent-ops-state is private. It carries the rest of the
fine-grained set with it — contents, issues, pull requests, actions
(dispatch, rerun, cancel) — and the security-alert read that README.md’s
code-scanning section already notes repo satisfies on a classic token.
workflow is separate and not implied by repo; it is what lets a cycle’s
pull request touch .github/workflows/.
read:org is not wanted by any call the pipeline makes. It is wanted by
gh itself, and only once the token is classic. gh’s minimum-scope check
(HeaderHasMinimumScopes, pkg/cmd/auth/shared/oauth_scopes.go) returns
early when the X-Oauth-Scopes response header is empty — which is exactly
what a fine-grained PAT sends, so the check has never once run against this
fleet. A classic token populates that header, the check runs for real, and
it requires repo and one of read:org/write:org/admin:org. Without
it gh auth status exits non-zero, so scripts/doctor.sh reports “gh is
not authenticated — run ‘gh auth login’ or set GH_TOKEN” and leaves
gh_ready clear, skipping the per-repository push-permission checks, the
Priority-field probe and the token-expiry reading — the three checks T0
step 4 leans on as its acceptance gate. The message would be wrong and the
gate blind, on four nodes at once, at the one moment the doctor has to be
believable.
No project scope is needed: Priority is a repository/organisation
IssueFieldSingleSelect reached through repository.issueFields
(lib/issue-priority.sh), not a Projects v2 field, so repo covers both
the read and setIssueFieldValue. scripts/doctor.sh probes it per
repository and says so outright, rather than leaving it to be inferred.
Mint each token with an expiry: GitHub states a classic token’s expiry in
the same GitHub-Authentication-Token-Expiration response header any other
personal access token with an expiry carries, so requirement 2.7a’s warning
— the guard #694 built after the 2026-08-22 fleet-wide expiry outage (#691)
— survives the cutover unchanged.
Check the first token before minting the other three — the two things most likely to surprise are one command apart:
GH_TOKEN=<the new token> bash -c ' gh auth status; echo "auth status exit: $?" gh api rate_limit --include 2>/dev/null \ | grep -i "^github-authentication-token-expiration:" for r in Poetic-Poems/poetic Poetic-Poems/poetic-fiddle \ Poetic-Poems/agent-ops-state Pullwright/agent-ops; do printf "%-30s push=%s\n" "$r" \ "$(gh api "repos/$r" --jq .permissions.push 2>&1 | head -1)" done'Wanting: exit 0 from auth status with all three scopes listed, an
expiration header, and push=true — Pullwright/agent-ops answers 404
until step 2 of T0 has run, and push=true from then on.
What the interim gives up is the fine-grained model’s repository-level
scoping: a classic repo token sees every repository its owner can. The
alternative — two fine-grained tokens per node and a per-owner selection in
front of every
gh call — touches every call site and the doctor’s token checks, for a
property D25 delivers anyway; it is not worth building twice. The Forge App
(#607, D25) retires the interim: one installation per organisation, each
minting short-lived tokens scoped to that organisation’s repositories.
What was dropped, and why
Section titled “What was dropped, and why”The private option (Team plan, private image with docker login on every
node, lib/image-drift.sh authenticating to the registry, removal of
CodeQL and its ruleset rules, loss of the merge queue) was assessed on
2026-08-28 and dropped the same day when D5 was reaffirmed: a public
repository is the product’s marketing, and the private half owned most of
the cost. Should it ever return, the assessment linked at the top carries
the full sequence.