You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sub-issue of #789, prerequisite for Phase 1 (#790).
Symptom
/clud-pr (and any worktree-based workflow under .claude/worktrees/)
cannot edit Cargo.toml files. crate_guard.py denies the write with:
Refusing to create/modify Cargo.toml at
'.claude/worktrees/<branch>/crates/fbuild-build': fbuild is kept close
to a monocrate ...
even though crates/fbuild-build IS in the allowlist.
Root cause
ci/hooks/crate_guard.py:relative_dir resolves the edit path relative
to os.getcwd(), which the harness pins to \$CLAUDE_PROJECT_DIR (the main checkout, not the worktree). So an absolute path like <repo>/.claude/worktrees/feat-xyz/crates/fbuild-build/Cargo.toml
yields rel_dir = ".claude/worktrees/feat-xyz/crates/fbuild-build",
which is not in APPROVED_CRATE_DIRS and gets denied.
Fix
After computing rel_dir, strip a leading .claude/worktrees/<single path component>/ prefix if present, then re-check against APPROVED_CRATE_DIRS. A worktree under that path is by definition a
fbuild checkout, so the same allowlist applies.
Activity