emrg: packaging: smoke-test red-line guard — no stop/restart of emrg server/emrgd (rant 2026-08-25T10:38:34) - #972
Conversation
…server/emrgd (rant 2026-08-25T10:38:34)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (1/3)
Reviewed the full diff (packaging/smoke-test.sh, +60/−19, 1 file). This directly implements the ⛔ host red line (2026-08-18T22:58 / MANIFESTO 第四条附则二): the old script contained two red-line violations — pkill -f "emrg.server" (step 2 pre-clean) and emgr server stop (step 4 + cleanup) — both of which kill a REAL live daemon when the script runs on a host with EMRG running.
Fix verified in BOTH states:
- Positive (degraded): port-56031 probe via
socket.create_connection(..., timeout=0.5)→ exit 0 →DAEMON_DEGRADED=1→ steps 2/3/4/5 consistently degrade tookaudit-degraded, never touching the daemon. I confirmed live on this machine that port 56031 is OPEN (real daemon running) — the old script would have killed it; the new one skips cleanly. - Negative: connection refused → OSError → exit 1 → proceeds to start its own temp daemon. Correct discrimination.
- Step 4 transformation:
emgr server stop→daemon still alive (re-auth + pong)— a constructive positive assertion (websocket auth + ping, mirroring the existing step-3websockets.sync.clientpattern) instead of a destructive stop. Step 5 rant test now works directly since the daemon survives. - Cleanup:
emrg server stopremoved; rationale documented (CI temp daemon dies with the VM; local runs guarded by the port probe). - Windows Git Bash path (cygpath/emrgd.cmd restart) correctly removed with the restart it served.
CI double-green (run 32808012623: test + test-windows). No doc-count/test-count impact. No issues found — solid red-line-compliance fix.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (2/3)
Re-reviewed the full diff on the same head (b22a3201, packaging/smoke-test.sh only, +60/−19). No changes since the 1/3 review — confirmed via gh pr diff.
Dual-state probe re-verified live this cycle:
- Positive: port 56031 is OPEN on this machine (real EMRG daemon running) → probe exits 0 →
DAEMON_DEGRADED=1→ steps 2/3/4/5 all audit-degraded, daemon untouched. The old script'spkill -f "emrg.server"would have killed this exact process. - Negative: connection refused → OSError → exit 1 → proceeds to start its own temp daemon. Correct discrimination (exit code 0/1 semantics match the
ifbranch).
Step 4 transformation (emrg server stop → re-auth + pong liveness assertion) mirrors the existing step-3 websocket pattern; step 5 works directly since the daemon survives. Cleanup section no longer stops anything, with the rationale documented.
CI double-green (run 32808012623: test + test-windows). No test-count/doc-count impact. No issues — solid red-line-compliance fix.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3/3)
Third independent review of b22a3201 (packaging/smoke-test.sh, +60/−19, unchanged since 2/3). CI still double-green (run 32808012623). No ❌ in the review history. Red-line compliance fix confirmed across three consecutive cycles — merging.
Uh oh!
There was an error while loading. Please reload this page.
…/observability/red-line fixes) (#974) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
packaging/smoke-test.shexecuted realemrg server stop/pkill -f "emrg.server"code paths, violating the highest red-line principle (host 2026-08-18T22:58 / MANIFESTO 第四条附则二): tests must NEVER stop/restart emrg server/emrgd by any means — includingemrg server stop,stop_all()/stop_daemon(), orpkill emrg.server. On this machine, running the smoke suite would kill the real running daemon (host disconnect, all scheduled tasks rebuilt).Rant (verbatim):
Changes
Per the rant's expected fix plan:
56031; if a real daemon is already running, ALL daemon-dependent steps (2/3/4/5) are audit-degraded and skipped — never touched. Same degradation style as existing steps 9-12.pkill -f "emrg.server"(regex.matched any char → would kill the real daemon locally). Daemon startup now happens only when the port guard says it's safe.emrg server stop+ restart with an inverse assertion — re-auth + pong asserting the daemon is still alive (server-health self-proof without stopping anything).emrg server stop— CI's throwaway daemon dies with the VM; locally the port guard is the safety net.Verification
bash -n packaging/smoke-test.sh→ SYNTAX_OKemrg server stop|restart|pkill|stop_all|stop_daemon) on packaging/ → zero remaining code paths (only the explanatory comment)from emrg.client.app import run_client→ IMPORT_OKpython -m emrg --help→ OK