Overview
MIND_RULES maps .github/* to KEEP_SUB, which only replaces PyAutoLabs with YOURORG. Everything else passes through verbatim, so a fresh-slate template arrives carrying somebody else's automation — most of which cannot succeed in the org it was spawned for.
Pre-existing; surfaced by the independent review of #118. Split from the bundled instance-state prompt (the autonomy_log half is filed separately).
Evidence — the template's own run history
PyAutoLabs/PyAutoMind-template currently has 13 failing runs from inherited workflows:
| workflow |
reaches outside its own repo? |
template result |
lifecycle_drift.yml |
no — checkout + local scripts |
success |
spawn_drift.yml |
clones YOURORG/* |
fail: repository 'https://github.com/YOURORG/PyAutoMind/' not found |
morning_status.yml |
8 hardcoded sibling repos |
fail ×5 |
morning_health.yml |
PyAutoHeart/PyAutoBrain/PyAutoHands workflow names |
fail ×5 |
arxiv_papers.yml + .github/scripts/arxiv_fetch.py |
PYAUTO_PAPERS_WEBHOOK_URL, CLAUDE_CODE_OAUTH_TOKEN |
fail ×3 |
The spawn_drift failure is the important one: it proves owner substitution does not make a cross-repo workflow work. YOURORG is a literal placeholder, so any workflow that clones or queries a sibling repo is broken on arrival.
Also instance content, not merely broken
arxiv_fetch.py hardcodes strong-lensing search vocabulary and a domain-shaped Claude prompt — a template spawned for a non-lensing org inherits a strong-lensing arXiv query.
arxiv_papers.yml / arxiv_fetch.py carry dated design decisions and incident notes in their headers — live task history.
The rule
A template workflow must be able to succeed on a freshly-spawned repo with no secrets and no sibling repos.
Only lifecycle_drift.yml clears that bar, and the run history proves it — it is the one green workflow.
Plan
- Update
spawn_spec.md rule 9 first, replacing the blanket .github/** KEEP_SUB with explicit per-file rules and stating the principle above.
- Mirror in
MIND_RULES:
lifecycle_drift.yml → KEEP (no owner references at all, so no substitution needed)
spawn_drift.yml → keep but strip the schedule: trigger, so it never auto-fails on an org with no published *-template repos; pull_request + workflow_dispatch remain, with a comment on re-adding the schedule
morning_status.yml, morning_health.yml, arxiv_papers.yml, .github/scripts/arxiv_fetch.py → DROP
- Extend
tests/test_spawn_template_contract.py with the guard that keeps rule 9 honest as new workflows land in Mind: no shipped workflow may carry a secrets. reference, a YOURORG/ cross-repo reference, or a schedule: trigger.
Detailed implementation plan
Affected Repositories
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./PyAutoMind |
main |
clean |
Suggested branch: feature/spawn-github-instance-automation
Key Files
docs/pyautobrain/spawn_spec.md — rule 9 (edit first, then mirror)
scripts/spawn.py — MIND_RULES .github/* entries; a SPECIAL: handler for the schedule strip
tests/test_spawn_template_contract.py — the new guards
Notes
- Dropping these is not a capability loss: a spawned org that later builds the same organs can copy the workflows across deliberately. Shipping them pre-broken, failing weekly and emailing the new owner, is strictly worse.
- Brain sized this "large (score 8), re-home as feature" — not taken; the score is prose-driven,
repos_affected is 1, and the change is a rules table plus one transform and tests.
Original Prompt
Click to expand starting prompt
draft/bug/pyautomind/spawn_github_rules_export_instance_automation.md — filed from the independent review of #118, split from the bundled instance-state prompt.
Overview
MIND_RULESmaps.github/*toKEEP_SUB, which only replacesPyAutoLabswithYOURORG. Everything else passes through verbatim, so a fresh-slate template arrives carrying somebody else's automation — most of which cannot succeed in the org it was spawned for.Pre-existing; surfaced by the independent review of #118. Split from the bundled instance-state prompt (the
autonomy_loghalf is filed separately).Evidence — the template's own run history
PyAutoLabs/PyAutoMind-templatecurrently has 13 failing runs from inherited workflows:lifecycle_drift.ymlspawn_drift.ymlYOURORG/*repository 'https://github.com/YOURORG/PyAutoMind/' not foundmorning_status.ymlmorning_health.ymlPyAutoHeart/PyAutoBrain/PyAutoHandsworkflow namesarxiv_papers.yml+.github/scripts/arxiv_fetch.pyPYAUTO_PAPERS_WEBHOOK_URL,CLAUDE_CODE_OAUTH_TOKENThe
spawn_driftfailure is the important one: it proves owner substitution does not make a cross-repo workflow work.YOURORGis a literal placeholder, so any workflow that clones or queries a sibling repo is broken on arrival.Also instance content, not merely broken
arxiv_fetch.pyhardcodes strong-lensing search vocabulary and a domain-shaped Claude prompt — a template spawned for a non-lensing org inherits a strong-lensing arXiv query.arxiv_papers.yml/arxiv_fetch.pycarry dated design decisions and incident notes in their headers — live task history.The rule
Only
lifecycle_drift.ymlclears that bar, and the run history proves it — it is the one green workflow.Plan
spawn_spec.mdrule 9 first, replacing the blanket.github/**KEEP_SUBwith explicit per-file rules and stating the principle above.MIND_RULES:lifecycle_drift.yml→ KEEP (no owner references at all, so no substitution needed)spawn_drift.yml→ keep but strip theschedule:trigger, so it never auto-fails on an org with no published*-templaterepos;pull_request+workflow_dispatchremain, with a comment on re-adding the schedulemorning_status.yml,morning_health.yml,arxiv_papers.yml,.github/scripts/arxiv_fetch.py→ DROPtests/test_spawn_template_contract.pywith the guard that keeps rule 9 honest as new workflows land in Mind: no shipped workflow may carry asecrets.reference, aYOURORG/cross-repo reference, or aschedule:trigger.Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
feature/spawn-github-instance-automationKey Files
docs/pyautobrain/spawn_spec.md— rule 9 (edit first, then mirror)scripts/spawn.py—MIND_RULES.github/*entries; aSPECIAL:handler for the schedule striptests/test_spawn_template_contract.py— the new guardsNotes
repos_affectedis 1, and the change is a rules table plus one transform and tests.Original Prompt
Click to expand starting prompt
draft/bug/pyautomind/spawn_github_rules_export_instance_automation.md— filed from the independent review of #118, split from the bundled instance-state prompt.