Skip to content

config(privacy): end the privacy shadow and leave the 60s privacy caches dark - #24650

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/cl2-shadow-off
Nov 5, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/cl2-shadow-off

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

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 fix(privacy): keep the deletion marker off privacy_ttl60 (Firestore read regression) #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

View guided diff Turn on auto-fix

…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]>
@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-04T23:51:59.920720Z 7df035c 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.

1 issue found across 10 files

Confidence score: 3/5

  • In backend/deploy/runtime_env/_base.yaml, turning off privacy_checks_shadow also makes enforce true when bpp_generation_memo is 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}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>

@Git-on-my-level
Git-on-my-level merged commit 49d496b into main Nov 5, 2026
64 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/cl2-shadow-off branch November 5, 2026 00:03
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