Skip to content

fix(daemon): accept slash-joined paths across the mount surface - #1109

Closed
kumavis wants to merge 1 commit into
llmfrom
break/daemon-mount-slash-paths
Closed

fix(daemon): accept slash-joined paths across the mount surface#1109
kumavis wants to merge 1 commit into
llmfrom
break/daemon-mount-slash-paths

Conversation

@kumavis

@kumavis kumavis commented Sep 1, 2026

Copy link
Copy Markdown
Member

Broken out of feat/hosted-endo-management.

Description

Mount methods took string | string[] but treated a single string as one segment, so the natural mount.readText('src/foo.js') failed while mount.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 at llm warning 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

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)
@kumavis

kumavis commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

probably not

@kumavis
kumavis marked this pull request as draft September 1, 2026 11:59
kriscendobot added a commit to kriscendobot/garden that referenced this pull request Sep 1, 2026
@kriscendobot

Copy link
Copy Markdown
Collaborator

On it — I've posted a job (endojs-endo-but-for-bots-pr1109-80042cab) and will follow up here when it lands.

garden 830a4b29

@kriscendobot

Copy link
Copy Markdown
Collaborator

No further action was needed for this comment. kumavis converted the PR back to draft immediately afterward, and it remains draft at head bb46e0b357b37c0b4aafa26b96dd65c49962b094.

No code changed, so no tests, lint, or type checks were run.

@kumavis
kumavis force-pushed the break/daemon-mount-slash-paths branch from bb46e0b to 0ad0db2 Compare September 1, 2026 12:28

kumavis commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

For the record on the red check at head 0ad0db21 (that push was the Prettier fix for mount.js; the earlier lint failure is resolved): test (24.x, macos-15) fails in @endo/chat#test — the channel suite got Exiting due to SIGINT with 36 passed and 55 still pending, i.e. a hang/interrupt, not an assertion. That suite is disjoint from this diff (daemon mount.js path splitting + help text; the mount suite itself passes, 79 tests). Notably this was the first PR run on the un-pinned 24.x macOS leg after #1104 merged; llm's own post-merge run at 24a7ce4f ran the same leg green, so I read it as a runner/timing flake on that leg, with no existing fix to port. I don't have re-run permission (403).

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

kriscendobot added a commit to kriscendobot/garden that referenced this pull request Sep 1, 2026
@kriscendobot

Copy link
Copy Markdown
Collaborator

On it — I've posted a job (endojs-endo-but-for-bots-pr1109-dcc1affe) and will follow up here when it lands.

garden 830a4b29

@kriscendobot

Copy link
Copy Markdown
Collaborator

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.

  • Head: 0ad0db2
  • Changes: none.
  • Deferred: no rerun or lifecycle action without a decision to resume or close the draft.
  • Checks: no local tests, lint, or type checks were run because no code changed. gh pr view 1109 --repo endojs/endo-but-for-bots showed the pull request still draft and the test (24.x, macos-15) check failed at this head.

kumavis commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

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 help() rows (including the previously undocumented entry()), the rejection error itself, the floot personas whose examples demonstrated the failing call, and the daemon AGENTS.md. The branch stays if the widening is ever wanted after all.


Generated by Claude Code

@kumavis kumavis closed this Sep 1, 2026
kriscendobot added a commit to kriscendobot/garden that referenced this pull request Sep 1, 2026
@kriscendobot

Copy link
Copy Markdown
Collaborator

On it — I've posted a job (endojs-endo-but-for-bots-pr1109-7ef7c52e) and will follow up here when it lands.

garden 830a4b29

@kriscendobot

Copy link
Copy Markdown
Collaborator

No further action is needed. The pull request was closed by kumavis in favor of #1112, and its head branch remains available.

  • Head: 0ad0db2
  • Replacement artifact: 99b525a documents the path forms in every requested surface: the help() rows including entry(), the rejection error, the floot personas, and packages/daemon/AGENTS.md.
  • Lifecycle: the GitHub timeline records kumavis closing this pull request at 2026-09-01T13:25:55Z. The break/daemon-mount-slash-paths ref still points to the head above.
  • Changes here: none. Nothing was declined beyond the superseded implementation.
  • Checks: no tests, lint, or type checks were run because this disposition made no code changes. I inspected the replacement diff and queried the pull request state, close event, and retained branch ref through the GitHub API.

kumavis pushed a commit that referenced this pull request Sep 1, 2026
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
@kumavis
kumavis deleted the break/daemon-mount-slash-paths branch September 1, 2026 23:53
@kumavis kumavis mentioned this pull request Sep 3, 2026
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.

2 participants