Skip to content

feat(preflight): report PDF/X-5 and PDF/A-3 claims as unsupported, not produced (#665) - #671

Merged
mberrys merged 2 commits into
devfrom
feat/0.3.0-665-pdfx5-pdfa3-claims
Sep 22, 2026
Merged

mberrys merged 2 commits into
devfrom
feat/0.3.0-665-pdfx5-pdfa3-claims

Conversation

@mberrys

@mberrys mberrys commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What changed

Loop does not produce PDF/X-5n, PDF/X-5g, or PDF/A-3. Core has no external-resource or n-colorant output-intent rules for those levels, so this is not a converter and not a renamed PDF/X check. A document that declares one of those levels used to pass with nothing looking at the claim. The new conformance-claims check parses the declaration once and reports check status unsupported (reason unsupported-conformance-level:<ids>), which leaves the run incomplete. A file that does not declare them gets no finding. PDF/VT stays on #605. Refs #665.

Protected paths: LoopLibCore/sources/pdfconformanceclaim.h, LoopLibCore/sources/pdfconformanceclaim.cpp, and LoopLibCore/sources/preflightengine.cpp. The claim table and the check belong in Core and do not depend on Widgets. No report schema or central type was added; unsupported is already a check status.

Release changelog

Proof

  • python scripts/agent/check-change.py --base origin/dev --build-dir build reports pass (head b2c56079109a5c5728f2931173f9416c8cefa35e, 71 checks)
  • One changes/feat-0.3.0-665-pdfx5-pdfa3-claims.md fragment added (Category, Audience, Breaking-Change, Summary)
  • Changed behaviour has a test that fails without the change (UnitTestsPreflightEngine, 110 passed, including declared PDF/X-5n, PDF/X-5g, and PDF/A-3 versus PDF/X-1a, PDF/X-4, PDF/A-2, and PDF/VT)
  • Protected-path or contract change named above, with the reason it is required

Internal logic (touched behavior-bearing code)

  • Guard clauses handle invalid, stale, cancelled, absent, unauthorized, and terminal cases before the happy path
  • Untrusted input is parsed once at the boundary into trusted typed or domain state, with no repeated checks downstream
  • Invalid state stops before partial mutation or publication and returns a descriptive error or result
  • Names carry the domain intent, and comments explain rationale rather than restating the code

Anti-slop pass

  • Redundant or explanatory comments that do not match the file's style removed
  • Abnormal defensive checks and broad try/catch blocks removed where a trusted upstream boundary already guarantees the invariant, with real boundary and safety checks kept
  • No any or equivalent cast added only to suppress a type error
  • Python imports stay at file scope unless a local import is required
  • Generated boilerplate, needless wrappers, and local-style drift removed
  • Validation, security, cancellation, provenance, and failure handling preserved

Anti-slop summary (1-3 sentences):

The claim table is the only place production and validation are recorded. Metadata is parsed once into level ids, and undecodable catalog metadata stays not_inspected rather than ok. The profile severity is not promoted to an error, because a declared level is outside the validator.

Security and rollback

  • Untrusted input validated at the trust boundary; no new unsafe construct without an inline justification
  • Rollback: revert the branch. The check is opt-in by profile id conformance-claims; the default profile is unchanged.

Docs

  • Docs updated in this PR, or "none needed" with the reason

Self-review (BSP-002 §4.3)

  • Reviewed in the diff view, not the editor, at least 30 minutes after the final commit; overnight if the change touches security-sensitive code, data handling, or public API surface
Open in Web Open in Cursor 

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

cursoragent and others added 2 commits September 21, 2026 23:32
…orted (#665)

Loop does not produce or validate PDF/X-5n, PDF/X-5g, or PDF/A-3. A document
that declares one of those levels is reported unsupported instead of passing
that class in silence.

Co-authored-by: michael berry <mberrys@users.noreply.github.com>
Co-authored-by: michael berry <mberrys@users.noreply.github.com>
@mberrys
mberrys marked this pull request as ready for review September 22, 2026 03:06
@mberrys
mberrys merged commit c971505 into dev Sep 22, 2026
16 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.

2 participants