Skip to content

emrg: conftest hermeticity guard — un-isolated stop_daemon calls fail loudly (⛔ red line backstop) - #890

Merged
argszero merged 1 commit into
masterfrom
feature/stop-daemon-hermeticity-guard
Aug 20, 2026
Merged

argszero merged 1 commit into
masterfrom
feature/stop-daemon-hermeticity-guard

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

The 2026-08-20 16:18/16:25 incidents killed the live emrgd twice because tests/test_stop_all.py:677 lacked stop_daemon isolation (host red line 2026-08-18T22:58, rant 2026-08-20T16:32:30). PR #889 fixed the specific leak; this PR adds the definitive anti-regression layer.

Changes

  1. tests/conftest.py — new autouse fixture _guard_stop_daemon_hermeticity: replaces emrg._stop_all.stop_daemon with a raiser, so any future test that triggers a real stop path fails with AssertionError instead of killing the live daemon. Tests that properly isolate it (monkeypatch.setattr(_stop_all, "stop_daemon", lambda: None)) patch after the fixture and override it as usual.
  2. tests/test_stop_all.py — canary test TestStopDaemonHermeticityGuard verifies the guard stays installed (checks function identity only, never calls stop paths).
  3. Agent.md — pytest count synced 981 → 982.

Verification

  • Full suite: 981 passed + 1 skipped (982 collected), import + CLI OK
  • Live daemon (~/.emrg/install/bin/python -m emrg) stayed alive through the entire run — guard confirmed effective
  • All existing stop_all tests (656/677/964, all isolated) still green

…ails loudly (⛔ red line backstop)

The 2026-08-20 16:18/16:25 incidents killed the live emrgd twice because
tests/test_stop_all.py:677 lacked stop_daemon isolation. PR #889 fixed the
specific leak; this adds the definitive anti-regression layer: an autouse
conftest fixture replaces emrg._stop_all.stop_daemon with a raiser so any
future test that triggers a real stop path fails with AssertionError instead
of killing the daemon. A canary test verifies the guard stays installed.
Agent.md pytest count synced 981 -> 982.

@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 1 (3 files +37/−1: conftest autouse guard replaces _stop_all.stop_daemon with a raiser — the ⛔ red-line backstop that makes any future un-isolated stop path fail loudly instead of killing the live daemon; canary test checks guard identity without touching stop paths; Agent.md count synced; pytest 981 passed + 1 skipped with daemon alive; test + test-windows CI PASS)

@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 2 (independent re-review: conftest autouse guard correctly replaces _stop_all.stop_daemon with a raiser (⛔ red-line backstop); existing isolated tests patch after the fixture and override as designed; canary checks guard identity only; Agent.md 982 sync correct; test + test-windows CI PASS)

@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 3 (re-review: head 000e4f4 unchanged, 3 files +37/−1; conftest autouse guard is the ⛔ red-line backstop making any un-isolated stop_daemon call fail loudly; canary verifies guard installation; Agent.md 982 synced; test + test-windows CI PASS, mergeable CLEAN)

@argszero
argszero merged commit 4bd49f3 into master Aug 20, 2026
2 checks passed
argszero added a commit that referenced this pull request Aug 20, 2026
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/stop-daemon-hermeticity-guard branch August 23, 2026 02:26
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