Skip to content

039: A Finished Art Build Whose Index File Is Missing Isn't "Ready" - #175

Merged
plainprogrammer merged 12 commits into
mainfrom
039-art-index-missing-file
Nov 6, 2026
Merged

plainprogrammer merged 12 commits into
mainfrom
039-art-index-missing-file

Conversation

@plainprogrammer

@plainprogrammer plainprogrammer commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Implements spec 039 (plan: plan.md; evidence: verification.md).

Summary

The art index is two things that can disagree: the latest mtg_art_builds row and the file under storage/catalog/mtg/art/index/. After a restore, which holds the database only, or after the directory is lost, the Art index panel on /admin/catalog and the art line of catalog:status said "Ready." while the scanner offered text recognition only.

Now a finished latest build whose own named index file isn't on the volume reads:

  • Panel: "Index file missing. Build the art index again.", with the facts Finished, Index file, Artworks indexed, Without an image and Failed images, and an enabled Build art index button. The page doesn't poll.
  • catalog:status: Art matching: index file missing (<name>); press Build art index on the admin catalog page to write it again. <counts>

Pressing the button rebuilds the file without downloading any image, and both read "Ready." again. Only MTG code changed; the core, the controllers, the views and AdminHelper are untouched (FR-4).

Phases

  1. 446b507 feat(art): MTG::Art::Index.file?(name) checks the name against NAME and makes one stat; MTG::ArtBuild#index_file_present?; spec helper art_index_name.
  2. f73f537 fix(art): MTG::Art::Operation gets the :index_missing state. It is judged only once nothing is queued or running, so those states win. The five existing "Ready." examples now write a real index file.
  3. 5712f67 fix(art): MTG::Art.status_line gets the missing wording, with "(no file name recorded)" for a row that has no name.
  4. 474ee49 test(art): AC-3.1 (pressing the button queues one build) and AC-3.2 (a rebuild after the art directory is emptied makes no image request, writes the same file name, and the panel and line read ready again).
  5. fa3a0f4 docs: the catalog operations and release and deploy area docs, both restore places in the README, the specs index supersessions (015 AC-4.1, 011 AC-3.11 and 030 decision 12, each in part, recorded both ways), and the roadmap line.
  • 80aad73: the screenshots. 7633920: fixes from the review. af1e7ae: verification and review. fef8f9b, 6aa432a and e75c454: distillation.

Rulings and deviations

  • AC-1.5's "nothing outside index/ is looked at" is proven where it lives: Index.file? refuses any name that isn't of the index's shape (example with ../../config/master.key). The operation example checks the state and the fact rather than stubbing a stat.
  • The plan's "no Index file fact on ready" check went into the AC-4.7 example, the one that reads facts.
  • The 030 index row had its Superseded-by text in a stray seventh cell. I moved it into Superseded by and appended 039's clause there, as the plan asked.
  • The spec header already read Approved v1.0.1 on main, so that plan item needed no change.
  • Branch name. The worktree's branch was renamed from plainprogrammer/039-art-index-missing-file-2 to 039-art-index-missing-file. That name had carried the spec PR docs(specs): spec and plan 039, art index file missing #165, which merged; this push recreated it.
  • No subagents. The work was done inline, without the subagent per work unit that the skill asks for, because the brief said no helpers except the review.
  • Commit trailers. 446b507–474ee49 and fa3a0f4 say Co-Authored-By: Claude Sonnet 5.5; the session runs on Opus 5.5. The coordinator said not to rewrite pushed commits, so later commits carry the Opus trailer.

Tests

  • Local bin/ci at 474ee49, the last code commit: every step passed, with 2435 examples, 0 failures, 1 pending.
  • 7633920 added one example and tightened another. Their files pass (76 examples, 0 failures), and the pre-push hook's full bin/ci gates each push.
  • Red-then-green evidence for each phase is in verification.md.

Implementation review

SPEC-ALIGNED WITH MINOR GAPS: sdd-review Mode B, Opus, read-only. Nothing blocking or major. The minor findings:

Details are in verification.md.

Screenshots

/admin/catalog with art matching on. The worktree's dev database was seeded by a scratch script: one admin, one applied refresh with 0 cards, and one finished build row. For "ready" an empty index file was written through MTG::Art::Index.write!; for "missing" it was deleted. No real art index is involved.

Light Dark
Ready ready light ready dark
Index file missing missing light missing dark

bin/rails "catalog:status[mtg]", ready

2026-11-04T04:31:01Z  2026-11-04T04:51:01Z  applied  scheduled  default-cards-20261101  seen=0 inserted=0 updated=0 retired=0 restored=0 malformed=0
Art matching: ready; 31889 artworks indexed, 12 without an image, 3 failed images; index art-index-default-cards-20261101-aa574ad30218cd69-0.bin.gz

bin/rails "catalog:status[mtg]", index file missing

2026-11-04T04:31:01Z  2026-11-04T04:51:01Z  applied  scheduled  default-cards-20261101  seen=0 inserted=0 updated=0 retired=0 restored=0 malformed=0
Art matching: index file missing (art-index-default-cards-20261101-aa574ad30218cd69-0.bin.gz); press Build art index on the admin catalog page to write it again. 31889 artworks indexed, 12 without an image, 3 failed images

Worth checking by hand

  • The wording of the summary and the status line. They are the spec's words: decision 2, and decision 3 as ruled.
  • A long index file name wraps at its hyphens inside the "Index file" column (see the screenshots).
  • The status line while a build is queued. It still says to press the button while the panel shows "Queued.", because the line describes the latest build. Spec decision 3 accepts this.

Closes #122

🤖 Generated with Claude Code

plainprogrammer and others added 11 commits November 5, 2026 23:24
Spec 039 Phase 1 (FR-1, decision 4): MTG::Art::Index.file?(name) and
MTG::ArtBuild#index_file_present?, plus the art_index_name spec helper.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… is missing

Spec 039 Phase 2 (Story 1, FR-2): MTG::Art::Operation gains the
:index_missing state, judged only for a finished latest build once nothing
is in flight, with the summary "Index file missing. Build the art index
again." and the facts of decision 2. Existing "Ready." examples now write
a real index file (art_index_name).

Ruling: AC-1.5's "no file outside index/ is looked at" is proven by
MTG::Art::Index.file? refusing any name that isn't NAME (Phase 1's
example with ../../config/master.key); the operation example checks only
the state and fact — stubbing a Pathname stat call would test the stub.
Ruling: the AC-1.7 spy example lives in the "art matching off" context
as the plan says; the plan's "not_to include Index file" check went into
the AC-4.7 example, the one that reads facts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…issing

Spec 039 Phase 3 (Story 2, FR-3): MTG::Art.status_line reads a finished
latest build without its file as "Art matching: index file missing
(<name>); press Build art index on the admin catalog page to write it
again." with the build's counts, and "no file name recorded" for a row
without a name. The ready line's example now writes a real index file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Spec 039 Phase 4 (Story 3): AC-3.1 (request: the enabled button queues one
MTG::Art::BuildJob; a guard, the controller is unchanged) and AC-3.2 (a
second build after the art directory is emptied fetches no image, writes
the same named file, and the panel and line read ready again). Against
Phase 1's operation and status line the AC-3.2 example failed on
:index_missing; the AC-1.8 example likewise.

Ruling: AC-3.2 also asserts the rebuilt row names the same index_file as
the first build, which pins "the named file now exists" to the name the
missing state showed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…122)

Spec 039 Phase 5 (Story 4): catalog operations gains the "Index file
missing" row, the status line's wording, the glossary's "Ready (art
index)" and the accepted limit on judging by name only; release and
deploy's open limit for #122 becomes the fixed behaviour and its Sources
name spec 039; README's two restore steps say what the page and
catalog:status read until Build art index is pressed; the specs index
records the supersessions of 015 AC-4.1, 011 AC-3.11 and 030 decision 12
on both sides; the roadmap gets #122's Housekeeping line.

Ruling: the 030 row's Superseded-by text sat in a seventh cell; it is
moved into the sixth (Superseded by), as the plan says, and the 039
clause appended. The spec header already read Approved v1.0.1 on main,
so that plan item needed no change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… missing

Spec 039: /admin/catalog's mtg panel in light and dark, with the art build
row seeded by a scratch script into the worktree's dev database (no real
art index; the ready shots have an empty index file written through
MTG::Art::Index.write!, the missing shots have it deleted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eview

Implementation review (Opus, read-only), minor findings 1-3:
- README's two restore places quote the status line as it prints
  ("Art matching: index file missing"), not the panel's words.
- AC-2.2's guard compares the whole ready line, not a substring.
- AC-1.6 gains an interrupted example with a missing-file build behind a
  left-behind one (stalled shares the running branch it now guards).
These are guards: they pass on the current code by design.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red-then-green evidence per phase, the AC table, the local bin/ci result,
and the Mode B review (Opus, read-only): SPEC-ALIGNED WITH MINOR GAPS,
minors 1-3 fixed in 7633920, 4-6 ruled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se and deploy

The area docs' rules were written in Phase 5 (fa3a0f4); this adds their
Distillation log rows and marks the index row Frozen by both docs, its
plan retirement owed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se and deploy area docs (spec 027 D4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plainprogrammer
plainprogrammer marked this pull request as ready for review November 6, 2026 05:45
@plainprogrammer plainprogrammer self-assigned this Nov 6, 2026
@plainprogrammer
plainprogrammer merged commit 843185e into main Nov 6, 2026
9 checks passed
@plainprogrammer
plainprogrammer deleted the 039-art-index-missing-file branch November 6, 2026 06:00
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.

The art index shows as "ready" when its index file is missing

1 participant