gstack/make-pdf/src
Garry Tan 9db479a38d
fix(make-pdf): pre-landing review wave — fence fidelity, injection hardening, Windows paths, transport rework
Review army (6 specialists + red team) findings, all fixed:

- Indented fences replay byte-for-byte and indented diagram fences are NOT
  extracted (red-team conf-9: the pre-pass reconstructed fences at column 0,
  splitting any list containing fenced code — every ordinary document).
- String.replace $-pattern injection killed at every seam: substituteSlots,
  mergeStyle, img/src rewrites all use function replacements (a diagram label
  containing $' duplicated the document tail).
- Big-expression transport reworked: browse `eval <file>` (one spawn, any
  size, Windows-safe) replaces the 64KB chunked window-buffer eval — fixes
  the per-chunk spawn cost, the char-vs-byte argv units, AND the Windows
  32,767-char command-line ceiling in one move.
- Staged-bundle trust: content verified by hash even when the file exists,
  and the rename-failure path re-hashes the survivor (sticky-bit /tmp EPERM
  would otherwise ride a pre-planted file past the check).
- Windows drive-letter img srcs (C:/x.png) reach the local-path branch
  instead of being swallowed as unknown URL schemes.
- DOCX rasterize-failure now embeds the decoded source as visible text —
  returning the figure made diagrams vanish silently (converter drops svg).
- Fence source preserved as base64 data-gstack-source attribute (the comment
  encoding corrupted every '-->' arrow); decodeFigureSource() round-trips.
- inlineLocalImages memoizes per path; file:// uses fileURLToPath; preview
  prints a divergence note for fences/local images; --to docx strips the
  watermark div and warns about print-only flags; TOC links resolve in
  html/docx (heading ids assigned); waitForExpression sleeps instead of
  busy-spinning; escapeHtml/svg-dims deduped to single definitions;
  typography stragglers (blockquote 12pt, footnotes 10pt, 42em screen
  measure); bundle BUILD_INFO gains srcSha256 for no-node_modules drift
  detection; MAX_TARGET_PX shared guard.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 07:57:42 -07:00
..
browseClient.ts fix(make-pdf): pre-landing review wave — fence fidelity, injection hardening, Windows paths, transport rework 2026-06-12 07:57:42 -07:00
cli.ts feat(make-pdf): --to html|docx output formats 2026-06-12 00:12:04 -07:00
commands.ts feat(v1.4.0.0): /make-pdf — markdown to publication-quality PDFs (#1086) 2026-04-20 13:20:30 +08:00
diagram-prepass.ts fix(make-pdf): pre-landing review wave — fence fidelity, injection hardening, Windows paths, transport rework 2026-06-12 07:57:42 -07:00
image-policy.ts fix(make-pdf): pre-landing review wave — fence fidelity, injection hardening, Windows paths, transport rework 2026-06-12 07:57:42 -07:00
image-size.ts fix(make-pdf): pre-landing review wave — fence fidelity, injection hardening, Windows paths, transport rework 2026-06-12 07:57:42 -07:00
orchestrator.ts fix(make-pdf): pre-landing review wave — fence fidelity, injection hardening, Windows paths, transport rework 2026-06-12 07:57:42 -07:00
pdftotext.ts v1.52.2.0 fix(make-pdf): render emoji instead of tofu (▯) on Linux (#1787) 2026-05-29 18:06:19 -07:00
print-css.ts fix(make-pdf): pre-landing review wave — fence fidelity, injection hardening, Windows paths, transport rework 2026-06-12 07:57:42 -07:00
render.ts fix(make-pdf): pre-landing review wave — fence fidelity, injection hardening, Windows paths, transport rework 2026-06-12 07:57:42 -07:00
setup.ts feat(v1.4.0.0): /make-pdf — markdown to publication-quality PDFs (#1086) 2026-04-20 13:20:30 +08:00
smartypants.ts feat(v1.4.0.0): /make-pdf — markdown to publication-quality PDFs (#1086) 2026-04-20 13:20:30 +08:00
types.ts feat(make-pdf): --to html|docx output formats 2026-06-12 00:12:04 -07:00