fix(pdf,tests): report:compare escapes control characters, prints names and free text only with --full, stats before read, missing file as a per-file failure; inferRegionCode regression test; import.ts JSDoc reattached

This commit is contained in:
bchanot committed 2026-10-10 15:53:07 +02:00
1 parent dc78a00835
commit b1b3e4927e
6 files changed
+257 -72

No files matched your search

+8 -4
View File
@@ -33,7 +33,7 @@ Import (`importReportFromPdf(bytes, migrationMap)`) accepts:
`pnpm report:compare <file.pdf | folder>...` reads the attachment of one or
more PDFs and prints it next to its v3 reading on the bundled reference
sheet, without writing anything:
sheet. It writes no output file:
- a v2 archive PDF: every legacy zone (`data-anno-id`, side, vertebrae) and
every legacy finding path is shown with its canonical target and the
@@ -46,8 +46,12 @@ sheet, without writing anything:
finding flagged `unresolved` in the report itself.
Options: `--summary` (one line per file, counts and unresolved counts),
`--identity` (print the practitioner, animal and owner names, off by
default), `--locale fr|en` (labels), `--diff a.pdf b.pdf` (compare the v3
`--full` (add the practitioner, animal and owner names and the real free
texts; by default only identifiers, catalog labels, snapshots of unresolved
items, counts and placeholders such as `comment (present)` are printed),
`--locale fr|en` (labels), `--diff a.pdf b.pdf` (compare the v3
content of two PDFs: an archive and the PDF exported after importing it
should print `identical v3 content`). The tool exits 2 when a file could not
should print `identical v3 content`; a differing text line is printed in
clear, whatever `--full`). Every untrusted string is printed with control
characters escaped as `\uXXXX`. The tool exits 2 when a file could not
be read (no attachment, unknown version, oversized) and prints the reason.