Skip to content

bug: release pipeline force-commits simulated workspace datasets (git add -f) #126

Description

@Jammy2211

bug: release pipeline force-commits simulated workspace datasets (git add -f)

Autonomy: supervised
Difficulty: large (executed as two scoped tasks — see Scope split)
Found: 2026-07-09 (verify_install check F). Diagnosis corrected 2026-07-13 — the
original "15×15 smoke artifact" framing below the fold was disproven; the real defect is
the -f force-commit, not simulator env.

Supersedes the old framing (issued/release_ships_smoke_datasets.md, retired
2026-07-13). The datasets aren't 15×15 because a smoke run shrank them at release —
generate.py never runs simulators. They're committed at all because pre_build.sh
force-stages dataset/ against .gitignore; some are incidentally 15×15 because a
prior local smoke run (PYAUTO_SMALL_DATASETS=1) left them on disk before pre_build.

Corrected diagnosis

Design intent (encoded in each workspace .gitignore): dataset/** is gitignored
except a small allowlist of real observational data un-ignored via ! lines. All
simulated datasets are meant to be generated at runtime, never committed. The
self-provision mechanism already exists — al.util.dataset.should_simulate(path) +
a simulator subprocess (canonical example scripts/imaging/modeling.py:96-102).

Two coupled bugs:

  1. PyAutoBuild/pre_build.sh runs git add -f dataset/ — the -f overrides .gitignore,
    committing simulated datasets that should be ignored.
  2. A minority of example scripts load simulated data without the should_simulate
    guard, so they only work because the -f leak committed the data for them.

Phase-2 cross-repo audit (2026-07-13, read-only)

Repo ignore rule tracked non-allowlisted size simulators orphan dirs loader
autolens_workspace dataset/** + 14 ! allowlist 242 8.2 MB 63 7 from_fits
autogalaxy_workspace dataset/** + 2 ! allowlist 134 1.4 MB 32 5 from_fits
autofit_workspace bare dataset/ 409 2.6 MB 3 from_json
HowToFit bare dataset/ 408 2.6 MB 2 from_json
HowToGalaxy bare dataset/ 21 2.8 MB 4 from_fits
HowToLens bare dataset/ 27 0.9 MB 7 from_fits

Notebook/Colab CWD gate → PASS. The guard's relative subprocess path resolves in both
notebook paths: Colab via setup_colab.setup()os.chdir(workspace_dir)
(setup_colab.py:250); CI nbconvert via run_smoke.py:118 (cwd=str(WORKSPACE)). Purge is
CWD-safe provided each simulated loader is guarded and its simulator exists.

Orphans (no simulator reference — do not blind-purge):

  • autolens (7): cluster/csv_api_example, imaging/simulated_lens,
    interferometer/{many_visibilities, simpleold, simulated_lens},
    point_source/{simulated_lens, start_here_example}
  • autogalaxy (5): database/simple__{0,1,2}, {imaging,interferometer}/simulated_galaxy

Scope split

  • This issue (bug: release pipeline force-commits simulated workspace datasets (git add -f) #126) = Group A: autolens_workspace + autogalaxy_workspace — allowlist
    regime, from_fits + should_simulate idiom already present, simulators exist. The 4-leg
    fix applies as written. Plus universal leg 1 (the -f drop).
  • Group B = the 4 bare-dataset/ repos (autofit, HowToFit, HowToGalaxy, HowToLens) —
    small toy/tutorial data, possibly committed-by-design; needs a policy decision (allowlist
    vs purge+guard, and a from_json guard idiom for the fit repos). Filed separately as
    bug/pyautobuild/release_datasets_group_b_policy.md.

Plan (high-level)

  1. Leg 1 — stop the leak (universal): drop -f from git add dataset/ in
    pre_build.sh so staging honors .gitignore.
  2. Leg 2 — guard the problem set (Group A): add the should_simulate + simulator
    subprocess to the truly-unguarded simulated loaders (small set; not the sibling scripts
    that rely on a folder's guarded start_here.py).
  3. Leg 3 — purge (Group A): git rm the non-allowlisted committed simulated datasets,
    excluding the classified orphans. Users/CI/Colab regenerate via the simulators.
  4. Leg 4 — guard leg: an allowlist-based assertion (git ls-files dataset/.gitignore
    allowlist — NOT git check-ignore, which mis-flags tracked + negated paths), wired as a
    PyAutoHeart leg or pre_build assertion, landed after the purge so it goes green.

Plan (detailed)

  • Leg 1PyAutoBuild/pre_build.sh: git add -f dataset/git add dataset/.
    Already-tracked real (allowlisted) data stays tracked; only allowlisted paths can ever be
    staged henceforth.
  • Leg 2 — per Group A repo, for each from_fits script that loads a non-allowlisted
    (simulated) dataset and lacks should_simulate: insert the guard block mirroring
    autolens_workspace/scripts/imaging/modeling.py:96-102, targeting that folder's simulator.
    Exclude scripts whose data is provided by a guarded start_here.py in the same folder.
  • Leg 3git rm -r --cached (then remove from tree) each non-allowlisted, non-orphan
    dataset dir in autolens + autogalaxy; verify a simulator produces it first. Orphans parked
    for a per-dir decision (dead → purge; consumer-but-no-simulator → needs a simulator).
  • Leg 4 — allowlist guard: parse each workspace .gitignore !dataset/... lines, assert
    every git ls-files dataset/ entry is under an allowlisted prefix. Fail loud otherwise.

Autonomy

--auto, effective level supervised (bug cap). Plan written here; implementation
proceeds; run parks at ship sign-off with a batched question (no auto-PR, no merge).
Orphan-dir dispositions and the precise leg-2 set are supervised judgment forks → batched
questions on this issue.

Impact

Every pip/Colab/tagged-zip user ships ~10 MB of simulated datasets that should be
runtime-generated; some are degenerate 15×15 from a pre-release smoke run. Open =
release-blocker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions