Skip to content

fix(release): markdownFiles skips what is not a file or a folder - #42

Merged
leemour merged 1 commit into
mainfrom
fix/docs-check-regular-files
Oct 4, 2026
Merged

leemour merged 1 commit into
mainfrom
fix/docs-check-regular-files

Conversation

@leemour

@leemour leemour commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Task

cli-dev docs-check crashes inside Claude Code's Bash sandbox. Found while setting up cli-tasks.

Why

The sandbox mounts character devices over names in the working folder, such as .claude/loop.md. The directory listing still reports a regular file there, so markdownFiles lists it and docsProblems crashes reading it (EACCES). Every repository that uses the default docs-check without --rules fails in a sandboxed agent session.

What

  • markdownFiles checks each entry with stat, which sees the mount.
    • A file is listed only when stat says it is a file.
    • A folder is entered only when both the listing and stat say it is a folder. A link to a folder is still not followed.
  • A changelog line under ## Unreleased, in the Fixed section.

Testing

  • pnpm lint && pnpm typecheck && pnpm test:coverage && pnpm docs:check pass (241 tests).
  • New test: a FIFO named loop.md is not listed, and a symbolic link to a file is. Without the change, the test fails.
  • Real case, inside the sandbox on cli-tasks: 0.17.0's cli-dev docs-check crashes on .claude/loop.md, and this build prints docs: ok.

🤖 Generated with Claude Code

Claude Code's Bash sandbox mounts character devices over names in the working folder
(.claude/loop.md, .claude/skills, .mcp.json). readdir still reports the entry underneath as a
regular file, so markdownFiles listed .claude/loop.md, and docs-check crashed reading it with
EACCES in every sandboxed agent session. It now asks stat, which sees the mount: a file is listed
only when stat says file, and a folder is entered only when both say folder, so a link to a folder
is still not followed.

Checked on cli-tasks inside the sandbox: 0.17.0's cli-dev docs-check crashes, this build prints
"docs: ok". The new test uses a FIFO, which fails without the change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leemour
leemour merged commit 5bba77b into main Oct 4, 2026
4 checks passed
@leemour
leemour deleted the fix/docs-check-regular-files branch October 4, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant