fix(daemon): accept slash-joined paths across the mount surface - #1109
fix(daemon): accept slash-joined paths across the mount surface#1109kumavis wants to merge 1 commit into
Conversation
glob() reports its results slash-joined and entry() accepts that spelling, but every other path-bearing method treated a string as a single literal name, so passing a glob result to readText or stat threw "Path segment must not contain '/'". A directory entry cannot hold a separator, so such a string was never a meaningful name — only a guaranteed error. Split path arguments into segments once, in normalizeSegments and resolveSegments, giving the interface one convention. '.', '..' and the denied-name checks still run per segment, so '..' stays clamped at the confinement root and a restricted name inside a joined path is still refused. Closes #15. (cherry picked from commit 9d0f61b)
|
probably not |
…en2-5bcdff64 [id:endojs/endo-but-for-bots#1109:comment:5493588098]
|
On it — I've posted a job ( garden |
|
No further action was needed for this comment. kumavis converted the PR back to draft immediately afterward, and it remains draft at head No code changed, so no tests, lint, or type checks were run. |
bb46e0b to
0ad0db2
Compare
|
For the record on the red check at head Since this PR is now draft ("probably not"), I'm not pushing anything further here — happy to pick it back up or close it out, whichever way you decide. Generated by Claude Code |
…en2-5bcdff64 [id:endojs/endo-but-for-bots#1109:comment:5494383735]
|
On it — I've posted a job ( garden |
|
No new work was routed from this note. It records the existing macOS CI interruption and leaves the pull request lifecycle decision open; it does not request a code change, rerun, or close.
|
|
Closing in favor of #1112, per kumavis: rather than widening the mount surface to split slash-joined strings, that PR documents the existing path forms where agents actually read them — the Generated by Claude Code |
…en2-5bcdff64 [id:endojs/endo-but-for-bots#1109:comment:5494658360]
|
On it — I've posted a job ( garden |
|
No further action is needed. The pull request was closed by kumavis in favor of #1112, and its head branch remains available.
|
Agents keep passing 'src/foo.js' as one mount path argument and hitting
"Path segment must not contain '/'". The surface rule — an array is a
sequence of segments, a plain string is a single name, and entry() is
the one method that splits a slash-joined string — was stated only
inside lookup()'s help text, while everything an agent actually reads
taught the mistake or stayed silent:
- help(): the EndoMount overview now states the path rule up front;
every path-taking method's row says a slash-joined string is rejected
and points at entry(); and entry() itself gains the help row it never
had.
- The rejection error now carries the remedy inline — pass
["dir", "file.txt"] or entry("dir/file.txt") — since the error is the
documentation an agent is guaranteed to read. Same condition, same
throw; message only.
- The floot full-control persona demonstrated the failing call verbatim
(readText('packages/daemon/src/interfaces.js')) and its list()
guidance implied slash sub-paths; both now model segment arguments and
introduce entry(). The new-project persona's worktree bullet gains the
same one-line rule.
- packages/daemon/AGENTS.md sharpens its Mount path note accordingly.
Documentation only; no path semantics change. Supersedes the
slash-joined-path widening drafted in #1109.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FnsnQttCNY3PwrtVqoE67s
Broken out of
feat/hosted-endo-management.Description
Mount methods took
string | string[]but treated a single string as one segment, so the naturalmount.readText('src/foo.js')failed whilemount.readText(['src', 'foo.js'])worked — a recurring stumbling block for agents driving mounts. Split slash-joined string arguments into segments consistently across the mount surface, and document the accepted forms in the mount help text (help.md/help-text-data.js).Security Considerations
Path splitting happens before the existing confinement checks;
..and absolute-path handling go through the same validation as segment arrays. No widening of what a mount can reach.Scaling Considerations
None.
Documentation Considerations
The mount
help()text documents the accepted path forms; no external docs to update.Testing Considerations
test/mount.test.js(79 tests, including new slash-path cases) passes; daemon lint clean atllmwarning baseline.Compatibility Considerations
Strictly widens accepted inputs; segment-array callers are unchanged. A caller relying on a slash-containing single segment being treated literally would change behavior, but such names were already unreachable on disk.
Upgrade Considerations
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FnsnQttCNY3PwrtVqoE67s
Generated by Claude Code