fix(test): use canonical temp path for verification cleanup exemption - #76742
fix(test): use canonical temp path for verification cleanup exemption#76742686f6c61 wants to merge 1 commit into
Conversation
The exemption is intentionally realpath-only. On macOS /tmp is a symlink to /private/tmp, so build the operand from realpath(gettempdir()) rather than a literal /tmp path. Fixes NousResearch#70797
Related: #70415 proposes production support for the raw top-level macOS temp alias. This PR instead corrects the fixture to the existing canonical-only contract. A maintainer decision is needed; these are competing policies, not duplicates. |
|
Noted on the policy fork with #70415. This PR intentionally does not change production exemption behavior: the verifier already writes under Happy to close/adjust if maintainers prefer the #70415 production alias path instead. |
|
Thanks — glad this lines up with #55946. Happy for this small fixture-only fix to land first so you can rebase the kanban PR on top with a one-line conflict (or none). No further changes planned on this head. |
SummaryOne PR directly addresses #70797. #76742 changes only the failing test fixture, replacing the literal macOS Related pull requests
DuplicatesThe same fixture correction is reportedly also present in #55946, so that overlapping line should be removed from #55946 when it is rebased; #70415 is not a duplicate because it proposes a different production policy. Suggested consolidationKeep #76742 open with a salvage path: retain its focused fixture-only canonicalization because that diff directly addresses the reported macOS failure while preserving the existing security contract. Do not treat #70415 as a duplicate; remove the duplicate fixture change from #55946 rather than closing its broader kanban work. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I70797(["issue #70797 (open)"])
P76742["PR #76742 (open)"]
P76742 -->|best fix| I70797
class I70797 open
class P76742 open
class P76742 best
class P76742 target
click I70797 "https://github.com/NousResearch/hermes-agent/issues/70797"
click P76742 "https://github.com/NousResearch/hermes-agent/pull/76742"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 1 kB of PR diffs, 4 kB of issue/PR text, 1 kB of discussion (4 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Related: #70415 changes production behavior to recognize the raw macOS temp alias, while this PR keeps canonical-only behavior and corrects the fixture. This is a policy choice, not a duplicate. |
Summary
test_nonrecursive_verification_artifact_cleanup_is_not_dangerousfailed on macOS because it fed a literal/tmp/...operand while the exemption compares againstrealpath(gettempdir())(/private/tmpon macOS).Changes
os.path.realpath("/tmp")under the mocked gettempdirNo production code change — the implementation is correct; the test was wrong.
Test plan
pytest tests/tools/test_approval.py::TestDetectDangerousRm::test_nonrecursive_verification_artifact_cleanup_is_not_dangerousFixes #70797