Remove duplicate step function definition in tool_builtins_steps.py that
was shadowing the decorated @when handler, causing the Behave step to be
orphaned at runtime. Add CHANGELOG entry documenting the encoding fix for
issue #7559.
ISSUES CLOSED: #7559
# Conflicts:
# CHANGELOG.md
- Fixed _handle_file_edit() to use encoding=inputs.get("encoding", "utf-8") for both read_text() and write_text() calls, ensuring encoding is explicit and not dependent on the platform default.
- Added encoding field to the FILE_EDIT_SPEC schema to surface encoding choices to callers.
ISSUES CLOSED: #7559
The validate_path() function in file_tools.py used str.startswith() to
verify that a resolved path stays within the sandbox root. This allowed
sibling directories whose names share a string prefix with the sandbox
(e.g. /tmp/sandbox-escape/ bypassing /tmp/sandbox/) to escape the
containment check.
Replace the string prefix check with Path.relative_to(root), which
performs a proper OS-level path prefix comparison using path separators.
Add a Behave regression scenario tagged @tdd_issue @tdd_issue_7558 that
exercises the prefix-collision bypass to prevent regressions.
ISSUES CLOSED: #7558