Skip to content

emrg: stop-git.ps1 guilt-by-association kill + README attraction pass (rants 2026-08-11T19:47:44/19:50:37) - #692

Merged
argszero merged 2 commits into
masterfrom
feature/stop-git-guilt-by-association-readme
Aug 11, 2026
Merged

emrg: stop-git.ps1 guilt-by-association kill + README attraction pass (rants 2026-08-11T19:47:44/19:50:37)#692
argszero merged 2 commits into
masterfrom
feature/stop-git-guilt-by-association-readme

Conversation

@argszero

Copy link
Copy Markdown
Owner

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.dll and block the git-tree kill, they are killed too ("要杀死相关进程,如果杀死git时,发现sh/vim导致杀不掉,则一起杀"). The #689 snapshot-only approach (never touch host sh/vim) was rejected.

  • New bin/stop-git.ps1 (standalone script, avoids the 0.2.26 cmd inline-PowerShell quoting escape):
    1. collects processes under %USERPROFILE%\.emrg\install\git\* only (system Git in Program Files never matched)
    2. pass 1: force-kills the git tree (git/ssh/plink/bash)
    3. pass 2: guilt-by-association — force-kills every survivor under the prefix (sh/vim included)
    4. exit 0 when nothing survives (clean install safe), 1 when a process still holds the prefix
  • bin/stop-emrg.cmd: step 4 now calls powershell -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 %~1 when 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] dontcopy entry for stop-git.ps1 + ExtractTemporaryFile('stop-git.ps1') passed as %~1 in PrepareToInstall.
  • packaging/build-runtime.sh: copies stop-git.ps1 into the runtime bin/.

2. README attraction pass (rant 2026-08-11T19:50:37)

  • Top brand icon: 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.
  • Core selling point promoted from the table row to a standalone callout above the feature table (EN/CN symmetric); table row removed to avoid duplication.
  • Test counts de-hardcoded: README.md/README.cn.md "currently N items"/"N 项" + GUI breakdown details replaced with "see badge above" — no more doc drift on every test change. tests/test_doc_counts.py python-count check now guards Agent.md only (READMEs point to the badge); GUI breakdown check still picks up any (N: ...) line it finds.

Verification

  • pytest: 695 passed (694 → +1: new test_stop_git_ps1_guilt_by_association)
  • GUI: 212 passed
  • Import + CLI sanity OK
  • Rant acceptance greps: no 694/212 in README.md/README.cn.md
  • Installer wiring pinned by rewritten tests/test_installer_stop.py (5 tests, text assertions — no Windows needed)

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.ps1 prefix %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=0 initialization 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 errorlevel inside the block is a runtime check, safe with delayed expansion.
  • {tmp} dontcopy extraction + %~1 pass-through correctly covers old installs that lack bin/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 argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

@argszero

Copy link
Copy Markdown
Owner Author

Addressed the review nits in 774216d:

  1. Wrong PR number in docstring: #697#692 (this PR).
  2. Dead %TEMP% fallback: removed — the {tmp} arg (or the installed copy in bin/) always wins; if the script is genuinely absent, the :verify plain-prefix survival check still catches survivors and aborts with the restart hint.
  3. 300ms kill-loop race: kept as-is deliberately — the race is theoretical, and the installer's restart hint covers any slow-exiting process. Not worth complicating the script.

The shared rants.jsonl note: those two rants (19:47:44/19:50:37) are tracked as in_progress in the submitting instance's queue; they'll be marked completed once #692 merges.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

Reviewed the follow-up commit 774216d on top of my R846 review:

  • test_doc_counts.py docstring PR ref fixed #697#692 (my earlier nit) ✓
  • Dead %TEMP%\emrg-stop-git.ps1 fallback 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.py updated 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.

@argszero
argszero merged commit 5d57d60 into master Aug 11, 2026
1 check passed
argszero added a commit that referenced this pull request Aug 11, 2026
…UI cursor/status-bar) (#694)

* emrg: evolution_prompt quick-ref for #692/#693 (stop-git snapshot + TUI cursor/status-bar)

* emrg: quick-ref #693 — drop literal {hid}/{host} braces (evolution prompt placeholder guard)

---------

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant