Skip to content

fix(preflight): report isolated over-limit ink regions (#116) - #158

Open
mberrys wants to merge 7 commits into
devfrom
cc/issue-116-ink-coverage-floor
Open

mberrys wants to merge 7 commits into
devfrom
cc/issue-116-ink-coverage-floor

Conversation

@mberrys

@mberrys mberrys commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #116 (L01-11). ink-coverage no longer suppresses over-limit regions below a percentage of the page. The floor is now physical: min_region_area_mm2 (default 0.25 mm², about a 0.5 mm square, the smallest solid a press reproduces as a distinct area). A probe_dpi too coarse to resolve that floor (fewer than four raster pixels) reports the page check-incomplete instead of passing clean. min_region_area_pct is deprecated, still accepted, and ignored.

Proof

Source SHA under test: head of cc/issue-116-ink-coverage-floor. Fixture loop-preflight/testdata/fixtures/ink-coverage-isolated-region.pdf (generator loop-preflight/tools/generate_ink_isolated_region_fixture.py) is one 6 mm square of 400% rich black on an A3 page (about 0.03% of the page), committed first (126daa5).

Result (PdfTool preflight, test-ink-coverage.json)
Before pass: true, 0 errors, 0 warnings
After 1 ink-coverage warning: 38.2 mm², peak 400%

The baseline PdfTool was built from the #157 head, which does not touch ink-coverage code.

Local (Windows, MSVC Release): UnitTestsPreflightEngine, UnitTestsPreflightCorpus, UnitTestsPreflightVerdict, UnitTestsPreflightChecks, UnitTestsEvidenceGraph, UnitTestsContentProcessorLimits all exit 0. Regenerating the corpus snapshots changed only the new ink-coverage-isolated-region.json (other differences were line endings). generate-architecture-catalogs.py --check, check_source_integrity.py, check_preflight_truth_source.py and check-change.py --dry-run pass. New tests cover the isolated region on a large page, the deprecated percentage floor no longer suppressing it, an unresolvable floor reporting incomplete, and min_region_area_mm2 validation.

Not run locally

Full check-change build/ctest/clang-tidy (no clang-tidy-18), Linux lanes, and the remaining mapped test targets; left to CI.

Remaining risk

  • Regions below the floor stay suppressed by design; the floor is a policy choice.
  • The probe is a raster estimate, not a plate-ready separation TAC.
  • A profile that relied on min_region_area_pct to hide small regions will now see them.

Handoff

Changed: probe and engine (pdfinkcoverageprobe.*, preflightengine.*), schema, example and test profiles, README, overlay (ink-coverage-raster-tac landed, closed_by ink-coverage), regenerated catalogs, fixture, generator, snapshot, change record and evidence. Anti-slop review: the physical floor replaces the percentage rather than adding a second knob, and the incomplete path fires only when the raster cannot resolve the configured floor.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

mberrys and others added 6 commits September 30, 2026 16:57
#116)

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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…and evidence (#116)

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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread LoopLibCore/sources/preflightengine.cpp Outdated
continue;
}

if (check.minRegionAreaMm2 < result.minResolvableAreaMM2)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete finding is emitted on every page, even when nothing is over the limit. The schema says an over-limit region the raster cannot resolve makes the check incomplete. This branch instead fires whenever the floor is below the raster resolution, even with overLimitAreaMM2 == 0. With min_region_area_mm2: 0 (allowed by the schema) every page of a clean document is reported incomplete. Gate it on the page actually having over-limit pixels.

… ink

The coarse-probe incomplete finding fired on every page whenever the floor
was below raster resolution, even on pages with no over-limit pixels.

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.

1 participant