Repository navigation
perf(firestore): register queue_age_sample_budget lever + publication freshness gate (dark, WQ2b) - #22205
Merged
Conversation
…ublication freshness gate (dark, WQ2b)
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. |
This was referenced Oct 19, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Oct 24, 2026
…_queries lever keys (dark, config unchanged) (#23390) ## Summary Register `conversation_list_cursor` and `finjob_candidate_queries` in backend `KNOWN_LEVERS`, with their origin callers documented. Registration makes both keys addressable; an absent percentage remains 0/off. No `FIRESTORE_READ_LEVERS` YAML literal or other config value changes. The cursor behavior is already merged in #22450. Finalization candidate-query behavior remains separate on `lane/firestore-reads-wq13-candidates` at `13e1eeea47`; this PR neither imports nor depends on that code. The cursor tests now use the production registry instead of patching in the key. ## Product invariants affected - INV-FSR-LEVERS — registration only; missing keys remain off, and runtime configuration remains the sole rollout authority. - INV-READ-BUDGET — query behavior and read budgets are unchanged; query-shape and cursor read-count coverage run unchanged apart from removing the registry patch. - INV-CONTRACT-LIST-PAGE — existing pagination behavior and response contracts remain unchanged while the cursor lever is absent/off. These are the IDs cited by #22450; #22205's registration pattern cited no invariant IDs. ## Verification - 674 tests passed: lever registry 19, cursor contracts 31, rendered runtime-env literal contracts 93, pusher config references 28, query-shape suite 503. Each suite ran in a separate pytest process using `backend/.venv` through `omi-heavy`. - Command: `backend/.venv/bin/python -m pytest backend/tests/unit/<suite>.py -q` for each of the five suites above; rendered-literal expectations unchanged. - Broader Firestore index guard: all seven contract files passed. - `make preflight`: all 32 checks passed. Pre-push also validated the committed three-file diff and the real PR body file: all 32 checks passed. - No GCP tier used; no cloud access needed. UI-Evidence: none — backend registry only, no UI change. Failure-Class: none ## Rollout and rollback Both keys remain dark because their config percentages are absent. No rollout is requested here; deployment and any later configuration change belong to the rollout lead. Revert this registration commit to roll back. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23390?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/23390?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23390&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. -->
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.
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.
Summary
Firestore reads loop WQ2b registry slice: add
queue_age_sample_budgettoKNOWN_LEVERS(backend/config/firestore_read_levers.py) and wire the queue-age publication freshness verification required by the #22142 review before that lever may ever be enabled. Dark by construction: noFIRESTORE_READ_LEVERSvalue changes, no lever enabled.ValueErrorpath; covered for unset var, empty string, empty object, and unrelated-lever cases. Repeated calls keep full scans (no cache, no early stop).omi_queue_age_sample_timestamp_secondsrecords the start of the last completed FRESH scan; cache hits and blocked scans do not advance it. With the budget active, freshness age stays within 600s + scan time (tests at 30s/300s tick cadences incl. 37s scan).Product invariants affected
none — no invariant registry path is touched (lever registry + publisher internals + tests only).
How it was verified
BACKEND_UNIT_TEST_FILE_LISTthroughbackend/test.shunderomi-heavy; all 32 preflight checks passed locally; report WQ2B-registry-report.md.Tests
backend/tests/unit/test_fsr_wq3_queue_age_budget.py(extended), lever registry tests, durable queue tests.UI evidence
UI-Evidence: none — backend-only, no user-facing surface.
Failure class (fixes)
Failure-Class: none
Rollout
Dark: the lever stays at 0/absent everywhere. The Firestore reads loop may ramp it only after this PR is deployed and its config PR sets a percentage. Merging does not start a deploy train.