Repository navigation
Description
Overview
Heart's manifest_drift check is YELLOW: PyAutoMind/scripts/repos_sync.py --check reports check tenant firewall (organ code): 9 mismatch(es) — instance facts (satellite repo names) in Brain/Heart/Hands organ code outside the declared config surfaces. A deep-research pass (2026-08-17, three parallel agents over the design docs, CI surfaces, and every finding) rejected the naive allowlist-all-9 clear: the recorded decision rule is "derivable or arbitrary → refactor; genuine branded fact → declare the surface" (PyAutoMind/complete/2026/08/autohands-firewall-allowlist.md), and recurrence is structural because no CI anywhere runs the firewall check — all 9 findings merged through green PRs (2026-08-08 → 08-14). This task clears the 9 by the rule (Phase A) and adds PR-time gates so an allowlist patch is never needed reactively again (Phase B).
Plan
- Extract Heart's
smoke.pyworkspace table to Heart's declared config surface (config/repos.yaml), the established idiom from the July config extraction. - Genericise five test files whose repo-name fixtures are verified non-load-bearing (synthetic names can never drift); derive the Hands test's literals from its already-parsed
SPECS. - Allowlist only the two justified findings (net +1 entry / +1 token, vs +8 entries for the naive clear), with the mandated exactness/negative-probe audit.
- Add an
--onlycheck selector torepos_sync.py, then a firewall gate step to Brain/Heart/Hands PR CI (and a Mind-side leg for allowlist edits), so drift fails in the PR that authors it. - File the
repos_sync --writeconfig-surface stamper (assessment §8-4, the design's own endgame) as a separate draft prompt — out of scope here.
Detailed implementation plan
Research grounding (why this shape)
- Design intent: the firewall exists for the config-diff fork model (
PyAutoMind/docs/pyautobrain/pyautoscientist_generalisation_assessment.md§8; shipped prose inPyAutoBrain/docs/adoption/config_surfaces.md).FIREWALL_ALLOWLISTreached its intended terminal state 2026-07-10 (72 files / 262 tokens — "docstring examples + test fixtures + workspace-root defaults only",complete/2026/07/pyautoscientist-4b.md) and has since accreted to 109 files / 430 tokens via six reactive patches. The header forbids growing it casually. - Recurrence mechanics: Brain/Heart/Hands PR workflows are deliberately pytest-only; Mind's PR CI never executes
repos_sync.py(a green Mind PR is NOT evidence the firewall passes — recorded incomplete/2026/08/autohands-firewall-allowlist.md); Heart'smanifest_drift.pyis exit-0, local-only, folded into one YELLOW line, and invisible to the cloud health run (readiness.py--cloudlists it as unobserved). All 9 findings postdate the 2026-07-18 clear and postdate each repo's PR CI. - Forbidden shortcut (recorded, do not re-propose): teaching the checker to ignore comments/docstrings.
Affected Repositories
- PyAutoMind (primary — allowlist,
--onlyselector,check_heartextension, Mind CI leg) - PyAutoBrain (3 test-fixture genericisations, tests.yml gate step)
- PyAutoHeart (smoke.py config extraction, 2 test genericisations, heart-tests.yml restructure + gate)
- PyAutoHands (test derivation, tests.yml restructure + gate) — see Coordination below
Branch Survey (2026-08-17)
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoMind | main | clean (workflow-state commits only) |
| ./PyAutoBrain | main | clean |
| ./PyAutoHeart | main | clean |
| ./PyAutoHands | main | clean — claimed by version-stamp-sync-guards (PyAutoHands#235, feature/version-stamp-sync-guards) |
Suggested branch: feature/tenant-firewall-drift-aug (each repo)
Coordination: the PyAutoHands leg (test_pre_build_staging.py + tests.yml) must either wait for #235 to merge or land on its own branch with a rebase check afterward — do not touch the version-stamp task's files (autohands/ version-stamp/sync-guard code).
Phase A — clear the 9 by the decision rule
PyAutoHeart/heart/smoke.py— extract, don't allowlist.WORKSPACES(WorkspaceSpec(key, directory, chain), ~lines 36-97) andIMPORT_NAMES(~line 99) are executable config (consumed for paths, PYTHONPATH, pip targets, import preflight, argparse choices). Move both to asmoke:block inPyAutoHeart/config/repos.yaml; load with a strict reader (KeyError on absence — twin precedents:heart/checks/version_skew.pyworkspace_library(),PyAutoHands/autohands/run_all.py_load_workspaces(); both fromcomplete/2026/07/pyautoscientist-3b-config.md). Config YAML is firewall-exempt (check_tenant_firewallscans only.py/.sh). Reword the residual--rootargparse help at smoke.py:591 from "PyAutoLabs organism root" to "organism root". Extendcheck_heartinPyAutoMind/scripts/repos_sync.pyto validate the newsmoke:block's repo names against the manifest (closes the same identity-unchecked gapversion_skew:has).- Genericise fixtures (all verified non-load-bearing; add a convention comment per the Aug 5 precedent so real names don't creep back):
PyAutoBrain/tests/test_worktree_conflict_guard.py— 7 tokens in active.md fixture strings; the awk inbin/worktree.shdoes plain string compares, validates against no repo list →RepoA/RepoB. Keep the module docstring's two real drifted forms only if quoted as history (prefer rewording).PyAutoBrain/tests/test_intake_dashboard.py(~110/121/132) — owner in a fake issue URL; the regex never inspects the owner →ExampleOrg.PyAutoBrain/tests/test_profiling_conductor.py— fixture dirautolens_profiling; every_runpasses--workspaceexplicitly →profiling_workspace(also proves the override is honoured).PyAutoHeart/tests/test_smoke.py— already half-synthetic (demo_workspace,legacy_workspace); chain entries are used as dir names /./namepip strings, preflight tests use empty chains →LibraryA/LibraryB; roottmp_path/"PyAutoLabs"→"organism".PyAutoHeart/tests/test_release_run.py(~263) —per_projectdict key is merged generically, never matched →demo_workspace.
PyAutoHands/tests/test_pre_build_staging.py— derive in-file. The file already parsesSPECSfrompre_build.shprecisely so fixtures cannot drift; replace the arbitrary literals (autolens_assistant141,autolens_workspace176/216,HowToFit/autofit_workspace204-211) withSPECS[i][0]picks, andpyautobase = tmp_path/"PyAutoLabs"(61) → neutral name (pre_build.shderives PYAUTOBASE from its own location).- Allowlist the two justified in
PyAutoMind/scripts/repos_sync.pyFIREWALL_ALLOWLIST:- extend
"PyAutoBrain/agents/conductors/intake/_intake.py"withautofit_workspace(measured-noise docstring at ~890 — names+counts are the evidence for rejecting the file-spread threshold; the code itself already derives from the body map); - add
"PyAutoBrain/tests/test_intake_reconcile_ranking.py": {PyAutoArray, PyAutoFit, PyAutoLabs, autofit_workspace, autolens_workspace} — assertions pin resolution against the live body map (_upstream_noisefiltering requires real manifest names;slug == "PyAutoLabs/PyAutoFit"). - Run the exactness audit mandated by
complete/2026/08/autohands-firewall-allowlist.md(negative probes: a wrong token in these files must still fail).
- extend
Phase B — PR-time enforcement
repos_sync.py main(): add--only <check-label>(repeatable or single) so a caller can run one leg; today it's all-or-nothing (lines ~845-874). Exit 1 only on the selected legs' drift.PyAutoBrain/.github/workflows/tests.yml: add a steppython3 PyAutoMind/scripts/repos_sync.py --check --only "tenant firewall (organ code)" --root "$GITHUB_WORKSPACE". The workflow already checks out Brain atpath: PyAutoBrain+PyAutoLabs/PyAutoMindatpath: PyAutoMind— the exact layout--rootneeds;check_tenant_firewallskips organs not checked out, so it gates exactly Brain. (--onlyavoids the map-block legs reddening Brain PRs on unrelated Mind-side changes.)PyAutoHeart/.github/workflows/heart-tests.ymlandPyAutoHands/.github/workflows/tests.yml: restructure from bare root checkout topath: PyAutoHeart|PyAutoHands+PyAutoLabs/PyAutoMindsibling; move pip/pytest underworking-directory:; add the same--onlyfirewall step. (Hands' "only pytest" header is a preference, not an invariant — it already concedes one cross-repo hole.)- Mind-side leg: new job/workflow in PyAutoMind PR CI, path-filtered to
scripts/repos_sync.py, checking out Mind + the three organs and running the firewall leg (full--checkacceptable — absent repos early-return), so allowlist edits and over-grants are themselves verified.
Phase C — file, don't build
- Write
PyAutoMind/draft/feature/pyautomind/repos-sync-config-stamper.md: teachrepos_sync --writeto stamp organ config surfaces from the body map + per-organ policy (assessment §8-4: "the only real engineering in the whole plan"; removes hand-mirroring). Reference this issue.
Key Files
PyAutoMind/scripts/repos_sync.py— FIREWALL_ALLOWLIST (+1 entry, +1 token),check_heartsmoke-block leg,--onlyselectorPyAutoHeart/config/repos.yaml— newsmoke:block;PyAutoHeart/heart/smoke.py— table → strict loaderPyAutoBrain/tests/{test_worktree_conflict_guard,test_intake_dashboard,test_profiling_conductor}.py,PyAutoHeart/tests/{test_smoke,test_release_run}.py,PyAutoHands/tests/test_pre_build_staging.py— fixture genericisation/derivationPyAutoBrain/.github/workflows/tests.yml,PyAutoHeart/.github/workflows/heart-tests.yml,PyAutoHands/.github/workflows/tests.yml, Mind PR CI — gates
Verification
python3 PyAutoMind/scripts/repos_sync.py --check --root <workspace-root>→check tenant firewall (organ code): OK, all other legs unchanged, exit 0.- Negative probes: insert a bogus manifest name into a genericised test file and into an allowlisted file → the check must flag both; remove before commit.
pytestgreen in Mind, Brain, Heart, Hands (the genericised tests especially).- Each amended workflow passes on its own PR — the gate step proving itself on the branch that adds it.
- Heart local:
python3 PyAutoHeart/heart/checks/manifest_drift.py→ "identity in sync"; YELLOW reason drops from readiness after merge to the canonical mains (Heart grades canonical checkouts, not worktrees).
Original Prompt
Click to expand starting prompt
See PyAutoMind/active/tenant-firewall-drift-aug.md (moved from draft/maintenance/pyautomind/ on issue creation) — includes the user's original request verbatim and the research conclusions.
Activity
prompt: file issue for tenant-firewall-drift-aug (#198) + stamper draft
Jammy2211 commentedon Aug 17, 2026
Planning complete (laptop session, 2026-08-17); execution handed to a remote session. Two operational notes not in the plan body:
Sequencing: the organ CI gate steps (Phase B items 6-8) invoke
repos_sync.py --only ...from aPyAutoLabs/PyAutoMindcheckout ofmain— so the PyAutoMind PR (allowlist +--onlyselector +check_heartextension) must merge before the Brain/Heart/Hands gate PRs can go green. Open the Mind PR first; the organ PRs can be prepared in parallel but will only pass CI after it lands.PyAutoHands coordination: the repo is claimed by
version-stamp-sync-guards(PyAutoHands#235). The Hands leg (test_pre_build_staging.py derivation + tests.yml gate) waits for #235 to merge, or lands on its own branch with a rebase check afterward. Do not touch the version-stamp files.Phase C filed as
draft/feature/pyautomind/repos-sync-config-stamper.md— not part of this task.Jammy2211 commentedon Aug 17, 2026
Execution complete (remote session, 2026-08-17). All PRs are open — nothing merged, per the handoff; merge order below.
PRs (merge in this order):
--onlyselector,check_heartsmoke-block leg. Merge first.smoke.py→config/repos.yamlextraction, and the--onlyfirewall gate steps in their PR CI. Their gate steps go green only after maintenance: firewall allowlist +2 by the rule, --only selector, smoke-block identity leg #199 is on Mindmain(expected red until then).firewall_gate.yml), stacked on maintenance: firewall allowlist +2 by the rule, --only selector, smoke-block identity leg #199. Merges last: one execution-time review finding was that a single Mind PR carrying both the checker changes and this workflow could never be green at merge time (the workflow checks organ mains, which stay drifted until step 2 merges — circular with the maintenance: firewall allowlist +2 by the rule, --only selector, smoke-block identity leg #199-first requirement). Splitting keeps every PR in the arc green at its merge.Verification run against the branch trio (Mind + Brain + Heart): full
--check→check tenant firewall (organ code): OK, all other legs unchanged, exit 0; negative probes flagged a bogus token in a genericised file, in an allowlisted file, and in the newsmoke:block; pytest green — Mind 139, Brain 349, Heart 469;manifest_drift→ "identity in sync (11 surfaces)";heart.smoke --helploads the identical workspace key set from config. The YELLOW reason drops after the merges reach the canonical mains (Heart grades canonical checkouts).Deferred — the PyAutoHands leg (blocked on PyAutoHands#235):
tests/test_pre_build_staging.py: derive repo literals from the already-parsedSPECS; rename thepyautobasefixture dir to a neutral name..github/workflows/tests.yml: restructure topath: PyAutoHands+PyAutoLabs/PyAutoMindsibling; add the--only "tenant firewall (organ code)"gate step.firewall_gate.yml(deliberately omitted in ci: Mind-side tenant-firewall gate over the checker itself #200 so the gate stays green while Handsmainstill carries its finding).Two notes for the record: the
active.mdentry is updated toprs-openwith the four PR links (its registeredstatus:line pointed at PyAutoLens#700 — looked like a copy-paste slip, overwritten). And thecheck_heartsmoke leg soft-skips a Heart config without thesmoke:block, so #199 merges cleanly ahead of Heart#147; Heart's own strict loader still fails loudly if the block ever disappears afterwards.Generated by Claude Code
Jammy2211 commentedon Aug 17, 2026
Merged. Adversarial final review found no blocking issues (two accepted-by-design notes: a malformed
smoke:spec crashescheck_heartloudly rather than reporting a tidy mismatch, consistent with the strict style;--writecombined with--onlystill runs all writes — no caller does this). All four PRs then merged in order, each green at merge time:0562f0d) — allowlist +2,--only,check_heartsmoke leg.642fa0d) and test: genericise repo-name fixtures + add PR-time tenant-firewall gate PyAutoBrain#229 (90d86b0) — retriggered after maintenance: firewall allowlist +2 by the rule, --only selector, smoke-block identity leg #199 landed; pytest + the new firewall gate step green on both before merging.e9e99fc) — retriggered after the organ merges; its firewall job green against the cleared organ mains, then merged.Post-merge main runs all verified green: Brain
Tests(pytest + gate) on90d86b0, HeartHeart Tests(pytest + gate) on642fa0d, MindTenant Firewall Gateone9e99fc. En route, the gate demonstrated itself twice: pre-#199 it failed organ PRs withunrecognized arguments: --only(the selector not yet on Mind main), and pre-organ-merge the Mind gate run listed exactly the 6 findings still on the organ mains.active.mdupdated to MERGED. Remaining before this task completes:firewall_gate.yml.Generated by Claude Code
firewall_gate: check PyAutoHands out now its leg has landed
firewall_gate: check PyAutoHands out now its leg has landed (#208)
Archive tenant-firewall-drift-aug as complete
Archive tenant-firewall-drift-aug as complete (#209)
Jammy2211 commentedon Aug 18, 2026
Both remaining checklist items are resolved. 9 → 0.
The Hands leg's blocker was already gone: PyAutoHands#235 merged as #236 at
2026-08-17 22:03 UTC — 71 minutes before the comment above deferred the leg
behind it. It had been unblocked and unnoticed since.
b7496ec) —test_pre_build_staging.pyderives itsfive remaining repo literals from the already-parsed
SPECS; thepyautobasefixture root is neutral;
tests.ymlrestructured topath: PyAutoHands+sibling PyAutoMind with the
--onlygate step. All three matrix legs green,the new gate step included — it proved itself on the PR that added it.
84dac42) — adds the PyAutoHands checkout tofirewall_gate.yml. Green against all three organ mains.The two items were never independent.
heart/checks/manifest_drift.pyshells out to
repos_sync.py --checkand parses its report lines rather thanreimplementing the check, so on a full local workspace — where all four organs
are checked out — the tenant-firewall reason could not drop while the Hands
finding stood, no matter how many ticks ran. With #237 merged it clears on the
next local tick.
One trap worth recording, which nearly closed this a day early: a green
firewall
--checkis not evidence unless the organ is actually checked out.check_tenant_firewallsilentlycontinues past absent organs(
repos_sync.py:775). A container holding only Mind + Brain reportscheck tenant firewall (organ code): OKwhile a live finding sits on Handsmain. Verify against a four-organ root. The same property is what makes theper-organ gates safe, so it is load-bearing rather than a bug.
Verification on the cleared tree: four-organ
--check→OK, exit 0; negativeprobe re-run — a bogus manifest name injected into the genericised file is still
flagged (exit 1), so the check was not weakened into passing.
Registry closed out in #209: record at
complete/2026/08/tenant-firewall-drift-aug.md,active.mdsection dropped, dashboard regenerated.Ready to close once you see Heart drop the reason locally.
Generated by Claude Code
complete: heart-worktree-drift-hidden-dirs