Repository navigation
fix(privacy): keep the deletion marker off privacy_ttl60 (Firestore read regression) - #24645
Merged
Merged
Conversation
…ead regression) Measured after #24622 served on Cloud Run (2026-11-04 22:13Z, shadow on): account_deletion_marker:_s4_read_deletion_status billed reads went from 54k to 530k per 10 min. With privacy_ttl60 on, every marker decision read Firestore directly (the r1 P1 fix) instead of the shared Redis negative cache, and the per-process 60s cache only hit ~70% across Cloud Run instances. The runtime kill switch was set at 22:27:47Z. This restores get_user_deletion_wipe_status to its pre-#24622 behavior (Redis negative cache, generation-fenced by writers); the fence and tombstone families keep privacy_ttl60. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
added a commit
that referenced
this pull request
Nov 5, 2026
…hes dark (#24650) ## What Config only. `privacy_checks_shadow`, `privacy_ttl60` and `bpp_decision_cache` go from 100 to 0 on every service. This ends the #24622 privacy shadow and leaves the 60s privacy caches dark. The code and its runtime kill switch stay. ## Why Measured on prod after #24622 served on Cloud Run (2026-11-04 22:13Z), using GMP `privacy_*` counters and `omi_firestore_billed_reads_by_caller_total`. **Correctness was fine.** There were 0 privacy mismatches (`stale_allow` / `block_reason`) across about 724k shadow comparisons in the first 10 min, of which 694k were deletion-marker, 25k batch and 4.4k external. The kill-switch guard tripped once, on 3 `stale_block` lines: the candidate was *more* restrictive, from a gate acquired between the two reads. **The savings aren't there on Cloud Run:** - `bpp_decision_cache` hit rate was about 0.4%. In a 30-min window, 81% of batch decisions had no memo token (`privacy_memo_requests_total{result="ineligible"}`), and the rest rotate on nearly every conversation write. Batch privacy reads didn't drop. - Deletion-marker reuse regressed reads 10x. It's fixed in #24645 and has been off via the kill switch since 22:27:47Z. - External-fence reuse hit about 83%, but the volume on Cloud Run is small. Fence and tombstone reuse would pay off on listen/pusher, whose listen leg is held. **Shadowing has a real cost.** `privacy_checks_shadow` turns off `bpp_generation_memo` enforcement, and shadow re-walks add about 9% of batch-privacy reads (`privacy_check_reads_total{mode="shadow"}`). That comes to roughly 15% of batch-privacy reads, about 1.4M reads/h at tonight's backlog. ## Rollback Set the three keys back to 100. The kill-switch document `ops_kill_switches/privacy_decision_cache` can stay set either way. ## Verification `pytest tests/unit/test_render_backend_runtime_env.py tests/unit/test_verify_pusher_config_references.py tests/unit/test_backend_runtime_env_validator.py tests/unit/test_firestore_read_levers.py`: 294 passed. ## Product invariants affected - INV-MEM-4 (path match on `backend/deploy/runtime_env.yaml` only; no memory promotion behavior changes) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/24650?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/24650?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24650&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
kriegcloud
pushed a commit
to kriegcloud/omi
that referenced
this pull request
Nov 5, 2026
…hes dark privacy_checks_shadow, privacy_ttl60 and bpp_decision_cache 100 -> 0 on every service. Measured on prod after BasedHardware#24622 served (2026-11-04 22:13Z): - Correctness: 0 privacy mismatches (deletion_marker 694k, batch 25k, external 4.4k shadow comparisons in the first 10 min). The only guard trips were stale_block (candidate more restrictive than live). - Value: bpp_decision_cache hit ~0.4%; 81% of batch decisions have no memo token and the rest rotate on nearly every conversation write. The deletion marker path regressed reads (fixed in BasedHardware#24645). External-fence and tombstone reuse is real but small on Cloud Run; its value would be on listen/pusher. - Cost of shadowing: privacy_checks_shadow turns off bpp_generation_memo enforcement, and the shadow re-walks add ~9% of batch privacy reads (~15% total, ~1.4M reads/h). The runtime kill switch has kept the caches off since 22:27:47Z. This removes the shadow cost and restores attempt-memo enforcement. Rollback: set the three keys back to 100. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What
get_user_deletion_wipe_statusgoes back to its pre-#24622 behavior, the shared Redis negative cache that writers fence by generation. The deletion marker no longer takes part inprivacy_ttl60. The external-fence and tombstone families keep it.Why
Measured on prod after #24622 served on Cloud Run (2026-11-04 22:13Z,
privacy_checks_shadowon).omi_firestore_billed_reads_by_caller_totalfordatabase.account_deletion_marker:_s4_read_deletion_statuswas 53,867 per 10 min at 22:05Z and 530,315 per 10 min at 22:30Z, about +2.9M reads/h. Withprivacy_ttl60on, every marker decision read Firestore directly, which was Luna r1 P1's fix to avoid re-seeding a stale Redis negative. The per-process 60s cache only hit ~70% across Cloud Run instances (privacy_ttl_cache_total{family="deletion_marker"}: 485k hit / 208k miss per 10 min), while the shared Redis cache it bypassed had been holding this caller to ~1M reads/day. cl2-infracost set the runtime kill switch (ops_kill_switches/privacy_decision_cache) at 22:27:47Z; this PR is the durable fix.Shadow result for the deletion marker before the kill switch: 694k comparisons per 10 min, 0 mismatches. The correctness design was fine; the cost wasn't.
Verification
pytest tests/unit/test_privacy_ttl_cache.py tests/unit/test_fsr_s4_caches.py tests/unit/test_account_deletion_auth_fence.py: 126 passed. A new test pins that withprivacy_ttl60on, the marker is served by the Redis negative cache (1 read across 5 calls) and never enters the process cache.Failure class (fixes)
Failure-Class: none
Product invariants affected
None.
🤖 Generated with Claude Code