Repository navigation
fix(image): one OCR engine per image, and an exact smoke check - #82
Merged
Merged
Conversation
bin/image-smoke matched any output holding "mtg". It now captures the task's output, then asserts the whole line "No mtg refresh runs yet." (spec 012 AC-6.3), which a fresh instance prints before the source's own lines (the art line, spec 011). Capturing first leaves no pipe to end early under pipefail, and a failure shows what the task printed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
) vendor/ocr is ignored by git but was not ignored by the build, so an image built in a set-up checkout took the checkout's copy of the engine. The build already runs bin/fetch-ocr-engine, which downloads the engine and checks every file against its pinned SHA-256, so the image now always holds that copy and a local build has the same /rails/vendor as a CI build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`COPY vendor/* ./vendor/` is the Rails template's line for gems vendored under vendor/, placed before `bundle install` so the install can see them. This app has none: the Gemfile has no path or vendored source, Gemfile.lock has no PATH section, and vendor/ holds only .keep, javascript/.keep and the ignored ocr/. So the install read nothing from it. With a wildcard source the line copies each matched directory's contents, not the directory, which is what put vendor/ocr/v7.0.0 at /rails/vendor/v7.0.0. A corrected `COPY vendor ./vendor` would still copy nothing the install uses, and `COPY . .` brings vendor/ in afterwards, so the line is removed, not fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dor (#31) bin/image-smoke lists /rails/vendor and fails when it holds anything besides .keep, javascript and ocr, naming what it found. That catches a flattened or duplicated copy of the OCR engine (as /rails/vendor/v7.0.0 was) before an image is pushed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plainprogrammer
added a commit
that referenced
this pull request
Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A local image built in a set-up checkout now holds the scanner's OCR engine once, and the smoke test asserts the exact
catalog:statusline and fails on anything unexpected in/rails/vendor.Closes #31
Closes #19
What changed
/vendor/ocris in.dockerignore, so the checkout's copy of the engine (installed bybin/setup) stays out of the build context and the image always gets the onebin/fetch-ocr-enginedownloads and checksum-verifies during the build.COPY vendor/* ./vendor/is removed from the Dockerfile. It is the Rails template's line for vendored gems, and with a wildcard it flattens any subdirectory ofvendor/. The app has none: nopath:source in the Gemfile, and trackedvendor/is only.keepandjavascript/.keep, which still arrive throughCOPY . ..bin/image-smokefails when/rails/vendorholds anything besides.keep,javascriptandocr, and prints what it found.bin/image-smokecaptures the output ofbin/rails "catalog:status[mtg]"and asserts the whole lineNo mtg refresh runs yet., instead of piping intogrep -q "mtg". On failure it shows what it got.spec/image_publishing_spec.rb; spec 012'sverification.md,CLAUDE.mdand the spec 012 follow-ups note match.Verification
collector:before, built fromorigin/mainin a set-up worktree):/rails/vendorheld.keep,javascript,ocrand the strayv7.0.0(14,496 KB); image 557 MB.collector:after): only.keep,javascript,ocr, withocr/v7.0.0present; image 542 MB.bin/image-smokepasses on the after image and fails on the before image withunexpected in /rails/vendor: v7.0.0.bin/ci: passed, 1351 examples, 0 failures, 1 pending (the art agreement spec, unrelated).Known limits
RUN bin/fetch-ocr-engine. That is what Local image builds contain the OCR engine twice (/rails/vendor/v7.0.0) #31 asks for: a local build matches a CI build.ocris present is proved by the scanner asset checks further down the script.No mtg refresh runs yet.A re-run clears it.plan.mdof spec 012 still quotes the old lines, as a record.🤖 Generated with Claude Code