Repository navigation
Description
Overview
PyAutoHeart/.github/workflows/smoke-tests.yml — the reusable workflow every workspace's smoke_tests.yml is a thin caller of — has exactly one skip condition: a docs-only gate that skips the matrix when every changed file matches *.md, docs/, LICENSE or runtime.txt. Anything else runs the full curated smoke list, whatever it touched. A one-character change to any non-markdown file costs the full run: ~11m20s in autolens_workspace_test (≈17 runs/week), ~8m40s in autolens_workspace (5.8 runs/day). The two extremes already in the record are 80x apart — a docs-only PR finishes in 8 seconds.
The failure mode is written into the repo already. smoke_tests.txt, on the 2026-08-22 disable of multi_dataset/jax_likelihood/mge.py: "Hit 4/4 jobs (3.12 and 3.13, twice each) on autolens_workspace_test#261, whose diff touches no script this gate runs."
Scope for this task is tier 1 only — skip when no script can be affected. Tier 2 (narrowing the entry list to the packages the diff touches) needs the selected set passed down to run_smoke.py and therefore edits each workspace's vendored runner; it is deliberately deferred and is not part of this issue. The prompt says tier 1 alone is most of the win.
Plan
- Extend the existing
changesjob's classification with one more reason to skip: if the diff touches nothing underscripts/,config/,smoke_tests.txt,smoke_notebooks.txtor.github/, skip the matrix the same way the docs-only path does. - Emit it as a second
docs_only-shaped output on the same job, so thesmokejob'sif:grows one clause and nothing else about the workflow's shape changes. - Fail closed, matching the docs-only gate exactly — no base SHA, unfetchable base, empty diff, or a single unclassifiable path runs everything. Only an explicit every-file-matches verdict may skip.
- Gate the new skip to
pull_requestevents, so a push tomainalways runs the full matrix and Heart'sci_statuskeeps reading a real conclusion. - Keep the skip inside the workflow. Do not implement it with
on.pull_request.paths. - Verify against at least one caller of each shape (
_workspaceand_workspace_test) before shipping, since the change lands once for every caller.
Detailed implementation plan
Affected Repositories
- PyAutoHeart (primary — and the only repo this tier touches)
Callers read for verification, not edited: autolens_workspace, autolens_workspace_test, autogalaxy_workspace_test.
Work Classification
Library (Heart-owned CI). No workspace leg in tier 1.
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoHeart | main | clean |
Suggested branch: feature/smoke-relevance-gate
Worktree root: ~/Code/PyAutoLabs-wt/smoke-relevance-gate/
Implementation Steps
- Extend the
changesjob (.github/workflows/smoke-tests.yml, currently ~lines 115–158). It already computesdocs_onlyfrom a two-dotgit diff --name-only "$BASE" HEADagainst the base tip, inside a guard that requires a non-null, non-zero$BASEthatgit fetch --depth=1can reach. Reuse that same$fileslist — do not re-derive the diff, and do not switch to a merge-base diff: the two-dot form against the tip is deliberate so upstream drift shows up as extra files and conservatively runs the matrix. - Add a second classification pass over
$filesproducingno_smoke_relevant_changes(name it to read as a reason, matchingdocs_only). A path is smoke-relevant if it matchesscripts/*,config/*,smoke_tests.txt,smoke_notebooks.txtor.github/*; if no changed path matches any of those, the new output istrue. Follow the existingwhile IFS= read -r f; do case "$f" in … esac; done <<< "$files"shape and itsbreak-on-first-mismatch structure, inverted appropriately. - Fail closed. Initialise the new flag
falsebefore the guard, exactly asdocs_onlyis, so every early-exit path (no$BASE, the all-zero SHA, a failed fetch, an empty$files) leaves itfalseand the matrix runs. The two flags are independent — a docs-only diff satisfies both, which is fine; they are ORed. - Gate to
pull_request. The new skip must not apply to a push tomain. Either set itfalseunlessgithub.event_name == 'pull_request', or add the event test to thesmokejob'sif:. Whichever is chosen, state it in a comment:config/repos.yamllistsworkspaces_test: ["Smoke Tests"]andworkspaces: ["Smoke Tests", "Navigator Check"]underrequired_workflows;ci_statusreads their conclusion on themainHEAD commit andreadinessgates RED on failure, andcancelledis in Heart'sFAILURE_CONCLUSIONS. Narrowing PR-side runs is free — Heart never reads them — but a skipped or cancelledmainrun breaks the readiness gate. - Wire the outputs. Add the new output to the
changesjob'soutputs:block and extendsmoke'sif: needs.changes.outputs.docs_only != 'true'to also require the new flag != 'true'. A job skipped this way still reportsskipped, which satisfies required-check semantics — that is the whole reason the gate lives inside the workflow. - Write the step summary for the new path the way the docs-only path does, so a reader of a skipped run can see which files were classified and why.
- Test. Add coverage to PyAutoHeart's own suite for the classification predicate if the repo has a place for it; whatever the repo's existing convention is for testing this workflow, follow it rather than inventing one. Run the full suite.
- Verify against callers. Read
autolens_workspace/.github/workflows/smoke_tests.yml(a_workspace-shape caller) andautolens_workspace_test/.github/workflows/smoke_tests.yml(a_workspace_test-shape caller) and confirm neither passes an input this change invalidates and neither relies on the matrix always running. Report what each declares.
Key Files
.github/workflows/smoke-tests.yml— thechangesjob and thesmokejob'sif:; this is the whole diffconfig/repos.yaml— read only,required_workflows, for themain-push constraint- PyAutoHeart's test suite — wherever workflow-shape assertions already live
Acceptance
- A PR touching only
README.mdplus a config sidecar still skips (the existing docs-only path is unaffected). - A PR touching nothing under
scripts/,config/,smoke_tests.txt,smoke_notebooks.txtor.github/now skips. - A PR with an unresolvable base still runs the full matrix.
- The
Smoke Testscheck reportsskipped, not pending, on every skip path. main-push runs are unchanged and Heart'sci_statusstill reads a real conclusion.
Out of scope
Tier 2 (package-level narrowing of the entry list). It needs the selected set passed to run_smoke.py as an input and therefore touches each workspace's vendored runner — a separate change in separate repos, to be filed on its own. Also out of scope: making the slow entries cheaper, which is the sibling prompt draft/test/workspaces/slowest_smoke_gate_scripts.md.
Original Prompt
Click to expand starting prompt
Relevance-gate the reusable smoke workflow so a PR only runs what its diff can affect
Type: test
Target: PyAutoHeart
Repos:
- PyAutoHeart
- autolens_workspace_test
- autogalaxy_workspace_test
- autolens_workspace
Themes: - ci-smoke
Difficulty: medium
Autonomy: safe
Priority: normal
Status: formalised
Consequence: judge
Review-minutes: 20
Unattended: ready
PyAutoHeart/.github/workflows/smoke-tests.yml — the reusable workflow every
workspace's smoke_tests.yml is a thin caller of — has exactly one skip
condition: a docs-only gate that skips the matrix when every changed file
matches *.md, docs/, LICENSE or runtime.txt. Anything else runs the
full curated smoke list, whatever it touched.
This prompt cuts how often the gate runs. Making the slow entries cheaper is
the sibling prompt draft/test/workspaces/slowest_smoke_gate_scripts.md; they
compound but are separate changes in separate repos.
Why
autolens_workspace_testsmoke costs ~11m20s and fires on every PR event
plus every push tomain. Run numbers put it at roughly 17 runs/week
(#555 on 2026-07-28 → #616 on 2026-08-22; approximate, since superseded PR
runs are cancelled).autolens_workspacecosts ~8m40s over 37 entries, 5.8 runs/day in the week
to 2026-08-23.- The failure mode is already recorded in the repo.
smoke_tests.txt, on the
2026-08-22 disable ofmulti_dataset/jax_likelihood/mge.py: "Hit 4/4 jobs
(3.12 and 3.13, twice each) on autolens_workspace_test#261, whose diff
touches no script this gate runs." - The two extremes already exist and are 80x apart: a docs-only PR finishes in
8 seconds (autolens_workspace_test run #605, autogalaxy_workspace #545);
a one-character change to any non-markdown file costs the full run.
Task
Two tiers, shippable independently. Tier 1 alone is most of the win.
-
Skip when no script can be affected. Extend the existing
changesjob's
classification: if the diff touches nothing underscripts/,config/,
smoke_tests.txt,smoke_notebooks.txtor.github/, skip the matrix the
same way the docs-only path does. Same fail-closed shape, same
docs_only-style output, one more reason to skip. -
Narrow the entry list to the packages the diff touches, plus a fixed
core. The smoke entries cluster cleanly by top-level package, so a
directory-level mapping is enough — no dependency analysis needed:package autolens_ws_test autogalaxy_ws_test autolens_workspace imaging/232.8s (42%) 175.8s (32%) 63.6s (18%) multi_dataset/— 177.1s (32%) 13.5s (4%) misc/154.6s (28%) 37.6s (7%) — interferometer/92.1s (17%) 150.6s (27%) 54.6s (16%) point_source/47.7s (9%) — 15.7s (4%) multi_galaxy/25.8s (5%) 11.8s (2%) 166.4s (47%) group/— — 22.9s (7%) guides/— — 14.3s (4%) cluster/— 4.2s (1%) — A PR touching only
scripts/misc/would run 155s instead of 553s; one
touching onlymulti_galaxy/in_testwould run 26s. Tier 2 needs the
selected set passed down torun_smoke.pyas an input, so it also touches
each workspace's vendored runner — scope it deliberately or defer it.
autogalaxy_workspace_test is the same size and has no other lever
Measured after this prompt was first filed (run 32533004337, 2026-08-21, py3.12,
557.1s across 37 entries — within 4s of autolens_workspace_test's 553.0s,
and again reconciling exactly to the step wall-clock).
Unlike its autolens sibling it has no hot spot at all: slowest entry 40.0s,
median 13.5s, and the top three are only 21% of the run. There is nothing to
speed up, so the sibling prompt does not apply and this gate is the only
lever for that repo.
What it does have is a combinatorial matrix: 25 of its 37 entries are
{imaging, interferometer, multi_dataset}/jax_{likelihood,grad}/{lp, mge, mge_group, rectangular, rectangular_mge, delaunay, delaunay_mge}, i.e. the
same handful of meshes crossed with three dataset types. Tier 2's
package-level narrowing maps onto that cleanly. A representative-subset
policy for the PR gate (full cross-product weekly) is worth considering
alongside it, but is a separate decision and belongs to that repo, not here.
Checked and NOT a factor: its six jax_grad/ entries were the obvious
suspect, since Heart budgets that class at 1800s for running at full
resolution. Measured they are 86.4s total (15.5%), 10.8–21.8s each. The
expensive jax_grad scripts are the autolens ones, and those are not in any
smoke list.
Hard constraints
- Do not implement this with
on.pull_request.paths. A job skipped by a
path filter never reports a conclusion, so a required status check sits
pending forever and blocks the merge. The in-workflowchangesjob emits a
realskipped, which satisfies required-check semantics — the workflow's own
comment already says so. Keep the skip inside the workflow. - Fail closed, matching the docs-only gate exactly: no base SHA, unfetchable
base, empty diff, or a single unclassifiable path ⇒ run everything. Only an
explicit every-file-matches verdict may skip. Keep the two-dot diff against
the base tip so upstream drift shows up as extra files. - Do not touch the push-to-
mainrun.PyAutoHeart/config/repos.yamllists
workspaces_test: ["Smoke Tests"]andworkspaces: ["Smoke Tests", "Navigator Check"]underrequired_workflows;ci_statusreads their
conclusion on themainHEAD commit andreadinessgates RED on failure.
cancelledis in Heart'sFAILURE_CONCLUSIONS, which is why the callers'
concurrency block only cancels non-mainrefs. Narrowing PR-side runs is
free — Heart never reads them — but a skipped or cancelledmainrun breaks
the readiness gate. If tier 1 would skip on amainpush, gate it to
pull_requestevents only. - The change is Heart-owned and lands once for every caller (both
_workspace
and_workspace_testfamilies, plus the HowTo repos). Verify against at
least one caller of each shape before merging.
Acceptance
- A PR touching only
scripts/misc/inautolens_workspace_testruns
materially less than the full 553s (tier 2), or a PR touching only
README.md+ a config sidecar still skips (tier 1). - A PR with an unresolvable base still runs the full matrix.
- The
Smoke Testscheck reportsskipped, not pending, on every skip path. main-push runs are unchanged and Heart'sci_statusstill reads a real
conclusion.
Activity
Jammy2211 commentedon Sep 9, 2026
Shipped
PR: #220 — merged to
mainas1593a765. Tier 1 only, as scoped.smoke-tests.yml'schangesjob now publishes a second reason to skip,no_smoke_relevant_changes: a diff touching none ofscripts/,config/,smoke_tests.txt,smoke_notebooks.txtor.github/cannot change what any smoke script does, so the matrix skips the way the docs-only path does. Both flags are classified from the same$fileslist —git diff --name-onlystill appears exactly once, so the two verdicts cannot disagree about what changed, and a test pins that.The
pull_requestgate turned out to be load-bearing for a narrower reason than the prompt gave, worth recording:skippedis not in Heart'sFAILURE_CONCLUSIONS, so a skipped run onmainwould not RED. Butci_status.rollupreturns green only on an explicitsuccesson HEAD — its own docstring says "otherwise ... an unknown, never a green" — so a skippedmainrun would leave readiness permanently unable to reach GREEN.cancelledis the one that REDs outright. The gate lives inside the classify step rather than on thesmokejob'sif:, so the published output means "a skip is warranted" instead of being true-but-inapplicable on a push. Push-to-mainbehaviour is byte-for-byte unchanged, and the docs-only gate was deliberately not narrowed topull_requestalongside it.Fail-closed was executed, not reasoned about: the step's real
run:body was run with onlygitstubbed, and both flags come backfalsewith an empty step summary for an empty$BASE, the all-zero SHA, a failinggit fetch, and an empty diff — plus a single relevant path in an otherwise irrelevant diff, tested at every insertion position since the loop breaks on first match. The two-dot diff against the base tip is preserved;merge-baseappears nowhere.Not implemented with
on.pull_request.paths— the job header comment now says why.Tests: 965 passed, 0 failed, 0 skipped, run independently by the implementing agent and by the architect session. 11 new test functions / 25 node ids in
tests/test_smoke_tests_wiring.pythat execute the predicate underbash -eagainst a synthetic diff rather than pattern-matching the YAML, following the repo's existingsubprocess.run(["bash", …])convention; the docs-only assertion intests/test_workflow_wiring.pygeneralised to both gates.Callers verified, one of each shape.
autolens_workspaceandautolens_workspace_testship byte-identicalsmoke_tests.yml(same blob65789266), declaring onlychain:andsecrets: inherit. Neither passes an input this change invalidates, neither reads any output of the reusable workflow, and neither runs a job downstream of the matrix — so a skipped matrix has no dependant.Tier 2 remains open and unstarted: narrowing the entry list to the packages the diff touches needs the selected set passed down to each workspace's vendored
run_smoke.py, so it is a multi-repo change and belongs to its own prompt. The sibling promptdraft/test/workspaces/slowest_smoke_gate_scripts.md(making the slow entries cheaper) is unaffected by this and still stands.Shipped as member 3 of the
ci-smokebundle.Generated by Claude Code