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
Owner

Summary

  • /new-agent akzeptiert optionalen path-Parameter im Format host:virtual (z.B. C:\Code\projekt:~/projekt)
  • agent.yaml unterst�tzt path_mappings-Feld (Zod-validiert)
  • sanitizeForDiscord() ersetzt Host-Pfade durch virtuelle Pfade in Discord-Ausgaben � l�ngste zuerst, beide Slash-Varianten
  • CLAUDE.md-Template informiert den Agent �ber virtuelle Pfade und verbietet das Leaken von Host-Pfaden
  • Windows-Laufwerksbuchstaben (C:) werden beim Parsen korrekt behandelt

Ge�nderte Dateien

  • src/agent/schema.tsPathMappingSchema + path_mappings-Feld
  • src/runtime/sanitize.tspathMappings-Option in SanitizeOptions
  • src/router.tspath_mappings aus agent.yaml an sanitizeOpts �bergeben
  • src/agent/identity.ts � CLAUDE.md-Template + agent.yaml schreiben path_mappings
  • src/commands/new-agent.tspath-Option + parsePathOption()

Test plan

  • npm run build � fehlerfrei
  • npm test � 120/120 Tests gr�n
  • 4 neue sanitize-Test-Cases (pathMappings)
  • Integration-Test angepasst
## Summary - `/new-agent` akzeptiert optionalen `path`-Parameter im Format `host:virtual` (z.B. `C:\Code\projekt:~/projekt`) - `agent.yaml` unterst�tzt `path_mappings`-Feld (Zod-validiert) - `sanitizeForDiscord()` ersetzt Host-Pfade durch virtuelle Pfade in Discord-Ausgaben � l�ngste zuerst, beide Slash-Varianten - CLAUDE.md-Template informiert den Agent �ber virtuelle Pfade und verbietet das Leaken von Host-Pfaden - Windows-Laufwerksbuchstaben (`C:`) werden beim Parsen korrekt behandelt ## Ge�nderte Dateien - `src/agent/schema.ts` � `PathMappingSchema` + `path_mappings`-Feld - `src/runtime/sanitize.ts` � `pathMappings`-Option in `SanitizeOptions` - `src/router.ts` � `path_mappings` aus `agent.yaml` an `sanitizeOpts` �bergeben - `src/agent/identity.ts` � CLAUDE.md-Template + `agent.yaml` schreiben `path_mappings` - `src/commands/new-agent.ts` � `path`-Option + `parsePathOption()` ## Test plan - [x] `npm run build` � fehlerfrei - [x] `npm test` � 120/120 Tests gr�n - [x] 4 neue sanitize-Test-Cases (pathMappings) - [x] Integration-Test angepasst
dev added 1 commit 2026-04-13 08:42:19 +00:00
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
21052bc646
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>
dev added 1 commit 2026-04-13 08:43:26 +00:00
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
cd56793959
dev added 1 commit 2026-04-13 08:51:24 +00:00
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
4b05ea885c
- 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>
dev added 1 commit 2026-04-13 09:01:21 +00:00
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
cbd2df66fb
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>
dev added 1 commit 2026-04-13 09:07:00 +00:00
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
e3ab6371cc
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>
dev added 1 commit 2026-04-13 09:11:46 +00:00
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
aeaeff8509
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>
dev added 1 commit 2026-04-13 09:16:35 +00:00
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
cff6d0cc3c
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>
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
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin refinement/mapped-project-paths:refinement/mapped-project-paths
git checkout refinement/mapped-project-paths
Sign in to join this conversation.
No description provided.