Title: mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, and a socket or symlink-to-directory aborts it · Issue #1727 · developing-today/code · GitHub
Open Graph Title: mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, and a socket or symlink-to-directory aborts it · Issue #1727 · developing-today/code
X Title: mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, and a socket or symlink-to-directory aborts it · Issue #1727 · developing-today/code
Description: mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, a socket or symlink-to-directory aborts it Summary internal/source's directory resolution collects every non-directory entry a walk finds and re...
Open Graph Description: mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, a socket or symlink-to-directory aborts it Summary internal/source's directory resolution collects every...
X Description: mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, a socket or symlink-to-directory aborts it Summary internal/source's directory resolution collects e...
Opengraph URL: https://github.com/developing-today/code/issues/1727
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, and a socket or symlink-to-directory aborts it","articleBody":"# mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, a socket or symlink-to-directory aborts it\n\n## Summary\n\n`internal/source`'s directory resolution collects **every** non-directory entry a walk finds and reads it, although the package documents the opposite. One FIFO in a source directory hangs `Resolve` indefinitely; one unix socket or one symlink to a directory aborts the whole resolution with a low-level OS error. All of the directory's ordinary script fragments are lost either way.\n\n## Evidence (verified this run)\n\nCode, on current main (`source.go`, sha256 `e6834f6e3557c9d26239f86cd912af82428cc9c5d5e69ce01fe0212d07763b68`, identical in both clones):\n\n- `pkgs/mcpx/internal/source/source.go:59` — the `Options.Extensions` doc: *\"Empty takes every regular file.\"*\n- `source.go:149-158` — the `readDir` walk callback: a directory entry is descended into / skipped per `Recursive`; the only other filter is `wanted(path, opt.Extensions)` (extension only). Every remaining entry — FIFO, socket, device, symlink-to-directory — is appended to `files`.\n- `source.go:131-137, 161-…` — each collected path is opened with `os.ReadFile`. Opening a FIFO for reading blocks until a writer appears; opening a socket fails `ENXIO`; opening a symlink to a directory fails `EISDIR`. Any error aborts the whole `Resolve`.\n\nConsumers: plumbing sources (launchers, prefixes, error hooks) resolve through `source.Resolve` at `internal/cli/commands.go:263` and `internal/cli/commands.go:2180`, so a directory a user points one of those settings at is the reachable input.\n\nProbe — executed this run **on the laptop** in a detached worktree at `origin/main` `2217171d`, as a test in the real `internal/source` package (probe + full log preserved by the filer; existing package suite: 14 tests pass, only the three probe bug-cases fail):\n\n- CTRL: a directory of two regular `.ts` files resolves and concatenates both — PASS.\n- CTRL: a symlink to a regular file inside the directory resolves and is read — PASS (this behaviour must be preserved).\n- BUG-A (FIFO): directory with `a.ts` + a FIFO → `Resolve` still blocked after 3 s (it blocks until a writer opens the FIFO — potentially forever in a CLI/daemon call).\n- BUG-B (symlink to a directory): directory with `a.ts` + a symlink to a real subdirectory → `Resolve` fails: `reading …/linkdir: read …/linkdir: is a directory`. A real subdirectory is silently skipped when not recursive; the symlink form aborts everything.\n- BUG-C (unix socket): directory with `a.ts` + a live unix socket file → `Resolve` fails: `reading …/sock: open …/sock: no such device or address`.\n\n## Why it matters\n\nDirectory sources exist for exactly the messy real-world case: a folder of script fragments that grows over time. Sockets and FIFOs appear in such folders in practice (a dev server's socket, a logging pipe, an editor/tool leftover), and today any one of them either wedges an mcpx invocation with no diagnostic at all (the FIFO case — the worst failure mode: no error, no timeout) or discards every fragment in the directory over one entry the resolver was never supposed to read. This contradicts the package's own documented contract (\"every regular file\").\n\n## Acceptance criteria\n\n- [ ] `readDir` only reads regular files: walk entries that are not regular (FIFO, socket, device) are skipped, not read — a directory containing one still resolves its regular files.\n- [ ] A symlink is judged by its target: a symlink to a regular file is still read (current behaviour, pinned by a test); a symlink to a directory is treated like a directory (skipped when not recursive, descended when recursive), never an `EISDIR` abort.\n- [ ] No regression for the plain cases: natural-order concatenation, extension filtering, and the non-recursive subdirectory skip keep working; the existing `internal/source` suite stays green.\n- [ ] New tests in `internal/source` cover at least: FIFO in a directory (resolution completes), unix socket in a directory, symlink-to-directory (both recursive settings), and symlink-to-regular-file.\n- [ ] Triage pin to decide: whether skipping a non-regular entry should be silent (matching how non-recursive subdirectories are silently skipped) or logged — either is acceptable if it is deliberate and tested; hanging or aborting is not.\n\n## Notes\n\n- Not a duplicate of #1702 (searchpath `~name` expansion): different package and defect. `internal/source`'s own `abs` shares the `~name` shape — worth a grep during triage, but it is not this issue.\n- Filed by the new-issue-creator (lane B); verification was a live probe in the real package, not a premise mirror.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T16:27:45Z","url":"https://github.com/developing-today/code/issues/1727"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b96d4fd1-d454-30cc-41ac-f24ebc7fd4c8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECF4:36E018:99F50:D670B:6B07369F |
| html-safe-nonce | a288045ed0775ed3df7b7da3f4ed5275575b7b7a1b9fdf7931bd11a48a531d11 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0Y0OjM2RTAxODo5OUY1MDpENjcwQjo2QjA3MzY5RiIsInZpc2l0b3JfaWQiOiIzNjczNjIwNjIyOTQ2NjA3NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 47edfd3f204881d65fc98da63045d7d4692d201ede018e3811d415a3c1a1b4ad |
| hovercard-subject-tag | issue:6083097707 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1727/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d740ea993b96514ce5db0b52f48c19e4ee02e2cbcfb10d04234843dbba34325f/developing-today/code/issues/1727 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d740ea993b96514ce5db0b52f48c19e4ee02e2cbcfb10d04234843dbba34325f/developing-today/code/issues/1727 |
| og:image:alt | mcpx(source): a directory source reads non-regular files — a FIFO blocks resolution forever, a socket or symlink-to-directory aborts it Summary internal/source's directory resolution collects every... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | d97a1befc96fc1512839eca15eb541061d491301144c9168e2985a8580319a49 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d28643426bfe8d1692f8788961b8217e9003f493 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width