You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No horizontal overflow:max(node.positions[].horizontalRatio) <= 1. horizontalRatio is (x - pageMargins.left) / innerWidth (DocumentContext.js:490), so a value above 1 means laid-out content advanced past the printable right edge. This is the only assertion that actually proves "nothing ran off the page".
That rule is not implemented. grep -rn "horizontalRatio" client/ returns zero hits.
The rule was corrected into ADR-034 during the #1914 documentation pass (it previously stated the wrong table._minWidth <= printableWidth() form, which both false-negatives and false-positives — see ADR-034's Deviation Log entry for 2026-08-04). The corrected assertion was documented but never landed as a test, so the ADR currently sets a bar that nothing enforces.
Why this matters now
Every horizontal-overflow fix in this pipeline is therefore verified by mechanism rather than outcome — tests assert that wordBreak: 'break-all' is present on the right run, not that the rendered content stayed inside the printable width. That is a proxy: it confirms the intended code path was taken, but it cannot catch a case where the mechanism fires and the content still overflows (e.g. a token whose safeTokenChars threshold was computed against the wrong column width, or a future column-width edit that invalidates a threshold silently).
Earlier #1929/#1939 rounds — the WORST_CASE_CHAR_ADVANCE_EM / USAGE_SAFE_TOKEN_CHARS_* / VENDOR_SAFE_TOKEN_CHARS constants are pinned by hand measurement recorded in comments, with no render assertion that would flip if a width edit invalidated them.
Note the interaction with rule #2 (height bound): the dontBreakRows silent-drop defect means an over-tall row is discarded with no throw and no warning, so neither overflow direction fails loudly on its own. Render-derived assertions are the only detection channel for either.
Important
Amended 2026-08-05 by product-owner — the max(horizontalRatio) <= 1 form quoted above is SUPERSEDED.
Implementing this issue proved the documented bar itself unmeasurable for this pipeline: horizontalRatio
is recorded at the left edge of each text line and before the line is placed
(ElementWriter.js:32), so for the overview table — all-fixed widths summing exactly to printableWidth() — it is structurally 0 for every input. Mutation testing in the PR #2008 review
confirmed removing wordBreak: 'break-all' left a <= 1 assertion green.
ADR-034 rule #1 was corrected accordingly (3rd correction, Deviation Log 2026-08-05): the content-extent
check is now per-cell _minWidth <= widths[i]._calcWidth after a real render, and maxHorizontalRatio
is re-scoped as the narrower table-box positioning check. Read the Context quote and Proposed-work item 2
below as historical. Acceptance bullets 1-3 are unchanged and were satisfied in that corrected form —
see PR #2008 and the round-2 review.
Proposed work
Add a reusable helper in the reportPdf test layer that walks a rendered pdfmake document's node tree and returns max(node.positions[].horizontalRatio) (verify against DocumentContext.js:490 for the pdfmake version currently pinned — the field is internal and version-sensitive, which is why it belongs behind one helper rather than inlined per test).
Assert <= 1[SUPERSEDED 2026-08-05 — assert per-cell _minWidth <= _calcWidth; see the amendment above] in realRender.test.ts across the existing worst-case fixtures, for both en and de — ADR-034 finding B2 established that German is consistently the binding locale for width bugs in this table, so a single-locale assertion would be the weaker check.
Consider pairing it with rule EPIC-02: Application Shell & Infrastructure #2's tableOffsetsTotal(cols) + sum(widths[i]._calcWidth) <= printableWidth() table-box assertion, which is likewise documented and likewise unimplemented.
Acceptance
A render-derived horizontal-overflow assertion exists and is exercised by the worst-case Usage/Vendor/header fixtures in both locales.
The assertion demonstrably fails when a safeTokenChars threshold or a column width is deliberately broken (revert test — a passing new assertion that cannot fail is the specific failure mode to avoid here; see ADR-034's history of assertions that passed on nothing).
Pre-existing debt — not introduced by #2002, and explicitly recorded as non-blocking in that PR's round-2 review. Filed as the follow-up I committed to owning there.
[product-architect]
Context
ADR-034 (
Client-Side-Report-PDF-Generation) minimum-bar rule #1 states:That rule is not implemented.
grep -rn "horizontalRatio" client/returns zero hits.The rule was corrected into ADR-034 during the #1914 documentation pass (it previously stated the wrong
table._minWidth <= printableWidth()form, which both false-negatives and false-positives — see ADR-034's Deviation Log entry for 2026-08-04). The corrected assertion was documented but never landed as a test, so the ADR currently sets a bar that nothing enforces.Why this matters now
Every horizontal-overflow fix in this pipeline is therefore verified by mechanism rather than outcome — tests assert that
wordBreak: 'break-all'is present on the right run, not that the rendered content stayed inside the printable width. That is a proxy: it confirms the intended code path was taken, but it cannot catch a case where the mechanism fires and the content still overflows (e.g. a token whosesafeTokenCharsthreshold was computed against the wrong column width, or a future column-width edit that invalidates a threshold silently).Two recent PRs are in exactly this position:
#1968, grey meta-suffix per-token runs) — assertsgreyRuns.some(r => r.wordBreak === 'break-all'). Real coverage with a proven revert signal, but one level removed from rule EPIC-01: Authentication & User Management #1.#1929/#1939rounds — theWORST_CASE_CHAR_ADVANCE_EM/USAGE_SAFE_TOKEN_CHARS_*/VENDOR_SAFE_TOKEN_CHARSconstants are pinned by hand measurement recorded in comments, with no render assertion that would flip if a width edit invalidated them.Note the interaction with rule #2 (height bound): the
dontBreakRowssilent-drop defect means an over-tall row is discarded with no throw and no warning, so neither overflow direction fails loudly on its own. Render-derived assertions are the only detection channel for either.Important
Amended 2026-08-05 by
product-owner— themax(horizontalRatio) <= 1form quoted above is SUPERSEDED.Implementing this issue proved the documented bar itself unmeasurable for this pipeline:
horizontalRatiois recorded at the left edge of each text line and before the line is placed
(
ElementWriter.js:32), so for the overview table — all-fixed widths summing exactly toprintableWidth()— it is structurally0for every input. Mutation testing in the PR #2008 reviewconfirmed removing
wordBreak: 'break-all'left a<= 1assertion green.ADR-034 rule #1 was corrected accordingly (3rd correction, Deviation Log 2026-08-05): the content-extent
check is now per-cell
_minWidth <= widths[i]._calcWidthafter a real render, andmaxHorizontalRatiois re-scoped as the narrower table-box positioning check. Read the Context quote and Proposed-work item 2
below as historical. Acceptance bullets 1-3 are unchanged and were satisfied in that corrected form —
see PR #2008 and
the round-2 review.
Proposed work
reportPdftest layer that walks a rendered pdfmake document's node tree and returnsmax(node.positions[].horizontalRatio)(verify againstDocumentContext.js:490for the pdfmake version currently pinned — the field is internal and version-sensitive, which is why it belongs behind one helper rather than inlined per test).Assert[SUPERSEDED 2026-08-05 — assert per-cell<= 1_minWidth <= _calcWidth; see the amendment above] inrealRender.test.tsacross the existing worst-case fixtures, for bothenandde— ADR-034 finding B2 established that German is consistently the binding locale for width bugs in this table, so a single-locale assertion would be the weaker check.'W'.repeat(30)inareaText, and the equivalent inusageText) as first cases.tableOffsetsTotal(cols) + sum(widths[i]._calcWidth) <= printableWidth()table-box assertion, which is likewise documented and likewise unimplemented.Acceptance
safeTokenCharsthreshold or a column width is deliberately broken (revert test — a passing new assertion that cannot fail is the specific failure mode to avoid here; see ADR-034's history of assertions that passed on nothing).Notes
Pre-existing debt — not introduced by #2002, and explicitly recorded as non-blocking in that PR's round-2 review. Filed as the follow-up I committed to owning there.