Skip to content

fix: chirp stock path uses runtime .snd extension; log every chirp attempt - #13

Merged
sumitake merged 1 commit into
mainfrom
dev/claude/chirp-snd-fix
Aug 4, 2026
Merged

fix: chirp stock path uses runtime .snd extension; log every chirp attempt#13
sumitake merged 1 commit into
mainfrom
dev/claude/chirp-snd-fix

Conversation

@sumitake

@sumitake sumitake commented Aug 4, 2026

Copy link
Copy Markdown
Owner

The v1.5.2 event-start chirp was silently broken: the firmware build converts .wav sound sources to .snd at packaging, so shared/calendar_event_starts.wav never existed at runtime — and /api/audio/play returns 200 before the deferred file-open, swallowing the failure at every layer. Confirmed by operator ear-test matrix (stock .wav silent / uploaded .wav audible / stock .snd audible) plus device storage listings and firmware source audit.

  • CHIRP_STOCK_PATH → .snd (regression test pins the extension)
  • Every chirp attempt now logs at INFO, success included (the bug left zero trace)
  • play_audio docstring + spec + README document the .snd conversion and the deferred-200 caveat, with an explicit correction retracting v1.5.2's wrong audibility claim

Tests: 323.

🤖 Generated with Claude Code

Root cause, confirmed by operator ear-testing plus device storage
forensics: the firmware build pipeline converts .wav SOURCE files to
.snd at packaging time -- runtime filenames under
/ext/apps_assets/shared/sounds/ are .snd, never .wav. Neither the
source tree nor the OpenAPI spec reveals this; only a live
GET /api/storage/list against the actual device does. Compounding it,
POST /api/audio/play returns 200 BEFORE the deferred file open --
playback queues behind a ~100ms amp holdoff, and an open failure at
holdoff-fire is logged device-side only and otherwise swallowed. A
True from play_audio therefore does NOT prove audible playback: a
wrong filename (the original ".wav" CHIRP_STOCK_PATH) was
indistinguishable from a correct one at every layer this codebase
could observe, including the v1.5.2 on-device report's own "chirp
fired" evidence. Operator ear-test matrix: stock .wav -> silent, an
uploaded .wav asset -> audible, stock .snd -> audible.

Fixes:
- CHIRP_STOCK_PATH corrected to "shared/calendar_event_starts.snd",
  with an extensive comment so a future reader doesn't "fix" it back
  to .wav by reading the source tree or the API docs without
  re-checking a live storage listing.
- calendar_countdown/main.py's chirp call site now logs at INFO on
  EVERY attempt, success or failure ("chirp played (%s) -> %s") --
  previously only failures were logged (in client.py), so a
  "successful" (True-returning) attempt left no trace at all; the
  original bug was doubly silent (no sound AND no log line), part of
  why it took storage forensics rather than a log check to find.
- BusyBarClient.play_audio's docstring documents both the .wav->.snd
  conversion and the deferred/swallowed-200 caveat explicitly, with an
  instruction to verify stock filenames against a live storage listing
  before shipping them.
- Spec doc: a "Correction" subsection appended to the v1.5.2 section,
  flagging that its own earlier "chirp's real playback timestamp"
  claim was wrong, with the full root-cause writeup and ear-test
  matrix. calendar_countdown/README.md's chirp note updated to match,
  operator-facing.

Tests: CHIRP_STOCK_PATH.endswith(".snd") pinned directly as a
regression test against this exact bug; caplog-based loop tests
confirm the INFO log fires on both successful and failed chirp
attempts.

TZ=UTC uv run pytest -q: 323 passed (319 before this fix).

Device cleanup: removed the chirp_test app's leftover uploaded test
asset (tone5s.wav, 480044 bytes, under /ext/user_assets/chirp_test)
via DELETE /api/assets/upload?application_name=chirp_test, verified
removed via a fresh /api/storage/list (the app's directory no longer
appears in the listing, and a direct list of that path now returns
400 "directory does not exist" rather than a stale 200). No on-device
verification round performed for the fix itself, per instruction --
the operator's own ear-test of the corrected .snd path is the
authoritative confirmation; a scripted probe could only re-confirm
the same HTTP 200 already shown not to prove audibility.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sumitake
sumitake merged commit b0e3e53 into main Aug 4, 2026
4 checks passed
@sumitake
sumitake deleted the dev/claude/chirp-snd-fix branch August 4, 2026 18:14
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