Skip to content

feat: live words put the provider first, an End cuts them, and its tail reaches the first summary (live_words_cascade) - #26473

Merged
Nizarius merged 4 commits into
mainfrom
feat/live-words-cascade
Nov 27, 2026
Merged

Nizarius merged 4 commits into
mainfrom
feat/live-words-cascade

Conversation

@Nizarius

Copy link
Copy Markdown
Collaborator

What changed and why

live_words_cascade: one per-account flag store rule (the family of #26348), app and backend, inert for an account its rule does not admit. No rule exists for it. The page of a conversation in progress went separately in #26467; this is the live-words half of the same work.

Builds on vendor_recognizer_on_opened_app; its End parts also need end_open_conversation.

  • Order. Per stretch of audio time the grey live words show the provider's words where it has them and the phone's own recogniser's only where it has none (the reverse of today); stored text still replaces both. The phone's recogniser is not started for an account whose language is multi-language or outside its list. Its phrases are joined into one paragraph instead of one line each, and a line rebuilt from part of its words no longer starts with a space.
  • How long a grey word stays. Until a stored line covers its moment of audio (2 s reach) or, where stored text exists to compare with, until it is five minutes old. This replaces, under the flag, the rule that dropped every live line older than the last stored line minus 10 s. A conversation that has ended keeps the live words of its own time range on its page by the same rule.
  • An End cuts the live words at the End instant (the X-Omi-Ended-At time), per word, for every screen, and the phone tells the display connection ({"type":"end"}), so the provider's line in progress breaks there.
  • The End's tail reaches the first summary. The End request carries live_tail, the words shown for the conversation being ended (at most 600 words). The backend checks and bounds it, keeps it encrypted with the stored End and nowhere else, and adds the words no stored line covers to that conversation's notes prompt, marked as a draft. The count the notes read and the time of its first word are stamped on the conversation; the late-speech rewrite rule takes stored words that land in that stretch to be the same speech, up to that count, and a summary pass still running when that speech lands settles instead of writing the notes again. Speech from before that stretch that lands late counts in full, as before.

Trust boundary, stated plainly. live_tail makes phone-authored text an input to one model prompt for an admitted account. That is a deliberate exception to the rule that client-authored text is display only, which tests/unit/test_client_processing_trust_boundary.py proves for client_processing; that field and that test are untouched. The bounds: only under the flag; a separate request field hidden from the published schema; 600 words / 6,000 characters / 200 lines; control and bracket characters removed; only words that start before the End, at most six hours before it and inside the conversation; dropped wherever stored text exists; never written to a conversation, a recording row or a transcript; one reader (the transcript= argument of the notes prompt). What the notes say (title, summary, the action items they propose) can therefore reflect those words, and so can whatever reads the notes; the discard and wake-word checks, memory extraction and search read the stored transcript alone.

Change note: backend/docs/listen_pusher_pipeline/changes/2026-11-26-live-words-cascade-end-tail-title-at-end.md.

Known limits

  • An End with a tail must reach a backend that has this change: an older one does not take live_tail for part of the app's Finish body and answers 404 where it would have finished the recording. The flag tool's live check refuses to admit accounts before the serving commit includes the key.
  • The stored tail is removed when a later summary pass finds it covered, when the credit is used up, or at the owner's next End with a tail (Ends one to eight days old). There is no timed sweep, so a tail whose speech never lands can stay (encrypted, at most 6,000 characters).
  • A summary pass writes the tail count to the conversation before the notes are written; a grouping pass that had already loaded that conversation loses its commit race once and is retried.
  • A grey word that stored text never covers sits under newer stored lines for up to five minutes, because grey lines are drawn after the transcript.
  • /v4/live-words still needs a load-balancer path rule before a wide ramp (unchanged).

Product invariants affected

  • INV-CAP-1: app/lib/services/capture/capture_controller.dart and capture_composition.dart gain one optional callback that an End calls after it has sealed the open phone file. With live_words_cascade off the callback returns null and the End request is byte-for-byte what it was; capture, upload and receipt handling are unchanged in both modes.
  • INV-MEM-4: backend/utils/conversations/process_conversation.py changes in one argument of the notes prompt builder. Memory intake, consolidation and promotion are untouched; memory extraction reads the stored transcript, never the tail.
  • INV-TASK-2: the same one-argument change. No capture-policy outcome, Candidate path or writer changes; action items the notes propose go through the path they went through before. For an admitted account the notes prompt can contain the tail's words, so a proposed item can come from them.

How it was verified

  • On an iPhone 16 Pro with an Omi pendant against a local prod-parity stack, flags selected through the development override:
    • cascade: twenty minutes of real speech with the provider's words replacing the phone's on screen (local counters: most of the phone recogniser's words replaced, a handful only it had, no recogniser restart);
    • one End pressed mid-speech: every live line left the list at the End instant, the display stream logged its line break at the same moment, the server stored the tail and the summary pass read the uncovered part;
  • On the local stack with a probe and fresh accounts (live_tail sent with an End, then the same speech uploaded): the first summary held facts that existed only in the tail, the stored transcript held only the batch text, and the landing 6 s later left the summary as it was (no rewrite). The same run without a tail wrote a second summary.
  • Backend: the changed and neighbouring test files one file per process; backend/scripts/typecheck.sh; scan_async_blockers.py.
  • The phone and stack runs above were made before this branch was rebased onto Re-cut native Finish summary matching and natural deadline scheduling #25992, which moved the grouping pass's planning loop into _plan_projection; the tail credit was carried into it unchanged and the backend tests were run again afterwards.
  • App: flutter test on the live-preview, unit, widget, page and provider folders; dart analyze lib no errors.

Not verified: Home's Listening row, the Listening page and the next conversation right after an End with speech continuing (the test phone was restarted seconds after the End); the five-minute rule, the joined paragraph and the indent fix on a phone's screen (unit tests only); a language outside the phone recogniser's list on a phone; a landing that brings substantially more than the tail on a stack (unit test only); the per-account form of the flag against a real flag store (the local stack uses the development override).

Tests

  • backend/tests/unit/test_reliability_experiment_live_words_cascade.py (43 cases): per-account switch, payload bounds and plain text, encrypted storage with the End, covered words dropped, transcript never written, the prompt as the only reader, rewrite accounting, the settle rule, removal of stored words, the display line break.
  • app/test/services/live_preview/live_words_cascade_test.dart (46 cases): reversed merge, joined paragraph and spacing, language rule, counters, watchdog, the End cut per word on the inputs of all three screens, a conversation's own time range, the stored-text-or-five-minutes rule, the tail payload and the End request body, the End message on the display connection.

UI evidence

UI-Evidence: none -- the grey live words keep the look merged in #26394; what changes is which words are listed and for how long (asserted in live_words_cascade_test.dart), and the screenshots taken on the test phone show real speech, so they are not published.

Failure class (fixes)

Failure-Class: none

Line-Count-Exception: app/lib/backend/http/api/conversations.dart | 1780 -> 1787 | one optional field on the End request beside the header it travels with
Line-Count-Exception: app/lib/pages/conversation_detail/page.dart | 1874 -> 1900 | the flag-gated branch that picks a conversation's live words by its time range, inside the function that already picks them
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 5138 -> 5149 | one optional callback an End calls after sealing the open phone file
Line-Count-Exception: backend/routers/conversations.py | 3358 -> 3365 | passing the optional tail to the End's stored cut
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3614 -> 3622 | one argument of the notes prompt builder and its comment
Line-Count-Exception: backend/utils/conversations/v3/service.py | 2013 -> 2051 | the tail credit beside the rewrite rule it adjusts and the tail read beside the notes call it feeds

🤖 Generated with Claude Code

Nizarius and others added 4 commits November 26, 2026 20:45
…il reaches the first summary (live_words_cascade)

Per-account flag store rule, off by default; needs vendor_recognizer_on_opened_app, and
end_open_conversation for the End parts.

App: the merged live words show the provider's words where it has them and the phone's own
recogniser's only where it has none; its phrases are one paragraph; a grey word stays until a
stored line covers its moment or it is five minutes old, on ended conversations too; an End cuts
the list at the End instant per word, tells the display connection, and sends the words shown for
the ended conversation with the End request (live_tail).

Backend: /v4/live-words starts a new display line where the phone marks an End. live_tail is
checked, bounded and kept encrypted with the stored End only; the notes prompt of the conversation
that End closed reads the words no stored line covers; the count is stamped before the notes are
written, the late-speech rewrite rule counts new stored words beyond it, and a summary pass still
running when that speech lands settles instead of writing the notes again.

A deliberate, bounded exception to client-authored text being display only: for an admitted
account phone-authored words reach one model prompt. client_processing and its proof are untouched.

Failure-Class: none
An End that carries a tail is still the app's Finish body, so it takes the path it took without one.
The tail's credit applies only to stored words that land in the stretch the tail covered. A payload
that cannot be read or stored costs the tail, never the End, on the server and in the app. Old tails
are cleared over a week of Ends, and a repeated End request leaves none behind.

Failure-Class: none
…ts flag)

Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@Nizarius
Nizarius merged commit bda61db into main Nov 27, 2026
70 checks passed
@Nizarius
Nizarius deleted the feat/live-words-cascade branch November 27, 2026 02:55
Git-on-my-level added a commit that referenced this pull request Nov 27, 2026
Brings in #26473 (live_words_cascade) and #26431. Conflicts kept both sides:
- api/conversations.dart, capture_controller.dart: the End request takes both
  finishCut (X-Omi-Finish-Cut) and liveTail (live_tail body field).
- conversations_v3_processing.settle_processing: the SLI's update dict and
  eligible_after check keep the cascade's absorbed-landing covers_through.
- v3/service.py: import both finish_home_sli and live_tail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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