Files
Tommi Kyntola 1ea27f1eec Dictate op: one recording aimed at one pane
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.
2026-08-17 16:46:42 +03:00
..

ai/

Curated, AI-friendly context for this repository. Treat it as ground truth on the same footing as code — when a fact here disagrees with the code, the code wins and the file gets fixed.

Purpose

Reduce the cost of reconstructing dais-specific context every agent session. Only facts that are hard to infer from the source or the other .md files belong here: platform quirks discovered in field trials, invariants whose violation fails silently, distinctions that are easy to confuse. Nothing that a quick read of the code already states.

How content gets added

  • Small, human-verified chunks — checked against reality before landing.
  • Opportunistic: when a discovery during normal work would have saved an hour had it been written down, it goes here.
  • Code wins on conflict; stale entries get fixed or deleted.

Layout

  • glossary.md — one line per term, TERM :: definition. Grep-friendly.
  • where-to-look.md — task :: path # note pointers. Grep-friendly.
  • gotchas.md — fact :: detail lines; the platform/field-trial knowledge this project paid for. Read before touching audio, tmux, or delivery code.