Skip to content

#112: post-#111 cleanup — obsolete tests + orphan modules + legacy scripts#116

Merged
BrettKinny merged 3 commits into
mainfrom
cleanup-post-111-orphans
May 23, 2026
Merged

#112: post-#111 cleanup — obsolete tests + orphan modules + legacy scripts#116
BrettKinny merged 3 commits into
mainfrom
cleanup-post-111-orphans

Conversation

@BrettKinny
Copy link
Copy Markdown
Owner

Summary

Follow-up cleanup after #113 ripped 5168 lines of dead voice + perception code from bridge.py. Three buckets in three commits:

Bucket 1 — Tests (commit b6f1c40)

tests/test_bridge_routes.py: 35 failing tests targeting ripped endpoints. Kept HealthTests (rewritten for the new minimal {status, service} shape); dropped everything else.

Deleted class Reason
PerceptionEventStateTests /api/perception/event + /state ripped
CalendarTodayTests /api/calendar/today moved to dotty-behaviour (dotty-behaviour/routes/calendar.py)
VoiceMemoryLogTests, VoiceRememberTests, VoiceEscalateTests voice path ripped
VisionExplainTests, AudioExplainTests moved to dotty-behaviour
MessageTests, MessageStreamTests ACP /api/message ripped
PerceptionFeedTests, VisionLatestTests perception bus moved to dotty-behaviour

Also dropped the now-unused _StubProc / _install_acp_stub / _reset_perception_state helpers and the heavy env-var dance (IDLE_PHOTOGRAPHER_ENABLED, DREAMER_ENABLED, CALENDAR_IDS, ZEROCLAW_BIN, CONVO_LOG_DIR) that the obsolete tests required.

Bucket 2 — Orphan modules (commit 1095559)

Modules + tests that were no longer imported by bridge.py / bridge/dashboard.py after the rip:

bridge/speaker.py            tests/test_speaker.py
bridge/household.py          tests/test_household.py
bridge/proactive_greeter.py  tests/test_proactive_greeter.py
bridge/purr_player.py        tests/test_bridge_dispatch.py
bridge/server_push.py        (no dedicated test)
bridge/perception/           tests/test_perception_cache.py
bridge/sensor_feed.html      (orphan template, not referenced anywhere)

Plus four dead-helper tests that mirrored code ripped from bridge.py itself (not orphan-module tests, but testing nothing real anymore):

tests/test_idle_photographer.py        idle-photographer notability helper
tests/test_bridge_perception_state.py  /api/perception/state staleness helper
tests/test_dream_dance_writers.py      dreamer + dance reflector writers
tests/test_room_view_parser.py         room_view VLM response parser
tests/test_memory_type_tags.py         NDJSON type taxonomy (dream/dance/perception/scene_synthesis)

bridge/security_watch.py is intentionally keptbridge/dashboard.py imports security_watch.get_recent_cycles for the /ui/security/recent/{device} panel. Verified by grep before final commit.

Bucket 3 — Legacy RPi scripts (commit e778f28)

scripts/deploy-bridge.sh           tar-over-ssh deploy to the retired RPi
scripts/install-bridge.sh          systemd-unit installer
zeroclaw-bridge.service.template   the systemd unit itself

scripts/deploy-bridge-unraid.sh + bridge/Dockerfile (from #109) is the post-#36 replacement.

Also fixed up Makefile — the setup wizard was rendering zeroclaw-bridge.service.template and printing a "Deploy zeroclaw-bridge.service" hint. Both removed. Doc references in CHANGELOG.md and docs/cutover-behaviour.md were left in place per the cleanup brief (historical record); the dotty-deploy-bridge skill description still mentions the old RPi path and is flagged for a follow-up docs sweep.

Stats

Bucket Tests removed Files deleted
1 32 (rewrote HealthTests 3→3) 0
2 (8 files of tests) 15 (7 bridge modules/dirs + 8 test files)
3 0 3 + Makefile edit

pytest tests/ -q: 35 failed, 224 passed → 0 failed, 64 passed. (Net test count drops because Bucket 1 removed 32 obsolete cases from one file and Bucket 2 removed 9 entire test files for ripped features.)

Ambiguous items investigated

  • HealthTests: brief said KEEP because /health still exists, but the old tests asserted on acp_running / cached_session / session_turns fields that are gone. Rewrote against the new {status, service} shape rather than deleting.
  • bridge/security_watch.py: kept (load-bearing for the dashboard, per brief). Confirmed bridge/dashboard.py:2396-2397 does from bridge import security_watch and calls security_watch.get_recent_cycles(limit=10).
  • bridge/sensor_feed.html: zero references in any .py or .html under bridge/ or in bridge.py. Deleted.
  • Makefile zeroclaw-bridge.service render step: deleting the template without this fix would break make setup. Scope-creep but unavoidable.

Test plan

  • pytest tests/ -q — 0 failed, 64 passed (was 35 failed, 224 passed before this branch)
  • python -c "import bridge" — clean
  • python -c "from bridge.dashboard import *" — clean
  • python bridge.py import — clean (warning about ephemeral CSRF secret as expected)
  • All hx-get="..." URLs in bridge/templates/*.html resolve to a handler in bridge.py or bridge/dashboard.py (/health + 16 /ui/* routes verified)
  • make -n help parses Makefile cleanly after the edit

🤖 Generated with Claude Code

BrettKinny and others added 3 commits May 24, 2026 00:07
35 test cases in tests/test_bridge_routes.py exercised endpoints that
were ripped from bridge.py in #111 (PR #113):

  - PerceptionEventStateTests        /api/perception/event, /state
  - CalendarTodayTests               /api/calendar/today (now in dotty-behaviour)
  - VoiceMemoryLogTests              /api/voice/memory_log
  - VoiceRememberTests               /api/voice/remember
  - VoiceEscalateTests               /api/voice/escalate
  - VisionExplainTests               /api/vision/explain (now in dotty-behaviour)
  - AudioExplainTests                /api/audio/explain (now in dotty-behaviour)
  - MessageTests                     /api/message (ACP voice turn)
  - MessageStreamTests               /api/message/stream
  - PerceptionFeedTests              /api/perception/feed (perception bus)
  - VisionLatestTests                /api/vision/latest/{device_id}

HealthTests is kept — `/health` still exists — but rewritten against the
new minimal `{status, service}` surface (the pre-#36 acp_running /
cached_session / session_turns fields are gone with ZeroClaw).

The _StubProc / _install_acp_stub / _reset_perception_state helpers and
the env-var dance for IDLE_PHOTOGRAPHER_ENABLED / DREAMER_ENABLED /
CALENDAR_IDS / ZEROCLAW_BIN are no longer needed: bridge.py's lifespan
post-#111 spawns nothing, so a no-op lifespan + a plain TestClient is
the whole bootstrap.

pytest tests/ -q: 35 failed → 0 failed (227 passed, +3 HealthTests).

Refs #112

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After #113 ripped the voice + perception code from bridge.py, a set of
bridge/* modules became unreachable — no `from bridge.x import y` in
bridge.py or bridge/dashboard.py touches them. Confirmed by grep before
deletion (all references were self-references or string literals in
templates that no longer hit a route).

Modules deleted:
  bridge/speaker.py           — SpeakerResolver, voice path
  bridge/household.py         — bridge-side HouseholdRegistry
                                (dotty-behaviour owns its own)
  bridge/proactive_greeter.py — ProactiveGreeter consumer
  bridge/purr_player.py       — purr_player consumer
  bridge/server_push.py       — server-pushed audio dispatch
  bridge/perception/          — read-only snapshot package over caches
                                that no longer exist
  bridge/sensor_feed.html     — orphan template (no template loader
                                or hx-get URL references it)

`bridge/security_watch.py` is intentionally kept — `bridge/dashboard.py`
imports `security_watch.get_recent_cycles` for the /ui/security/recent
panel.

Associated test files removed:
  tests/test_speaker.py             tests bridge.speaker (deleted above)
  tests/test_household.py           tests bridge.household
  tests/test_proactive_greeter.py   tests bridge.proactive_greeter
  tests/test_perception_cache.py    tests bridge.perception.cache
  tests/test_bridge_dispatch.py     tests bridge.purr_player.dispatch_purr_audio
  tests/test_idle_photographer.py   tests idle photographer helpers
                                    (ripped from bridge.py in #111)
  tests/test_bridge_perception_state.py
                                    tests _annotate helper for the
                                    ripped /api/perception/state endpoint
  tests/test_dream_dance_writers.py tests dreamer + dance reflector
                                    helpers (ripped in #111)
  tests/test_room_view_parser.py    tests room_view parser (ripped in #111)
  tests/test_memory_type_tags.py    tests NDJSON `type` taxonomy whose
                                    feeders (dream/dance/perception/
                                    scene_synthesis) were ripped in #111

pytest tests/ -q: 227 passed → 64 passed (all green).

Refs #112

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
scripts/{deploy-bridge,install-bridge}.sh + zeroclaw-bridge.service.template
targeted the retired bare-metal RPi systemd path (tar-over-ssh into
/root/zeroclaw-bridge/ then systemctl restart zeroclaw-bridge.service).
PR #109's scripts/deploy-bridge-unraid.sh + bridge/Dockerfile is the
post-#36 replacement — bridge.py runs as a container alongside
dotty-pi / dotty-behaviour on the same Docker host.

Files deleted:
  scripts/deploy-bridge.sh           tar-over-ssh deploy to RPi
  scripts/install-bridge.sh          systemd unit installer
  zeroclaw-bridge.service.template   the systemd unit itself

Makefile setup-wizard updated:
  - Drop the `render zeroclaw-bridge.service.template` step
  - Drop the "Deploy zeroclaw-bridge.service to the ZeroClaw host" hint
    from the post-setup instructions

Doc references to these artifacts in CHANGELOG.md and
docs/cutover-behaviour.md are intentionally left — they're historical
record of the pre-#36 architecture. The dotty-deploy-bridge skill
description also still calls out the old path; flagged for a follow-up
docs sweep.

Refs #112

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 23, 2026 14:11
@BrettKinny BrettKinny merged commit 7274148 into main May 23, 2026
8 of 10 checks passed
@BrettKinny BrettKinny deleted the cleanup-post-111-orphans branch May 23, 2026 14:12
@BrettKinny BrettKinny review requested due to automatic review settings May 23, 2026 14:34
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