Skip to content

fix(image): one OCR engine per image, and an exact smoke check - #82

Merged
plainprogrammer merged 6 commits into
mainfrom
031-image-vendor-and-smoke-check
Oct 13, 2026
Merged

plainprogrammer merged 6 commits into
mainfrom
031-image-vendor-and-smoke-check

Conversation

@plainprogrammer

Copy link
Copy Markdown
Owner

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:status line and fails on anything unexpected in /rails/vendor.

Closes #31
Closes #19

What changed

Verification

  • Before (collector:before, built from origin/main in a set-up worktree): /rails/vendor held .keep, javascript, ocr and the stray v7.0.0 (14,496 KB); image 557 MB.
  • After (collector:after): only .keep, javascript, ocr, with ocr/v7.0.0 present; image 542 MB.
  • bin/image-smoke passes on the after image and fails on the before image with unexpected in /rails/vendor: v7.0.0.
  • bin/ci: passed, 1351 examples, 0 failures, 1 pending (the art agreement spec, unrelated).
  • One independent read-only review (Opus): no must-fix; it ran the script's shell logic on sample inputs (warning lines ahead of the status line, trailing whitespace, extra entries).
  • Not verified before this PR: Docker, and arm64. The runs above were podman on amd64; this PR's CI is the first run of the changed Dockerfile and smoke script under Docker on both architectures.

Known limits

  • A local build now always downloads the engine from the npm registry, so an offline local build fails at 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.
  • The vendor guard rejects extras only; that ocr is present is proved by the scanner asset checks further down the script.
  • A smoke run that crosses Monday 03:15 UTC, when the weekly refresh is scheduled, could show a run line instead of No mtg refresh runs yet. A re-run clears it.
  • plan.md of spec 012 still quotes the old lines, as a record.

🤖 Generated with Claude Code

plainprogrammer and others added 6 commits October 13, 2026 17:52
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>
…r evidence (#19, #31)

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

CLAUDE.md says what .dockerignore now keeps out and what the smoke test checks in /rails/vendor (#31). The
spec 012 follow-ups memory no longer lists the smoke check (#19).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plainprogrammer plainprogrammer self-assigned this Oct 13, 2026
@plainprogrammer
plainprogrammer merged commit 14bdf07 into main Oct 13, 2026
4 checks passed
@plainprogrammer
plainprogrammer deleted the 031-image-vendor-and-smoke-check branch October 13, 2026 22:29
plainprogrammer added a commit that referenced this pull request Oct 14, 2026
…e the images ran (#19, #31)

The failure paths were shown with a stand-in container CLI, and every image run was podman on amd64. The
follow-ups memory points at PR #82.

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>
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.

Local image builds contain the OCR engine twice (/rails/vendor/v7.0.0) Tighten bin/image-smoke's catalog:status check

1 participant