The validator that demanded tests for /tmp scripts

ork #3844 · cross-instance-test-validator · fixed 2026-09-01, and the dead legacy branch went with it

BUG A Stop-time hook blocked whole turns demanding a test file for /tmp scratch scripts that will never live in the repo. FIX Files outside the project dir are skipped before test-candidate generation. DELETED The unreachable "legacy single-file dispatch" branch, green-tested dead code since #3804.

What the block looked like

[skill/cross-instance-test-validator] Missing test coverage for new code
  Implementation: /tmp/ork-w4-disp-tolerant.py
  Expected test file:
    - /tmp/test_ork-w4-disp-tolerant.py
    - //tests/test_ork-w4-disp-tolerant.py   <= the tell

The doubled slash is the fingerprint: the second candidate was built by joining tests/ onto an ancestor that turned out to be the filesystem root /.

Why the walk escaped

ancestorsOf(dir, projectDir) climbs parent by parent and stops when it reaches projectDir. For a file under the project, that always terminates. For a file outside it, the stop condition is never true:

in-project file
~/repo/src/hooks/skill/
up~/repo/src/hooks/
up~/repo/src/
up~/repo/ = projectDir, STOP
/tmp file (pre-fix)
/tmp/citv-outside/
up/tmp/ (not projectDir)
up/ (root, still not projectDir)
!emits //tests/... candidates

Try it

The fix, and the deletion

function isUnderProject(filePath, projectDir) {
  const rel = relative(projectDir, filePath);
  return rel !== '' && !rel.startsWith('..') && !isAbsolute(rel);
}
// Stop loop: if (!isUnderProject(filePath, projectDir)) continue;

The same PR deletes the pre-#3844 "legacy single-file dispatch" branch instead of hardening it. The hook is registered exactly once, on Stop, and a Stop payload never carries tool_input.file_path. That branch was exercised only by its own unit tests: a green suite asserting a payload production never delivers, the same #959/#3801 shape this repo keeps finding. Its three tests were replaced by two controls proven to fail on the pre-fix source (2 failed / 19 passed pre-fix, 21 / 21 post-fix).

ork #3844 · fix PR #3865 · self-contained page, no external assets.