diff --git a/pyproject.toml b/pyproject.toml index 9500b5e..efb708c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ dependencies = [ # TIFF or PDF within our limits (imaging.open_image and check_pdf). Grew # out of this package; 0.x minor releases are additive, a breaking one # becomes 1.0 and stops at the ceiling. - "sillybos>=4,<5", + "sillybos>=5,<6", "python-dotenv>=1.0", # Writes the searchable PDF. Core rather than an extra because the roadmap # treats that as the flagship catalogue-ready output, and it should work on diff --git a/site/tests/site.spec.ts b/site/tests/site.spec.ts index 7e0abe1..0a51e75 100644 --- a/site/tests/site.spec.ts +++ b/site/tests/site.spec.ts @@ -101,7 +101,12 @@ test("the security watch renders the advisory record everywhere it is promised", const count = await rows.count(); expect(count).toBeGreaterThan(0); for (const row of await rows.all()) { - await expect(row.locator("td:nth-child(2) a")).toHaveAttribute("href", /\/security\/cve-[\w-]+\/$/); + // A record is keyed by its CVE, or by the GHSA or PYSEC id when no CVE + // was assigned; the first GHSA-keyed record arrived with sillybos 4.2.0. + await expect(row.locator("td:nth-child(2) a")).toHaveAttribute( + "href", + /\/security\/(cve|ghsa|pysec)-[\w-]+\/$/ + ); await expect(row.locator(".verdict")).not.toBeEmpty(); } @@ -327,9 +332,12 @@ async function allPages(request: APIRequestContext, baseURL: string): Promise { - // Every page, with a wait for the network to go quiet on each: the security - // watch took the site past a hundred pages and past the default 30 s. - test.slow(); + // Every page, with a wait for the network to go quiet on each. The security + // watch took the site past a hundred pages, and the completed backfill past + // the tripled default of 90 s, so the budget follows the page count: two + // seconds a page, and never less than the old 90. + const pages = await allPages(request, baseURL!); + test.setTimeout(Math.max(90_000, pages.length * 2_000)); // The migration published a site on which all 19 corpus images were dead // links, behind a green build and a green test suite: the markdown still // carried mkdocs-relative paths. Parsing the HTML for src attributes is what @@ -338,7 +346,7 @@ test("every image on every page actually loads", async ({ page, request, baseURL // bytes arrived cannot be fooled that way. const broken: string[] = []; - for (const url of await allPages(request, baseURL!)) { + for (const url of pages) { await page.goto(url); // Lazy images below the fold never load in a short viewport, so force them. await page.evaluate(() => diff --git a/tests/ocr/test_input_limits.py b/tests/ocr/test_input_limits.py index c6d7beb..04dd713 100644 --- a/tests/ocr/test_input_limits.py +++ b/tests/ocr/test_input_limits.py @@ -141,6 +141,30 @@ def test_a_pdf_that_carries_javascript_is_refused(self, tmp_path: Path) -> None: with pytest.raises(InputRefusedError, match="a PDF with JavaScript"): check_pdf(path) + def test_a_tiff_whose_tags_contradict_each_other_is_refused(self, tmp_path: Path) -> None: + """sillybos 5 refuses a floating-point Predictor on integer samples; the reason reaches triage.""" + import struct + + # One 8-bit greyscale LZW frame, 4 by 4, with Predictor 3, which only + # floating-point samples can carry (CVE-2026-112396). + entries = [ + (256, 3, 1, 4), # ImageWidth + (257, 3, 1, 4), # ImageLength + (258, 3, 1, 8), # BitsPerSample + (259, 3, 1, 5), # Compression: LZW + (262, 3, 1, 1), # PhotometricInterpretation: black is zero + (317, 3, 1, 3), # Predictor: floating point + ] + ifd = struct.pack(" None: diff --git a/uv.lock b/uv.lock index 94f61ac..e5424bc 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 5 +revision = 3 requires-python = ">=3.11" resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'darwin'", @@ -4231,11 +4231,11 @@ wheels = [ [[package]] name = "sillybos" -version = "4.0.0" +version = "5.0.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/62/b0/d81799aa58c1b6914409089de10f74ccd59e02157ace8e9e1afde27b8b13/sillybos-4.0.0.tar.gz", hash = "sha256:d267e6009b4e8e742e11c23d71f93e31c535efbea6502aa93f781b4638cf307d", size = 613210, upload-time = "2026-11-01T22:52:35.522Z" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/4b/2afcb5f406492f7748f7053c3666be0bb9a75d98a57fe51f8d68c01d85a0/sillybos-5.0.0.tar.gz", hash = "sha256:f5f9b2f18dc0d396aacc3e1ad8ee7537749e6f67dfb42997a3a45863802e32d8", size = 655464, upload-time = "2026-11-03T17:11:19.194Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8d/35/108931718880ef090b111582646e092bb0cb8010301f75ab94c2d15a4509/sillybos-4.0.0-py3-none-any.whl", hash = "sha256:85b6b438cc23065cd7e26374a20b200055b68b30f86ed37433353daa3ff80c9d", size = 38384, upload-time = "2026-11-01T22:52:34.173Z" }, + { url = "https://files.pythonhosted.org/packages/d9/dd/e066e4eca9f8d3dda19a1eb944eff4b024c5d12b05cf65eec7b782f0cec4/sillybos-5.0.0-py3-none-any.whl", hash = "sha256:46da1e20355490dfaf10944120a5c01b46b9436afdb3fcc4245f464bfee8b4d8", size = 43122, upload-time = "2026-11-03T17:11:17.484Z" }, ] [[package]] @@ -4660,7 +4660,7 @@ requires-dist = [ { name = "python-pptx", marker = "extra == 'docs'", specifier = ">=0.6" }, { name = "reportlab", specifier = ">=4.0" }, { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.5" }, - { name = "sillybos", specifier = ">=4,<5" }, + { name = "sillybos", specifier = ">=5,<6" }, { name = "sphinx", marker = "extra == 'apidocs'", specifier = ">=8.0" }, { name = "sphinx-argparse", marker = "extra == 'apidocs'", specifier = ">=0.6.1" }, { name = "tetrak-easyocr-armenian", marker = "extra == 'armenian'", specifier = ">=0.8" },