Skip to content

Carry the colour a print file declares, and audit the rest of the catalogue - #46

Merged
tannevaled merged 1 commit into
mainfrom
the-colour-a-print-file-declares
Oct 11, 2026
Merged

tannevaled merged 1 commit into
mainfrom
the-colour-a-print-file-declares

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

OutputIntents and URI join the entries a rewrite carries.

⛔ Found by an audit, not by a report

Twice in one afternoon this package was found dropping a catalogue entry
whose absence is not "no opinion" but a default — page labels, then optional
content — so the whole list was measured: a document holding twenty-three
catalogue entries, a watermark over it, and of each entry the question what
would its absence mean?

/OutputIntents ⛔ no colour management — a prepress file lost the ICC profile it declares, and would print differently with nothing to say why
/URI relative links resolve against wherever the viewer thinks the document is. The link is not removed, it is silently pointed elsewhere

Both name no page, so they copy safely. The test reaches the profile stream
and not just the array, because an /OutputIntents whose /DestOutputProfile
went with the rebuild declares a colour space it cannot supply.

What is deliberately not carried, now written down with its reason

  • /OpenAction, /AA — these are code. Dropping them is safer, and is
    what sanitize exists for;
  • /Legal, /DSS — a signature's attestation and validation data. A
    rewrite invalidated that signature the moment it changed a byte, and carrying
    the validation data of a signature that no longer verifies would say the
    document is still attested when it is not;
  • /Threads, /Collection — they point into the document, which is why
    /Names /Dests is not carried either.

⛔ And three the audit reported as lost that are not

/AcroForm, /Outlines and /StructTreeRoot are all carried. The audit's
fixture held an empty one of each, and an empty form, outline or structure
tree is deliberately not written.

A measured absence has to be read before it is believed — which is the other
half of why the audit was worth running, and why the report is in the README
rather than only in a commit message.

Checks

100 % statement coverage with zero uncovered blocks, go vet and gofmt
clean. Two mutations caught.

🤖 Generated with Claude Code

…alogue

OutputIntents and URI join the entries a rewrite carries.

⛔ FOUND BY AN AUDIT, not by a report. Twice in one afternoon this package was
found dropping a catalogue entry whose absence is not "no opinion" but a
DEFAULT — page labels, then optional content — so the whole list was measured:
a document holding twenty-three catalogue entries, a watermark over it, and of
each entry the question "what would its absence MEAN?".

    /OutputIntents   ⛔ no colour management: a prepress file lost the ICC
                        profile it declares and would print differently with
                        nothing to say why
    /URI             relative links resolve against wherever the viewer thinks
                        the document is — the link is not removed, it is
                        silently pointed elsewhere

Both name no page, so they copy safely. The test reaches the PROFILE STREAM and
not just the array, because an /OutputIntents whose /DestOutputProfile went
with the rebuild declares a colour space it cannot supply.

What is deliberately not carried is now written down with its reason:
OpenAction and AA are code and dropping them is safer; Legal and DSS belong to
a signature a rewrite has already invalidated; Threads and Collection point
into the document.

⛔ And three the audit reported as LOST are not: AcroForm, Outlines and
StructTreeRoot are all carried, and the audit's fixture held an EMPTY one of
each — which is deliberately not written. A measured absence has to be read
before it is believed, which is the other half of why the audit was worth
running.

100% statement coverage, go vet and gofmt clean. Two mutations caught.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 274db81 into main Oct 11, 2026
1 check passed
@tannevaled
tannevaled deleted the the-colour-a-print-file-declares branch October 11, 2026 16:50
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