fix(785): the new leak guard's third assertion was a tautology

`test_the_subprocess_env_CARRIES_the_isolated_hook_fire_log_dir` shipped with

    assert "hook-fire" not in str(Path.home() / ".cache") or isolated != str(...)

Evaluated: `str(Path.home() / ".cache")` is `/Users/timothy/.cache`, which never contains
"hook-fire", so the left operand is always True and the `or` never reaches the comparison.
The assertion could not fail. It was decoration inside a guard added specifically to stop
vacuous checks — the recurring shape this milestone exists to close, committed by its own
fix.

The first two assertions in that test were doing the real work throughout, so nothing that
was proved is now unproved. The third now compares the resolved paths, with the production
path DERIVED the way `hook-fire-log.sh` derives it (`${HOME:-/tmp}/.cache/ersatztv/
hook-fire`) rather than restated as a literal that would drift from it.

Verified reachable: with `isolated` set to the production path the comparison evaluates
False, i.e. the assertion fires. Previously that same input passed.

Found by re-reading the fix commit rather than by the reviews — which is the argument for
re-reviewing the FIX and not only the original diff.

Refs: #785
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-21 21:29:00 +02:00
co-authored by Claude Opus 5
parent 4822003004
commit a01def3f10
@@ -175,9 +175,13 @@ def test_the_subprocess_env_CARRIES_the_isolated_hook_fire_log_dir():
"this file is writing into the production hook-fire log. Build the env per call; do not "
f"snapshot os.environ at import time. env has {env.get('ETV_HOOK_FIRE_LOG_DIR')!r}"
)
assert "hook-fire" not in str(Path.home() / ".cache") or isolated != str(
Path.home() / ".cache" / "ersatztv" / "hook-fire"
), "the isolated dir IS the production dir"
# The path `hook-fire-log.sh` falls back to when ETV_HOOK_FIRE_LOG_DIR is unset, derived the
# same way it derives it rather than restated as a literal.
production = Path(os.environ.get("HOME", "/tmp")) / ".cache" / "ersatztv" / "hook-fire" # noqa: S108 — mirrors hook-fire-log.sh's own ${HOME:-/tmp}
assert Path(isolated).resolve() != production.resolve(), (
f"the 'isolated' log dir IS the production one ({production}), so the fixture is isolating "
"nothing and this test would pass while the leak continued"
)
def test_the_marker_hook_really_marks_the_worktree_it_was_told_about(tmp_path):