fix(windows): pin Go source and shebang scripts to LF at checkout

main

Commit

Suhaan Thayyil3d ago

core.autocrlf=true is the Git for Windows default, so a stock Windows clone checks out every text file with CRLF. Measured on a git clone -c core.autocrlf=true of 3f632e40: all 872 Go files arrived with CRLF and gofmt -s -l . listed all 872, and sh scripts/entire-graph-statusline_test.sh exited 2 at its second line with : command not found. Both are steps of mise run check and of CI, so the gate CONTRIBUTING.md asks for could not pass on a default Windows clone at all. No CI runner can see this: every runner, the Windows ones included, checks out LF.

The script class is found by reading the first two bytes of every tracked file rather than by matching names, because a CR on a #! line becomes part of the interpreter's name whatever the file is called -- a CRLF #!/usr/bin/env python3 file exits 127 with env: python3\\r: No such file or directory -- and a glob would miss an executable with no extension. The sibling repository that shares internal/agentsetup already has exactly that shape in its task runner. Naming the interpreter explicitly bypasses the #! line and hides the problem, which is why CI's python3 scripts/entire-graph-prompt-context_test.py passed on the same clone.

go build, go vet and the whole go test ./... suite were unaffected there (10 packages, 0 failures), so the exposure is tooling and not the tests: the NDJSON goldens are compared through normalizeSnapshotText, which strips CR, and the verify-block goldens hold hashes of freshly rendered output inside JSON that is parsed rather than hashed.

git add --renormalize . rewrites nothing under these rules, which is the proof that they change checkout only and never committed content.