emrg: enforce CRLF for Windows .cmd/.ps1 + truthful stop-git failure (rant 2026-08-12T12:30:41) - #701
Conversation
…(rant 2026-08-12T12:30:41)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260812-123914 (reviewer: argszero)
Reviewed the full diff: .gitattributes CRLF enforcement (.cmd/.bat/*.ps1 text eol=crlf) is the correct root-cause fix for the LF-misparse installer series; the new CRLF guard test (zero bare-LF lines across all tracked Windows scripts) runs on every pytest runner incl. CI; stop-git.ps1 truthful-failure reporting (names survivors before exit 1, never silent bogus exit=0); updated assertion + doc count synced. Verified git ls-files --eol = i/lf w/crlf for all four scripts.
CI PASS (31563862915) — actionlint gate + doc-count guard + full pytest green. No issues found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260812-1240 (reviewer: argszero)
Reviewed the full diff (.gitattributes + guard test + stop-git.ps1 + test update):
- .gitattributes: .cmd/.bat/*.ps1 text eol=crlf — blobs stay LF-canonical, checkout is CRLF on every platform. Verified via fresh clone: all 4 tracked scripts show i/lf w/crlf.
- Guard test validated in BOTH states: fresh checkout (CI-equivalent) → PASSES; injected LF-only file → discriminator (crlf != lf) correctly flags it. A future LF-only .cmd fails CI instead of the installer.
- stop-git.ps1 truthful failure: survivors named ('still running: name (pid N)') + exit 1; exit 0 only when clean — no silent bogus success. test_installer_stop.py updated to assert the new form; 5 tests pass.
- Agent.md count synced (729 → 730).
One operational note (not a blocker): local checkouts that predate .gitattributes keep stale LF .cmd files (git doesn't rewrite unchanged blobs) — run git add --renormalize . once after merging so the guard passes locally. CI is unaffected (fresh checkout).
No issues found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260812-124221 (reviewer: argszero)
3rd consecutive LGTM (123914 + 1240 parallel + this cycle). Code unchanged since full review in cycle 123914; CI PASS (31563862915). Merge condition satisfied.
Root cause of the 0.2.25/0.2.26/0.2.27 Windows installer 'exit code 1' series (host 2026-08-12 step-by-step diagnosis):
Main root cause — LF-only .cmd files are misparsed by cmd.exe
.gitattributes—*.cmd,*.bat,*.ps1text eol=crlf→ git checks out CRLF on every platform (blobs stay LF-canonical; verifiedgit ls-files --eol= i/lf w/crlf).tests/test_cmd_crlf.py(works on every pytest runner incl. CI): every tracked*.cmd/.bat/.ps1must have zero bare-LF lines — a future PR adding a LF-only .cmd fails CI instead of the installer.Secondary — stop-git.ps1 truthful failure (spec B)
still running: <name> (pid N)) before exiting 1, so the installer shows a useful message instead of a silent bogus exit=0 when an admin-owned sh/vim cannot be killed.Verification: pytest 729 → 730 (new CRLF guard + updated stop-git assertion), import + CLI green, doc counts synced. The installed .cmd files come from a fresh CI checkout → CRLF → 0.2.28 installer should no longer hit 'stop-emrg.cmd exit code 1'.