Skip to content

feat(smoke): affected-by, parallel --jobs and a targeted mode for shift workers - #353

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/shift-smoke-targeted
Nov 19, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/shift-smoke-targeted

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Shift workers' smoke leg ran every workspace one after another (~35–40 min of a 75-min shift), far more than a task done in a chat. Plan C (approved 2026-11-19, "approve C"; #352): workers run a targeted smoke, and the full affected smoke runs in parallel in the close-out, only before an unattended merge. This PR adds the Heart side; PyAutoBrain's templates and AUTONOMY.md leg 2 follow in a sibling PR (merge this one first — the close-out calls the new flags).

New pyauto-heart smoke forms (a human /smoke_test with no flags is unchanged: every workspace, serially):

  • --affected-by REPO[,REPO…] — workspaces whose chain: contains the repo (or whose directory is it); nothing selected → "nothing to run", exit 0.
  • --jobs N (default 1 = old serial path) — each workspace in its own process and cached env, own log under $HEART_STATE_DIR/smoke-runtime/<ws>/; thread caps cores//N (OMP/MKL/OPENBLAS/NUMBA, XLA intra-op) applied last in the child via HEART_SMOKE_THREAD_CAPS; PASS/FAIL table, exit 1 if any fails.
  • --targeted --changed-files PATH… [--names …] [--base REF] — curated smoke_tests.txt entries that are themselves changed or name the changed module's dotted path or a touched public name (top-level def/class/NAME =, from git diff -U0 vs the merge-base); none → the fastest recorded script of the changed repo's own workspace as an import check. Reports to test-results/targeted/.
  • config/repos.yaml: euclid declares scripts_dir: ".".

Closes #352 (with the PyAutoBrain sibling PR)

API Changes

None to a library API — new CLI flags on pyauto-heart smoke; defaults unchanged.
See full details below.

Test Plan

  • tests/test_smoke_selection.py — 14 new tests (13 fail on main; the 14th exits on main as an unknown flag): selection per changed repo (a PyAutoGalaxy change skips autofit/autocti/autocti_test; PyAutoFit selects all), --jobs 3 same pass/fail + result files as serial on fake workspaces, one failing workspace fails the run, targeted selection from a fake smoke_tests.txt, thread caps in the child env
  • Full suite 1482 passed; skill line budget OK; tenant firewall OK
  • Selection checked against the real task tree (a sersic.py change → scripts by import path, fallback guides/using_jax.py); no real smoke sweep run (a shift was using the laptop)
Full API Changes

Added

  • pyauto-heart smoke --affected-by, --jobs, --targeted --changed-files [--names] [--base]; env HEART_SMOKE_THREAD_CAPS

Changed

  • config/repos.yaml euclid scripts_dir: "."

Known limits

  • A targeted script that depends on an earlier list entry's output (euclid's ordered list) may fail alone; output/ is not wiped.
  • HowToLens has no smoke_tests.txt, so targeted mode never selects it.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…ke split (#352)

Plan C, approved by the human 2026-11-19 ("approve C"):

- --affected-by REPO[,REPO...]: only workspaces whose smoke `chain:` contains
  (or which are) one of the repos; names that select nothing are reported,
  not an error, so a close-out can pass any PR repo.
- --jobs N (default 1 = unchanged serial): N workspaces at once, each as its
  own heart.smoke process with its own cached env and log under
  $HEART_STATE_DIR/smoke-runtime/<ws>/smoke.log; OMP/MKL/OPENBLAS/NUMBA thread
  counts and XLA's CPU pool capped so N x threads <= cores (caps re-applied in
  the child's runtime env); fails if any workspace fails; per-workspace summary.
- --targeted --changed-files PATH... [--names] [--base]: run only the curated
  smoke_tests.txt entries that are a changed file or mention a changed
  module's import path or a public def/class/NAME the diff touches; none match
  -> the cheapest curated script of the changed repo's own workspace as an
  import check. Runs through PyAutoHands run_python.py --list, reporting to
  test-results/targeted/; output/ is not wiped.
- config: euclid workspace declares scripts_dir "." (its list is root-relative).

A human `pyauto-heart smoke` with no flags still runs every workspace serially.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 7b95800 into main Nov 19, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/shift-smoke-targeted branch November 19, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(smoke): shift workers test like a chat; full affected smoke runs in parallel before unattended merges

1 participant