Skip to content

feat: mirror rendered figures to an opt-in Eyes scratch folder #4

Closed

Description

@Jammy2211

Overview

When iterating on figures for PyAutoEyes, feedback currently waits for the full loop (fix → PR → CI → dashboard refresh). This adds an opt-in "scratch mirror": each <lib>_visualization harness copies freshly rendered PNGs to $PYAUTO_EYES_SCRATCH/<lib>/<dataset_type>/ as producers finish, so the human can inspect figures on the fly before any PR or CI. Phase 1 covers autogalaxy/autofit/autocti_visualization and the Brain Eyes skill; autolens_visualization follows in phase 2 (after autolens_visualization#7 merges).

Plan

  • Opt-in env var PYAUTO_EYES_SCRATCH (human sets /mnt/c/Users/Jammy/Science/scratch/eyes); unset = silent no-op, so CI and other machines are unaffected and no machine path is committed.
  • Layout mirrors the Eyes dashboard: $PYAUTO_EYES_SCRATCH/<lib>/<dataset_type>/ (autogalaxy/imaging, autogalaxy/ellipse, autofit/..., autocti/...), <dataset_type> = producer domain scripts/<domain>/.
  • Each repo's _viz_cli.py gains mirror_to_scratch(domains=None) + python _viz_cli.py scratch [domain ...], replacing the scratch domain folder with current PNGs (no stale figures) and printing the path.
  • gallery/gallery_run.sh calls the mirror after each successful producer; a mirror failure never fails the run.
  • Brain skills/eyes/eyes.md gains an "Active image work (on-the-fly)" mode: after each fix re-render that domain, mirror, tell the human the scratch path.
Detailed implementation plan

Affected Repositories

Branch Survey

Repository Current Branch Dirty?
./autogalaxy_visualization main clean
./autofit_visualization main clean
./autocti_visualization main clean
./PyAutoBrain main clean

Suggested branch: feature/eyes-scratch-mirror

Implementation Steps

  1. _viz_cli.py (each viz repo): add mirror_to_scratch(domains=None) -> Path | None; for each domain delete $PYAUTO_EYES_SCRATCH/<lib>/<domain>/ and copy every PNG under scripts/<domain>/images/ preserving the subpath below images/. <lib> = registry import_name (autogalaxy/autofit/autocti). Add __main__ entry python _viz_cli.py scratch [domain ...] (no domains = every domain with images/, skip misc). Cross-check gallery/viz_manifest.yaml file: entries so the mirror captures what the gallery shows.
  2. gallery/gallery_run.sh: after a producer succeeds and PYAUTO_EYES_SCRATCH is set, mirror that script's domain (failure tolerated); update header usage comment.
  3. Short README/AGENTS.md note where the harness is documented.
  4. Brain skills/eyes/eyes.md: "Active image work (on-the-fly)" section.
  5. Test: scratchpad-pointed run of one cheap domain per repo; unset = no-op; ruff lint; revert test re-renders.

Key Files

  • _viz_cli.py — mirror helper + CLI entry
  • gallery/gallery_run.sh — per-producer mirror hook
  • PyAutoBrain/skills/eyes/eyes.md — active image work mode

Original Prompt

Click to expand starting prompt

Eyes scratch mirror — on-the-fly figure inspection

Consequence: judge
Autonomy: human-required

@autolens_visualization @autogalaxy_visualization @autofit_visualization @autocti_visualization @PyAutoBrain

Request (verbatim, 2026-10-21)

For PYAutoEyes work, I often have to wait for a complete loop of image fix to
dashboard update to provide feedback, but when im actively working on images it
needs to be more on-the-fly (e.g. before PRs, CI). Can we make it so such work
puts images for inspection in Science/scratch/eyes/dataset_type as we go.

Follow-up: "go, mirror the dashboard so its eyes/autolens/<dataset_type>"

Approved plan

  • Opt-in env var PYAUTO_EYES_SCRATCH (human sets it to
    /mnt/c/Users/Jammy/Science/scratch/eyes); unset = no-op, so CI and other
    machines are unaffected and no Windows path is committed.
  • Layout mirrors the PyAutoEyes dashboard: $PYAUTO_EYES_SCRATCH/<lib>/<dataset_type>/
    (autolens/imaging, autogalaxy/ellipse, autofit/samples, autocti/imaging_ci, …),
    where <dataset_type> = the producer domain scripts/<domain>/.
  • Each <lib>_visualization/_viz_cli.py gains a mirror helper + entry point
    python _viz_cli.py scratch [domain ...]: replaces the scratch domain folder
    with the current PNGs (no stale figures), prints the path.
  • gallery/gallery_run.sh calls it after each successful producer, so a
    worktree run of one domain lands figures in scratch immediately.
  • Brain skills/eyes/eyes.md gains an "active image work" mode: after each fix,
    re-render that domain, mirror, tell the human the scratch path.

Split (human decision 2026-10-21)

autolens_visualization is claimed by point-image-fit-filename (PR #7, also edits
_viz_cli.py). Phase 1 = autogalaxy/autofit/autocti_visualization + Brain eyes.md
now. Phase 2 = autolens_visualization, same change, after #7 merges via /prm.

Activity

  1. Jammy2211 commented on Oct 21, 2026

    @Jammy2211
    ContributorAuthor

    Shipped (phase 1). Merged via /prm on 2026-10-21. Every CI leg was green.

    • autogalaxy_visualization#5 (41be603)
    • autofit_visualization#4 (1a63cd12)
    • autocti_visualization#4 (bb8f05b1)
    • PyAutoBrain#529 (e03f4cb1): the /eyes "Active image work" section

    Setting PYAUTO_EYES_SCRATCH turns the mirror on: gallery_run.sh <domain> and python _viz_cli.py scratch [domain] copy figures to $PYAUTO_EYES_SCRATCH/<lib>/<dataset_type>/.

    Phase 2 (autolens_visualization) is filed as a separate draft. It can start once autolens_visualization#7 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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