emrg: stop-git.ps1 guilt-by-association kill + README attraction pass (rants 2026-08-11T19:47:44/19:50:37) - #692
Conversation
… (rants 2026-08-11T19:47:44/19:50:37)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Reviewed the full diff and ran the suite on feature/stop-git-guilt-by-association-readme:
Correctness (both states verified by analysis + tests, ps1 is Windows-only so not executed here):
stop-git.ps1prefix%USERPROFILE%\.emrg\install\git\*guarantees system Git (Program Files) and host tools are never matched — guilt-by-association stays scoped to the bundled prefix, faithfully implementing the host's 2026-08-11T19:47:44 decision (install success priority over #689's snapshot-only protection).- Positive state: nothing under prefix → both passes no-op →
$left.Count=0→ exit 0 → installer proceeds. - Negative state: git orphan holding msys-2.0.dll → pass 1 kills git/ssh/plink/bash, pass 2 kills sh/vim survivors → exit 1 only if something still holds the prefix.
EXIT_CODE=0initialization moved to the top of stop-emrg.cmd — step 1–3 failures now propagate through:verify(previously the reset at the label wiped them).if errorlevelinside the block is a runtime check, safe with delayed expansion.{tmp}dontcopy extraction +%~1pass-through correctly covers old installs that lackbin/stop-git.ps1; build-runtime.sh packages it.
Tests/docs: full suite 695 passed (12.8s warm); tests/test_doc_counts.py + tests/test_installer_stop.py 8/8; Agent.md's 695 matches the collected count. README/README.cn badge switch removes the doc-drift failure mode the old guard existed for.
Nits (non-blocking):test_doc_counts.py docstring references "#697" (this PR is #692 — forward/wrong number); %TEMP%\emrg-stop-git.ps1 fallback is effectively dead code (the {tmp} arg or installed copy always wins); the 300ms sleeps between kill passes can theoretically false-abort on a slow-exiting process — the installer's restart hint covers it.
Also noting: the two rants referenced in the title (2026-08-11T19:47:44/19:50:37) are not present in the shared ~/.emrg/rants.jsonl (still 10 completed entries) — they appear to live in the submitting instance's own queue. Recommend syncing them into the shared file for traceability when convenient.
argszero
commented
Aug 11, 2026
Addressed the review nits in 774216d:
The shared |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Reviewed the follow-up commit 774216d on top of my R846 review:
test_doc_counts.pydocstring PR ref fixed #697 → #692 (my earlier nit) ✓- Dead
%TEMP%\emrg-stop-git.ps1fallback removed from stop-emrg.cmd;{tmp}arg + installed-copy paths remain, and:verify's prefix check still guards the no-script case (my earlier nit) ✓ test_installer_stop.pyupdated to assert the fallback is gone (positive discriminator) ✓
Full suite re-run on head 774216d: 695 passed (12.8s); targeted tests 8/8. Mergeable against master 0df709d. Approving.
Uh oh!
There was an error while loading. Please reload this page.
Two host rants addressed in one PR (they share the doc-count guard; splitting would create a modify/delete conflict on the README count lines):
1. stop-emrg.cmd — guilt-by-association bundled-git kill (rant 2026-08-11T19:47:44)
Host FINAL decision OVERRIDES #689: install success has priority — if sh/vim hold
msys-2.0.dlland block the git-tree kill, they are killed too ("要杀死相关进程,如果杀死git时,发现sh/vim导致杀不掉,则一起杀"). The #689 snapshot-only approach (never touch host sh/vim) was rejected.bin/stop-git.ps1(standalone script, avoids the 0.2.26 cmd inline-PowerShell quoting escape):%USERPROFILE%\.emrg\install\git\*only (system Git in Program Files never matched)bin/stop-emrg.cmd: step 4 now callspowershell -File stop-git.ps1; emrg: stop-emrg.cmd — kill only EMRG-owned git trees, never host Git Bash sh/vim (rant 2026-08-11T18:56:58) #689's snapshot/step0/PIDFILE mechanism removed. The installer passes the{tmp}-extracted copy as%~1when the OLD install lacks the script; verify keeps a plain-prefix survival check (exit 1 → installer aborts with restart hint).packaging/make-installer.sh:[Files] dontcopyentry for stop-git.ps1 +ExtractTemporaryFile('stop-git.ps1')passed as%~1inPrepareToInstall.packaging/build-runtime.sh: copies stop-git.ps1 into the runtimebin/.2. README attraction pass (rant 2026-08-11T19:50:37)
packaging/assets/icon.svg(Branch Emergence design, emrg: app icon finalization — Branch Emergence SVG design source + gen-assets pipeline (rant 2026-08-11T18:28:09) #688) centered below the title, above the badges — pure local defs, no external references, safe for GitHub rendering.tests/test_doc_counts.pypython-count check now guards Agent.md only (READMEs point to the badge); GUI breakdown check still picks up any(N: ...)line it finds.Verification
test_stop_git_ps1_guilt_by_association)tests/test_installer_stop.py(5 tests, text assertions — no Windows needed)