From 4e1891c3324c13c6aa6a85e9b8bdcbb65c1655d8 Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Sun, 12 Apr 2026 22:38:09 +0200 Subject: [PATCH 1/2] docs: add test/fixtures/images/README.md (T2) Document fixture images and generated artifacts for contributors. Co-Authored-By: Claude Opus 4.6 (1M context) --- test/fixtures/images/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/fixtures/images/README.md diff --git a/test/fixtures/images/README.md b/test/fixtures/images/README.md new file mode 100644 index 00000000..355989da --- /dev/null +++ b/test/fixtures/images/README.md @@ -0,0 +1,24 @@ +# Test Fixture Images + +These images are used by the unit test suite for image comparison testing. + +| File | Description | +|------|-------------| +| `a.png` | Base island map (80x80) | +| `b.png` | Modified island map — small region differs from `a.png` | +| `c.png` | Modified island map — different region differs from `a.png` | +| `d.png` | Modified island map — another variation | +| `a_cropped.png` | Cropped version of `a.png` | +| `portrait.png` | Portrait orientation image (3x6) | +| `portrait_b.png` | Modified portrait — differs from `portrait.png` | +| `a.webp` | WebP version of `a.png` | + +## Generated artifacts (gitignored) + +These files are generated during test runs and should NOT be committed: + +| Pattern | Description | +|---------|-------------| +| `*.diff.png` | Annotated diff overlay | +| `*.base.diff.png` | Annotated base image | +| `*.heatmap.diff.png` | Heatmap of pixel differences | From 1ef64f8e3279ac3c732d52f029a213e8733b0034 Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Sun, 12 Apr 2026 22:42:46 +0200 Subject: [PATCH 2/2] feat: add snap_diff:clean rake task for diff artifact pruning (P3.3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bin/rake snap_diff:clean removes diff artifacts (*.diff.png, *.heatmap.diff.png, snap_diff_report.html) from tmp/ and doc/screenshots/ while keeping baselines. Addresses tmp/ bloat — 262 files accumulated after a development session. Co-Authored-By: Claude Opus 4.6 (1M context) --- Rakefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 0e83a620..a6798fa0 100644 --- a/Rakefile +++ b/Rakefile @@ -35,8 +35,18 @@ task "report:sample", [:embed] do |_t, args| ruby "scripts/generate_sample_report.rb #{embed_arg}" end +desc "Remove screenshot diff artifacts (keeps baselines)" +task "snap_diff:clean" do + patterns = ["**/*.diff.png", "**/*.base.diff.png", "**/*.heatmap.diff.png", + "**/*.diff.webp", "**/*.base.diff.webp", "**/*.heatmap.diff.webp", + "**/snap_diff_report.html"] + removed = patterns.flat_map { |p| Dir.glob("tmp/#{p}") + Dir.glob("doc/screenshots/#{p}") } + removed.each { |f| FileUtils.rm_f(f) } + puts "Removed #{removed.size} diff artifacts" +end + task "clobber" do - puts "Cleanup tmp/*.png" + puts "Cleanup tmp/" FileUtils.rm_rf(Dir["./tmp/*"]) end