feat(DIS-152): mapped project paths (host:virtual) for agents #66

Open
dev wants to merge 7 commits from refinement/mapped-project-paths into main

7 commits

Author SHA1 Message Date
Nick Tabeling
cff6d0cc3c fix(DIS-152): add Glob and Grep permissions for mapped host paths
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
Glob and Grep are separate tools from Read in Claude Code's permission
model — the agent was triggering permission prompts when trying to use
Glob on the host path even though Read was allowed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 11:16:30 +02:00
Nick Tabeling
aeaeff8509 fix(DIS-152): rewrite CLAUDE.md path section with unambiguous table format
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
Previous wording was unclear — agent kept using the virtual alias ~/gem
as a real filesystem path. New format uses a two-column table with
explicit examples showing the correct (real path + Read/Glob/Grep tools)
vs. incorrect (virtual path + Bash) usage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 11:11:41 +02:00
Nick Tabeling
e3ab6371cc fix(DIS-152): instruct agent to use Read/Glob instead of Bash for mapped paths
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
Bash tool is sandboxed to workspace CWD regardless of settings.json — agent
was using Bash(ls) on mapped paths and getting blocked. CLAUDE.md now
explicitly tells the agent to use Read/Glob/Grep for external paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 11:06:56 +02:00
Nick Tabeling
cbd2df66fb fix(DIS-152): remove deny(../**) when path_mappings present
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
deny always wins over allow in Claude Code — the Read(../**) deny rule
was silently blocking the explicitly allowed host paths. When mappings
exist, drop the ../** traversal guard and use explicit Read(./**) allow
instead of blanket Read.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 11:01:16 +02:00
Nick Tabeling
4b05ea885c fix(DIS-152): grant agent actual fs access to mapped host paths
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
- createClaudeConfig() adds Read/Write/Edit(<hostPath>/**) to allow list
  for each path_mapping so Claude Code can actually access the directory
- createClaudeMd() shows agent both real path (to use) and virtual path
  (to mention in responses) — previously only showed virtual path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 10:51:19 +02:00
Nick Tabeling
cd56793959 update task
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
2026-04-13 10:43:17 +02:00
Nick Tabeling
21052bc646 feat(DIS-152): mapped project paths (host:virtual) for agents
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
Adds optional path_mappings to agent.yaml so host directories are
transparently mapped to virtual paths in agent responses and CLAUDE.md.
Sanitizer replaces host paths (longest first, both slash styles) before
repoRoot/home substitutions. /new-agent accepts a host:virtual path
option with Windows-safe splitting and fs.existsSync validation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 10:41:10 +02:00