emrg: stop-emrg.cmd v2 — host-verified fix for installer exit 1 - #729
Conversation
…s 09:56:47/10:00:33)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (1/3)
Reviewed the full diff on feature/stop-emrg-v2-verified (c738de7).
Bug 1 (step 4 skipped) — fix verified: the old if not exist "%EMRG_DIR%\emrgd.pid" goto :verify is gone. Daemon section now falls through via goto :daemon_pid → (no pid) goto :step4, so the bundled-git kill ALWAYS runs before :verify. Verified on the real blob: goto :verify absent, :step4 present, ordering :step4 < :verify ✓.
Bug 2 (%VAR% parse-time expansion) — fix verified: nested paren blocks replaced by label structure (:tui_wmic/:tui_done, :daemon_stop/:daemon_pid/:daemon_pid_wait/:kill_pid/:pid_gone); loop guard uses delayed expansion if !TRIES! geq 10 goto :kill_pid with setlocal enabledelayedexpansion ✓.
Diagnostics preserved (host requirement): per-step echo [N] check/kill/result + chcp 65001 + residual listing in :verify ✓.
Consistency: blob is LF 4263 bytes → +91 CRLF = 4354 bytes host CRLF, matching the PR's byte-exact claim; .gitattributes eol=crlf intact. tests/test_installer_stop.py 8/8 green locally (incl. new test_stop_emrg_v2_step4_always_runs); Agent.md 760→761 synced.
No issues found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle. CI run 31659728224 SUCCESS (test + test-windows both green). Verified: bin/stop-emrg.cmd is a byte-exact copy of the host-verified v2 (4354 bytes, CRLF, EXIT_CODE=0 on real Windows); step 4 (kill bundled git) now always executes before :verify (no goto :verify skip); paren-block %VAR% parse-time expansion fixed via label structure + !TRIES! delayed expansion; per-step [N] diagnostics preserved. Test suite: +1 test (test_stop_emrg_v2_step4_always_runs), old tests adapted to :step4 label; pytest 761 green; Agent.md count synced (doc-count guard green).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3/3)
Third independent cycle confirming the diff at c738de7 (unchanged since 1/3 review): stop-emrg.cmd v2 fixes both root causes — (1) step 4 (bundled-git kill) now ALWAYS runs via goto :step4 fall-through (no more goto :verify early jump), (2) paren-block %VAR% parse-time expansion replaced by label structure + !TRIES! delayed expansion. Host-verified on real Windows (EXIT_CODE=0); byte-exact CRLF confirmed; tests 8/8 + CI 31659728224 green. Merging.
Implements host rants 2026-08-13T09:56:47 + 2026-08-13T10:00:33 (final root cause, host-verified on real Windows with EXIT_CODE=0).
Double bug in stop-emrg.cmd (host's decisive diagnostic):
emrgd.pidabsent), the old daemon section jumped straight to:verify, so step 4 (kill bundled git) never ran → orphaned evolution-spawned git.exe×3 + sh + vim processes kept lockinginstall\git→ verify reported them → exit 1 → installer aborted.%VAR%parse-time expansion inside paren blocks:if %TRIES% geq 10expanded at parse time ("10 was unexpected at this time") andif exist "%INSTALL%\bin\emrg.cmd"misjudged inside a block ("no emrg.cmd" while the file exists).Fix (host's verified v2, copied VERBATIM per host instruction — no rewrites):
goto :step4;if exist emrgd.pidwraps the pid poll/kill, then:step4always executes before:verify.:tui_wmic/:tui_done,:daemon_stop/:daemon_pid/:daemon_pid_wait/:kill_pid/:pid_gone);if !TRIES! geq 10uses delayed expansion.echo [N] check/kill/result+chcp 65001.Verification: tests updated —
test_stop_emrg_v2_step4_always_runsadded (nogoto :verify,!TRIES!delayed expansion, labels present, diagnostics present), old tests adapted to the v2:step4label structure; full pytest 761 green; doc-count guard synced (Agent.md 760 → 761).