Repository navigation
Conversation
fixture-manifest.json hashes every release-test fixture byte-for-byte, so a CRLF checkout (the Git for Windows default with core.autocrlf=true) makes every manifest check fail. Follow the existing legacy-skills precedent: pin text fixtures to LF and leave media fixtures untouched.
…odec serve.py wrote server-events.jsonl as UTF-8 but read it back with the platform default encoding, so a non-ASCII event aborted the request handler on any non-UTF-8 locale (GBK on zh-CN Windows) and silently mojibaked elsewhere. Pin every remaining text read/write in the helper, including CLI help capture and stdout/stderr evidence, to UTF-8, and cover the /events round trip.
The evidence contract allows --bsk to point at a wrapper, but Windows cannot exec a file without an executable extension even when it carries a shebang, so discover() and execute() failed with WinError 193 and the audit tests could not run there. Prefix Python wrappers with the current interpreter, leave native executables and .cmd/.bat shims alone, and skip the AF_UNIX-only admin-home assertion on platforms that use named pipes.
f7720b2 to
0414dc7
Compare
NianJiuZst
left a comment
There was a problem hiding this comment.
Thanks for the clean, well-isolated fix and thorough root-cause writeup! A few Windows gaps worth closing before we land this:
-
Non-CJK Windows locales (
cp1252) still fail intest_release_audit.py:
test_adversarial_server_routes_bfcache_cors_and_media_mimeswrites"你好"without an explicit encoding:
(root / "captions-zh.vtt").write_text("WEBVTT\n\n00:00.000 --> 00:01.000\n你好\n")
That passes onzh-CNWindows (gbk), where"你好"is representable, but raisesUnicodeEncodeErroronen-USWindows (cp1252). Please addencoding="utf-8"there (and ideally across the remaining bareread_text/write_textcalls intest_release_audit.py). -
Wire
test_release_audit.pyinto the existing Windows CI job:
.github/workflows/ci.ymlalready has awindows-daemonjob onwindows-latest(which runs lightweight script checks around line 165). Addingpython evals/browser/skills/browserskill-release-test/scripts/test_release_audit.pythere (~18s) will exercise this on a realwindows-latestcheckout and prevent future fixture/encoding regressions. -
Two small
release_audit.pyWindows follow-ups while we're here:launcher(): On Windows, a--bsk wrapper.pyscript often omits a Unix#!shebang, andCreateProcessWstill fails on.py/.pywwithWinError 193. Handlingpath.suffix.lower() in {".py", ".pyw"}via[sys.executable or "python", str(path)]covers both shebang-less.pywrappers and extensionless shebang scripts.execute()timeout handling (p.send_signal(signal.SIGINT)): on Windows,Popen.send_signal(signal.SIGINT)raisesValueError: Unsupported signal: 2, aborting beforemeta.jsonis written. Usingp.terminate()whenos.name == "nt"avoids crashing the recorder on timeouts.
-
(Nit) In
test_events_endpoint_serves_utf8_payloads, please usewith urllib.request.urlopen(...)andthread.join()infinally:to match the other server tests in the file and avoid unclosed socket warnings.
- Encode every helper text write explicitly; the captions fixture used the locale codec and failed on cp1252 Windows. - Run the audit helper tests in the existing windows-daemon CI job so fixture and encoding regressions surface on a real windows-latest checkout. - Treat shebang-less .py/.pyw --bsk wrappers as interpreter scripts, since CreateProcessW rejects them as well. - Terminate instead of send_signal(SIGINT) on Windows timeouts, where the latter raises ValueError before meta.json is written. - Match the other server tests: context-managed responses and thread.join().
Thanks for the detailed review — all four points are addressed in
Verification: 26/26 on Windows 11 (zh-CN) and 26/26 on Linux (WSL, Python 3.12). One CI note: the |
Fixes #763
Problem
scripts/test_release_audit.pycannot run on Windows. All CI jobs useubuntu-latest, so none of this is caught there, but a Windows contributorfollowing the README gets
Ran 23 tests — FAILED (failures=1, errors=21):fixture-manifest.jsonhashes every release-test fixturebyte-for-byte. With the Git for Windows default
core.autocrlf=truethecheckout is CRLF, so every manifest check fails.
WinError 193. The evidence contract allows--bskto be a wrapper, andthe tests use a shebang Python script. Windows cannot exec a file without an
executable extension, so
discover()andexecute()abort.serve.pywritesserver-events.jsonlas UTF-8 but readit back with the platform default encoding. A non-ASCII event aborted the
request handler on non-UTF-8 locales (GBK on zh-CN Windows) and mojibaked
silently elsewhere. The same applied to captured help text, stdout/stderr
evidence and benchmark output.
daemon.sockpath. Windows uses named pipes, so that branch is unreachable.Change
eol=lfand media files to-text, following theexisting
crates/bsk-cli/tests/fixtures/legacy-skills/*.mdprecedent.launcher(): on Windows, run Python wrappers through the currentinterpreter;
.exe/.com/.cmd/.batand every non-Windows platform arelaunched unchanged. Wire it into both
discover()calls andexecute().subprocesshelp capture.the launcher decision and the UTF-8
/eventsround trip.No product code, no browser execution and no gate semantics change:
gatestill requires every planned scenario to pass in the authoritative round.
Verification
Windows 11, Python 3.13.1, checkout with
core.autocrlf=true:fixture-manifest.jsonafter re-checkout, and theworking tree carries no fixture content diff (
git check-attrreportstext: set / eol: lffor.html,text: unsetfor.wav).test_launcher_runs_python_wrappers_through_the_interpreterpasses an explicitplatformargument, so the Windows branch is covered on the Linux CI runnerwithout mutating the global
os.name(which would also change howpathlibresolves paths).
launcher()returns the path untouched, and thehelper already wrote/read UTF-8 on the CI image.
🤖 Generated with Claude Code