Repository navigation
SCA-4091: Backport SCA-2533 to the serving listen base - #26210
Git-on-my-level merged 4 commits into
Conversation
…6103) ## Summary - Keep raw and derived audio when the backend tombstones an empty listen generation. Count retained object versions under `chunks`, `audio` and `raw-live` with a read-only inventory and one INFO record. An inventory failure leaves the completed teardown successful and records an unknown count. - Existing conversation purges continue past disappeared or stale object generations, aggregate protected generations across scoped prefixes, and verify the prefix afterward. Permission and bucket errors retain their provider reason. Original-custody `record-wal` objects still use the base commit's fail-fast purge, after the preceding prefixes succeed. The account wipe uses its strict path. - Preserve the privacy cascade default and destructive-operation gates. The post-response privacy task logs a single ERROR on a typed prefix failure. Durable erasure keeps its existing retry behavior. ## Verification - Second panel FIX: moved the purge exception import into the post-response privacy callback. Both CI-failing test files now pass in the 13-file focused run (520 passed, one Firestore emulator test skipped). - First panel FIX: added the lifecycle change note and updated the orphan-repair and quiet-finalization test mocks. The updated head passed 328 tests across six targeted suites and all 41 local preflight checks. - Backend coverage includes the delete request and accepted erasure, automatic listen teardown, merge cleanup, account holds, generation races, empty prefixes and buckets, and fail-fast WAL erasure. - The design revision passed 225 tests across eight targeted suites, with one Firestore emulator test skipped. All 41 local preflight checks passed. - Post-deploy, check that Cloud Error Reporting group `COq2w_fF6o7I3gE` stops receiving events. For a newly discarded generation, confirm raw objects remain and the worker emits one retention record. The goal owner approved this design on SCA-2533 at `f43f320a68ad`. Failure-Class: FC-audio-cleanup-before-durable-custody Line-Count-Exception: backend/routers/conversations.py | 3060 -> 3077 | Report typed audio-prefix failures at ERROR level at the post-response task boundary while preserving the durable eraser's retry contract. Line-Count-Exception: backend/utils/other/storage.py | 2775 -> 2803 | Keep audio bucket routing, read-only inventory, protected-generation aggregation, and the original-custody WAL sweep with the existing conversation storage functions. (cherry picked from commit 34831db)
Codex Review Summary: ✅ CompletedThis 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. |
Hash conversation and owner identifiers and report protected prefix failures with bounded outcome codes and counts. Verify emitted logs exclude held object paths and provider text.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 103f025d08
ℹ️ 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".
|
|
||
|
|
||
| def _delete_privacy_audio_after_response(uid: str, conversation_id: str, *, source_ids: List[str]) -> None: | ||
| from database.account_deletion_operational_holds import StoragePrefixPurgeBlocked, StoragePrefixPurgeError |
There was a problem hiding this comment.
Move the purge-error imports to module scope
The new helper imports its exception classes inside the function, violating the explicit backend convention in backend/AGENTS.md: “All imports at module top level — never inside functions.” Move these imports into the router’s module-level database imports so the new cleanup path follows the repository’s required import structure.
AGENTS.md reference: backend/AGENTS.md:L168-L168
Useful? React with 👍 / 👎.
Render protected prefix failures with a fixed reason code and generation counts. Keep the typed object map for aggregation and verify both direct and durable-erasure sanitized rendering.
d808ab6
into
release/listen-96f0631-sca2533
Scope
Backport #26103 (
34831db99152f11ddca1dacdca1bf3df360d55e1) onto96f06315ca05f0d55c3cc9b84bfcb0bff877ca22. Both digests observed serving under96f0631came from that SHA. Production build-only run · Production backend-sync buildsha256:b6fbdcb78a6a33f3d3c82ea7048fa71b052e458b24881b33f6f86bbd08f79171, 18 ready pods at readback.sha256:33b5f757e93dc60cf8ebc017b944b236a49c959a1d6016a039b0ac4529de7d20, 12 ready pods at readback. The registry currently resolves96f0631to this digest.One additional commit takes the
OMI_INDEXED_LIST_READS_ENABLEDregistry row from #26188 and regenerates its reference at the release base's existing as-of date. The base's expired graduation blocks the required pre-push check. This changes registry metadata only and carries zero additional runtime dependencies.Automatic empty-generation teardown retains
chunks,audio, andraw-live. It inventories retained object versions read-only and logs the count or inventory error type. The approved logging follow-ups hash owner and conversation IDs in both new events. The purge ERROR uses fixed reason codes and generation counts. The sharedStoragePrefixPurgeBlockedmessage also carries a fixed reason code and generation counts. Its typed object map stays available for aggregation. Existing merge cleanup and durable erasure can render the exception without including stored object identities. The conversations router is the only router in the diff.Explicit erasure compared with
96f063196f0631, a protected-prefix failure aborts before any private-sync sweeps that have yet to run. SCA-2533: Retain audio during automatic empty-generation teardown #26103 still runs the private-syncraw-syncandraw-mobile-batchsweeps for blobs whose metadata links them to the conversation when execution reaches that bucket, even after a protected-prefix result. It then raises the aggregate unless an intervening failure aborts sooner. This permits additional partial erasure of linked originals while the protected generations remain. Shipping explicitly accepted this ordering for explicit erasure on SCA-4091. Both logging follow-ups preserve it.Verification
omi-heavy run -- bash backend/test.shwith the 10 unit files changed by SCA-2533: Retain audio during automatic empty-generation teardown #26103: 491 passed, 1 Firestore emulator test skipped. The new regression test checksstr(error)andsanitize(str(error)), the rendering used by the durable erasure task.omi-heavy run -- bash backend/test.sh test_conversation_lifecycle_contract.py test_listen_lifecycle_rollover_isolation.py test_live_capture_lifecycle.py: 52 passed.git diff --check 96f0631 HEADpassed. The SCA-2533 commit's stable patch ID matches the upstream merge’s first-parent diff.Image and release
The backend Dockerfile is
backend/Dockerfile. The productionbuild-onlypath requires main ancestry and a successful Release Eligibility push run onmainfor the exact carrier SHA. A tree-neutral merge would establish ancestry and generate proof for the merge commit. A manual workflow dispatch on the carrier cannot produce the exact-SHA main push receipt. Shipping withdrew the tree-neutral route and referred branch-specific build admission and exact-head proof to David. Publication remains blocked pending that ruling. The listen Helm workflow consumes an already-published tag in production and its forward deploy updates the NEG exporter as well. The production handoff is the approved, image-only listen Deployment patch after full review and Shipping GO. The inverse is96f0631.Review requires omi-panel plus an Owners batch-custody check at the exact head. Release readback covers listen 5xx and route 2xx at 10 and 30 minutes, and zero post-roll events in Error Reporting group
COq2w_fF6o7I3gE.Failure-Class: FC-audio-cleanup-before-durable-custody
Line-Count-Exception: backend/routers/conversations.py | 3080 -> 3101 | Report typed audio-prefix failures with hashed IDs and bounded outcome metadata while preserving durable erasure retries.
Line-Count-Exception: backend/utils/other/storage.py | 2775 -> 2803 | Keep inventory, protected-generation aggregation, and the original-custody WAL sweep with the conversation storage functions.