dorfteich/apps/api/assets/README.md
Claude Fable 5 74a9e495e4
Some checks failed
CI / Lint, typecheck, test (pull_request) Failing after 6m34s
CI / Import/export fidelity gate (pull_request) Has been skipped
CI / Build container images (pull_request) Has been skipped
CI / Auth e2e pack (pull_request) Has been skipped
#209: pandoc reference documents carry the VS-NfD marking for DOCX/ODT
reference-vs-nfd.docx/.odt ship as derived binaries: the pinned pandoc's
default reference documents plus a header and footer with the marking —
part of the document's page setup, so it repeats on every page in Word
and LibreOffice and is not deletable body text. Source of truth is
scripts/gen-classified-reference-docs.mjs (wording from shared
classificationMarking(); maintenance documented in assets/README.md).
The converter passes reference docs to pandoc-server via in-request
files + reference-doc; the worker attaches them for marked docx/odt jobs
(job option {marking}, as in #208). Unclassified exports pass nothing
and are unchanged (pinned by fake-converter test). Fidelity suite
asserts against real pandoc 3.6 that marked outputs carry the
header/footer parts and unmarked ones do not; per-page repetition
verified via LibreOffice 25.8 headless PDF (5/5 pages, 2 markings each,
both formats). Word: quick manual look pending (sample files in the
workspace), procedure documented in assets/README.md.

Co-Authored-By: Claude Fable 5 (1M context) <noreply@anthropic.com>
2026-07-31 07:09:47 +02:00

2.1 KiB

Runtime assets

reference-vs-nfd.docx / reference-vs-nfd.odt (issue #209, ADR 0022)

Pandoc reference documents for the DOCX/ODT export of a classified page: their page setup defines a header and footer carrying the VS-NfD marking, which pandoc copies into its output — so the marking repeats on every page in Word and LibreOffice and is not deletable body text. Unclassified exports pass no reference document and are unchanged.

These are derived binaries — never edit them by hand. Source of truth is ../scripts/gen-classified-reference-docs.mjs: it takes the default reference documents of the pinned sidecar (pandoc/core:3.6, the exact image the stages run) and injects the header/footer, with the wording from classificationMarking() in @dorfteich/shared (single source, ADR 0022). Regenerate — after a pandoc pin bump, a wording change, or a layout tweak in the script — with Docker running:

pnpm --filter @dorfteich/shared build   # the script imports the wording
node apps/api/scripts/gen-classified-reference-docs.mjs

Commit script and binaries together. The fidelity suite (export.fidelity.test.ts) asserts against the real pinned pandoc that a marked export carries the header/footer parts and an unmarked one does not.

Per-page verification in the office suites

After regenerating, confirm the marking repeats on every page of a multi-page export (not just structurally in the XML):

  1. Produce a marked multi-page export (any classified page with a few screens of text, exported to .docx and .odt).
  2. LibreOffice (scriptable): soffice --headless --convert-to pdf <file> and check every PDF page shows the marking twice (header + footer) — e.g. with pypdf.
  3. Word: open the .docx, check header and footer on every page (print preview). Word's AppleScript/sandbox makes this hard to script — this step is a quick manual look.

Last verified 2026-07-31 (pandoc 3.6 output): LibreOffice 25.8, both formats, 5/5 pages with 2 markings each. Word: manual check pending — sample files in the workspace under doku/209-marked-sample.docx/.odt.