feat(app): a call still being said lets the brain get ready

A partial transcript that call detection already reads as a request is sent
to the worker as prepare, so the intent judge runs while the speaker talks.
The live round trip now times the earcon and the answer's own sound apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 12:25:15 +09:00
parent 46e4e75d05
commit b88e20134f
6 changed files with 96 additions and 13 deletions

View File

@@ -169,9 +169,14 @@ never takes the voice turn and never goes through the response policy.
`app/src/conversation.rs` runs between the core's events and everything else that reads them (every
event is passed on unchanged). It talks to the core through a small `Voice` interface (answer, cancel
one request, stop all, earcon, ask "addressed", ask "rank"), so the glue is tested with a fake.
one request, stop all, earcon, prepare, ask "addressed", ask "rank"), so the glue is tested with a fake.
- `Chat` and `ReplyText`: chat calls, above.
- `Partial` (getting ready): a partial transcript that call detection already reads as a request
(joined to the speaker's waiting wake word alone, as its final would be; not the wake word alone,
not a stop) is sent to the brain as `prepare(user, text)`, so the brain judges what the call needs
while the speaker is still talking (`voice_worker.spec.md`, `prepare`). Not while an answer runs:
the call may not be taken, and the brain is busy answering.
- `SpeechStart` opens the speaker's utterance; `SpeakingStopped` marks it ending.
- `Final`: a request gets the next id, `ended_at` = arrival minus the final's `wait_ms`, and goes
through call detection. Ignore closes the utterance. Stop stops all speech, runs the policy's stop,
@@ -202,7 +207,8 @@ modes) and every policy rule above with fake times (settling, ordering by end ti
interruption, ranking tie, ranking timeout, stop dropping the queue), and the conversation loop with a
fake voice side (answering and queueing, a busy drop recorded without text, voice stop, addressed yes,
no and timeout, the earcon before each answer, once for a wake word alone, none while busy or when
off, interruption cancelling the right speech, a ranking deciding, end times from
off, partials that read as a call sent to get ready (joined to a waiting wake word, none while
answering), interruption cancelling the right speech, a ranking deciding, end times from
`wait_ms`, and chat: an answer posted as a reply once, per-channel switches, no answers to bots or to
a stop, chat wake words and designated people, a failed answer posting nothing). `tests/worker_protocol.rs` checks an answer spoken under its id and both judgements against
the real Python worker with a fake brain.