Skip to content

Commit af0e497

Browse files
committed
fix(tools): a workspace keeps its given hidden entries as spelled and adds the implicit ones
- The post-init re-resolved every denied entry strictly: a looping `hide_paths` entry raised at run start, and the review-rules reader's historical paths, added by name, resolved to their current targets and stopped matching.
1 parent d42c3c2 commit af0e497

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/agent6/tools/_path_safety.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ class Workspace:
110110
exempt: tuple[pathlib.Path, ...] = ()
111111

112112
def __post_init__(self) -> None:
113-
hidden = paths.hidden_paths(self.root, self.denied)
114-
object.__setattr__(self, "denied", tuple(resolved(p) for p in hidden))
113+
# The given entries stay as spelled: a caller adds a historical path by name, and a
114+
# looping entry is refused when read, not here. The implicit private dirs and packs
115+
# join them, through the non-strict realpath `host_workspace` uses.
116+
implicit = (pathlib.Path(os.path.realpath(p)) for p in paths.hidden_paths(self.root))
117+
object.__setattr__(self, "denied", tuple(dict.fromkeys((*self.denied, *implicit))))
115118

116119
def _denying(self, abs_path: pathlib.Path) -> pathlib.Path | None:
117120
"""Return the denied root covering the path, or None; the one owner of the verdict."""

0 commit comments

Comments
 (0)