Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/workspace-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 5 additions & 3 deletions bin/pyauto-heart
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,13 @@ 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==<pinned> installs by explicit pin
E pip install autolens==<pinned> 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
--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.
Expand Down
8 changes: 5 additions & 3 deletions health_agent/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**
Expand Down
2 changes: 1 addition & 1 deletion health_agent/capabilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 16 additions & 6 deletions heart/checks/verify_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -543,11 +543,21 @@ check_e() {
echo "=== Check E: pip install autolens==2026.2.26.4 (yanked) ==="

local venv="/tmp/autolens_verify_E_$TS"

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

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

Expand Down Expand Up @@ -589,7 +599,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)"
Expand Down
9 changes: 5 additions & 4 deletions skills/verify_install/verify_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 20 additions & 8 deletions tests/test_verify_install_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -129,6 +125,22 @@ 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 '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():
text = SCRIPT.read_text()
body = text[
Expand Down Expand Up @@ -192,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(
Expand Down
Loading