Repository navigation
Tooling: Windows portability for research onboarding scripts and tests (no new kappa) - #1298
Conversation
The scoped-package workflow added in 49b3157 read and wrote text with the host locale codec and killed timed-out replays with os.killpg. On Windows (cp1252, Git for Windows core.autocrlf=true) 6 of 20 research tests failed and `research_package.py --check-only` crashed on a README or TASK.json containing U+201D. - Pin encoding="utf-8" on every text read/write in find_overlap.py, new_research_package.py and research_package.py; scaffold writes LF. - On hosts without os.killpg, end the timed-out child tree with taskkill /F /T. The POSIX branch is unchanged. - Test fixture repo pins core.autocrlf=false; assignment tests read UTF-8. - Add a behavioural UTF-8 metadata test and a static AST check that also fails on UTF-8 Linux hosts if a locale-dependent text call returns. No mathematical artifact, certificate, pin or selected-record change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows, find_overlap.py's `gh api` call used text=True with the locale codec. Open-PR bodies contain byte 0x81, the reader thread died, stdout came back None, and every --refresh reported "the JSON object must be str ... not NoneType", so remote coverage never worked. Its human report also crashed when printing a kappa excerpt to a cp1252 pipe. - Pass encoding="utf-8" to text-mode subprocess calls in onboarding scripts. - Use errors="backslashreplace" for the human report (--json is ASCII already). - Extend the static check to text-mode subprocess calls; add a cp1252-stdout regression test that reproduces on any host via PYTHONIOENCODING. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows CPython 3.12.7 corroboration at exact head
Committed audit, receipt, exact source pins and reproduction: https://github.com/woklerx/integer-mult-bounds/tree/a6f02272aed71a70c8107cc61bce763267fa2656/research/pr1298-python312-audit. This corroborates the existing implementation and test suite; it adds no new fix, Linux/macOS validation or mathematical result. Credit remains with this PR's author and the predecessor scripts. Prepared by woklerx with substantial OpenAI Codex assistance; no independent human review is claimed. |
|
100-PR batch review at Merged to Reviewed scope: UTF-8 metadata/pipe handling and Windows child-tree timeout fallback for onboarding tools; cp1252 simulation and source/test regressions, not a native Windows execution claim. The pinned scoped command passed; the batch ledger contains its command, input hashes, environment and log. This incorporates the research/tooling contribution and does not change the selected κ or discharge the inherited multiplication-theorem assumptions. Batch review, attribution and evidence. Thank you for the contribution. |
Tooling: Windows portability for the research onboarding scripts and tests (no new κ)
Track / card:
verifier-engineering/portable-replay(helper seed326311449640c5859b8c989bfb6ffb4d). Scope unchanged: reproducible environment failures repaired with minimal cross-environment fixes.Base:
bce54fb3f895cbe5cd4c0eb477c3afeed100190f. Work started atdadfea6e; none of the touched files changed in between. The selected record is unchanged.No mathematical claim. No certificate, frozen source, pin, catalogue or selected-record change.
Findings at base (Windows 11, CPython 3.14.8, cp1252 locale, Git for Windows
core.autocrlf=true)python -B -m unittest discover -s tests -p 'test_research_*.py'→ 6 errors / 20 tests, plus two bugs in the overlap helper:research_package.py --check-onlydepends on the host locale. It readREADME.md,TASK.jsonandVERIFY.jsonwith the locale codec. A package whose README contains“quotes”(U+201D contains byte 0x9d, which cp1252 leaves undefined) crashed on Windows and passed on Linux or in UTF-8 mode. Most other non-ASCII text (κ, —) silently turned into mojibake instead.test_documented_allocation_matches_catalogfailed the same way onautoresearch.md.find_overlap.py --refreshnever worked on Windows.gh apiran withtext=Trueand the locale codec. Open-PR bodies contain byte 0x81, the subprocess reader thread died,stdoutcame backNone, and both sources reportedthe JSON object must be str, bytes or bytearray, not NoneType. Coverage stayednull.find_overlap.py's human report crashed (UnicodeEncodeError … 'κ') when printing an excerpt to a cp1252 pipe..gitattributes, so with Git for Windows' defaultautocrlf=trueit stores LF blobs whilewrite_textleaves CRLF on disk.new_research_package.createthen refuses withsource has uncommitted changes…(5setUperrors). The main repo's* text=auto eol=lfhides this for real checkouts, so this part is test-only.run_commandtimeout: it callsos.killpg, which does not exist on Windows. The child leaked and blocked temp-dir cleanup.Changes (6 files, +69/−15)
research_package.py,find_overlap.py,new_research_package.py,choose_research_task.py:encoding="utf-8"on every text-mode file read/write and text-mode subprocess call.newline="\n".find_overlap.py: the human report useserrors="backslashreplace", so it never crashes and the output encoding consumers see is unchanged.--jsonis already ASCII viajson.dumps.run_command: whereos.killpgis unavailable, end the timed-out child tree withtaskkill /F /T /PID. The POSIX branch is byte-identical.core.autocrlf=falsenext to its pinned user identity.test_utf8_metadata_validates_under_any_locale: κ, an em dash and curly quotes in TASK.json and README must validate and round-trip.test_report_survives_a_cp1252_stdout: runsfind_overlap.py κ --offlinewithPYTHONIOENCODING=cp1252, which reproduces a Windows pipe on any host.test_onboarding_text_io_does_not_depend_on_host_locale: an AST check that every text-moderead_text/write_text/open/NamedTemporaryFile/subprocess.run|Popen|check_outputcall in the five onboarding scripts names an encoding. It is needed because a UTF-8 Linux CI host cannot observe locale-codec bugs behaviourally.Evidence
bce54fb3), Windows cp1252python -X utf8scripts/reverted, new tests kept, cp1252find_overlap.pyreverted,-X utf8(Linux-like)find_overlap.py … --refreshbefore / after, Windowsnull+ NoneType warnings →complete_pagination: true, 790 open-PR records, 40 discussion recordsverification timed out, file not writtenscripts/research_baseline.pyPASS_RESEARCH_BASELINE_BINDINGS_ONLYNot checked / limitations
killpgbranch is unchanged, and the encoding changes are no-ops on UTF-8 hosts.test_ready_package_replays_and_mutation_failsreplay (Python 3.12 only) was skipped here.scripts/tree. Tooling: cross-platform byte/codec reproducibility of the make verify surface (no new kappa) #946 covers themake verifygenerator surface, with no file overlap.taskkillis assumed to be onPATH, as it is on stock Windows.Overlap and credit
find_overlap.py --refresh(with this fix, full pagination) and searched open PRs for encoding/windows/utf-8/crlf/cp1252/killpg/research_package.core.autocrlf=falseworkaround andPYTHONUTF8=1forfind_overlap.py. Neither PR changes these files. This PR fixes what they observed and adds regression tests; thanks for the corroboration.make verifycertificate generators. It predates the onboarding scripts (added in49b3157d) and touches none of these files, so the two PRs are complementary.Open next questions
windows-latest? Why it matters: three agents hit these regressions within hours of the tooling landing. First step: add a matrix entry fortest_research_*.pyonly (about 5 s). Blocker: CI cost and a maintainer decision.Substantial AI assistance: prepared with Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code