Repository navigation
Description
Overview
Phase 2a of the GitHub token consolidation (parent Mind prompt github_token_and_secret_setup_full_review; phase 1 merged as PyAutoHeart#316 + PyAutoHands#322, record complete/2026/10/github-token-p1-hands-app.md). The organ workflows that read across repos, dispatch, or open a PR move off the person-owned PAT_PYAUTOLABS and two never-created secrets onto the org-owned pyautolabs-bot App, and every silent credential fallback is removed. Phase 2b (owner-wide writers: Brain sweep/archive, Gut void, Mind pushers) follows separately.
Plan
- Brain nightly release driver mints a scoped App token (actions write + contents read on PyAutoHands) to dispatch and poll the Hands release.
- Brain
repo_settings.ymlis retired: it needs the Administration permission the App deliberately lacks. The equivalent localgh apiloop is recorded in the Brain reference that pointed at it. - Heart health replaces the never-created
HEART_TIMINGS_TOKENwith an owner-wide read-only App token, so cross-repo artifact reads stop 403ing. The fallback to the job token is deleted. - Scientist organism board replaces the PAT with an owner-wide read-only App token; the
|| github.tokenfallback and the silent request-budget drop are deleted. - Memory queue filing replaces the never-created
QUEUE_PR_TOKENwith an App token scoped to PyAutoMemory so the PR actually opens and triggers CI. - One PR per repo; each migrated workflow is run once in a side-effect-free mode after merge and reported.
Tier: judge — merge mode: human /prm
Detailed implementation plan
Affected Repositories
- PyAutoBrain (primary)
- PyAutoHeart
- PyAutoScientist
- PyAutoMemory
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| organs/PyAutoBrain | main | clean (unregistered feature/pyautodna-stack-management worktree exists) |
| organs/PyAutoHeart | main | clean |
| organs/PyAutoScientist | main | clean (same unregistered worktree) |
| organs/PyAutoMemory | main | clean |
Suggested branch: feature/github-token-p2a-readers-app
Implementation Steps
PyAutoBrain/.github/workflows/nightly-release.yml: addactions/create-github-app-token@v3(client-id: ${{ vars.APP_CLIENT_ID }},private-key: ${{ secrets.APP_PRIVATE_KEY }},owner: PyAutoLabs,repositories: PyAutoHands,permission-actions: write,permission-contents: read); replaceGH_TOKEN: ${{ secrets.PAT_PYAUTOLABS }}with the step output. UpdatePyAutoHands/docs/nightly_release_design.md's secrets list only if it is in this repo set (it is not: note it in the PR for phase 5).PyAutoBrain/.github/workflows/repo_settings.yml: delete. Grep Brainskills/anddocs/forrepo_settingsand replace the pointer with the local loopfor r in $(gh repo list PyAutoLabs -L 200 --json name --jq '.[].name'); do gh api -X PATCH repos/PyAutoLabs/$r -f delete_branch_on_merge=true; done.PyAutoHeart/.github/workflows/heart-health.yml: mint step withpermission-actions: read(norepositories:→ all installed repos);GH_TOKEN: ${{ steps.app_token.outputs.token }}; delete${{ secrets.HEART_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}and the comment explaining the fallback.PyAutoScientist/.github/workflows/organism_board.yml: mint step withpermission-contents: read+permission-metadata: read, owner-wide;GH_TOKENfrom the step; remove|| github.token; set the request budget to the single PAT value and delete the fallback branch; updateREPORTING.md.PyAutoMemory/.github/workflows/queue_filing.yml: mint step (repositories: PyAutoMemory,permission-contents: write,permission-pull-requests: write);PR_TOKENfrom the step; remove the compare-link fallback; push with the App token (not the job token) so the PR's CI triggers; updateREADME.md'sQUEUE_PR_TOKENparagraph.- Bot identity for any commit:
pyautolabs-bot[bot]/346909844+pyautolabs-bot[bot]@users.noreply.github.com.
Key Files
PyAutoBrain/.github/workflows/nightly-release.yml,repo_settings.ymlPyAutoHeart/.github/workflows/heart-health.ymlPyAutoScientist/.github/workflows/organism_board.yml,REPORTING.mdPyAutoMemory/.github/workflows/queue_filing.yml,README.md
Testing
- YAML parse + actionlint on every touched workflow (the
client-idinput warning is a known actionlint metadata false positive). - Each repo's pytest where present.
- Post-merge:
gh workflow run heart-health.yml,organism_board.yml; nightly only in a non-release/inspect mode if one exists; Memory proven via its PR-trigger mint.
Trade-offs
- Owner-wide tokens (no
repositories:) for Heart and Scientist because they read every repo; permissions are read-only so the blast radius is nil. - Retiring
repo_settings.ymlrather than granting Administration keeps the App unable to delete repos.
Original Prompt
Click to expand starting prompt
GitHub token consolidation phase 2a: organ readers and dispatchers (Brain nightly, Heart, Scientist, Memory) on the App
Type: release
Target: PyAutoBrain
Repos:
- PyAutoBrain
- PyAutoHeart
- PyAutoScientist
- PyAutoMemory
Difficulty: hard
Autonomy: supervised
Priority: high
Status: formalised
Consequence: judge
Parent: draft/release/pyautohands/github_token_and_secret_setup_full_review.md (surveys in_surveys/; phase plan in 03_target_design_and_phases.md); phase 1 = complete/2026/10/github-token-p1-hands-app.md; sibling 2b = draft/release/pyautobrain/github_token_phase2b_owner_wide_writers_app_token.md
Witness:grep -rl PAT_PYAUTOLABS .github/workflowsempty in Brain (except branch_sweep_all/branch_archive, 2b), Heart, Scientist, Memory; no|| github.token/|| secrets.GITHUB_TOKENfallback on any cross-repo credential;repo_settings.ymlgone; one green run of each migrated workflow in a side-effect-free mode
Review-minutes: 20
Unattended: never
Phase 1 proved the App (Heart#316, Hands#322). Move the organ workflows that
READ across repos, DISPATCH, or OPEN A PR off PAT_PYAUTOLABS / never-created
secrets onto per-job actions/create-github-app-token@v3
(client-id: ${{ vars.APP_CLIENT_ID }}, private-key: ${{ secrets.APP_PRIVATE_KEY }},
owner: PyAutoLabs, narrowest repositories:/permission-*:); GH_TOKEN env
for gh, actions/checkout token: for clones. Missing credentials fail the job
loudly: delete every silent fallback. One PR per repo.
- Brain
nightly-release.yml: dispatch + poll Handsrelease.yml→ actions write + contents read on PyAutoHands. Repo variablesNIGHTLY_*unchanged. - Brain
repo_settings.yml: RETIRE (needs Administration, which the App deliberately lacks). Delete the workflow; record the equivalent localgh api -X PATCH repos/PyAutoLabs/<repo> -f delete_branch_on_merge=trueloop in whichever Brain skill/reference pointed at it (greprepo_settings). - Heart
heart-health.yml: replace the never-createdHEART_TIMINGS_TOKENwith an App token (actions read, owner-wide = norepositories:) so cross-repo artifact reads stop 403ing; delete the|| secrets.GITHUB_TOKENfallback; update the inline comment. - Scientist
organism_board.yml: cross-repo activity reads → contents read + metadata, owner-wide; delete the|| github.tokenfallback and the silent 180→60 budget drop (updateREPORTING.md). - Memory
queue_filing.yml: replace the never-createdQUEUE_PR_TOKENwith an App token (pull-requests write + contents write on PyAutoMemory) so the PR actually opens and triggers CI instead of the compare-link fallback; update README.
Validation: YAML parse + actionlint (ignore the known client-id false
positive); each repo's own tests; dispatch each migrated workflow in a
side-effect-free mode after merge to main (Heart health render, Scientist board
render, Brain nightly with its dry/inspect input if one exists — never a live
release) and report; for Memory, a PR-trigger path filter is acceptable proof of
the mint. Keep PRs to .github/, skills/docs; another session's unregistered
pyautodna-stack-management branch exists on Brain and Scientist.
Out of scope: 2b owner-wide writers (Brain sweep/archive, Gut void, Mind pushers), phase 3 dispatchers, phase 4 secret deletion, phase 5 policy page.
🤖 Generated with Claude Code
Activity
fix(release): nightly anchor variable via the App's Variables permiss…
Jammy2211 commentedon Oct 23, 2026
Shipped
pyautolabs-botApp incl. the window-anchor variable via the App's new Variables permission;repo_settings.ymlretired, localgh apiloop documented inskills/repo_cleanup/reference.md)HEART_TIMINGS_TOKEN || GITHUB_TOKENfallback removed)|| github.tokenfallback and the silent 180→60 budget drop removed)All CI green; none of these repos' CI exercises the edited workflows, so post-merge proof = dispatches on main (nightly dry_run, heart-health, organism_board) reported on this issue; Memory proves on its next real filing.
🤖 Generated with Claude Code
Jammy2211 commentedon Oct 23, 2026
Post-merge proofs: Heart heart-health run 39971435680 success; Scientist organism_board run 39971440448 success; Brain nightly dry_run on main (39971454356) failed at the mint — permission is named
actions_variables— fixed by #533 (dry run 39971711185 success on the branch), merged.