Skip to content

chore(review): J2 — remove dead code left by the route extractions#169

Merged
AVADSA25 merged 1 commit into
mainfrom
review-fixes-2
May 31, 2026
Merged

chore(review): J2 — remove dead code left by the route extractions#169
AVADSA25 merged 1 commit into
mainfrom
review-fixes-2

Conversation

@AVADSA25
Copy link
Copy Markdown
Owner

Summary

Pure-hygiene companion to #168. The dead-code review found three zombie blocks in codec_dashboard.py — code whose live versions moved into route modules during the extraction series, but whose original copies were never deleted. No behavior change.

codec_dashboard.py: 1,201 → 1,104 LOC (−97).

Removed

Block Lines Why dead
_mask_sensitive, _SENSITIVE_FIELDS, _VALIDATION_RULES, _validate_config_updates 445–504 Live copies in routes/config.py (F1). The dashboard copies had zero callers — no @app route, no import, no test ref.
_latest_response_for_session 515–556 Exact duplicate of the live copy in routes/tts.py (F3, called by /api/response there).
shadowed import asyncio 628 asyncio already imported at module level (line 6); the local re-import inside _process_command was dead.

Back-compat handled

  • _latest_response_for_session is now re-exported from routes.tts so codec_dashboard._latest_response_for_session still resolves for the 15 behavioral tests in test_pwa_response_bridge.py (verified identity-equal).
  • test_response_uses_correlation_helper retargeted to scan routes/tts.py — it was only still green against codec_dashboard.py because of the duplicate this PR removes.

Test plan

  • python3.13 -m pytest --ignore=tests/test_skills.py -q2,055 passed, 77 skipped
  • codec_dashboard._latest_response_for_session is routes.tts._latest_response_for_session
  • All 127 routes still registered (incl. /api/config, /api/response, /api/command, /api/chat)
  • The 4 config symbols are gone from the codec_dashboard namespace
  • git diff confirms only the 3 dead blocks deleted (+9 / −104)
  • ruff check: 0 issues

Branches off main (post-#167); independent of #168 (different regions of codec_dashboard.py) — clean merge in either order.

🤖 Generated with Claude Code

codec_dashboard.py: 1,201 → 1,104 LOC (-97). Pure hygiene, no behavior change.

Three zombie blocks whose live versions moved to route modules but whose
codec_dashboard copies were never deleted (surfaced by the dead-code review):

1. Config helpers (445-504): _mask_sensitive, _SENSITIVE_FIELDS,
   _VALIDATION_RULES, _validate_config_updates — the live copies are in
   routes/config.py (F1/SR-50). The dashboard copies had ZERO callers
   (no @app route, no import, no test reference).

2. _latest_response_for_session (515-556) — exact duplicate of the live copy
   in routes/tts.py (F3/SR-52, called by /api/response there). Removed the
   dup; re-exported `from routes.tts import _latest_response_for_session` so
   codec_dashboard._latest_response_for_session keeps resolving for the
   behavioral tests in test_pwa_response_bridge.py.

3. Shadowed `import asyncio` (628) inside _process_command — asyncio is
   already imported at module level (line 6); the local re-import was dead.

Test surface:
  - test_pwa_response_bridge::test_response_uses_correlation_helper retargeted
    to scan routes/tts.py (where /api/response + the helper actually live now);
    it was only still passing against codec_dashboard.py because of the
    duplicate this PR removes.

Verified: codec_dashboard._latest_response_for_session is routes.tts.
_latest_response_for_session (identity-equal); all 127 routes still registered;
the 4 removed config symbols are gone from the codec_dashboard namespace.

Full suite: 2,055 passed / 77 skipped. ruff clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AVADSA25 AVADSA25 merged commit 10df5e3 into main May 31, 2026
1 check passed
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.

2 participants