From 2bf1b6948988c4e4f4be72b9878e406ce90781c3 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 29 Jul 2026 17:23:29 +0100 Subject: [PATCH 1/3] fix: keep legacy install check on Python 3.12 --- heart/checks/verify_install.sh | 9 ++++++--- tests/test_verify_install_script.py | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/heart/checks/verify_install.sh b/heart/checks/verify_install.sh index 11e9822f..7c74c160 100755 --- a/heart/checks/verify_install.sh +++ b/heart/checks/verify_install.sh @@ -545,9 +545,12 @@ check_e() { local venv="/tmp/autolens_verify_E_$TS" ARTEFACTS+=("$venv") - step "creating venv with python3 at $venv" - if ! make_venv "$venv" python3; then - RESULTS+=("E|FAIL|could not create venv with python3") + # This pinned 2026.2.26.4 stack predates Python 3.13 dependency wheels + # (notably SciPy 1.14.0). Check E verifies yanked-wheel reachability, not + # forward interpreter support, so keep its historical environment on 3.12. + step "creating venv with python3.12 at $venv" + if ! make_venv "$venv" python3.12; then + RESULTS+=("E|FAIL|could not create venv with python3.12") return fi diff --git a/tests/test_verify_install_script.py b/tests/test_verify_install_script.py index cc6caba1..63808db9 100644 --- a/tests/test_verify_install_script.py +++ b/tests/test_verify_install_script.py @@ -129,6 +129,14 @@ def test_check_b_reuses_one_exact_version_and_classifies_rejection(): assert "failed without a Requires-Python rejection" in text +def test_check_e_uses_python_312_for_the_historical_stack(): + text = SCRIPT.read_text() + body = text[text.index("check_e()") : text.index("# ----- check F:")] + + assert 'if ! make_venv "$venv" python3.12; then' in body + assert 'if ! make_venv "$venv" python3; then' not in body + + def test_version_comparison_runs_before_supported_venv_deactivation(): text = SCRIPT.read_text() body = text[ From 015ad8824b1bbb03331dde78636cf86257a7293c Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 29 Jul 2026 17:35:03 +0100 Subject: [PATCH 2/3] fix: harden legacy check interpreter contract --- .github/workflows/workspace-validation.yml | 4 ++-- bin/pyauto-heart | 6 ++++-- heart/checks/verify_install.sh | 12 ++++++++--- skills/verify_install/verify_install.md | 9 +++++---- tests/test_verify_install_script.py | 23 ++++++++++++++-------- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/.github/workflows/workspace-validation.yml b/.github/workflows/workspace-validation.yml index 4a489e40..e029525f 100644 --- a/.github/workflows/workspace-validation.yml +++ b/.github/workflows/workspace-validation.yml @@ -486,13 +486,13 @@ jobs: steps: - name: Checkout PyAutoHeart uses: actions/checkout@v4 - # Check B invokes each explicit pythonX.Y binary in one job. setup-python + # Checks B and E invoke explicit pythonX.Y binaries in one job. setup-python # prepends each toolcache interpreter without removing the earlier paths. - name: Expose Python 3.11 for the below-floor rejection uses: actions/setup-python@v5 with: python-version: '3.11' - - name: Expose supported Python 3.12 + - name: Expose Python 3.12 for Checks B and E uses: actions/setup-python@v5 with: python-version: '3.12' diff --git a/bin/pyauto-heart b/bin/pyauto-heart index 805f4f5e..f6f21fe3 100755 --- a/bin/pyauto-heart +++ b/bin/pyauto-heart @@ -350,10 +350,12 @@ Checks: B one exact release installs/imports on 3.12/3.13 and rejects on 3.11 C conda install flow (python=3.12) + start_here.py + welcome.py D pip install "autolens[optional]" resolves and imports - E pip install autolens== installs by explicit pin + E pip install autolens== installs on Python 3.12 by explicit pin F Colab bootstrap simulation + one real notebook cell -Check B requires python3.11, python3.12, and python3.13 on PATH. A passing +Checks B and E require explicit interpreters: Check B requires python3.11, +python3.12, and python3.13; Check E requires python3.12. Missing required +interpreters are FAIL. A passing --find-links run is development-only evidence and leaves readiness STALE; PyPI/TestPyPI evidence is required for the release gate. diff --git a/heart/checks/verify_install.sh b/heart/checks/verify_install.sh index 7c74c160..abc94525 100755 --- a/heart/checks/verify_install.sh +++ b/heart/checks/verify_install.sh @@ -14,7 +14,7 @@ # B one exact autolens release installs on 3.12/3.13 and rejects on 3.11 # C conda install flow (python=3.12) + start_here.py + welcome.py # D pip install "autolens[optional]" resolves -# E pip install autolens==2026.2.26.4 still installs by explicit pin +# E pip install autolens==2026.2.26.4 on Python 3.12 by explicit pin # F Colab simulation: fake google.colab + the injected setup cell + run a cell # # Each check creates its own throwaway venv / conda env and reports @@ -62,7 +62,7 @@ Checks: while python3.11 rejects it because Requires-Python is >=3.12 C conda install flow (python=3.12) + start_here.py + welcome.py D pip install "autolens[optional]" resolves and imports - E pip install autolens==2026.2.26.4 (yanked) installs by explicit pin + E pip install autolens==2026.2.26.4 (yanked) installs on python3.12 by explicit pin F Colab simulation: fake google.colab, run the injected setup cell (pip bootstrap + setup_colab + workspace clone), then a notebook cell @@ -545,6 +545,12 @@ check_e() { local venv="/tmp/autolens_verify_E_$TS" ARTEFACTS+=("$venv") + if ! command -v python3.12 > /dev/null 2>&1; then + step "python3.12 not installed — FAIL (required Check E interpreter)" + RESULTS+=("E|FAIL|python3.12 not installed") + return + fi + # This pinned 2026.2.26.4 stack predates Python 3.13 dependency wheels # (notably SciPy 1.14.0). Check E verifies yanked-wheel reachability, not # forward interpreter support, so keep its historical environment on 3.12. @@ -592,7 +598,7 @@ check_e() { local actual_count actual_count=$(printf '%s' "$installed_pkgs" | grep -oE "==2026.2.26.4" | wc -l) if [ "$pip_rc" -eq 0 ] && [ "$actual_count" -eq "$expected_count" ]; then - RESULTS+=("E|PASS|all 5 libs installed at 2026.2.26.4 via explicit pin") + RESULTS+=("E|PASS|all 5 libs installed at 2026.2.26.4 via explicit pin (python3.12)") else RESULTS+=("E|FAIL|pip rc=$pip_rc, $actual_count/$expected_count libs at 2026.2.26.4") tail_log "Check E output" "$(cat /tmp/E_pip.log 2>/dev/null)" diff --git a/skills/verify_install/verify_install.md b/skills/verify_install/verify_install.md index 176b3787..be2ab9ac 100644 --- a/skills/verify_install/verify_install.md +++ b/skills/verify_install/verify_install.md @@ -17,12 +17,13 @@ about cleanup if they ran with `--keep`. | B | One exact `autolens` version installs and imports cleanly on `python3.12` and `python3.13`, then the same exact version is rejected by `python3.11` specifically because `Requires-Python` is `>=3.12`. An unpinned 3.11 install is not evidence because pip may select an older compatible release. | | C | The conda flow from `installation/conda.rst` works end-to-end (`conda create … python=3.12` → `pip install autolens` → clone workspace → run `welcome.py` + `start_here.py`). | | D | `pip install "autolens[optional]"` resolves cleanly and imports. | -| E | `pip install autolens==2026.2.26.4` (a yanked release the docs reference) still installs by explicit pin. | +| E | `pip install autolens==2026.2.26.4` (a yanked release the docs reference) still installs on `python3.12` by explicit pin. | | F | The Colab bootstrap path end-to-end: a venv emulating Colab's preinstalled env (`autolens` + `jax` from PyPI), a fake `google.colab` package so the on-Colab branch activates, then the injected setup cell verbatim (`pip install autoconf --no-deps` → `setup_colab.setup("autolens")` → workspace clone at the release tag) and one real notebook cell (`al.Imaging.from_fits` on `dataset/imaging/simple`). SKIPs while the installed autoconf predates the `setup_colab` registry (self-activates at the next release). | -The three Check B interpreters are required evidence: a missing `python3.11`, -`python3.12`, or `python3.13` is **FAIL**. Optional host capabilities such as -conda remain **SKIP** when unavailable and do not count toward overall failure. +Check B requires `python3.11`, `python3.12`, and `python3.13`; Check E requires +`python3.12`. A missing required interpreter is **FAIL**. Optional host +capabilities such as conda remain **SKIP** when unavailable and do not count +toward overall failure. ## Running without a skill harness diff --git a/tests/test_verify_install_script.py b/tests/test_verify_install_script.py index 63808db9..f2a5c354 100644 --- a/tests/test_verify_install_script.py +++ b/tests/test_verify_install_script.py @@ -10,14 +10,10 @@ import yaml -SCRIPT = Path(__file__).resolve().parent.parent / "heart" / "checks" / "verify_install.sh" +ROOT = Path(__file__).resolve().parent.parent +SCRIPT = ROOT / "heart" / "checks" / "verify_install.sh" HELPERS = SCRIPT.with_name("verify_install_helpers.sh") -WORKFLOW = ( - Path(__file__).resolve().parent.parent - / ".github" - / "workflows" - / "workspace-validation.yml" -) +WORKFLOW = ROOT / ".github" / "workflows" / "workspace-validation.yml" def run(*args): @@ -133,8 +129,16 @@ def test_check_e_uses_python_312_for_the_historical_stack(): text = SCRIPT.read_text() body = text[text.index("check_e()") : text.index("# ----- check F:")] + assert 'command -v python3.12 > /dev/null 2>&1' in body + assert 'RESULTS+=("E|FAIL|python3.12 not installed")' in body assert 'if ! make_venv "$venv" python3.12; then' in body assert 'if ! make_venv "$venv" python3; then' not in body + assert '(python3.12)' in body + assert "installs on python3.12 by explicit pin" in text + assert "Check E requires python3.12" in (ROOT / "bin/pyauto-heart").read_text() + assert "still installs on `python3.12` by explicit pin" in ( + ROOT / "skills/verify_install/verify_install.md" + ).read_text() def test_version_comparison_runs_before_supported_venv_deactivation(): @@ -200,7 +204,7 @@ def test_pep440_equivalent_versions_compare_equal(): assert result.returncode == 0, result.stderr -def test_release_workflow_exposes_every_required_check_b_interpreter(): +def test_release_workflow_exposes_every_required_interpreter(): jobs = yaml.safe_load(WORKFLOW.read_text())["jobs"] steps = jobs["verify_install_release"]["steps"] run_index = next( @@ -214,6 +218,9 @@ def test_release_workflow_exposes_every_required_check_b_interpreter(): ] assert setup_versions == ["3.11", "3.12", "3.13"] + workflow_text = WORKFLOW.read_text() + assert "Checks B and E invoke explicit pythonX.Y binaries" in workflow_text + assert "Expose Python 3.12 for Checks B and E" in workflow_text def test_help_describes_supported_success_and_below_floor_rejection(): From 8259dcfb3fc7b401e4405473c3ddcf2b99e0610a Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 29 Jul 2026 17:42:53 +0100 Subject: [PATCH 3/3] fix: align legacy check evidence surfaces --- bin/pyauto-heart | 8 ++++---- health_agent/capabilities.md | 8 +++++--- health_agent/capabilities.yaml | 2 +- heart/checks/verify_install.sh | 3 ++- tests/test_verify_install_script.py | 3 --- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/pyauto-heart b/bin/pyauto-heart index f6f21fe3..3ed765b1 100755 --- a/bin/pyauto-heart +++ b/bin/pyauto-heart @@ -353,10 +353,10 @@ Checks: E pip install autolens== installs on Python 3.12 by explicit pin F Colab bootstrap simulation + one real notebook cell -Checks B and E require explicit interpreters: Check B requires python3.11, -python3.12, and python3.13; Check E requires python3.12. Missing required -interpreters are FAIL. A passing ---find-links run is development-only evidence and leaves readiness STALE; +Checks B and E require explicit interpreters on PATH. Check B requires +python3.11, python3.12, and python3.13; Check E requires python3.12. Missing +required interpreters are FAIL. A passing --find-links run is development-only +evidence and leaves readiness STALE; PyPI/TestPyPI evidence is required for the release gate. Arguments are forwarded to the underlying check; see \`-h\` on the script. diff --git a/health_agent/capabilities.md b/health_agent/capabilities.md index 0241b30b..7060d694 100644 --- a/health_agent/capabilities.md +++ b/health_agent/capabilities.md @@ -50,9 +50,11 @@ Audited at commit `a2543d0` (Rename PyAutoPulse to PyAutoHeart). - **verify_install** (`checks/verify_install.sh`) — pip, conda, and Colab install-path checks A–F. Check B proves one exact release succeeds on Python - 3.12/3.13 and rejects on 3.11. RED if the last run has `ready==false`; STALE - if it is find-links-only, older than 14 days, or never run. Moved here from - PyAutoHands — install verification is Heart's job. + 3.12/3.13 and rejects on 3.11; Check E installs historical 2026.2.26.4 on + Python 3.12 because its stack has no Python 3.13 dependency wheels. RED if + the last run has `ready==false`; STALE if it is find-links-only, older than + 14 days, or never run. Moved here from PyAutoHands — install verification is + Heart's job. - **url_check / url_sweep / url_check_live** — offline regex guard, ecosystem sweep, and live HTTP reachability audit. **Monitoring only — never gates readiness.** diff --git a/health_agent/capabilities.yaml b/health_agent/capabilities.yaml index f42c0384..cdd0426f 100644 --- a/health_agent/capabilities.yaml +++ b/health_agent/capabilities.yaml @@ -92,7 +92,7 @@ deep_checks: - id: verify_install impl: heart/checks/verify_install.sh cli: "pyauto-heart verify_install" - measures: "pip, conda, and Colab install-path checks A-F; exact release succeeds on Python 3.12/3.13 and rejects on 3.11" + measures: "pip, conda, and Colab install-path checks A-F; Check B exact release succeeds on Python 3.12/3.13 and rejects on 3.11; Check E installs historical 2026.2.26.4 on Python 3.12 because its stack has no Python 3.13 dependency wheels" gate_role: "RED if last run ready==false; STALE if find-links-only, older than 14d, or never run" - id: url_check impl: heart/checks/url_check.sh diff --git a/heart/checks/verify_install.sh b/heart/checks/verify_install.sh index abc94525..fc22b7fa 100755 --- a/heart/checks/verify_install.sh +++ b/heart/checks/verify_install.sh @@ -543,7 +543,6 @@ check_e() { echo "=== Check E: pip install autolens==2026.2.26.4 (yanked) ===" local venv="/tmp/autolens_verify_E_$TS" - ARTEFACTS+=("$venv") if ! command -v python3.12 > /dev/null 2>&1; then step "python3.12 not installed — FAIL (required Check E interpreter)" @@ -551,6 +550,8 @@ check_e() { return fi + ARTEFACTS+=("$venv") + # This pinned 2026.2.26.4 stack predates Python 3.13 dependency wheels # (notably SciPy 1.14.0). Check E verifies yanked-wheel reachability, not # forward interpreter support, so keep its historical environment on 3.12. diff --git a/tests/test_verify_install_script.py b/tests/test_verify_install_script.py index f2a5c354..de2b93d6 100644 --- a/tests/test_verify_install_script.py +++ b/tests/test_verify_install_script.py @@ -218,9 +218,6 @@ def test_release_workflow_exposes_every_required_interpreter(): ] assert setup_versions == ["3.11", "3.12", "3.13"] - workflow_text = WORKFLOW.read_text() - assert "Checks B and E invoke explicit pythonX.Y binaries" in workflow_text - assert "Expose Python 3.12 for Checks B and E" in workflow_text def test_help_describes_supported_success_and_below_floor_rejection():