Repository navigation
fix(backend): make the meeting Chat receipt a durable reconciled projection - #11888
Merged
Git-on-my-level merged 2 commits intoAug 20, 2026
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
…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]>
…e 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]>
Git-on-my-level
force-pushed
the
agent/m4-air-codex-sol/meeting-receipt-unification
branch
from
August 20, 2026 05:12
d2cbc7c to
7d74f6b
Compare
Git-on-my-level
deleted the
agent/m4-air-codex-sol/meeting-receipt-unification
branch
August 20, 2026 05:34
Git-on-my-level
added a commit
that referenced
this pull request
Aug 20, 2026
…listing it (#11946) 33 backend test files stub `utils.conversations.*` with hand-maintained lists of module names, for a package holding 25 submodules; each file names only the few it happens to need. #11888 added `utils/conversations/meeting_receipt.py` and imported it from `routers/conversations.py`, and two of those suites failed in CI at *collection* with ModuleNotFoundError - which reads as a product bug rather than a stale fixture, and which the module's author hits in CI rather than the fixture's owner hitting it locally. FC-hand-listed-test-isolation-membership already describes this exactly, and prescribes the cure: derive membership from the source signal, union it with the explicit list so omission is not an opt-out, and prove the derivation with an adopter deliberately absent from that list. Its canonical_prevention_artifact named only the Swift runner; the backend carried the same class with no guard. Add `package_submodule_stubs`, which enumerates a package's real submodules from disk - never importing them, so no package side effect runs - and unions `extra`. It resolves the directory relative to the backend root rather than through `importlib.util.find_spec`, because inside a `stub_modules` block the package is already a stub whose `__spec__` is None, so spec lookup would report the fake. Three properties matter and are covered by tests. Private `_`-prefixed modules are included: a router can `from pkg._private import X`, which is the same omission bug. Enumeration recurses, because a stubbed sub-package carries an empty `__path__` and would otherwise block `from pkg.child.leaf import X` from resolving. And `utils.conversations` has no `__init__.py`, so a package is detected by containing modules rather than by that file. Adopt it in the two suites that actually broke. Verified by adding a module to the package and importing it dotted from the router: 10 errors before, 10 passed after. The import form matters - `from pkg import new` resolves through the stubbed parent's __getattr__ and does not reproduce the failure. The remaining ~31 hand-listed suites are untouched and remain follow-up work. Failure-Class: FC-hand-listed-test-isolation-membership Co-authored-by: Claude Opus 5 <[email protected]>
This branch was successfully deployed
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.
The incident
A 28m40s Google Meet call on 2026-08-19 (
06542b24-ddfe-5dfb-810a-4c57ff407b98, 15:00:52–15:29:32 UTC) produced a correct summary but no meeting-notes card in Chat.Everything upstream of the receipt worked, and this was measured rather than assumed:
transcription_sessionsshows the ambient session closing onmeeting_startedat 15:00:52, aconversationRole=meetingsession running to 15:29:32, closing onmeeting_ended, strategylocal_segments.conversation_role=meeting,conversation_finalization_reason=meeting_ended,source=desktop,status=completed.is_meeting_treatment_eligibleagainst the real record returns True:duration_s=1720.0(needs ≥300),dedup_speech_s=1719.8(needs ≥60).Chat received only a notification-journal row, not a
conversationLinkreceipt. Two earlier meetings the same day did get receipts — and both were 1m24s and 1m52s, i.e. below the ≥5 min bar, so the behaviour had inverted.Which link dropped the receipt is not determinable from the data. That is the defect this PR addresses.
Why it happened
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:
routers/developer.py(×2),utils/conversations/process_conversation.py,utils/conversations/finalizer.py,utils/task_intelligence/proactive_engine.py#11836 was already one bug in exactly that seam — a snapshot that answered before finalization and therefore carried the default
false. It fixed one caller. This is the next instance, and production could not attribute it either.The change
Compute the verdict once, persist it with its inputs, and reconcile the receipt instead of emitting it as a one-shot event.
conversation_finalization_jobsbecomes the durable receipt authority — no competing collection. The five call sites read the stored verdict.capture:{conversation_id}continuity key. This also covers a v1 client, which deliberately leavesconversationLinkintents pending and previously had nothing to retry it.persist_desktop_meeting_arrivaladapter is removed. Its test now proves the end-to-end contract: one eligible meeting yields exactly oneconversationLinkreceipt; ambient and rotation yield none.Rollout
MEETING_RECEIPT_RECONCILER_ENABLEDdefaultsfalse, declared on bothbackend-listenand the Cloud Runbackendservice — they co-host this code path viaPOST /v1/conversations/{id}/reprocess. Declaring it on only one would give a v2 receipt on capture and a legacy path on regenerate, which reads as nondeterminism rather than a config gap.Tests
Per-file, all green (211 total across the touched suites):
test_meeting_treatment.pytest_meeting_receipt_runtime_flag.pytest_conversation_finalization_jobs.pytest_conversation_finalization.pytest_chat_first_proactive_engine.pytest_chat_first_proactive_router.pytest_chat_first_blocks.pytest_developer_from_segments_idempotency.pytest_listen_finalization_cloud_tasks.pytest_stale_processing_periodic_scheduling.pyThere is pre-existing test-order pollution in the chat-first suites: base
091a65bef4fails 14 tests when those files are run in one process. On this branch that combined run fails 0.Deliberately out of scope
Client-side simplification (the desktop should stop gating Chat arrival at all) and the duplicate local session rows — every meeting currently has a shadow
ambientrow sharing itsbackendId. Also the two detection workstreams (tier-2 mic detection, idle rotation): those are detection problems and this is a delivery problem, and the project already ruled telemetry-first on one and "must not become a second rotation authority" on the other.Failure-Class: FC-durable-terminal-projection
Line-Count-Exception: backend/database/conversation_finalization_jobs.py | 1403 -> 1729 | The receipt is deliberately stored on the finalization job rather than in a competing collection, so the durable verdict, its reason, its measured inputs, and the reconciliation query belong to this module's existing transactional ownership. Splitting it would separate the receipt from the transaction that makes it authoritative, which is the property the change exists to establish.
Line-Count-Exception: backend/routers/developer.py | 2115 -> 2126 | +11 lines routing the from-segments path through the shared receipt service so the cloud and local-segments paths write exactly one receipt. No new responsibility is added to this router; the recomputation it previously did is removed.