Repository navigation
fix(backend): stop projecting ledger-bound capture receipts as partial recordings - #23412
Conversation
…l recordings The committed-capture proof latches coverage='incomplete' when its run ledger evicts runs (32 runs x 30s) or transcript notes overflow 512 — both accounting bounds, not observed loss. Observed loss (missing claims, conflicts) fails the snapshot to None before any envelope exists, so any live capture past ~16 continuous minutes served capture_coverage= 'incomplete' and the app showed a 'Partial recording' chip with zero missing audio. The public projection now downgrades a ledger-bound 'incomplete' (committed proof, complete lifetime, zero conflicts) to 'mapped' and the envelope-overflow stub to 'unknown', at projection time so already-stored rows are repaired too. Sync receipts keep 'incomplete' meaning decoded frames short of the claimed count: real missing audio. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Git-on-my-level
left a comment
There was a problem hiding this comment.
SHIP — Sol / P88, round 1, exact head 6dfe83fd2300c534ef5db5574089abd274aac071 (direct sprint-bus request).
No P0/P1 findings. The read-time change is limited to the committed-proof/complete-lifetime/no-conflict shape and the explicit overflow stub. I traced the producer: missing observed claims or conflicts prevent the committed snapshot, while run eviction and transcript-note limits latch the bound flag. Ordinary sync decoded-frame-loss receipts lack that proof/lifetime shape and remain incomplete; source evidence and capture/transaction behavior are unchanged.
Reviewed the continuous 20-minute producer-to-projection regression, conflicting/incomplete-lifetime rejection cases, overflow abstention, sync-loss preservation and public round-trip tests. Internal receipts remain excluded from response serialization; the generated schema additions are optional. No local test rerun or production-data access in this review.
Code-review verdict only; exact-head CI and lead-owned merge/deploy remain separate gates. No merge performed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6dfe83fd23
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if evidence_field(evidence, 'capability') == 'unknown' and evidence_field(evidence, 'reason') == 'overflow': | ||
| return True |
There was a problem hiding this comment.
Preserve observed-loss overflow receipts
When a sync WAL decodes fewer frames than claimed and its receipt is near the 4096-byte limit, apply_capture_evidence_dark_write first sets coverage='incomplete' and then bounded_envelope reduces it to this same overflow stub. For example, 14 ordinary UUID-based segment receipts serialize to 4096 bytes as mapped but 4100 bytes after the observed-loss status is applied, producing {capability: 'unknown', coverage: 'incomplete', reason: 'overflow'}. Treating every such stub as ledger-bound changes the public projection to unknown, so the Partial recording warning is suppressed despite confirmed missing audio; the overflow representation needs to preserve whether the bounded payload already represented observed loss.
Useful? React with 👍 / 👎.
…S client models.conversation imports evidence_field/ledger_bound_incomplete from utils.capture_evidence at module scope; test_action_item_date_validation stubs utils as a package with an empty __path__, so the isolated models.conversation load failed at collection with ModuleNotFoundError. Load the real stdlib-only modules before the models load, mirroring utils.model_text. The desktop/windows omiApi.generated.ts output was also stale against the committed app-client spec (lifetime/proof on CaptureEvidenceMetadata); regenerate it so the TS generator and knowledge-ledger contract checks see all four client artifacts in sync. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Update stale rollout expectations and exercise both workload-only and rollback metric policies without changing runtime configuration. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove the unpublished duplicate repair before integrating the now-green main baseline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep the active worker count in the parent shell and update it with the existing PID arrays. Every 20ms polling iteration previously forked twice for command substitution merely to count workers. File isolation, status handoff, crash detection and timing budgets remain intact. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A feature shard still exceeded the unchanged 720-second wall guard at 762s after counter-fork removal. Bash 5.1+ can wait for any tracked child; retain the atomic status-file and liveness reaper, with polling on older Bash. This removes the remaining periodic jobs/sleep subprocesses from Linux CI while preserving per-file isolation and failure detection. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep accurate types, canonical imports and scoped real-module fixtures while retaining main notes fixes and all runtime/test limits. Carry the shared isolated-worker startup optimization. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The drain test assumed a 50ms sleep meant renewal had begun; a loaded runner returned the response before the heartbeat reached renewal. Wait for an asyncio.Event set at the blocked renewal entry. Keep the renewal-reached, cancellation and sub-5-second drain assertions unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preserve fresh per-test isolation and every proration/402/no-write assertion. Keep endpoint calls under the unchanged one-second CPU guard without charging cold router imports and mock construction to the call phase. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preserve the capture coverage projection, main rendering-helper fixtures, and explicit payment stub cleanup ordering. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preserve main module-scoped payment-router loading, per-test mock resets, and package alias cleanup alongside the capture coverage projection. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…loss stays visible bounded_envelope can replace an oversize sync receipt that is short of frames with the overflow stub, so projecting that stub away hid real loss. Only the live committed proof's evicted-ledger shape is downgraded now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(backend): stop projecting ledger-bound capture receipts as partial recordings
Summary
The iOS conversation detail shows a "Partial recording" chip whenever
capture_coverage == 'incomplete'. Since #20903, that field projects straightfrom the internal
capture_evidence.coveragereceipt. For live captures, thatreceipt comes from the committed-capture proof (
CommittedCaptureMap, #20427),whose
incompleteflag latches on ledger bounds, not observed loss: therun ledger keeps 32 runs of at most 30 s each and evicts the oldest beyond
that, so any continuous capture past ~16 minutes — and any capture past 512
transcript notes — latches
incompleteeven with zero missing claims and zeroconflicts. Every long live conversation therefore told the user that audio was
lost when none was.
Observed loss can never take this shape: a missing source-position claim sets
complete=Falseand any conflict bumpsconflicts, and both makecommitted_snapshotreturnNone(the conversation then gets anunknownenvelope, no chip). So a committed-proof
incompleteenvelope with a completelifetime and zero conflicts is bound-only by construction.
Root cause with locations
backend/utils/committed_capture.py:140-142— run-ledger eviction latchesself.incomplete = True(bound, no loss observed).backend/utils/committed_capture.py:184-205— transcript-note overflowlatches the same flag (bound).
backend/utils/committed_capture.py:241— the snapshot emits that flag ascoverage='incomplete'whilelifetime.complete=True.backend/models/conversation.py(_project_capture_coverage) — the publicprojection served it verbatim to released clients.
latch introduced with the committed proof in fix(sync): dedupe live repair speech and resolve overlapping generations #20427 (merged 2026-10-03).
The fix
ledger_bound_incomplete()(backend/utils/capture_evidence.py) recognizes thetwo bound-only receipt shapes: a committed proof with a complete lifetime and
zero conflicts, and the
bounded_envelopebyte-overflow stub. The publicprojection downgrades those to
mapped(positions proven for committedtranscript audio) or
unknown(overflow stub abstains), so only observed lossserves
incompleteand shows the chip. The rule runs at projection time, soalready-stored rows — including today's false positives — are repaired without
a migration. Sync receipts keep their meaning: their
incompleteis decodedframes short of the claimed count, i.e. real missing audio.
Evidence (production, metadata-only reads on the owner's account)
Last 55 conversations (2026-10-23): 2 carry
coverage='incomplete', bothorigin=live,proof=committed_transcript_v1,conflicts=0,lifetime.complete=true— both ledger-bound false positives. One is the cited54-minute pendant conversation (created 06:39Z); the other is a >29-minute
live conversation still in progress. 48 sync conversations are
unknown(no claims, no chip), 2 are
mapped, 3 carry no evidence. Cloud Logging shows≥1000
check=live_coverageshadow records in 24h fleet-wide, so the writer isfleet-default and any user with >16-minute continuous live captures is affected
— not an account-specific issue.
Product invariants affected
None of the locked invariants govern this surface; the behavioral contract is
backend/docs/listen_pusher_pipeline.mdx(coverage projection paragraph),updated in this PR: only observed loss serves
incomplete.Verification
backend/.venv/bin/python -m pytest tests/unit/test_conversation_capture_coverage.py -q— 11 passed, including an end-to-end reproduction: 20 minutes of continuous,
fully-claimed pendant audio latches
incompleteinCommittedCaptureMap,the snapshot says
incomplete, and the public projection now servesmapped.Conflicts, an incomplete lifetime, and sync frame-loss receipts stay
incomplete.pytest tests/unit/test_capture_evidence.py tests/unit/test_capture_evidence_paths.py tests/unit/test_capture_coverage_ledger.py tests/unit/test_capture_coverage_pipeline.py— 59 passed.isolation contract) across the 277 selected conversation/capture/coverage/listen
files — all green.
black --line-length 120 --skip-string-normalizationclean.Failure-Class: none
UI-Evidence: none -- this PR touches backend capture-evidence code and the generated app-client schema artifacts only; no hand-written UI source changed
🤖 Generated with Claude Code