Conversation
The three end-to-end tests in tests/test_judge.py build their stub judge runner as an `sh -c` string and interpolate a Path into it with an f-string. On Windows str(Path) yields backslash separators, which the shell reads as escapes: `cat > C://Users//...` redirects to a mangled path and still exits 0, so the stub runner looks like it ran while having written nothing. The `cat` that follows then fails, the group is skipped, and the test fails for a reason unrelated to what it asserts. The same interpolation also splits on whitespace when a path contains a space, which is reachable when %TEMP% sits under a user name with one. Render interpolated paths with Path.as_posix() and shlex.quote(). Both are no-ops on POSIX, so Linux and macOS are unchanged.
14 tasks
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three end-to-end tests in
tests/test_judge.pyfail on Windows on an unmodifiedff690b6:Those three tests build their stub judge runner as an
sh -ccommand string and interpolate aPathinto it with an f-string. On Windowsstr(Path)yields backslash separators, and the shell reads a backslash as an escape character:The redirect exits 0 while writing to a mangled path, so the stub runner looks like it ran and wrote nothing. The
cat C:\Users\...that follows then fails, the group is skipped, andjudge.mainreturns 1 — the three tests fail for a reason unrelated to what they assert.The same interpolation splits on whitespace if a path contains a space, which is reachable when
%TEMP%sits under a user name with a space:Fix: render every interpolated path with
Path.as_posix()andshlex.quote(). Both are no-ops on POSIX, so Linux and macOS behavior is unchanged.Before → after, same Windows machine, same checkout:
python -m unittest tests.test_judge -vRan 17 tests—FAILED (failures=3)Ran 17 tests—OKpython -m unittest discover -s tests -vRan 41 tests—FAILED (failures=3)Ran 41 tests—OKThis is test-fixture only.
scripts/judge.py,scripts/run_evals.py, the skill, the hooks, and every manifest are untouched.Authorship and provenance — select exactly one
Agent/tool and model/version: WorkBuddy agent harness; model DeepSeek-V4.1-Flash.
Agent contribution: Located the three failing tests, diagnosed the cause, wrote the
shell_pathhelper and its three call sites, ran the before/after comparisons on Windows, and drafted this PR.Human verification: The submitter was given the diagnosis, the diff, and the before/after results, selected the authorship category above, and approved submission. The submitter did not personally re-run the commands; every run reported under Verification was performed by the agent that wrote the change.
Known limitations or uncertain results: Checks ran on Windows (Python 3.13.12).
Path.as_posix()andshlex.quote()are no-ops for the POSIX temp paths used on Linux and macOS, so those runs should be unaffected, but no Linux or macOS run was performed here. The three tests still require a POSIXshonPATH; a Windows machine without Git Bash errors rather than skips, and this PR does not change that.Labels
Target label: Target:Evals
Author label: Author:AI
Workflow labels: bug
Safety and side effects
Side effects, permissions, network access, and cost: None. Test-fixture string construction only; no new dependencies, network calls, or provider costs. The tests keep using temporary directories and delete them as before.
Compatibility
Migration or rollback notes: None required.
Path.as_posix()andshlex.quote()are identity operations for the POSIX temp paths currently used in CI, so the Ubuntu run is byte-identical.Verification
python -m unittest tests.test_judge -von Windows before the fix —Ran 17 tests,FAILED (failures=3)(cleanff690b6).python -m unittest tests.test_judge -von Windows after the fix —Ran 17 tests,OK.python -m unittest discover -s tests -von Windows after the fix —Ran 41 tests,OK.python -m unittest tests.test_judgewithTEMP/TMP/TMPDIRpointed at a directory containing a space —Ran 17 tests,OK.python scripts/run_evals.py validate—Evaluation cases are valid.git diff --check— clean.The three tests failed before the change on the same machine and pass after it; no test was skipped, deleted, or weakened.
Why this stayed red: no workflow runs this file.
plugin-load-check.ymlinvokestests.test_always_on_hookson a[ubuntu-latest, windows-latest]matrix,pi-load-check.ymlrunsscripts/check_pi_extension.py, andcursor-skill-sync.ymlwatches the skill files.grep -rn "test_judge\|discover" .github/workflows/returns nothing, sotests/test_judge.pyis not executed on any runner.Behavior evals: Not applicable; no skill-behavior, runner, or plugin-runtime change.
Final accountability