gstack/make-pdf/test
Jake Wilk 699c0f48db fix(make-pdf): reject a directory when resolving the browse binary
`isExecutable()` tested `access(X_OK)` alone. That is TRUE for directories — they
carry the execute/traverse bit on POSIX and pass the check on Windows too — so
binary discovery accepted a directory as the browse binary.

It bites on a stock global install. `~/.claude/skills/browse` is the skill's own
docs folder and contains nothing but SKILL.md, but it sits on one of the probed
paths, passes X_OK, and wins. From then on every browse invocation runs a
directory as a program and fails with an EMPTY error string, which make-pdf
surfaces as:

    [1/5] Checking browse binary... OK (C:\Users\...\.claude\skills\browse)
    [2/5] Launching Chromium... FAIL
    Chromium failed to launch: browse newtab exited 1:

Note the first line reports the wrong path as OK, so the output actively points
away from the cause. Setting GSTACK_BROWSE_BIN worked around it, which made it
look like a discovery-order problem rather than a type-check problem.

Fix is one `statSync(p).isFile()` before the access check.

Tests: 2 added, both failing before this change and passing after. The first
asserts the precondition explicitly — that the directory really does pass
`access(X_OK)` — so the test documents WHY the bare check was wrong rather than
just pinning the new behaviour. The second reproduces the exact shape: a
directory named `browse` containing a SKILL.md.
2026-08-12 16:37:24 -04:00
..
e2e v1.58.0.0 feat: diagram + multi-format document engine (mermaid, excalidraw, single-file HTML, DOCX) (#1990) 2026-06-12 15:38:53 -07:00
fixtures v1.58.0.0 feat: diagram + multi-format document engine (mermaid, excalidraw, single-file HTML, DOCX) (#1990) 2026-06-12 15:38:53 -07:00
browseClient.test.ts fix(make-pdf): reject a directory when resolving the browse binary 2026-08-12 16:37:24 -04:00
coverage-gaps.test.ts v1.58.0.0 feat: diagram + multi-format document engine (mermaid, excalidraw, single-file HTML, DOCX) (#1990) 2026-06-12 15:38:53 -07:00
diagram-prepass.test.ts v1.58.0.0 feat: diagram + multi-format document engine (mermaid, excalidraw, single-file HTML, DOCX) (#1990) 2026-06-12 15:38:53 -07:00
image-policy.test.ts v1.58.0.0 feat: diagram + multi-format document engine (mermaid, excalidraw, single-file HTML, DOCX) (#1990) 2026-06-12 15:38:53 -07:00
pdftotext.test.ts v1.30.0.0 fix wave: 21 community PRs + Windows CI extension + codex flag-semantics smoke (#1391) 2026-05-09 08:06:47 -07:00
render.test.ts v1.58.0.0 feat: diagram + multi-format document engine (mermaid, excalidraw, single-file HTML, DOCX) (#1990) 2026-06-12 15:38:53 -07:00