fix(s03,s04,s20): remove dead safe_path, sync READMEs

- Delete safe_path entirely (following PR #483 approach) — no dead code
- Update all 3 READMEs per module to reflect read_file in Gate 2
- s04: also update permission_hook snippet in READMEs
- s20: remove safe_path (already replaced with inline resolution)

Closes #482
This commit is contained in:
root
2026-07-28 19:29:01 +08:00
parent 97b8541b36
commit 581241cdc7
8 changed files with 7 additions and 25 deletions

View File

@@ -108,7 +108,7 @@ def permission_hook(block):
for pattern in DENY_LIST:
if pattern in block.input.get("command", ""):
return "Permission denied by deny list"
if block.name in ("write_file", "edit_file"):
if block.name in ("read_file", "write_file", "edit_file"):
path = block.input.get("path", "")
if not (WORKDIR / path).resolve().is_relative_to(WORKDIR):
choice = input(" Allow? [y/N] ").strip().lower()