Repository navigation
config(privacy): end the privacy shadow and leave the 60s privacy caches dark - #24650
Conversation
…hes dark privacy_checks_shadow, privacy_ttl60 and bpp_decision_cache 100 -> 0 on every service. Measured on prod after #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 #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]>
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. |
There was a problem hiding this comment.
1 issue found across 10 files
Confidence score: 3/5
- In
backend/deploy/runtime_env/_base.yaml, turning offprivacy_checks_shadowalso makesenforcetrue whenbpp_generation_memois enabled, so this changes enforcement behavior rather than only disabling shadow checks. Confirm that this authority change is intended.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/deploy/runtime_env/_base.yaml">
<violation number="1" location="backend/deploy/runtime_env/_base.yaml:32">
P2: Turning off `privacy_checks_shadow` here also changes authority, not just shadow. In `batch_pipeline_privacy.py`, `enforce = lever_enabled('bpp_generation_memo', uid) and not shadow` now evaluates True inside task attempts, so the memo path decides batch privacy writes. The PR says there are no memory-promotion changes, so either set `bpp_generation_memo` to 0 in the same JSON or state the promotion in the PR description.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| SYNC_POLL_BACKOFF_ENABLED: {value: 'false', category: rollout} | ||
| FIRESTORE_READ_LEVERS: | ||
| value: '{"action_items_page":100,"action_items_ttl120":100,"backfill_task_reads":100,"batch_privacy_memoize":0,"bpp_decision_cache":100,"bpp_generation_memo":100,"candidates_page":100,"canonical_statuses_dedupe":100,"conversation_list_cursor":100,"deletion_marker_cache":100,"finjob_candidate_queries":100,"historical_scan_memo":100,"ledger_purge_coalesce":100,"lifecycle_record_pending_head":5,"mcp_conversation_cards_cache":100,"memory_list_index_window":100,"people_scan_dedupe":100,"privacy_checks_shadow":100,"privacy_ttl60":100,"queue_age_sample_budget":100,"request_read_dedupe":100,"serving_config_cache":100,"singleton_loops":100,"subscription_cache":100,"sync_snapshot_resolve_cache":100,"usage_month_cache":0,"usage_month_total":0}' | ||
| value: '{"action_items_page":100,"action_items_ttl120":100,"backfill_task_reads":100,"batch_privacy_memoize":0,"bpp_decision_cache":0,"bpp_generation_memo":100,"candidates_page":100,"canonical_statuses_dedupe":100,"conversation_list_cursor":100,"deletion_marker_cache":100,"finjob_candidate_queries":100,"historical_scan_memo":100,"ledger_purge_coalesce":100,"lifecycle_record_pending_head":5,"mcp_conversation_cards_cache":100,"memory_list_index_window":100,"people_scan_dedupe":100,"privacy_checks_shadow":0,"privacy_ttl60":0,"queue_age_sample_budget":100,"request_read_dedupe":100,"serving_config_cache":100,"singleton_loops":100,"subscription_cache":100,"sync_snapshot_resolve_cache":100,"usage_month_cache":0,"usage_month_total":0}' |
There was a problem hiding this comment.
P2: Turning off privacy_checks_shadow here also changes authority, not just shadow. In batch_pipeline_privacy.py, enforce = lever_enabled('bpp_generation_memo', uid) and not shadow now evaluates True inside task attempts, so the memo path decides batch privacy writes. The PR says there are no memory-promotion changes, so either set bpp_generation_memo to 0 in the same JSON or state the promotion in the PR description.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/deploy/runtime_env/_base.yaml, line 32:
<comment>Turning off `privacy_checks_shadow` here also changes authority, not just shadow. In `batch_pipeline_privacy.py`, `enforce = lever_enabled('bpp_generation_memo', uid) and not shadow` now evaluates True inside task attempts, so the memo path decides batch privacy writes. The PR says there are no memory-promotion changes, so either set `bpp_generation_memo` to 0 in the same JSON or state the promotion in the PR description.</comment>
<file context>
@@ -29,7 +29,7 @@ environment_shared:
SYNC_POLL_BACKOFF_ENABLED: {value: 'false', category: rollout}
FIRESTORE_READ_LEVERS:
- value: '{"action_items_page":100,"action_items_ttl120":100,"backfill_task_reads":100,"batch_privacy_memoize":0,"bpp_decision_cache":100,"bpp_generation_memo":100,"candidates_page":100,"canonical_statuses_dedupe":100,"conversation_list_cursor":100,"deletion_marker_cache":100,"finjob_candidate_queries":100,"historical_scan_memo":100,"ledger_purge_coalesce":100,"lifecycle_record_pending_head":5,"mcp_conversation_cards_cache":100,"memory_list_index_window":100,"people_scan_dedupe":100,"privacy_checks_shadow":100,"privacy_ttl60":100,"queue_age_sample_budget":100,"request_read_dedupe":100,"serving_config_cache":100,"singleton_loops":100,"subscription_cache":100,"sync_snapshot_resolve_cache":100,"usage_month_cache":0,"usage_month_total":0}'
+ value: '{"action_items_page":100,"action_items_ttl120":100,"backfill_task_reads":100,"batch_privacy_memoize":0,"bpp_decision_cache":0,"bpp_generation_memo":100,"candidates_page":100,"canonical_statuses_dedupe":100,"conversation_list_cursor":100,"deletion_marker_cache":100,"finjob_candidate_queries":100,"historical_scan_memo":100,"ledger_purge_coalesce":100,"lifecycle_record_pending_head":5,"mcp_conversation_cards_cache":100,"memory_list_index_window":100,"people_scan_dedupe":100,"privacy_checks_shadow":0,"privacy_ttl60":0,"queue_age_sample_budget":100,"request_read_dedupe":100,"serving_config_cache":100,"singleton_loops":100,"subscription_cache":100,"sync_snapshot_resolve_cache":100,"usage_month_cache":0,"usage_month_total":0}'
category: rollout
FSR_QUEUE_AGE_PUBLISHER:
</file context>
What
Config only.
privacy_checks_shadow,privacy_ttl60andbpp_decision_cachego 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 andomi_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 3stale_blocklines: the candidate was more restrictive, from a gate acquired between the two reads.The savings aren't there on Cloud Run:
bpp_decision_cachehit 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.Shadowing has a real cost.
privacy_checks_shadowturns offbpp_generation_memoenforcement, 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_cachecan 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
backend/deploy/runtime_env.yamlonly; no memory promotion behavior changes)🤖 Generated with Claude Code