Driving, with the airc viewer on the car screen: an agent's input box is
visible and what you want to give it is a PROMPT, a sentence, not a keypress.
airc's buttons cover keypresses well and the Android app has IME dictation, but
the car browser has no dictation at all — so today a prompt means the laptop
keyboard. dais already transcribes locally and pastes into a tmux pane; what
was missing is a way to say "record now, and deliver it to the pane I am
looking at" without touching the laptop.
{"op":"dictate","action":"toggle","pane":"%19"}
start | stop | discard | toggle, the last resolved against the CURRENT mode so
a client that missed a poll — or a latch someone started at the desk — cannot
be inverted by a stale button. stop TRANSCRIBES and discard throws the
recording away, which is the existing latch-vs-voice-off rule and what makes a
remote ✕ useful: a misheard prompt can be dropped instead of typed. Omit the
pane and it is F10 over the socket.
The pane is an ephemeral override (:dictate-target), never a slot. transition!
persists on any :targets/:active-slot change, so writing a slot would churn
targets.edn and the digits addressed by voice; a reserved slot is worse, since
load-targets honors the overlay only while (get targets active-slot) is truthy
and a dangling active-slot silently discards every persisted target on the next
start. save-targets! writes only :targets/:active-slot, so nothing a car-side
tap aims at can survive a restart — asserted by a test rather than by new code.
Two orderings are load-bearing, and both are the opposite of the obvious one:
- The override is set in the same transition as the mode change and AFTER it.
Every mic OPEN drops a pending override (drop-override), which is exactly
what keeps a forgotten one from stealing a later utterance — so setting the
aim first would erase it.
- It is consumed after dispatch, not before, and only when the plan actually
DELIVERED. :armed is cleared before dispatch for the opposite reason; copying
that placement here would deliver to the slot instead. An utterance the
confidence gate refused ("say again?") keeps its aim, or the repeat lands in
the wrong pane.
No TTL. The plan sketched one; the rule set turned out not to need a clock,
because a mic open, a voice-off and any explicit target op all drop the aim,
and the only utterance that can reach a pending override is the one it was set
for. Dropping the TTL also removes the failure mode where an aim expires
mid-sentence.
state gains the precedence split the feature needs: active-target is where an
UTTERANCE goes (override, else slot) and is the single point everything the
router produces reads through; slot-target is the active slot ignoring any
override, and the desk-side router-bypassing paths now use it — the keystroke
bridge behind dais-top's passthrough lock and F11/esc are keys typed by
someone sitting at the machine, aimed at the slot they can see, and must not
follow a recording someone made from the car.
The ear's transcribe-vs-discard decision moves from a hardcoded via string to
ear/transcribing-stops, so the next caller that latches has one obvious place
to register — miss it and recordings vanish silently, which is a bad way to
find out.
The dictation run is now keyed on the delivery LABEL rather than the slot: an
override, a re-pointed slot and two slots naming one pane all have to answer
"same cursor?" correctly, and only the label does.
parse-target-value accepts a bare pane id ("%23"). tmux takes one anywhere a
target-pane goes, it is how airc reports panes, and it is the one spec form
immune to the pane_index renumbering trap — so `dais-ctl target set 3 %19`
starts working as a side effect.
Reporting: dictate_target rides along in state.json, the status query, the
state_changed broadcast and the target-list reply (a UI that missed an event
self-heals on the poll it already runs), and dais-top shows the override on the
target line so the cockpit never claims the slot while speech goes elsewhere.
tools/dais-ctl gains `dictate` with completion, which makes the whole feature
hand-testable without airc.
Also drops the last references to FABLE_PLAN.md, GOAL.md and CODEX_PLAN.md,
deleted in 9353d85: the README reading order, one code comment, and AGENTS.md's
claim that a missing file is normative.
9.2 KiB
Gotchas
fact :: detail. Field-trial knowledge this project paid for — verify against
code/reality before deleting anything here.
pw-record exit code lies :: it exits 1 on SIGINT while still finalizing a valid WAV; success = file exists with body past the 44-byte RIFF header, NEVER the exit code (ear/dais_ear.py _stop_recorder).
parec buffers ~2s without --latency-msec :: chunks then arrive in bursts, VAD processes them in catch-up and speech_start/speech_end timestamps become near-simultaneous lies; keep --latency-msec=50.
bundled Silero is batch-only :: faster_whisper.vad SileroVADModel.call resets h/c per call; StreamingVad drives model.session directly carrying h/c + 64-sample context across chunks; output needs reshape(-1)[0] (shape is (1,), not (1,1)).
whisper hallucinates from near-silence :: "Hello." / "Thank you." with HIGH confidence (no_speech_prob ~0.03 observed) when the audio is a chime or noise burst — confidence gates alone are insufficient.
the daemon can hear itself :: the "Listening" notification chime triggered VAD and transcribed as "Hello!" in trials; startup_mute_ms in the ear AND the suppress-sound notify-send hint both exist for this — do not remove either.
wtype is dead on KWin :: no zwp_virtual_keyboard_manager_v1 (verified 2026-06-10); the focus backend is ydotool/uinput, no compositor protocol involved.
uinput access rides on Steam :: /dev/uinput ACL for the user comes from steam-devices' udev rule (uaccess tag); removing that package silently breaks ydotoold after reboot.
ydotool speaks US-QWERTY :: keycodes map to symbols via the active layout; fi layout garbles : ' " / @ — the user keeps US active for dais; fi support would need clipboard-paste delivery (wl-copy + Ctrl-Shift-V).
tmux display-message cannot validate targets :: it exits 0 and falls back to the current client for unknown targets — pane existence checks must use list-panes -t.
list-panes -t validates the pane but does not filter to it :: the exit code is the real answer (bad index -> "can't find pane: N", exit 1), while the OUTPUT is every pane in the containing window — so -t s:w.0 printing four rows is NOT evidence the check is only window-level. executor/pane-exists? reads the exit code only, which is correct; don't "fix" it after misreading the output.
tmux send-keys "S-Tab" delivers a PLAIN Tab :: shift-tab is its own key NAME (BTab), not a modified Tab, and send-keys exits 0 for the wrong one — so the bug is silent and looks like the app ignoring shift (Claude Code cycles permission modes with shift-tab). executor/chord->tmux special-cases #{"S"}+Tab -> BTab; ydotool needs no special case, its keycodes are literally shift+tab.
per-pane info needs one list-panes -a, not -t :: -t prints the whole containing window (above) and display-message can't validate, so there is no "ask about THIS pane" call — daemon/pane-details makes a single list-panes -a and indexes rows under both spec forms, because a stored target may name the window or index it.
paste-buffer -p brackets even one keystroke :: the keystroke bridge (send op) therefore drops -p — dictation stays bracketed (one deliberate paste), passthrough must look like typing or the target sees a paste per character. Same load-buffer stdin path either way; text still never rides on argv.
passthrough into a :focus target is a feedback loop :: ydotool types into whatever has focus, which during passthrough is dais-top itself — every key would re-enter its own stdin. dais-top refuses the mode and falls back to keylock, and re-checks per chunk because voice can move the active slot mid-pass.
single-line dictation is load-bearing :: Claude Code collapses MULTI-line pastes into "[Pasted text +N lines]"; the router joins transcripts to one line so the text stays visible in the input box.
the space BETWEEN dictated sentences is the daemon's job :: the ear only joins whisper SEGMENTS inside one utterance (" ".join) and single-line TRIMS, so consecutive VAD utterances — separate pastes at the same cursor — used to butt together ("right now.What happens"). A continuing utterance now gets a LEADING space (router/continuation-space) driven by state :dictation-run; leading not trailing, so a submitted prompt carries no stray whitespace. Nothing DELIVERED means the run is untouched: a dry-run, a gated/dropped utterance and a failed paste all leave the box as the last real delivery left it, so they must not open OR close a run.
closing the mic must not close the dictation run :: a latch stop (toggle-record) closes the mic BEFORE its transcript is produced, so a generic "mic not open" reset would kill continuation in :manual-recording entirely — the reset hangs off the deliberate stops only (state/voice-off, mute, toggle-vad's close branch).
a latch stop TRANSCRIBES only for vias listed in ear/transcribing-stops :: ear-message's discard branch is the default ("off means OFF"), so a new caller that opens a latch and stops it with its own via (dictate:stop) gets set_mode off — mic closes, no transcript, no error anywhere. The set is the registry; add the stop via there or the recording vanishes silently.
an ephemeral delivery override is consumed AFTER dispatch, and only if it DELIVERED :: dispatch-plan! reads state/active-target mid-dispatch, so clearing :dictate-target before it (where :armed is cleared, for the opposite reason) sends the utterance to the slot instead. And a confidence-gated / dropped / dry-run utterance must KEEP it, or the repeat lands in the wrong pane — daemon/handle-publish reads the label before dispatch and clears in one swap! gated on delivered?.
the dictate override needs no TTL because a mic open drops it :: every voice path (F9/F10/dais-ctl/voice) opens the mic first, and both toggle-vad and toggle-record drop a pending override in their OPEN branch — so the only utterance that can reach one is the recording it was set for. That is what keeps state/active-target pure (no clock); don't "fix" a stale override with a timestamp, check whether some new path can open the mic without going through those transitions.
kglobalaccel has no key-release events :: push-to-talk is impossible via KDE shortcuts; every hotkey is a stateless toggle and the daemon owns the state.
"a" is a filler word :: in the keypress grammar, control/ctrl+letter pairing must run BEFORE filler removal or "press control a" loses its "a".
KDE/systemd exec env has no user PATH :: node comes from fnm (interactive zsh only) and pixi lives in ~/bin — KDE-bound tools are sh+socat with absolute paths; dais-ctl (node) is NOT safely KDE-bindable; config uses /home/k/bin/pixi absolutely.
testing against the live daemon types into the user's focused window :: default target slot is :focus and the systemd daemon runs LIVE; use a private dry-run daemon (see AGENTS.md) or point a slot at a scratch tmux pane first.
a private test daemon must isolate its DIRS, not just its socket :: with only a socket override it still writes $XDG_RUNTIME_DIR/dais/state.json + the marker files (the live daemon's — the statusline then lies, e.g. a stale dry_run:true) and its shutdown hook DELETES those markers; a targets change would also overwrite ~/.local/state/dais/targets.edn. Set DAIS_RUNTIME_DIR + DAIS_EVENTS_DIR + DAIS_STATE_DIR + DAIS_CONFIG too. Recovery: any op that writes state ({"op":"settings","strategy":"whole-match"} is value-preserving) makes the live daemon reflect itself again.
never pkill the daemon by cmdline :: a private test daemon and the user's systemd unit share clojure.main -m dais.daemon, so pkill -f kills theirs (systemd restarts it, losing session-only settings: enter-mode/strategy/language/dry-run). Match the test instance's own environ/socket instead (recipe in AGENTS.md).
name-based pane targets are only stable on HAND-renamed windows :: tmux automatic-rename is on by default and retitles a window after its foreground command, so scratch:tmux.0 silently stops resolving the moment the pane runs cat (verified 2026-08-17, tmux 3.7b). rename-window clears automatic-rename for that window, which is the only reason the user's app:claude.0 / dais:claude.0 hold — executor/list-all-panes' "stable under reordering" is about pane_index, NOT about the name.
whisper model cache is shared :: ~/.cache/huggingface (shared with ../lausu); warm load ~1s, cold load downloads the model.
picked targets shadow config wholesale :: once any target is picked, ~/.local/state/dais/targets.edn overlays BOTH :targets and :active-slot at startup — editing :targets in config/dais.edn has no effect until that file is deleted. Corollary for code: anything REPORTING targets must read the state atom, never (:targets cfg) — the startup banner did the latter and misreported every picked/released slot on restart until v1.2.0.
:active-slot must always resolve :: load-targets only honors the overlay while (get targets active-slot) is truthy, so any transition that REMOVES a slot (state/release-slot) must move :active-slot in the same step — a dangling one silently discards every persisted target on the next start.
tmux pane_index is positional :: closing a pane renumbers the ones after it, so a stored "s:w.2" target silently starts pointing at a DIFFERENT pane (still alive, still green). A renamed window fails loudly instead (✗); the index shift does not.