Overview
Local $smoke-test execution currently trusts the ambient Python environment, even though workspace CI owns explicit install contracts. This allowed missing dill, numba, nufftax, and Jupyter/kernel dependencies to interrupt a local all-workspace sweep despite the relevant libraries and CI already declaring them. The gap became visible after the NUFFT default and compatibility work evolved from May through August 2026 while the local smoke skill, introduced in late June, retained its ambient-environment assumption.
The fix should make local smoke execution reproducible without creating a second manually maintained dependency list.
Plan
- Add a Heart-owned local smoke command with one isolated, cached environment per workspace.
- Build each environment from the workspace-owned CI install contract where present, with a generic metadata-derived fallback for legacy workspaces.
- Invalidate cached environments when Python, the installer, or relevant library dependency metadata changes.
- Execute current local library source and PyAutoHands helpers explicitly so cached wheels cannot hide worktree changes.
- Fail fast when the selected interpreter, Jupyter kernel, or required runtime imports do not resolve inside the smoke environment.
- Cover isolation, cache invalidation, preflight failure, and ambient-environment leakage with lightweight tests.
- Route the local smoke skill through the command and document rebuild/recovery behavior.
Detailed implementation plan
Affected Repositories
Work Classification
- Direct PyAutoHeart validation-tooling bug; no library or workspace source changes.
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./PyAutoHeart |
main |
clean |
No active task claims PyAutoHeart and no recent feature branch overlaps this work.
Suggested branch: fix/persist-smoke-environments
Worktree root: /home/jammy/Code/PyAutoLabs/.worktrees/persist-smoke-environments/
Implementation Steps
- Add
heart/smoke.py as a standard-library orchestration layer for workspace selection, environment fingerprints, isolated virtualenv creation, installer execution, preflight checks, and invocation of the workspace-owned smoke runner.
- Fingerprint Python identity, each workspace install epilogue, and the
pyproject.toml files of its local dependency chain. Rebuild automatically on mismatch and support an explicit rebuild flag.
- Prepend the environment's executable directory to
PATH and local library/PyAutoHands source roots to PYTHONPATH; verify subprocess Python and Jupyter/kernel ownership before any science scripts run.
- Use each workspace's
.github/scripts/smoke_install.sh as the dependency source of truth. For a legacy workspace without that contract, derive the local library install set and optional extras from package metadata rather than listing third-party packages in Heart.
- Wire
pyauto-heart smoke through bin/pyauto-heart with workspace filters, prepare-only, rebuild, and organism-root options.
- Update
skills/smoke_test/SKILL.md and reference.md so agents use the command rather than reconstructing the environment manually.
- Add
tests/test_smoke.py using temporary fixture repositories and mocked/lightweight subprocesses; keep Heart's own suite free of scientific dependencies.
Key Files
heart/smoke.py — isolated environment lifecycle and smoke orchestration.
bin/pyauto-heart — user-facing command dispatch.
tests/test_smoke.py — regression coverage.
skills/smoke_test/SKILL.md — canonical local smoke workflow.
skills/smoke_test/reference.md — environment ownership and recovery detail.
Validation
- Run the focused smoke-environment tests.
- Run the complete PyAutoHeart test suite.
- Exercise prepare-only mode against at least one real workspace and prove its interpreter and imports come from the generated environment.
- Verify a metadata fingerprint change triggers rebuilding before script execution.
Original Prompt
Click to expand starting prompt
And make sure it is permanent enough to stay in future as I feel like nufftax and other issues crop up now and then? Maybe this was recent work
Overview
Local
$smoke-testexecution currently trusts the ambient Python environment, even though workspace CI owns explicit install contracts. This allowed missingdill,numba,nufftax, and Jupyter/kernel dependencies to interrupt a local all-workspace sweep despite the relevant libraries and CI already declaring them. The gap became visible after the NUFFT default and compatibility work evolved from May through August 2026 while the local smoke skill, introduced in late June, retained its ambient-environment assumption.The fix should make local smoke execution reproducible without creating a second manually maintained dependency list.
Plan
Detailed implementation plan
Affected Repositories
Work Classification
Branch Survey
No active task claims PyAutoHeart and no recent feature branch overlaps this work.
Suggested branch:
fix/persist-smoke-environmentsWorktree root:
/home/jammy/Code/PyAutoLabs/.worktrees/persist-smoke-environments/Implementation Steps
heart/smoke.pyas a standard-library orchestration layer for workspace selection, environment fingerprints, isolated virtualenv creation, installer execution, preflight checks, and invocation of the workspace-owned smoke runner.pyproject.tomlfiles of its local dependency chain. Rebuild automatically on mismatch and support an explicit rebuild flag.PATHand local library/PyAutoHands source roots toPYTHONPATH; verify subprocess Python and Jupyter/kernel ownership before any science scripts run..github/scripts/smoke_install.shas the dependency source of truth. For a legacy workspace without that contract, derive the local library install set and optional extras from package metadata rather than listing third-party packages in Heart.pyauto-heart smokethroughbin/pyauto-heartwith workspace filters, prepare-only, rebuild, and organism-root options.skills/smoke_test/SKILL.mdandreference.mdso agents use the command rather than reconstructing the environment manually.tests/test_smoke.pyusing temporary fixture repositories and mocked/lightweight subprocesses; keep Heart's own suite free of scientific dependencies.Key Files
heart/smoke.py— isolated environment lifecycle and smoke orchestration.bin/pyauto-heart— user-facing command dispatch.tests/test_smoke.py— regression coverage.skills/smoke_test/SKILL.md— canonical local smoke workflow.skills/smoke_test/reference.md— environment ownership and recovery detail.Validation
Original Prompt
Click to expand starting prompt