feat(classify): split halftone-scan into halftone-scan + form-scan (MK-18) #34

Merged
David merged 1 commit from fix/taxonomy-form-scan-MK-18 into main 2026-05-24 17:41:37 +02:00
Owner

Summary

Resolves MK-18 with option B: split halftone-scan into the AM-halftone spec class (kept, zero fixtures, theoretical) and a new form-scan class (FM-screened background panels: tax forms, vehicle inspection forms, and similar documents). The chosen name lands here so MK-16 can implement panel-density scoring against a stable label.

  • New ImageClass::FormScan wired through as_str, from_label, the embedded recipe table, and the every_embedded_recipe_parses test.
  • New src/image/recipes/form-scan.toml ships as a passthrough stub. A binary-scan chain (contrast-stretch in particular) would crush the shaded panels and lose the form fields they enclose; MK-16 owns the panel-aware replacement alongside the panel_density feature.
  • FormScan is intentionally not added to the score() candidates slate. Auto-detection cannot produce form-scan until MK-16 wires the panel-density signal; until then the class is reachable only via --class form-scan. halftone-scan and its halftone_autocorr_peak branch are untouched.
  • README class list and monkey image classify / --class doc comments updated.
  • MK-16's description has been updated on YouTrack to use form-scan and to note that adding FormScan to the score slate is part of that issue.

tests/fixtures/ is gitignored (real-world scans are kept local), so the directory rename happens on the user's machine after merge: rename tests/fixtures/classify/halftone-scan/ (containing the 1099 / inspection scans) to tests/fixtures/classify/form-scan/; the halftone-scan/ directory stays empty until real AM-halftone fixtures arrive.

Test plan

  • cargo test: 79/79 pass (synthetic halftone test still asserts HalftoneScan; the new form-scan recipe parses via every_embedded_recipe_parses).
  • just check: fmt + clippy + tests + docker builder compile all green.
  • After merge: local rename of tests/fixtures/classify/halftone-scan/ to tests/fixtures/classify/form-scan/ and re-run just classify-fixtures to confirm the existing fixtures still classify as unknown or binary-scan (they cannot land on form-scan until MK-16 ships the panel-density signal).

Related: MK-18, unblocks MK-16.

## Summary Resolves MK-18 with option B: split `halftone-scan` into the AM-halftone spec class (kept, zero fixtures, theoretical) and a new `form-scan` class (FM-screened background panels: tax forms, vehicle inspection forms, and similar documents). The chosen name lands here so MK-16 can implement panel-density scoring against a stable label. - New `ImageClass::FormScan` wired through `as_str`, `from_label`, the embedded recipe table, and the `every_embedded_recipe_parses` test. - New `src/image/recipes/form-scan.toml` ships as a passthrough stub. A binary-scan chain (contrast-stretch in particular) would crush the shaded panels and lose the form fields they enclose; MK-16 owns the panel-aware replacement alongside the `panel_density` feature. - `FormScan` is intentionally **not** added to the `score()` candidates slate. Auto-detection cannot produce `form-scan` until MK-16 wires the panel-density signal; until then the class is reachable only via `--class form-scan`. `halftone-scan` and its `halftone_autocorr_peak` branch are untouched. - README class list and `monkey image classify` / `--class` doc comments updated. - MK-16's description has been updated on YouTrack to use `form-scan` and to note that adding `FormScan` to the score slate is part of that issue. `tests/fixtures/` is gitignored (real-world scans are kept local), so the directory rename happens on the user's machine after merge: rename `tests/fixtures/classify/halftone-scan/` (containing the 1099 / inspection scans) to `tests/fixtures/classify/form-scan/`; the `halftone-scan/` directory stays empty until real AM-halftone fixtures arrive. ## Test plan - [x] `cargo test`: 79/79 pass (synthetic halftone test still asserts `HalftoneScan`; the new `form-scan` recipe parses via `every_embedded_recipe_parses`). - [x] `just check`: fmt + clippy + tests + docker builder compile all green. - [ ] After merge: local rename of `tests/fixtures/classify/halftone-scan/` to `tests/fixtures/classify/form-scan/` and re-run `just classify-fixtures` to confirm the existing fixtures still classify as `unknown` or `binary-scan` (they cannot land on `form-scan` until MK-16 ships the panel-density signal). Related: MK-18, unblocks MK-16.
feat(classify): split halftone-scan into halftone-scan + form-scan (MK-18)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 17s
Create release / Create release from merged PR (pull_request) Has been skipped
664b3c1ef9
MK-18 picked option B: keep `halftone-scan` as the AM-halftone (newspaper / magazine, detectable dot pitch) spec class with zero fixtures, and introduce `form-scan` for the FM-screened (stochastic) background panels that surfaced on tax forms, vehicle inspection forms, and similar documents in MK-16. The chosen class name lands here so MK-16 can implement against a stable label rather than retasking `halftone-scan` mid-flight.

Wired the new variant through `ImageClass`, `as_str`, `from_label`, the embedded recipe table, and the `every_embedded_recipe_parses` test. The new `src/image/recipes/form-scan.toml` ships as a passthrough stub; a naive binary-scan chain (contrast-stretch in particular) would crush the shaded panels and lose the form fields they enclose, so MK-16 owns the panel-aware processing chain alongside the panel-density feature.

`FormScan` is intentionally left out of the `score()` candidates slate so auto-detection cannot produce it until MK-16 wires the `panel_density` signal; until then the class is reachable via `--class form-scan` only. `halftone-scan` and its `halftone_autocorr_peak` scoring branch are untouched.

`tests/fixtures/` is gitignored, so the directory layout for fixtures is local-only. After this lands the user should rename the local `tests/fixtures/classify/halftone-scan/` (containing the 1099 / inspection-form scans) to `tests/fixtures/classify/form-scan/`; the `halftone-scan/` directory stays empty until real AM-halftone scans arrive.

MK-16's description has been updated to use `form-scan` throughout and to note that adding `ImageClass::FormScan` to the score slate is part of that issue.

#MK-18 State Done
David merged commit 1af5bfd581 into main 2026-05-24 17:41:37 +02:00
David deleted branch fix/taxonomy-form-scan-MK-18 2026-05-24 17:41:38 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/monkey!34
No description provided.