Skip to content

chore: workspace .gitignore cleanup for generated artifacts (8 repos) #6

Description

@Jammy2211

Overview

Generated artifacts (literal image.fits, path/, scripts/scripts/, *.log, __pycache__/, .codex/, output_path/) are routinely polluting git status across the workspace repos, making real edits invisible and contributing to the 2026-04-27 forensic-sweep findings (101-commit drift on PyAutoGalaxy hidden by 8+ "always dirty" files). Implements prompt 02 of the autoprompt/ workflow-infrastructure series.

This is an umbrella issue tracking 8 separate workspace PRs — one per repo. Each PR appends prompt 02's pattern block to that workspace's .gitignore (deduped against existing entries) and removes from tracking any currently-committed files matching the new patterns via git rm --cached.

Plan

  • One worktree root, real worktrees for all 8 affected workspace repos on shared branch feature/workspace-gitignore-noise
  • For each .gitignore: append the prompt 02 pattern block, deduped against existing lines (most have __pycache__/, *.pyc, root.log already)
  • For each repo: git rm --cached any tracked files matching the new patterns (17 files total across 5 repos)
  • One PR per workspace (8 PRs), all referencing this umbrella issue
  • No smoke-test runs — .gitignore-only changes don't affect script behaviour, smoke would just burn ~minutes per repo with zero signal. One-time deviation from /ship_workspace's standard recipe; not formalised as a skill (decision deferred)
  • Out of scope: chasing source-side script bugs that wrote image.fits, path/to/model/json/, etc. — file follow-up issues if the patterns recur post-merge
Detailed implementation plan

Affected Repositories (8 workspaces)

Repo GitHub Tracked files matching new patterns
autofit_workspace PyAutoLabs run_scripts.log
autogalaxy_workspace PyAutoLabs image.fits, path/to/model/json/model.json
autolens_workspace PyAutoLabs path/to/model/json/model.json, scripts/guides/root.log
autofit_workspace_test PyAutoLabs report.log, root.log, scripts/simulators/__pycache__/util.cpython-312.pyc
autogalaxy_workspace_test PyAutoLabs (none)
autolens_workspace_test PyAutoLabs (none)
autofit_workspace_developer Jammy2211 (none)
autolens_workspace_developer PyAutoLabs output/output/.../search.log files

17 tracked files total to be removed via git rm --cached. Note: autofit_workspace_developer is on Jammy2211/ (the rest are PyAutoLabs).

Work Classification

Workspace-only. No library impact.

Branch Survey

All 8 repos are on main, all clean except autogalaxy_workspace_test which has 1 untracked dir scripts/imaging/images/ (out of scope for prompt 02's pattern set; not touched).

Suggested branch (shared across all 8 repos): feature/workspace-gitignore-noise
Worktree root: ~/Code/PyAutoLabs-wt/workspace-gitignore-noise/ (created later by /start_workspace)

Patterns to Append (verbatim from prompt 02)

# Generated artifacts — never check in
image.fits
path/
scripts/path/
scripts/scripts/
output_path/
root.log
*.log

__pycache__/
*.pyc
.codex/

Each .gitignore is appended only with patterns it doesn't already contain, keeping the # Generated artifacts — never check in header comment so the new block is grouped.

Implementation Steps

  1. worktree_create workspace-gitignore-noise <8 repos> — set up real worktrees on feature/workspace-gitignore-noise for each.
  2. For each of the 8 worktree repos:
    • Read existing .gitignore.
    • Compute the missing patterns (set diff against the prompt 02 block).
    • Append a # Generated artifacts — never check in header + missing lines.
    • Run git rm --cached <file> for each tracked file matching the new patterns (per the table above).
  3. Verify each repo's git status --short shows only:
    • Modified .gitignore
    • Cached removals (D <file>)
  4. Per-repo: git add -A && git commit && git push -u origin feature/workspace-gitignore-noise.
  5. Per-repo: gh pr create --repo <owner>/<repo> referencing this umbrella issue.
  6. Acceptance: after pulling each merged PR into a clean workspace, git status shows no new dirty files matching the pattern set.

Key Files

  • <workspace>/.gitignore × 8 — appended-only, deduped.
  • The 17 tracked files removed via git rm --cached.

Out of scope

  • Source-side bugs that wrote image.fits / path/to/model/json/ (file follow-ups, don't bundle).
  • Library .gitignores (already adequate per prompt 02).
  • **/images/ patterns (covers autogalaxy_workspace_test dirty entry but isn't in prompt 02's list — separate follow-up if it recurs).
  • Auto-running smoke tests (deferred decision; one-off skip for this task).

Original Prompt

Click to expand starting prompt

Workspace .gitignore cleanup

⚠️ Caveat — drafted from a stale repo state. This prompt was drafted on 2026-04-27 during a forensic sweep that found local checkouts up to 101 commits behind origin. The trigger looked like a structural workflow flaw, but later analysis showed the drift was largely driven by stale local checkouts being edited without git pull first, not by missing tooling. Now that PyAutoPrompt is the canonical source-of-truth and skills/install.sh auto-discovers across both repos, some of the recommendations below may be over-engineered for the day-to-day case. Re-evaluate whether each measure is still warranted — the cheap habits (pull before edit, never rewrite history) buy most of the win.

Generated artifacts are routinely polluting git status in the workspace repos, to the point where the user (and agents) stop reading git status because "of course it's dirty". On 2026-04-27 this caused 101-commit drift on PyAutoGalaxy to go unnoticed for weeks: the workspaces showed 8+ "dirty" files each, all generated, so the actual modified files (real PyAutoJAX→PyAutoLabs renames) were buried.

Examples of the noise pattern, all observed in working trees:

  • image.fits at workspace root (a script wrote a literal default filename)
  • path/, scripts/path/ (a script took "path" as a literal arg)
  • scripts/scripts/ (a script ran from inside scripts/ with cd scripts/)
  • output_path/ (similar literal)
  • root.log (logger output)
  • __pycache__/ directories everywhere

Some of these reflect actual bugs in scripts (passing "path" as a positional arg). The bugs should be fixed at source where reasonable, but .gitignore is the backstop that prevents the pollution from compounding.

What to ship

Add to the .gitignore of every workspace repo (autofit_workspace, autogalaxy_workspace, autolens_workspace, the *_test and *_developer variants):

# Generated artifacts — never check in
image.fits
path/
scripts/path/
scripts/scripts/
output_path/
root.log
*.log

__pycache__/
*.pyc
.codex/

Where the literal noise comes from a real script bug (e.g. image.fits from a plotter that defaulted to that filename), file an issue or fix the source while you're there.

Acceptance

  • After pulling the updated .gitignore into a clean workspace and running the smoke tests, git status is clean.
  • The dataset/* simulator outputs that workspaces actually want to track (dataset/imaging/.../data.fits etc.) remain tracked — only the literal-string accidents are ignored.

How to handle existing tracked files matching the new patterns

git rm --cached <file> (don't use plain git rm, that deletes content) then commit the .gitignore and the --cached removal in the same PR.

Out of scope

  • Source-side fixes for the scripts that write path/ etc. — file follow-up issues but don't bundle the fixes here.
  • Library .gitignore updates (PyAutoConf/PyAutoFit/PyAutoArray/PyAutoGalaxy/PyAutoLens already have reasonable .gitignores; the noise problem is workspace-specific).

Files touched

One PR per workspace repo:

  • autofit_workspace/.gitignore
  • autogalaxy_workspace/.gitignore
  • autolens_workspace/.gitignore
  • autofit_workspace_test/.gitignore
  • autolens_workspace_test/.gitignore
  • autofit_workspace_developer/.gitignore
  • autolens_workspace_developer/.gitignore

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