Conversation
Five membership dictionaries over groups with opposite View and Print usage; hidden-layers currently passes it without a finding. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…creen (#115) hidden-layers now evaluates every governor it meets (marked content, Form XObject /OC, annotation /OC, inline OCMDs) under the View and Print usages and reports divergence, print-hidden membership dictionaries, and unevaluable ones as incomplete. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
#115) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…evidence (#115) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…evidence (#115) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 1, 2026
mberrys
commented
Oct 1, 2026
| const bool divergent = !governor.incomplete && governor.viewState != governor.printState; | ||
| const bool hiddenInPrint = !governor.incomplete && governor.printState == OCState::OFF; | ||
| // A plain group hidden in print from marked content is already reported by name. | ||
| if (!governor.incomplete && !divergent && !(hiddenInPrint && (governor.kind == QStringLiteral("ocmd") || governor.source != QStringLiteral("marked-content")))) |
Contributor
Author
There was a problem hiding this comment.
Duplicate finding for marked-content OCMDs that are hidden in print. performMarkedContentBegin already adds a hidden-layers finding ("unnamed optional-content group") when isContentSuppressed() is true. This skip test only exempts plain OCGs, so the same OCMD is reported a second time here. A plain OCG in BDC that diverges between view and print is also reported twice. The fixture's BDC OCMDs are all print-ON, so the tests don't catch this. The marked-content path should defer to the governor report when the governor is an OCMD, or vice versa.
A marked-content OCMD hidden in print was reported both as an unnamed group and by the governor report; a plain group diverging between view and print was likewise reported twice. 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.
Closes #115
What changed
hidden-layersnow evaluates every optional-content governor it meets under both the View and the Print usage (default configuration with its/ASevents applied) and reports what it finds:/PAnyOn, AllOn, AnyOff, AllOff and/VEexpressions) on marked content (BDC, including inline dictionaries the content processor cannot evaluate), Form XObject/OCentries (Do), and annotation/OCentries.evidence.view_state,print_state,policy,ocg_names,governor,governor_source,divergence.errorfinding withinspection_complete: false, not a pass.hidden-layers-ocmdislanded(closed byhidden-layers);hidden-layersmeasures, limitations and evidence rewritten.Existing behaviour is kept: a plain group hidden in print from marked content is still reported once by name, and the golden corpus is unchanged.
Proof
Source SHA under test:
2478cd80. Fixture:loop-preflight/testdata/fixtures/ocmd-print-divergence.pdf(generatorloop-preflight/tools/generate_ocmd_divergence_fixture.py), committed first (38d7af0). It has two groups with opposite View/Print usage and five membership dictionaries (AllOn and AllOff on Form XObjects; AnyOn, AnyOff and/VE [/Not ...]on marked content), each diverging between screen and print.ocmd-print-divergence(test-hidden-layers, warning)pass: true, no errors, no warningshidden-layerswarnings, one per policy; AllOn is on-screen/off-print, the other four off-screen/on-printocmd-print-divergence.jsonThe baseline binary was built from the PR #156 head, which does not touch hidden-content code.
Local (Windows, MSVC Release):
UnitTestsPreflightEngine112/112 (includes the divergence test and an unevaluable-expression test that expects an incomplete error),UnitTestsPreflightCorpus156/156,UnitTestsPreflightVerdict53/53,UnitTestsPreflightChecks17/17,UnitTestsEvidenceGraph15/15,UnitTestsContentProcessorLimits10/10.python scripts/generate-architecture-catalogs.py --check,check_source_integrity.py,check_preflight_truth_source.py,generate-adapters.pyandcheck-change.py --dry-runpass.Skipped or unavailable locally: the full
check-change.pybuild/ctest/clang-tidy run (noclang-tidy-18; only the targets above were built), Linux lanes, and the remaining mapped test targets. CI covers those.Remaining risk
/OCentry on a Form XObject or annotation that is never painted is not inspected./Annotsonly when the annotation dictionary itself carries/OC.Anti-slop review
No second visibility engine: evaluation reuses
PDFOptionalContentMembershipObjectandPDFOptionalContentActivityfor both usages, and the only new decision logic is when to report. A governor is never silently treated as visible when it cannot be evaluated.🤖 Generated with Claude Code