Skip to content

fix(privacy): keep the deletion marker off privacy_ttl60 (Firestore read regression) - #24645

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/cl2-marker-revert
Nov 4, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/cl2-marker-revert

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

What

get_user_deletion_wipe_status goes back to its pre-#24622 behavior, the shared Redis negative cache that writers fence by generation. The deletion marker no longer takes part in privacy_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_shadow on). omi_firestore_billed_reads_by_caller_total for database.account_deletion_marker:_s4_read_deletion_status was 53,867 per 10 min at 22:05Z and 530,315 per 10 min at 22:30Z, about +2.9M reads/h. With privacy_ttl60 on, 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 with privacy_ttl60 on, 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

View guided diff Turn on auto-fix

…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]>
@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T22:36:12.101802Z 09d962c PR opened
ℹ️ 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.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

View guided diff | Turn on auto-fix | Re-trigger cubic

@Git-on-my-level
Git-on-my-level merged commit 8731817 into main Nov 4, 2026
65 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/cl2-marker-revert branch November 4, 2026 22:45
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]>
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