Skip to content

config: URGENT flag-off five FIRESTORE_READ_LEVERS (backend-sync 5xx 0.0068 vs ref 0.0010) - #23575

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/firestore-reads-flagoff-1025
Oct 25, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/firestore-reads-flagoff-1025

Conversation

@Git-on-my-level

Copy link
Copy Markdown
Member

Summary

Firestore reads loop URGENT flag-off: singleton_loops, usage_month_cache, backfill_task_reads, historical_scan_memo, ledger_purge_coalesce 100 → 0; the other 12 keys byte-identical to the deployed literal (17 keys, incl. batch_privacy_memoize:5 from #23554). Generated with avo/firestore-reads/set_levers.py.

  • Why now: loop verify UNSAFE at 08Z and 09Z on 2026-10-25 — backend-sync 5xx rate 0.0034 (640 errs) at 08Z → 0.0068 (1239 errs) at 09Z vs lever-free reference 0.0010 (roughly doubling hourly). All five flagged levers are the 100%-pct levers verify grades against the backend-sync guard. Evidence is ambiguous (the lead's op1custody train served new backend-sync code ~05:37–06Z, same service), so per runbook we flag off on breach anyway: if the 5xx rate persists at lever 0, the levers are exonerated and re-enable at 5%.
  • Off-path restores pre-lever behavior for all five levers (per-process loops, uncached reads, per-task scans — worst case equals lever-off). Reads cost of this flag-off is bounded and known: these callers regain reads only until root cause lands.
  • Rendered literal identical across _base.yaml, regenerated runtime_env.yaml, listen/pusher dev+prod values, the flag registry doc, and the two pinned contract tests. The literal keeps all 17 keys — missing keys default OFF (backend/config/firestore_read_levers.py).

Product invariants affected

  • INV-MEM-4 — config-only lever rollout; no data-path, promotion or authority change; each lever reverts to its pre-lever per-process behavior at 0.
  • INV-DATA-1 — no routing or ownership change; value-only edit of the existing FIRESTORE_READ_LEVERS key.

Test plan

  • backend/tests/unit/test_verify_pusher_config_references.py + backend/tests/unit/test_render_backend_runtime_env.py + backend/tests/unit/test_backend_runtime_env_validator.py: 267 passed locally (lane venv, this commit).
  • Diff checked: exactly the 5 flagged keys 100→0 in every literal site; all other 12 keys unchanged; 17 keys in both old and new literals.

Rollout

  1. Train order listen → pusher → Cloud Run (URGENT flag-off; backend-sync 5xx doubling hourly at time of writing).
  2. Lead handoff posted on merge; ramp clocks for untouched levers unaffected (batch_privacy_memoize stays 5).

…0.0068 vs ref 0.0010)

singleton_loops, usage_month_cache, backfill_task_reads, historical_scan_memo, ledger_purge_coalesce 100->0; other 12 keys byte-identical (17-key literal). Loop verify UNSAFE 08Z+09Z 2026-10-25; set_levers.py; 267 contract tests pass.
@chatgpt-codex-connector

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-10-25T09:13:09.957111Z 54b47fb 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.

@Git-on-my-level
Git-on-my-level merged commit 2f4235d into main Oct 25, 2026
58 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/firestore-reads-flagoff-1025 branch October 25, 2026 09:24
Git-on-my-level added a commit that referenced this pull request Oct 25, 2026
… 5->100, queue_age_sample_budget 0->5 (#23599)

## Summary

Firestore reads loop config, three runbook-gated moves in one literal
(17 keys, generated with `avo/firestore-reads/set_levers.py`,
REPLACE-mode, byte-identical at all sites):

- **Exoneration re-enable 0 → 5**: `singleton_loops`,
`usage_month_cache`, `backfill_task_reads`, `historical_scan_memo`,
`ledger_purge_coalesce`. These five were URGENT-flagged off in #23575
(merged 2f4235d, served on Cloud Run via the 2026-10-25 09:54Z train at
b71be9b, DONE 10:35Z). Guard evidence at lever 0: backend-sync 5xx rate
0.0096 (11Z) → 0.0077 (12Z) → 0.0071 (13Z) vs 0.0068 at levers 100 (09Z)
and ref 0.0010 — the rate persisted with the levers at 0, and the same
hours last week (pre-#23575) were 0.018–0.036. Per the loop runbook
exoneration rule, the levers re-enable at 5%.
- **`batch_privacy_memoize` 5 → 100**: ramp5 served 08:36:49Z
(backend-02126-x49, literal verified), >3h soak, verify PASS at
11Z/12Z/13Z, graded SUPPORTED (implied drop 115M/day at 5%, snapshot
2026-10-25T13:00:02Z.verify.json). Standard ramp5 → ramp100 rule for
SUPPORTED levers.
- **`queue_age_sample_budget` 0 → 5**: WQ2b-prescribed enable (registry
+ freshness gate merged #22205; `FSR_QUEUE_AGE_PUBLISHER=1` on prod
backend-listen values since the 2026-10-25 06:00Z train). Its caller
`durable_queue_age:_sample_status_page` is now the top origin: 0 → 18.8M
reads/h on backend-sync+backfill between 10Z and 13Z (snapshot
2026-10-25T13:00:02Z) after the flag-off un-coordinated the loops.

Config only; no code paths change. Off-path for every lever is the
current served behavior.

## Product invariants affected

- INV-MEM-4 — config-only rollout of default-off code-path levers; every
lever reverts at 0 with no data-path or authority change.
- INV-DATA-1 — value-only edit of the existing `FIRESTORE_READ_LEVERS`
key; no routing or ownership change.

## Test plan

- `backend/tests/unit/test_render_backend_runtime_env.py` +
`backend/tests/unit/test_verify_pusher_config_references.py`: 121 passed
on this branch (2026-10-25).
- Literal verified byte-identical at all 6 declaration sites +
regenerated `runtime_env.yaml`, flag registry, and both pinned contract
tests.
- Post-merge watch: verify.py per-lever gates +
backend/backend-sync/backend-sync-backfill 5xx rates hourly; if any
lever grades UNSAFE/FALSIFIED or the 5xx rate doubles again, flag off
via config PR. 5xx rate persisting at these values further implicates
the 2026-10-25 code trains, not the levers.

## Rollout

1. Train order **listen → pusher → Cloud Run** (FIRESTORE_READ_LEVERS
order; Cloud Run candidate check compares GKE env against main's
runtime_env). Note: GKE listen/pusher are still on the pre-#23575
literal, so this train also brings them current.
2. Handoff to the two-lane lead via bus after merge; ramp clocks start
at the served revision carrying this literal.
3. D+2 absolute readout per lever vs baseline; 0 for any
FALSIFIED/UNSAFE.
Git-on-my-level added a commit that referenced this pull request Oct 25, 2026
## Summary

Firestore reads loop config: graduate the six runbook-ramped levers 5 →
100 in one
literal (17 keys, generated with `avo/firestore-reads/set_levers.py`,
REPLACE-mode,
byte-identical at all 43 declaration sites):

- `singleton_loops`, `usage_month_cache`, `backfill_task_reads`,
`historical_scan_memo`,
  `ledger_purge_coalesce`, `queue_age_sample_budget`: 5 → 100.
- Unchanged: `batch_privacy_memoize` 100, `memory_list_index_window` 25,
`people_scan_dedupe` 0, all graduates at 100.

Gate evidence (runbook ramp5 rule): the 5% literal has been served on
all four Cloud Run
services since **2026-10-25T17:56:02Z** (#23599 c304e3a,
backend-f3e669f-40214727824-1,
literal verified); by merge the 3h soak holds. verify PASS on the 19:00Z
and 20:00Z ticks
(2 consecutive post-serve) with no UNSAFE/FALSIFIED lever and `flag_off:
[]`.
`singleton_loops` lease gate: `lease_1h` non-empty in snapshot
2026-10-25T19:00:28Z
(publish_all_queue_oldest_ready_ages acquired 12,
reconcile_abandoned_byok 58;
lease_gke_ok true). Levers INCONCLUSIVE at 5% follow the loop's
graduation precedent
(WQ2 batch, #23179): the absolute readout at 100% decides.

Why now: the six levers' caller pools are the top remaining Firestore
read hotspots —
`conversation_finalization_jobs` scans ~29M reads/h and
`durable_queue_age` sampling
~21.5M reads/h in the 17–18Z hour (snapshot 2026-10-25T19:00:28Z,
pre-serve baseline).

Config only; no code paths change. Off-path for every lever is the
current served behavior.

## Product invariants affected

- INV-MEM-4 — config-only rollout of default-off code-path levers; every
lever reverts at 0 with no data-path or authority change.
- INV-DATA-1 — value-only edit of the existing `FIRESTORE_READ_LEVERS`
key; no routing or ownership change.

## Test plan

- `backend/tests/unit/test_render_backend_runtime_env.py` (93) +
`backend/tests/unit/test_verify_pusher_config_references.py` (28): 121
passed on this branch (2026-10-25).
- Literal verified byte-identical at all 43 sites; regenerated
`runtime_env.yaml`, flag registry, and both pinned contract tests.
- Post-merge watch: verify.py per-lever gates +
backend/backend-sync/backend-sync-backfill 5xx rates hourly; any
UNSAFE/FALSIFIED lever flags off via config PR. The backend-sync 5xx
exoneration probe (rate 0.0120 pre-serve 17Z vs ref 0.0078, with bpm at
100) stays live until the rate holds under ref for 24h.

## Rollout

1. Train order **listen → pusher → Cloud Run** (FIRESTORE_READ_LEVERS
order; the Cloud Run candidate check compares GKE env against main's
runtime_env). GKE listen/pusher still carry the pre-#23575 literal; this
train also brings them current.
2. Handoff to the two-lane lead via bus after merge; ramp clocks start
at the served revision carrying this literal.
3. D+2 absolute readout per lever vs a fresh post-serve baseline; 0 for
any FALSIFIED/UNSAFE.
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