Repository navigation
fix(home): show a held sync piece as Processing on legacy Home - #25723
Merged
Merged
Conversation
A batch-only live capture can stay open for a long time when speech never pauses. Its phone-WAL sync piece already has speech and a server-minimum title, and its notes wait on the quiet hold or the live bridge. The settling hold hid every completed server-minimum row until two hours after finished_at. A growing piece moves finished_at forward, so legacy Home showed neither the piece nor the live row. On the default legacy Home list, for an owner who is not a v3 owner, a kept legacy-layer piece with content whose hold is held, or whose bridge names a live target, now lists as writing_notes. Every other reader, filtered views, v3 owners and recording/v3_derived rows keep the previous behavior. Filler, discarded, blocked, below-floor and merged pieces stay hidden. The wait counts from the last content arrival and ends at the settling bound. Failure-Class: FC-provisional-home-content-published-as-final
…iting notes A standalone run leaves sync_bridge_pending in place, so a piece whose summary already landed could still match held_for_notes and flip from ready to writing_notes for up to two hours. Summary receipts now disqualify it. Tests cover that case, a held piece leaving Home once merged, and the v3-gate Redis-miss window. Failure-Class: FC-provisional-home-content-published-as-final
Git-on-my-level
added a commit
that referenced
this pull request
Nov 18, 2026
Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Prod, 2026-11-18. A batch-only live capture stayed
in_progressfor over 30 minutes because speech never paused for 120 s. Its phone-WAL sync piece already had speech and a server-minimum title. Its notes were held:sync_processing_hold.held=True, andsync_bridge_pendingnamed the open live row.is_settling_fragmenthides every completed server-minimum row until two hours afterfinished_at. A growing piece keeps movingfinished_at, so on the legacy Home list the piece stays hidden for as long as the capture lasts. The live row is not listed either, so legacy Home (App Store 1.0.592 and older, Android) shows neither row.Scope: legacy Home only. v3 owners (
conversations_v3_enabled(uid)) and v3-layer rows (recording,v3_derived) keep their current behavior.fragment_visibility.held_for_notescovers a completed legacy-layer row whose quiet hold isheldor whose live bridge names a target, with intake'ssync_relevance='keep'andhas_content.keepmeans the deterministic rules did not classify the piece as filler. It does not prove real speech. The slim list select has no word or speech-seconds field for sync rows (full_snapshotexists only after a full run), and this module never treats duration as evidence.summary_output_present/summary_completed_at),recordingandv3_derivedrows never qualify. A standalone run leavessync_bridge_pendingin place, and only assignment pops it.sync_processing_hold.last_content_at(falling back tofinished_at) and ends atSETTLING_MAX_HOLD_SECONDS.show_held, default off):is_settling_fragmenttakesshow_held, andis_visible_conversationand the list collectors thread it through.home_step.classify/projectreturnwriting_notesfor the piece only withshow_held.GET /v1/conversationssetsshow_held, and only for the default Home view whenconversations_v3_enabled(uid)is false. That is the gate/v1/conversations/liveuses to tell the app it is a v3 account.capable_cached/client_seen_cachedfail closed and cacheFalsefor 120 s (READ_CACHE_SECONDS/SEEN_CACHE_SECONDS). For that window a v3 owner getsshow_heldon./v1/conversations/livereads the same gate and returnsv3:false, so the app shows legacy Home for that window too. Tested.sync_processing_hold.sync_bridge_pending,sync_relevanceandhas_contentwere already selected.SETTLING_FIELDSand the other projections are unchanged. No new document reads.phase_shadow.compare('settling_hold')and('home_visibility')will count held pieces on the legacy Home list as mismatches against the phase model, which still reads them as waiting.The 10-minute
sync_bridge_pendingwindow is unchanged.get_live_conversationandlifecycle_loopare untouched.Several pieces for one live row
All are listed. When the live row closes, the bridge merges every unprocessed piece into it (
_finish_pending_live_bridge), so they end as one conversation. Released Home clients already fold everytranscribing/writing_notesrow of a day into one Processing row (home_rows.dartfoldProcessingRuns; 1.0.593 =bc05bc952dhas the same code).Collapsing on the server would hide speech whenever the bridge rejects a piece's overlap. It would also make per-row visibility depend on neighbouring rows.
Not in this PR: notes before the live row closes
Releasing a held piece's notes before its live target closes is not duplicate-safe:
_finish_pending_live_bridgereturns it unchanged whenalready_processedandSYNC_BRIDGE_CONTAINED_DONOR_MERGE_ENABLEDisoff, which is prod (deploy/runtime_env/_base.yaml).on, a piece that only partly overlaps the target is refused.assignment.pyprocessed_ids/protected_donors).test_pending_bridge_preserves_an_independently_enriched_donorandtest_off_refuses_contained_processed_donor_before_any_target_read.The live row's own transcript would then make a second Home row. The smallest safe follow-up is provisional early notes: no derived effects, and a receipt
already_processedignores, so the bridge still absorbs the piece at seal.Verification
tests/unit/test_home_held_sync_piece.py, 26 cases. They cover:recording/v3_derivedrows never qualifying;summary_completed_atorsummary_output_present) withtitle_provenance=server_minimumand a stale bridge target readingready;deleted+sync_merged_into);GET /v1/conversationsroute over the listing fake, on the indexed slim projection (one piece is held by the quiet hold alone, so the projection must carrysync_processing_hold):writing_notes, with the filler piece and thein_progresslive row excluded;?statuses=completedis unchanged;recording=Truerow sees only the derived row.show_held=False) gives the same result as main for every row.database/conversations.py, so the selector picks 1,823 files and CI runs them. Locally, 110 files that touch these symbols or the query registry passed (bash test.sh, exit 0).classifymonkeypatches, the query-shape registry needingshow_heldclassified, and a strict-fake projection. Fixes:projectpassesshow_heldonly when it is set;show_heldis registered as post-read only;sync_processing_hold, not the sharedSETTLING_FIELDS;_collect_cursor_conversation_pagedigest is re-pinned (pass-through kwarg, same query).backend/scripts/typecheck.sh: 0 errors withNODE_OPTIONS=--max-old-space-size=8192. The pre-push copy hits the Node heap limit (exit 241) while running beside the other gates, so the push skipped it. CI runs it.Deploy: API backend. Rollback: revert this PR.
Line-Count-Exception: backend/database/conversations.py | 5245 -> 5257 | show_held threaded beside capture_only through the existing list collectors
Line-Count-Exception: backend/routers/conversations.py | 2902 -> 2909 | default-Home and v3-owner gate for show_held in the existing list route
Product invariants affected
none
Failure-Class: FC-provisional-home-content-published-as-final
🤖 Generated with Claude Code