Skip to content

fix(desktop): keep waiting for the finalization projection before notifying - #11836

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/meeting-completion-projection-wait
Aug 19, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/meeting-completion-projection-wait

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

What and why

#11832 threaded meetingTreatmentEligible into postMeetingCompletionIfReady and returned early whenever it was non-nil:

if let meetingTreatmentEligible {
    guard meetingTreatmentEligible else { return }
    scheduleMeetingCompletionNotification(conversationID: conversationID)
    return                                    // skips the projection wait
}
guard await waitForFinalizationProjectionIfNeeded(...) else { return }

uploadLocalSegments always returns a non-nil value, so on the local-fallback recovery path the new branch always won and waitForFinalizationProjectionIfNeeded never ran.

That wait is what guarantees the backend has projected the conversation before the user is told it is ready. Skipping it can schedule a meeting-completion notification that opens an unhydrated conversation — the same class of failure #11832 set out to fix.

This gates on eligibility without discarding the wait. A known-ineligible finalization (short or mostly silent call) still returns early and never notifies; an eligible one waits for the projection exactly as it did before #11832.

Failure class

Failure-Class: none

Verification

  • testRecoverPendingFinalizationsProcessesExhaustedBackendBoundLocalFallback (desktop/macos/Desktop/Tests/TranscriptionFinalizationStateMachineTests.swift:606) asserts the /v1/conversations/{id}/finalization request on this exact path. It predates #11832, passed on main before it, and failed in CI afterwards with ("[]") is not equal to ("["/v1/conversations/local-fallback-conversation/finalization"]"). It is the guard for this fix; no new test is added because the existing one already covers the boundary.
  • make preflight — see CI.
  • The Swift suite could not be run locally: desktop/macos/scripts/run-swift-ci.sh requires Xcode 16.4 and rejects the installed Xcode 26.2 regardless of OMI_SWIFT_CI_XCODE_APP. CI is the verifier for this change.

Context

#11832 was merged while its 45-minute Desktop Swift Static & Test Contracts job was still running; the failure surfaced after the merge. Everything else in that PR — the Telegram catalog fix and the finalization-time meeting-treatment gate — passed CI and is unaffected by this change.

🤖 Generated with Claude Code

Review in cubic

#11832 threaded meetingTreatmentEligible into postMeetingCompletionIfReady
and returned early whenever it was non-nil. uploadLocalSegments always
returns a non-nil value, so the local-fallback recovery path stopped
calling waitForFinalizationProjectionIfNeeded.

The threaded value cannot be authoritative: it comes from the
from-segments response, which returns before the backend finalizes the
conversation, so it carries the default false rather than a decided
verdict. That both suppressed the notification and skipped the real
check.

waitForFinalizationProjectionIfNeeded already reads the finalization
projection, applies the same rule via shouldWakeMeetingCompletion, and
fails closed on 404 so a short meeting cannot bypass backend policy.
Defer to it unconditionally: the >=5 min gate stays enforced, and the
wake waits for the projection as it did before #11832.

testRecoverPendingFinalizationsProcessesExhaustedBackendBoundLocalFallback
already asserts the /finalization request on this path and caught the
regression in CI; it is the guard for this fix.

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
@Git-on-my-level
Git-on-my-level force-pushed the fix/meeting-completion-projection-wait branch from cddbe29 to d57ad9d Compare August 19, 2026 02:19
@Git-on-my-level
Git-on-my-level merged commit 3599aab into main Aug 19, 2026
27 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/meeting-completion-projection-wait branch August 19, 2026 04:09
Git-on-my-level added a commit that referenced this pull request Aug 19, 2026
…ibility policy

Integrates with the meeting-detection track (#11832, #11836), merged into this
branch from main.

conversation_role is open-time durable identity, not the treatment decision.
Enrichment gated on the role alone would spend a Google Calendar read, a
screen-activity query, and a stored-meetings row on a 90-second call that the
authoritative finalization policy has already ruled out — and that row would
then be visible to our own time-overlap resolver for unrelated conversations in
the same window. Desktop meeting-role conversations now defer to
is_meeting_treatment_eligible; every other source keeps its prior behaviour.

The existing wiring fixture was a zero-segment 'meeting', which the gate
correctly skips, so it now carries qualifying speech. That is a fixture
correction, not a weakened assertion: a silent conversation was never eligible
for meeting treatment.

Also folds the bare-meeting-code title pattern ('Meet - amc-iajq-asx') into
ConferencingApps as browserCallTitlePattern/isBrowserCallTitle. #11832
consolidated two divergent conferencing catalogs; leaving this pattern in the
extractor would have made a third.

Failure-Class: none

Verified per-file: enrichment_wiring 10, meeting_context_resolution 28,
meeting_treatment 4, screen_activity_identity 19, notes_v2 5,
usage_context 33, action_item_date_validation 26, structure_timezone 16.
All four contract surfaces regenerate with no diff after the merge.

Co-Authored-By: Claude Opus 5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Aug 20, 2026
…ection

A 28m40s Google Meet call produced a correct summary but no meeting-notes card
in Chat. Detection, rotation and finalization all worked: the conversation
carries conversation_role=meeting, conversation_finalization_reason=meeting_ended,
and is_meeting_treatment_eligible returns True against the real record
(duration 1720s, deduplicated speech 1719.8s). The receipt simply never arrived,
and nothing in the system recorded why.

The cause is structural rather than a single bad line. Meeting-treatment
eligibility was recomputed at five call sites, against four different in-memory
snapshots, at four different lifecycle moments, and the verdict was never
persisted. #11836 was already one bug in that seam - a snapshot that answered
before finalization and returned the default false. It fixed one caller. This
was the next instance, and production could not attribute it either.

Record the verdict once on the durable finalization job, with its reason and its
measured inputs, and reconcile the receipt instead of emitting it as a one-shot
event:

- conversation_finalization_jobs becomes the receipt authority; the five call
  sites read the stored verdict rather than recomputing it.
- One shared post-finalization receipt service covers both the cloud path and
  the local-segments (from-segments) path, so the receipt is written exactly
  once for either.
- Intent persistence is distinguished from kernel materialization, which is the
  seam the receipt exists to close.
- Reconciliation rides the existing five-minute finalization sweep - eligible
  and unmaterialized receipts are re-driven, idempotent through the existing
  capture:{conversation_id} continuity key. This also covers a v1 client, which
  deliberately leaves conversationLink intents pending and previously had
  nothing to retry it.
- The obsolete persist_desktop_meeting_arrival adapter is removed; its test now
  proves the end-to-end contract instead - one eligible meeting yields exactly
  one conversationLink receipt, while ambient and rotation yield none.

MEETING_RECEIPT_RECONCILER_ENABLED defaults false and is declared on both
backend-listen and the Cloud Run backend service, which co-host this code path
via POST /v1/conversations/{id}/reprocess.

Client-side simplification and the duplicate local session rows are deliberately
left as follow-ups, as are the separate detection workstreams (tier-2 mic
detection, idle rotation) - those are detection problems and this is a delivery
problem.

Failure-Class: FC-durable-terminal-projection

Co-Authored-By: Claude Opus 5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Aug 20, 2026
…ection (#11888)

* fix(backend): make the meeting Chat receipt a durable reconciled projection

A 28m40s Google Meet call produced a correct summary but no meeting-notes card
in Chat. Detection, rotation and finalization all worked: the conversation
carries conversation_role=meeting, conversation_finalization_reason=meeting_ended,
and is_meeting_treatment_eligible returns True against the real record
(duration 1720s, deduplicated speech 1719.8s). The receipt simply never arrived,
and nothing in the system recorded why.

The cause is structural rather than a single bad line. Meeting-treatment
eligibility was recomputed at five call sites, against four different in-memory
snapshots, at four different lifecycle moments, and the verdict was never
persisted. #11836 was already one bug in that seam - a snapshot that answered
before finalization and returned the default false. It fixed one caller. This
was the next instance, and production could not attribute it either.

Record the verdict once on the durable finalization job, with its reason and its
measured inputs, and reconcile the receipt instead of emitting it as a one-shot
event:

- conversation_finalization_jobs becomes the receipt authority; the five call
  sites read the stored verdict rather than recomputing it.
- One shared post-finalization receipt service covers both the cloud path and
  the local-segments (from-segments) path, so the receipt is written exactly
  once for either.
- Intent persistence is distinguished from kernel materialization, which is the
  seam the receipt exists to close.
- Reconciliation rides the existing five-minute finalization sweep - eligible
  and unmaterialized receipts are re-driven, idempotent through the existing
  capture:{conversation_id} continuity key. This also covers a v1 client, which
  deliberately leaves conversationLink intents pending and previously had
  nothing to retry it.
- The obsolete persist_desktop_meeting_arrival adapter is removed; its test now
  proves the end-to-end contract instead - one eligible meeting yields exactly
  one conversationLink receipt, while ambient and rotation yield none.

MEETING_RECEIPT_RECONCILER_ENABLED defaults false and is declared on both
backend-listen and the Cloud Run backend service, which co-host this code path
via POST /v1/conversations/{id}/reprocess.

Client-side simplification and the duplicate local session rows are deliberately
left as follow-ups, as are the separate detection workstreams (tier-2 mic
detection, idle rotation) - those are detection problems and this is a delivery
problem.

Failure-Class: FC-durable-terminal-projection

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(backend): teach two hand-listed test fixtures about the new module and flag

CI surfaced two lists that did not learn about this change.

The conversation-events and conversation-search suites stub their dependencies
through a hand-maintained dict of module names. routers/conversations.py now
imports utils.conversations.meeting_receipt, which was absent from that dict, so
both suites failed at collection with ModuleNotFoundError rather than any
behavioural error. This is the drift FC-hand-listed-test-isolation-membership
describes: omission is not an opt-out.

The runtime-env validator builds a synthetic Cloud Run state to assert against
the real manifest contract. That fixture did not declare
MEETING_RECEIPT_RECONCILER_ENABLED, so the validator correctly reported it
missing on cloud_run/backend - and the extra error also perturbed two unrelated
assertions that count errors. Add a with_meeting_receipt_reconciler_env helper
modelled on the existing with_conversation_notes_v2_env sibling, scoped to the
backend service only, and wire it into the fixture composition chain.

The flag itself was already correctly declared on both backend-listen and the
Cloud Run backend service; no deployment configuration changed, and no assertion
was weakened.

Failure-Class: FC-hand-listed-test-isolation-membership

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 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