Skip to content

Intercept Pebble watchapp dictation into the Index Feed#303

Open
Kaysera wants to merge 4 commits into
coredevices:masterfrom
Kaysera:feat/pebble-app-index-feed
Open

Intercept Pebble watchapp dictation into the Index Feed#303
Kaysera wants to merge 4 commits into
coredevices:masterfrom
Kaysera:feat/pebble-app-index-feed

Conversation

@Kaysera

@Kaysera Kaysera commented Jul 21, 2026

Copy link
Copy Markdown

Closes #264

Summary

When dictation audio arrives from a user-selected Pebble watchapp, the phone skips
normal transcription and instead feeds the decoded audio into the same pipeline
phone-mic recordings already use to become Index ring feed items. The watch still
gets its normal end-of-session ack, just with no transcript. Which watchapps are
selected is a user-editable set, not a compile-time constant.

UI

Index Settings (debug section) gains an "Index Feed Watchapps" row showing the
current selection count. Tapping it opens a checkbox dialog of installed watchapps
(from LibPebble.getLocker()); changes save immediately. A watchapp that's since
been uninstalled stays selected instead of dropping out, so switching between debug
and release builds of the same app doesn't require re-picking it. No watch connected
→ empty-state message instead of a blank list.

Design notes

  • PebbleDictationSink lives in :util so :pebble (decoder) and :experimental
    (ring feed) stay sibling modules with no new dependency edge either way.
  • Allowlist starts empty; nothing is intercepted until the user opts in.
  • Decoded PCM is resampled to 16kHz (reusing RingSync's Resampler) before
    ingestion, since the watch's native Speex rate isn't guaranteed to be 16kHz and
    the Ring pipeline expects that format.

Testing

  • ./gradlew :composeApp:assembleDebug + existing unit tests pass.
  • Verified end-to-end on real hardware: Android + a physical Pebble Time 2 running
    a debug build of pebble-index-note (which is a demo app I coded just for the purpose of this PR). Produces a real Index feed item that is later classified by the intent model and audio that can be listened.
  • Verified with local STT + local Index model only; cloud not testable from a dev build (no login).

Known follow-ups

  • No automated test for this path yet (STTRouter intercept branch, or the new
    resample/byte-conversion logic).
  • No guard on decode+write time vs. PEBBLE_FW_TRANSCRIPTION_TIMEOUT (~15s).
  • Cancellation mid-intercept isn't specifically exercised.

AI Usage

Claude has been used to help me understand the codebase and program the feature in a way that is coherent with the existing code. I'm a Python programmer and it's been 5 years since I last touched Kotlin so I have needed some help there. However, the design decisions and structure are mine. If they clash with the app design, are too complex and difficult to maintain, or introduce too much noise, I'm willing to work on this simplifying the feature and aligning it to the app as much as I can.

Kaysera added 4 commits July 21, 2026 18:59
- Drop the now-redundant TARGET_WATCHAPP_UUID seed constant now that
  the allowlist is fully user-editable via the picker; seed defaults
  to an empty set instead.
- STTRouter: guard against empty audio frames and log on divert,
  matching the existing 3-arg transcribe path's conventions.
- Fix styling/consistency nits to match each file's local conventions
  (property/setter ordering in SettingsViewModel, braced if/else in
  Preferences, trailing comma in TranscriptionProvider) and make
  IndexFeedWatchappsDialog public like its sibling dialogs.
- Trim KDoc added by this branch that didn't match the surrounding
  modules' no-class-doc convention.
CLAUDE.md's platform rule requires new audio input sources to conform
to the format the Ring pipeline expects (16kHz, PCM_16BIT, mono, raw)
rather than relying on the pipeline's per-file sample rate parameter.
The watch's native Speex sample rate is whatever the firmware reports
and isn't guaranteed to already be 16kHz, so resample it using the
same Resampler the phone-mic/ring path already uses in RingSync.kt.

Also reword a comment in IndexSettings.kt to avoid the "X, not Y"
phrasing CLAUDE.md's comment guidance flags.
@CLAassistant

CLAassistant commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

[Feature request] Add voice note to Index feed from Pebble Time 2

2 participants