Skip to content

refactor(cleanup): delete dead codec_keyboard.py duplicate (A-8)#65

Merged
AVADSA25 merged 1 commit into
mainfrom
fix/pr3-a8-delete-codec-keyboard
May 22, 2026
Merged

refactor(cleanup): delete dead codec_keyboard.py duplicate (A-8)#65
AVADSA25 merged 1 commit into
mainfrom
fix/pr3-a8-delete-codec-keyboard

Conversation

@AVADSA25
Copy link
Copy Markdown
Owner

Summary

Closes A-8 (MEDIUM)codec_keyboard.py (398 LOC) was an unused duplicate of codec.py's inline keyboard handling. Verify-first (per the agreed gate for deletions); deleted only after proving it's dead.

Verify-first evidence

  • No production importer — only tests/test_full_product_audit.py + tests/test_transcript.py referenced it.
  • No PM2 entry runs itecosystem.config.js has no codec_keyboard.py script. The live keyboard path is inline in codec.py: on_press@788, on_release@858, keyboard.Listener@919 (the codec process). The line-54 "hotkey" comment refers to codec-dictatecodec_dictate.py.
  • clean_transcript is safedefined in codec_config.py:841; codec_keyboard only re-imported it, and test_transcript.py already fell back to codec_config.

Chose delete (option b), not migrate (option a)

The audit floats option (a) — make codec_keyboard the canonical impl — calling it "cleaner." But that swaps the live, battle-tested core-UX keyboard handler (F13 toggle, F18 voice, wake word, double-tap) for an unused module that's nearly untestable in CI (no real pynput headless). Regression risk on core UX for an aesthetic gain → against "never break working code." Deleting the dead duplicate achieves the audit's goal (kill the confusing fork) with zero production risk.

Changes

  • Deleted codec_keyboard.py (398 LOC).
  • Redirected test_full_product_audit.py::TestKeyboard → asserts codec.py's live handlers + F13 debounce ≥1.0s + that the dead module stays gone.
  • Simplified test_transcript.py to import clean_transcript from codec_config.
  • AGENTS.md §2 + CONTRIBUTING.md: note keyboard handling lives inline in codec.py.

No behavior lost: the overlay_events.jsonl toggle-logging was a codec_keyboard-only feature that was never live (codec.py's handler doesn't write it).

Verification

Full suite 1365 passing, 23 pre-existing failures unchanged (zero new). No skills/ touched → no manifest regen.

Reference: docs/audits/PHASE-1-CODE-QUALITY.md finding A-8.

🤖 Generated with Claude Code

Closes A-8 — codec_keyboard.py (398 LOC) was a duplicate of codec.py's
inline keyboard handling, dead in production.

## Verify-first evidence (no deletion until proven dead)

- No production importer — only tests/test_full_product_audit.py +
  tests/test_transcript.py referenced it.
- No PM2 entry runs it — ecosystem.config.js has no codec_keyboard.py
  script. The live keyboard path is inline in codec.py (on_press@788,
  on_release@858, keyboard.Listener@919) in the `codec` process.
- clean_transcript is DEFINED in codec_config.py:841; codec_keyboard only
  re-imported it.

## Chose delete (option b) over migrate (option a)

Option (a) — make codec_keyboard the canonical impl — would swap the live,
battle-tested core-UX keyboard handler (F13 toggle, F18 voice, wake word,
double-tap) for an unused module that's nearly untestable in CI (no real
pynput headless). That's a regression risk for an aesthetic gain, against
"never break working code." Deleting the dead duplicate achieves the
audit's goal (kill the confusing fork) with zero production risk.

## Changes

- Deleted codec_keyboard.py (398 LOC).
- Redirected test_full_product_audit.py::TestKeyboard to assert codec.py's
  live handlers + F13 debounce >=1.0s + that the dead module stays gone.
- Simplified test_transcript.py to import clean_transcript from codec_config.
- AGENTS.md §2 + CONTRIBUTING.md: note keyboard handling lives inline in
  codec.py now.

Note: the overlay_events.jsonl toggle-logging was a codec_keyboard-only
feature that was never live (codec.py's handler doesn't write it) — no
production behavior lost.

## Verification

Full suite 1365 passing, 23 pre-existing failures unchanged (zero new).
No skills/ touched -> no manifest regen.

Reference: docs/audits/PHASE-1-CODE-QUALITY.md finding A-8.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@AVADSA25 AVADSA25 merged commit faf3bef into main May 22, 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