test(tests): R4.2 ledger: reader rows point at their cargo tests, census checks they exist

69 ported rows of scan, inflate, read and the security import cases now name the O7/O9
cargo tests; r4-ledger.mjs refuses a ported cargo target absent from cargo test --list.
This commit is contained in:
bchanot committed 2026-10-18 16:14:10 +02:00
1 parent 6ee04c96c5
commit ebcae06ac1
2 files changed
+146 -75

No files matched your search

+69 -69
View File
@@ -163,15 +163,15 @@ packages/pdf/tests/goldens.test.ts goldens of demo > highlighted views: same fac
packages/pdf/tests/goldens.test.ts goldens of v2unresolved > nologos > text, images and links per locale; same pagination across locales ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of v2unresolved > logos > text, images and links per locale; same pagination across locales ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of v2unresolved > highlighted views: same facts but titles and data attributes ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/inflate.test.ts inflateFlate > round-trips a payload spanning several slices ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > feeds the inflater in 16 KiB slices, each awaited ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > an output exactly at the limit passes, one byte more is null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > empty input: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > truncated stream: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > trailing junk: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > corrupt body: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > not deflate at all: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > a 64 MiB bomb past the default cap is cancelled in well under a second ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > round-trips a payload spanning several slices ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > feeds the inflater in 16 KiB slices, each awaited ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > an output exactly at the limit passes, one byte more is null ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > empty input: null ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > truncated stream: null ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > trailing junk: null ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > corrupt body: null ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > not deflate at all: null ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > a 64 MiB bomb past the default cap is cancelled in well under a second ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7/O9 -
packages/pdf/tests/r3.highlight-oracles.test.ts R3 highlight oracles (TypeScript freeze) > matches the frozen highlighted trees deleted - R3 highlight generator; oracle files kept (R4.8)
packages/pdf/tests/r3.sanitiser-oracles.test.ts R3 sanitiser oracles (TypeScript freeze) > keeps every legitimate SVG untouched deleted - R3 sanitiser generator; oracle files kept (R4.8)
packages/pdf/tests/r3.sanitiser-oracles.test.ts R3 sanitiser oracles (TypeScript freeze) > matches the frozen verdicts deleted - R3 sanitiser generator; oracle files kept (R4.8)
@@ -183,66 +183,66 @@ packages/pdf/tests/r4.text-oracles.test.ts R4 text oracles (TypeScript freeze) >
packages/pdf/tests/r4.text-oracles.test.ts R4 text oracles (TypeScript freeze) > matches the frozen text and number rules deleted - O4 generator; oracle files kept (R4.8)
packages/pdf/tests/raster.test.ts resvg rasterisation of the demo views > main (haloed) and head views: 1200 px wide, highlight present, sane coverage ported R4.4/R4.5 cargo (pending) O2/O4 -
packages/pdf/tests/raster.test.ts resvg rasterisation of the demo views > a rasterizer that throws: page without image, one view_raster_failed warning ported R4.4/R4.5 cargo (pending) O2/O4 -
packages/pdf/tests/read.test.ts T4 roundtrip > reads back the exported envelope whole ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > report-v2.full.pdf: migrated, re-exported, imported again equal ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > report-v2.minimal.pdf: migrated, re-exported, imported again equal ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > keeps the 29 unresolved findings of the 612-leaf report through export and import ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > reads report-v3.bare.pdf as a bare v3 with no archive ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T6 versions > envelope v2 wrapper: report kept, snapshot rejected as unsupported_envelope ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T6 versions > envelope v1 with a report v4: incompatible_version 4 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T6 versions > bare report version 7: incompatible_version 7 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a stamped PDF without attachment: attachment_stripped ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a stamped PDF saved with object streams (pre-BLK-009 layout): the stamp is invisible, no_attachment ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a foreign PDF: no_attachment ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > the Filespec named osteo-report.json wins over an earlier EmbeddedFile ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > refuses an oversized file or one without a %PDF- header as invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T4 roundtrip > reads back the exported envelope whole ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > report-v2.full.pdf: migrated, re-exported, imported again equal ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > report-v2.minimal.pdf: migrated, re-exported, imported again equal ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > keeps the 29 unresolved findings of the 612-leaf report through export and import ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > reads report-v3.bare.pdf as a bare v3 with no archive ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts T6 versions > envelope v2 wrapper: report kept, snapshot rejected as unsupported_envelope ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts T6 versions > envelope v1 with a report v4: incompatible_version 4 ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts T6 versions > bare report version 7: incompatible_version 7 ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a stamped PDF without attachment: attachment_stripped ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a stamped PDF saved with object streams (pre-BLK-009 layout): the stamp is invisible, no_attachment ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a foreign PDF: no_attachment ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > the Filespec named osteo-report.json wins over an earlier EmbeddedFile ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > refuses an oversized file or one without a %PDF- header as invalid_pdf ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/reexport.test.ts re-export from the envelope alone > reproduces text, images, views and the envelope minus exportedAt ported R4.4/R4.5 cargo (pending) O2 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > finds the one Flate stream, named through its visible Filespec ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > the length is the declared /Length and the data ends on endstream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > the export keeps the Filespec, its name and the stamp in clear, no object stream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > readAttachmentBytes returns the inflated envelope bytes ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v2.full.pdf → origin v2 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v2.minimal.pdf → origin v2 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v3.bare.pdf → origin bare_v3 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > a stamped PDF with object streams hides its stamp: no_attachment (documented) ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > a decoy EmbeddedFile first, the named Faunosteo one second: the name wins ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > an unnamed decoy without a version is skipped for the versioned JSON after it ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > a foreign PDF, with or without attachments: no_attachment ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > /Length as an indirect reference: read up to endstream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > a wrong direct /Length that does not land on endstream: measured instead ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > CRLF after stream, /Type/EmbeddedFile unspaced, a leading /Params dict ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > a Filespec with a hex /F name and an /EF listing /UF too names its stream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > decodePdfString: literal with escapes, hex ASCII, hex UTF-16BE with BOM ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts the keyword stamp > hex (pdf-lib) and literal /Keywords strings are both read ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > empty: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > random bytes: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > the type alone: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > dict without stream: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > stream without endstream: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > only the /EmbeddedFiles name tree key: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > unterminated dictionary: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > hex /Keywords without a closing bracket: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > caps the candidates at 32 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > 64 MiB ObjStm bomb beside the attachment: report in ms, bomb never inflated ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > EmbeddedFile bomb past 16 MiB: inflation cancelled, no_attachment, no hang ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > both bombs before an unnamed real attachment: bomb skipped, report read ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 candidates without any endstream on a 20 MiB file: no candidate, well under a second ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 nested EmbeddedFile dicts (descending offsets) without endstream on a 20 MiB file: no candidate, no finder reset ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > several indirect /Length streams in a row: each measured to its own endstream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > a measured stream running past the cap window is not a candidate, the next one is ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 raw candidates of 1 MiB of "[": no_attachment under a second, JSON.parse never called ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > a 16 KB Flate candidate opening 8 million "[" deep: skipped unparsed, no_attachment fast ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > 2000 "[" inside a string with escaped quotes and backslashes: not rejected, parsed once ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > the real envelope passes the pre-scan and is parsed once ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > one 16 MiB budget shared by every candidate > one 10 MiB garbage object before the attachment: 6 MiB left, the report is read ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > one 16 MiB budget shared by every candidate > two 10 MiB garbage objects before the attachment: budget exhausted, no_attachment ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > 5 assets → schema ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a 3 MiB asset → caps ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > finding depth 9 → caps ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > 1,025 annotations → caps ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a view chain cycle → integrity ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a dangling svg_asset_id → integrity ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > another sheet (sheet_mismatch) → sheet_mismatch ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > finds the one Flate stream, named through its visible Filespec ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > the length is the declared /Length and the data ends on endstream ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > the export keeps the Filespec, its name and the stamp in clear, no object stream ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > readAttachmentBytes returns the inflated envelope bytes ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v2.full.pdf → origin v2 ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v2.minimal.pdf → origin v2 ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v3.bare.pdf → origin bare_v3 ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > a stamped PDF with object streams hides its stamp: no_attachment (documented) ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > a decoy EmbeddedFile first, the named Faunosteo one second: the name wins ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > an unnamed decoy without a version is skipped for the versioned JSON after it ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > a foreign PDF, with or without attachments: no_attachment ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > /Length as an indirect reference: read up to endstream ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > a wrong direct /Length that does not land on endstream: measured instead ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > CRLF after stream, /Type/EmbeddedFile unspaced, a leading /Params dict ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > a Filespec with a hex /F name and an /EF listing /UF too names its stream ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > decodePdfString: literal with escapes, hex ASCII, hex UTF-16BE with BOM ported cargo pdf_scan::decode_pdf_string_rows_match O7 -
packages/pdf/tests/scan.test.ts the keyword stamp > hex (pdf-lib) and literal /Keywords strings are both read ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > empty: no candidate, no stamp, no_attachment or invalid_pdf ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > random bytes: no candidate, no stamp, no_attachment or invalid_pdf ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > the type alone: no candidate, no stamp, no_attachment or invalid_pdf ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > dict without stream: no candidate, no stamp, no_attachment or invalid_pdf ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > stream without endstream: no candidate, no stamp, no_attachment or invalid_pdf ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > only the /EmbeddedFiles name tree key: no candidate, no stamp, no_attachment or invalid_pdf ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > unterminated dictionary: no candidate, no stamp, no_attachment or invalid_pdf ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > hex /Keywords without a closing bracket: no candidate, no stamp, no_attachment or invalid_pdf ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts garbage never throws > caps the candidates at 32 ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > 64 MiB ObjStm bomb beside the attachment: report in ms, bomb never inflated ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > EmbeddedFile bomb past 16 MiB: inflation cancelled, no_attachment, no hang ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > both bombs before an unnamed real attachment: bomb skipped, report read ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 candidates without any endstream on a 20 MiB file: no candidate, well under a second ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 nested EmbeddedFile dicts (descending offsets) without endstream on a 20 MiB file: no candidate, no finder reset ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > several indirect /Length streams in a row: each measured to its own endstream ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > a measured stream running past the cap window is not a candidate, the next one is ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 raw candidates of 1 MiB of "[": no_attachment under a second, JSON.parse never called ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > a 16 KB Flate candidate opening 8 million "[" deep: skipped unparsed, no_attachment fast ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > 2000 "[" inside a string with escaped quotes and backslashes: not rejected, parsed once ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > the real envelope passes the pre-scan and is parsed once ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > one 16 MiB budget shared by every candidate > one 10 MiB garbage object before the attachment: 6 MiB left, the report is read ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > one 16 MiB budget shared by every candidate > two 10 MiB garbage objects before the attachment: budget exhausted, no_attachment ported cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > 5 assets → schema ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a 3 MiB asset → caps ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > finding depth 9 → caps ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > 1,025 annotations → caps ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a view chain cycle → integrity ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a dangling svg_asset_id → integrity ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > another sheet (sheet_mismatch) → sheet_mismatch ported cargo pdf_import::o7_locate_and_read_match_the_typescript O7 -
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > 1,025 annotations → snapshot_too_large ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > a 3 MiB asset → snapshot_too_large ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > 5 assets → snapshot_invalid ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
@@ -257,7 +257,7 @@ packages/pdf/tests/security.test.ts hostile SVG assets > <!ENTITY> and 257 <use>
packages/pdf/tests/security.test.ts hostile SVG assets > a huge root viewBox is clamped to a 1200×2400 raster ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts hostile SVG assets > horse.svg and paws-in-harmony.svg pass with nothing removed and an identical serialisation ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts __proto__ ids and the inflate bomb > report ids named __proto__ print raw and pollute nothing ported R4.4/R4.5 cargo (pending) O1 -
packages/pdf/tests/security.test.ts __proto__ ids and the inflate bomb > inflates a normal payload and returns null for a 24 MB bomb ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts __proto__ ids and the inflate bomb > inflates a normal payload and returns null for a 24 MB bomb ported cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node O7 -
packages/pdf/tests/security.test.ts branding URL injection (HIGH) > writes /URI as the hex of the ASCII bytes, no UTF-16 BOM, and reloads to the URL ported R4.4/R4.5 cargo (pending) O2 link sink
packages/pdf/tests/security.test.ts branding URL injection (HIGH) > a URL with a code point above 0x7e or below 0x21 throws branding_invalid at the sink ported R4.4/R4.5 cargo (pending) O2 link sink
packages/pdf/tests/security.test.ts branding URL injection (HIGH) > the link sink alone keeps the whole URL inside the /URI string ported R4.4/R4.5 cargo (pending) O2 link sink
Can't render this file because it contains an unexpected character in line 44 and column 158.
+77 -6
View File
@@ -62,7 +62,13 @@ const APP_MOCKING_SUITES = [
'state.coreFailures.test.tsx',
]
const READER = 'R4.2 cargo (pending)'
// R4.2 targets: one cargo test per oracle checks every frozen row (several TS cases fold
// into one Rust test; the census below checks that each named test exists).
const SCAN = 'cargo pdf_scan::every_pdf_input_scans_as_the_typescript_did'
const DECODE = 'cargo pdf_scan::decode_pdf_string_rows_match'
const LOCATE = 'cargo pdf_import::o7_locate_and_read_match_the_typescript'
const INFLATE =
'cargo pdf_inflate::every_o9_row_matches_node, pdf_inflate::every_o7_flate_input_matches_node'
const WRITER = 'R4.4/R4.5 cargo (pending)'
const CARGO_GOLDENS = 'R4.4/R4.5 cargo goldens (pending)'
const SAME = 'vitest (same case)'
@@ -104,18 +110,28 @@ const GOLDENS = `${APP}pdf.goldens.test.ts`
// First match wins. `title` (a prefix or a RegExp) splits a file's cases.
const RULES = [
// packages/pdf, reader side (R4.2)
{ file: `${PDF}scan.test.ts`, ...ported(READER, 'O7') },
{ file: `${PDF}inflate.test.ts`, ...ported(READER, 'O7/O9') },
{ file: `${PDF}read.test.ts`, ...ported(READER, 'O7') },
{
file: `${PDF}scan.test.ts`,
title: /decodePdfString/,
...ported(DECODE, 'O7'),
},
{
file: `${PDF}scan.test.ts`,
title: /locateAttachment|readAttachmentBytes|readAttachedDocument/,
...ported(LOCATE, 'O7'),
},
{ file: `${PDF}scan.test.ts`, ...ported(SCAN, 'O7') },
{ file: `${PDF}inflate.test.ts`, ...ported(INFLATE, 'O7/O9') },
{ file: `${PDF}read.test.ts`, ...ported(LOCATE, 'O7') },
{
file: SECURITY,
title: 'import: the report survives a rejected snapshot > ',
...ported(READER, 'O7'),
...ported(LOCATE, 'O7'),
},
{
file: SECURITY,
title: '__proto__ ids and the inflate bomb > inflates a normal payload',
...ported(READER, 'O7'),
...ported(INFLATE, 'O7'),
},
// packages/pdf, export side (R4.4 layout, R4.5 serialiser)
{
@@ -403,8 +419,63 @@ function printSummary(rows, totals) {
console.log(`written: ${relative(ROOT, OUT)}`)
}
/** The tests of one cargo test file of the core (`cargo test --test <file> -- --list`). */
function cargoTests(file) {
const run = spawnSync(
'cargo',
[
'test',
'-p',
'faunosteo-core',
'--features',
'pdf-read',
'--locked',
'--test',
file,
'--',
'--list',
],
{
cwd: ROOT,
encoding: 'utf8',
env: { ...process.env, CARGO_TERM_COLOR: 'never' },
},
)
if (run.status !== 0) {
throw new Error(`cargo test --test ${file} -- --list failed: ${run.stderr}`)
}
const names = new Set()
for (const line of run.stdout.split('\n')) {
const test = /^(\S+): test$/.exec(line)
if (test) names.add(test[1])
}
return names
}
/** Census (plan §B.6): every `cargo` target of a ported row names an existing test. */
function missingCargoTargets(rows) {
const wanted = new Set()
for (const row of rows) {
if (row.disposition !== 'ported' || !row.target.startsWith('cargo '))
continue
for (const name of row.target.slice('cargo '.length).split(', '))
wanted.add(name)
}
const listed = new Map()
const missing = []
for (const name of wanted) {
const [file, test] = name.split('::')
if (!listed.has(file)) listed.set(file, cargoTests(file))
if (!listed.get(file).has(test)) missing.push(name)
}
return missing
}
function main() {
const { rows, errors, totals } = collect()
for (const name of missingCargoTargets(rows)) {
errors.push(`ported target missing from cargo test --list: ${name}`)
}
if (errors.length) {
for (const error of errors) console.error(`r4-ledger: ${error}`)
console.error('r4-ledger: nothing written')