chore(review): J2 — remove dead code left by the route extractions#169
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
_mask_sensitive,_SENSITIVE_FIELDS,_VALIDATION_RULES,_validate_config_updatesroutes/config.py(F1). The dashboard copies had zero callers — no@approute, no import, no test ref._latest_response_for_sessionroutes/tts.py(F3, called by/api/responsethere).import asyncioasyncioalready imported at module level (line 6); the local re-import inside_process_commandwas dead.Back-compat handled
_latest_response_for_sessionis now re-exported fromroutes.ttssocodec_dashboard._latest_response_for_sessionstill resolves for the 15 behavioral tests intest_pwa_response_bridge.py(verified identity-equal).test_response_uses_correlation_helperretargeted to scanroutes/tts.py— it was only still green againstcodec_dashboard.pybecause of the duplicate this PR removes.Test plan
python3.13 -m pytest --ignore=tests/test_skills.py -q→ 2,055 passed, 77 skippedcodec_dashboard._latest_response_for_session is routes.tts._latest_response_for_session✓/api/config,/api/response,/api/command,/api/chat)codec_dashboardnamespacegit diffconfirms only the 3 dead blocks deleted (+9 / −104)ruff check: 0 issues🤖 Generated with Claude Code