Skip to content

fix(batch): hold a refused file in the triage queue with its reason - #96

Merged
stephen-masters merged 1 commit into
mainfrom
fix/refused-files-to-triage
Nov 3, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
fix/refused-files-to-triage

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

Summary

  • A file that sillybos refuses before any decoder reads it (a PostScript file called .png, a pixel bomb, a PDF with JavaScript) now goes to the triage queue with the refusal as its reason, a manifest and a record with no candidates. Before, it fell into the generic error handler: printed, counted as a failed run (exit 1), and left in scans/ for the next run to refuse again.
  • The orientation check already catches its own refusals and leaves the reading to refuse the file, so every refusal arrives at the one handler in _process_file. Telemetry records the file as refused; the manifest row says triage with the reason as its note.
  • tetrak-ocr triage lists a refused file with no score and the reason, unchanged.
  • This is the second of brief 022's "how we would know it worked" tests: a batch seeded with hostile files holds each with a readable reason and processes the rest.

Test plan

  • Two new tests in tests/ocr/test_batch.py: a PostScript file named .png beside a legible page is held with "says PNG, is PostScript", the page is processed, the run prints Triaged (1) and exits 0; the queue lists it
  • ruff; pytest -m "not slow": 495 passed (the three test_vision.py failures are pre-existing on a Mac without ocrmac)
  • markdownlint over the guide

🤖 Generated with Claude Code

A file sillybos refuses before any decoder reads it fell into the generic
error handler: printed, counted as a failed run, and left in scans/ for
the next run to refuse again. It now goes to the triage queue like a
poor transcript does, with the refusal as its reason, a manifest and a
record with no candidates, and the exit code stays 0. Brief 022's test of
the arrangement is that a batch seeded with hostile files holds each with
a readable reason and processes the rest.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying tetrak with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8ea27e0
Status: ✅  Deploy successful!
Preview URL: https://54f0d636.tetrak.pages.dev
Branch Preview URL: https://fix-refused-files-to-triage.tetrak.pages.dev

View logs

@stephen-masters
stephen-masters merged commit b82e44a into main Nov 3, 2026
9 checks passed
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.

1 participant