fix(file-safety): return POSIX inner_path from classify_sandbox_mirro… - #63235
fix(file-safety): return POSIX inner_path from classify_sandbox_mirro…#63235aturzone wants to merge 1 commit into
Conversation
…r_target on Windows
classify_sandbox_mirror_target built inner_path with str(Path(*parts)),
which emits OS-native separators — "profiles\group1\SOUL.md" on Windows.
inner_path is a logical HERMES_HOME-relative identifier surfaced to the
model ("the authoritative file is likely <inner_path>"), not an on-disk
path, and its classify_container_mirror_target sibling already builds it
with .as_posix(). Emit it POSIX-style so the two mirror classifiers agree
and the hint stays canonical on every platform. mirror_root stays native
(str) — it names a real host dir for display, matching the sibling.
tests: the sandbox-mirror suite already encodes the POSIX inner_path
contract but only ran green on POSIX CI (the project's CI is Linux-only);
on native Windows five cases failed. Normalize the two mirror_root
assertions the same way the container-mirror tests already do, and add a
regression guard that inner_path never contains a native separator.
Assisted-by: Claude Code (Opus 4.8)
|
Thanks for the focused cross-platform fix. The premise holds on current main: The PR aligns those two classifiers and adds a direct separator regression assertion. GitHub reports the PR as mergeable against current main. Automated hermes-sweeper review. |
monerostar
left a comment
There was a problem hiding this comment.
Ubuntu 26.04 on linux-5800x.
Live call of classify_sandbox_mirror_target on main already returns POSIX inner_path here (profiles/group1/memories/MEMORY.md, no backslashes), which is expected on Linux. The real footgun is Windows str(Path(...)).
PR side:
- same live path still POSIX
tests/agent/test_file_safety_sandbox_mirror.py: 14 passed (0.08s), includingtest_inner_path_uses_posix_separators- aligns sandbox mirror hints with the container-mirror
.as_posix()sibling
Looks good.
…r_target on Windows
classify_sandbox_mirror_target built inner_path with str(Path(*parts)), which emits OS-native separators — "profiles\group1\SOUL.md" on Windows. inner_path is a logical HERMES_HOME-relative identifier surfaced to the model ("the authoritative file is likely <inner_path>"), not an on-disk path, and its classify_container_mirror_target sibling already builds it with .as_posix(). Emit it POSIX-style so the two mirror classifiers agree and the hint stays canonical on every platform. mirror_root stays native (str) — it names a real host dir for display, matching the sibling.
tests: the sandbox-mirror suite already encodes the POSIX inner_path contract but only ran green on POSIX CI (the project's CI is Linux-only); on native Windows five cases failed. Normalize the two mirror_root assertions the same way the container-mirror tests already do, and add a regression guard that inner_path never contains a native separator.
Assisted-by: Claude Code (Opus 4.8)
What does this PR do?
Related Issue
Fixes #
Type of Change
Changes Made
How to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs