Skip to content

SCA-4091: Backport SCA-2533 to the serving listen base - #26210

Merged
Git-on-my-level merged 4 commits into
release/listen-96f0631-sca2533from
agent/m1-studio-codex-sol/6a50ae9d4523
Nov 29, 2026
Merged

Git-on-my-level merged 4 commits into
release/listen-96f0631-sca2533from
agent/m1-studio-codex-sol/6a50ae9d4523

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Scope

Backport #26103 (34831db99152f11ddca1dacdca1bf3df360d55e1) onto 96f06315ca05f0d55c3cc9b84bfcb0bff877ca22. Both digests observed serving under 96f0631 came from that SHA. Production build-only run · Production backend-sync build

  • sha256:b6fbdcb78a6a33f3d3c82ea7048fa71b052e458b24881b33f6f86bbd08f79171, 18 ready pods at readback.
  • sha256:33b5f757e93dc60cf8ebc017b944b236a49c959a1d6016a039b0ac4529de7d20, 12 ready pods at readback. The registry currently resolves 96f0631 to this digest.

One additional commit takes the OMI_INDEXED_LIST_READS_ENABLED registry 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, and raw-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 shared StoragePrefixPurgeBlocked message 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 96f0631

  • The serving base aborts at the first prefix delete failure. SCA-2533: Retain audio during automatic empty-generation teardown #26103 tolerates object-not-found and stale-generation races in the six non-WAL conversation prefixes, then relists to verify the result. For protected generations still present, it collects the hold results and continues deleting eligible objects from the rest of those prefixes. A permission, bucket, unverified-only, or strict WAL failure still aborts immediately. No per-object deletion precondition is weakened.
  • Bucket order comes from a set, so neither version guarantees which bucket runs first. The base reaches each bucket's WAL only after that bucket's preceding prefixes succeed. SCA-2533: Retain audio during automatic empty-generation teardown #26103 still interleaves WAL with each bucket's prefixes. A WAL sweep from an earlier bucket can therefore finish before a hold is discovered in a later bucket, as it could on the base. Once a protected-prefix result is collected, the shared guard skips WAL for the current and every subsequent bucket. Any WAL sweep that runs still uses the strict generation and metageneration preconditions and stops on the first failure.
  • On 96f0631, 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-sync raw-sync and raw-mobile-batch sweeps 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.
  • The accepted-erasure runner still calls the strict purge directly and propagates failures for durable retry. Post-response conversation deletion logs typed prefix failures once. The separate account wipe retains its fail-fast path and its existing hold checks.

Verification

  • omi-heavy run -- bash backend/test.sh with 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 checks str(error) and sanitize(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.
  • Pre-push passed, including all 45 selected shared preflight checks, backend type checking, and the hook-selected backend tests.
  • git diff --check 96f0631 HEAD passed. 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 production build-only path requires main ancestry and a successful Release Eligibility push run on main for 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 is 96f0631.

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.

Git-on-my-level and others added 2 commits November 24, 2026 02:32
…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)
Copy the single OMI_INDEXED_LIST_READS_ENABLED row from c4bb578 (#26188) and regenerate the reference at the existing as-of date. The 96f0631 release base otherwise fails the time-sensitive pre-push gate. No runtime behavior or setting changes.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T08:04:33.667804Z 103f025 New commits
ℹ️ 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" or "@codex security review".

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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.
@Git-on-my-level
Git-on-my-level merged commit d808ab6 into release/listen-96f0631-sca2533 Nov 29, 2026
29 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m1-studio-codex-sol/6a50ae9d4523 branch November 29, 2026 06:11
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