refactor(cleanup): Remove 4,500 lines of dead code (Phase 1 legacy cleanup)

- Delete engine/emitters.py (25 lines, unused Protocol definitions)
- Delete engine/beautiful_mermaid.py (4,107 lines, unused Mermaid ASCII renderer)
- Delete engine/pipeline_viz.py (364 lines, unused visualization module)
- Delete tests/test_emitters.py (orphaned test file)
- Remove introspect_pipeline_viz() method and references from engine/pipeline.py
- Add comprehensive legacy code analysis documentation in docs/

Phase 1 of legacy code cleanup: 0 risk, 100% safe to remove.
All tests pass (521 passing tests, 9 fewer due to test_emitters.py removal).
No regressions or breaking changes.
This commit is contained in:
2026-03-16 20:33:04 -07:00
parent 28203bac4b
commit 5762d5e845
8 changed files with 678 additions and 4590 deletions

View File

@@ -1,69 +0,0 @@
"""
Tests for engine.emitters module.
"""
from engine.emitters import EventEmitter, Startable, Stoppable
class TestEventEmitterProtocol:
"""Tests for EventEmitter protocol."""
def test_protocol_exists(self):
"""EventEmitter protocol is defined."""
assert EventEmitter is not None
def test_protocol_has_subscribe_method(self):
"""EventEmitter has subscribe method in protocol."""
assert hasattr(EventEmitter, "subscribe")
def test_protocol_has_unsubscribe_method(self):
"""EventEmitter has unsubscribe method in protocol."""
assert hasattr(EventEmitter, "unsubscribe")
class TestStartableProtocol:
"""Tests for Startable protocol."""
def test_protocol_exists(self):
"""Startable protocol is defined."""
assert Startable is not None
def test_protocol_has_start_method(self):
"""Startable has start method in protocol."""
assert hasattr(Startable, "start")
class TestStoppableProtocol:
"""Tests for Stoppable protocol."""
def test_protocol_exists(self):
"""Stoppable protocol is defined."""
assert Stoppable is not None
def test_protocol_has_stop_method(self):
"""Stoppable has stop method in protocol."""
assert hasattr(Stoppable, "stop")
class TestProtocolCompliance:
"""Tests that existing classes comply with protocols."""
def test_ntfy_poller_complies_with_protocol(self):
"""NtfyPoller implements EventEmitter protocol."""
from engine.ntfy import NtfyPoller
poller = NtfyPoller("http://example.com/topic")
assert hasattr(poller, "subscribe")
assert hasattr(poller, "unsubscribe")
assert callable(poller.subscribe)
assert callable(poller.unsubscribe)
def test_mic_sensor_complies_with_protocol(self):
"""MicSensor implements Startable and Stoppable protocols."""
from engine.sensors.mic import MicSensor
sensor = MicSensor()
assert hasattr(sensor, "start")
assert hasattr(sensor, "stop")
assert callable(sensor.start)
assert callable(sensor.stop)