Repository navigation
Description
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
- PyAutoHeart (primary)
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.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. - Fingerprint Python identity, each workspace install epilogue, and the
pyproject.tomlfiles of its local dependency chain. Rebuild automatically on mismatch and support an explicit rebuild flag. - Prepend the environment's executable directory to
PATHand local library/PyAutoHands source roots toPYTHONPATH; verify subprocess Python and Jupyter/kernel ownership before any science scripts run. - Use each workspace's
.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. - Wire
pyauto-heart smokethroughbin/pyauto-heartwith workspace filters, prepare-only, rebuild, and organism-root options. - Update
skills/smoke_test/SKILL.mdandreference.mdso agents use the command rather than reconstructing the environment manually. - Add
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
- 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
Activity
Jammy2211 commentedon Aug 10, 2026
Implementation complete — draft PR #142
The regression was local-workflow drift, not missing library metadata:
nufftaxbecame the default NUFFT backend in May 2026 and its compatibility pins evolved through July.smoke_install.shcontracts were hardened in July/August, including directnufftax/optional-extra fixes, but the local skill did not adopt them.PR #142 adds a Heart-owned
pyauto-heart smokecommand with one locked environment per workspace. The environment fingerprint follows Python, the workspace installer, and dependency-librarypyproject.tomlfiles; local source is injected explicitly, while ambientPYTHONPATHandPYAUTO_*state are removed.pip check, source ownership, interpreter ownership, and Jupyter kernel ownership all run before scripts.A virtualenv is built at its final path because console-script shebangs make completed venvs non-relocatable. During rebuild, the previous complete environment is retained as a rollback backup and restored if install or preflight fails.
Validation:
autogalaxy_workspace --prepare-only: PASS from its checked-in CI installerdill 0.4.1,numba 0.66.0,nufftax 0.6.1PR: #142
Jammy2211 commentedon Aug 10, 2026
Shipped — 2026-08-10
PR
Summary
Smoke-test dependency environments are now isolated and persisted per library/Python version, with version-handshake invalidation so stale packages such as nufftax cannot silently recur. PyAutoHeart passed 351 local tests, CI on Python 3.12 and 3.13, and a real autogalaxy prepare/reuse check with dill 0.4.1, numba 0.66.0, and nufftax 0.6.1.