Skip to content

config(firestore-reads): restore exonerated cohort 5 levers 0->100 (keep #24210 backend-sync usage_month exception) - #24238

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/firestore-reads-restore-1101
Nov 1, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/firestore-reads-restore-1101

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

Firestore reads loop restoration config (guard cohort re-enable): five FIRESTORE_READ_LEVERS values 0 → 100, everything else byte-identical to main. This is the exoneration follow-up to #24194 (guard flag-off, WQ31/WQ32).

  • Discriminating experiment result (levers at 0 since config(firestore-reads): guard flag-off finjob_candidate_queries 5->0 (WQ32) #24207/fix(backend): restore monthly usage reads only for sync admission #24210 served ~04:44Z 2026-11-01): backend-sync 5xx stayed flat-to-higher at 0.0041–0.0044 (1522–1639 err/h, ticks 05Z/06Z/07Z) vs 0.0035–0.0036 at levers 100 and ref 0.0014 — per the loop's own rule, the flagged cohort is EXONERATED (exogenous). The lead's independent RCAs agree (admitscope-2026-11-01.md §5 "After the flag-off, 5xx rose, so per the runbook's own discriminating rule the flagged cohort is exonerated"; syncwall-2026-11-01.md attributes the 5xx mass to deliberate nonterminal_ack + legacy file retries).
  • Restored to 100: singleton_loops, backfill_task_reads, historical_scan_memo, ledger_purge_coalesce, queue_age_sample_budget. Measured give-back at 0 (cohort-union of needle callers, snapshot 2026-11-01T05Z/07Z vs pre-flag-off 10-31T19Z/21Z): ~29–44M reads/day ≈ $14–21/day; at 0 the flag-off also re-added the batch-admission latency class documented in admitscope.
  • Kept at fix(backend): restore monthly usage reads only for sync admission #24210 scope on purpose (lead instruction 6be508/5bd7df/c38004): usage_month_cache / usage_month_total stay 0 everywhere except the cloud_run/backend-sync exception (100/100, FSR_USAGE_MONTH_TOTAL_EPOCH unchanged). The GKE charts keep the Cloud Run-only usage_month_total split (GKE = 0). finjob_candidate_queries stays 0 (its own 02Z UNSAFE gate; callers ~0). batch_privacy_memoize, memory_list_index_window, people_scan_dedupe stay 0 (graded WEAK/FALSIFIED).

Config only, generated with avo/firestore-reads/set_levers.py + the prod.overlay inline sites (5 keys only); audited at 19 literal sites: the 5 restored keys = 100 everywhere, usage_month_cache/usage_month_total = 0 everywhere except the backend-sync Cloud Run site. Regenerated runtime_env.yaml + flag registry; the two pinned contract tests updated (119/119 pass on the lane venv). Per the lead: this PR is NOT to be merged by the loop — it is staged for the single off-peak lead train before 13:00Z.

Product invariants affected

  • INV-MEM-4 — config-only lever rollout; no data-path, promotion or authority change; every restored lever reverts to flag-off 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_render_backend_runtime_env.py + backend/tests/unit/test_verify_pusher_config_references.py: 119/119 pass on the lane venv.
  • Literal audit: 19 sites JSON-parsed; 5 restored keys = 100 at every site; umc/umt = 0 everywhere except prod.overlay backend-sync (100/100, fix(backend): restore monthly usage reads only for sync admission #24210 exception preserved); finjob/bpm/mliw/people = 0 at every site.

Rollout

  1. Lead-owned single off-peak train before 13:00Z, order listen → pusher → cloud-run (FIRESTORE_READ_LEVERS order). The loop does not merge, dispatch, or approve anything here.
  2. Post-train: tick verify continues; ramp-clock/grade bookkeeping per runbook; re-baseline after serve.

View guided diff Turn on auto-fix

…eep #24210 backend-sync usage_month exception)

Discrimination verdict at full cohort-off (#24207+#24210 served ~04:44Z):
backend-sync 5xx flat-to-higher 0.0041-0.0044 (1522-1639/h, 05Z-07Z ticks)
vs 0.0035-0.0036 at 100 and ref 0.0014 -> cohort EXONERATED per runbook
rule; agrees with lead RCA admitscope-2026-11-01 s5 + syncwall-2026-11-01.

Restored to 100: singleton_loops, backfill_task_reads, historical_scan_memo,
ledger_purge_coalesce, queue_age_sample_budget. Give-back at 0 measured
~29-44M reads/day (~$14-21/day, snapshot union 11-01T05/07Z vs 10-31T19/21Z).

Kept: usage_month_cache/usage_month_total at #24210 scope (backend-sync CR
site 100/100 only; GKE umt stays 0 per CR-only split) per lead instruction;
finjob_candidate_queries 0 (own 02Z gate); bpm/mliw/people 0 (graded).

Config-only via set_levers.py + prod.overlay inline sites; 19 literal sites
audited; contract tests updated; 119/119 pass (lane venv). NOT merged by the
loop: staged for the lead's single off-peak train before 13:00Z.
@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 ⚠️ Failed 2026-11-01T12:18:15.198473Z
We couldn’t complete this review. Comment @codex review to try again.
4fa9003 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@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 10 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 added a commit that referenced this pull request Nov 1, 2026
…tay in the doc (#24251)

## Summary
Stops every audio, transcription and lifecycle PR from editing the same
8,791-line doc.

`backend/AGENTS.md` told every audio, transcription,
conversation-lifecycle, speaker or listen/pusher change to update
`backend/docs/listen_pusher_pipeline.mdx` in the same PR. Between 10-18
and 11-01:
- **165 fleet PRs** edited that file;
- **77 of them had to merge `main` back in**, and each catch-up re-ran
the pre-push gate and a full CI cycle (shipspeed baseline, conflict hot
spots).

The new rule:
- **Change notes** (what changed, why, rollout and flag state, evidence)
go in
`backend/docs/listen_pusher_pipeline/changes/YYYY-MM-DD-<slug>.md`, one
new file per change. Concurrent PRs never touch the same note.
- **Contracts stay in the pipeline doc**: env vars and defaults, wire
and payload fields, ordering and idempotency guarantees, sequence
diagrams. Tests (for example `tests/unit/test_vad_cache_ttl_config.py`)
and the flag registry cite that file, so contract edits still happen
there.
- Notes are folded into the doc periodically by one docs-only PR.

The `backend/AGENTS.md` rule is shortened to stay inside its
`agents-md-lean` byte budget; the detail lives in `changes/README.md`.

## Rollout / merge notes
- Docs and agent instructions only. No runtime, workflow or deploy
change.
- **Merge after the 23:00Z train** (lead 9a266d): five vroute lanes and
#24238/#24240 are editing the pipeline doc today.

🤖 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/24251?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/24251?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24251&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
Git-on-my-level merged commit 01bfac0 into main Nov 1, 2026
65 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/firestore-reads-restore-1101 branch November 1, 2026 20:25
Git-on-my-level added a commit that referenced this pull request Nov 2, 2026
…/ledger_purge 100->0 (backend-sync 5xx 0.0134 vs ref 0.0073) (#24348)

# Firestore reads loop guard flag-off — 2026-11-02
(singleton/backfill/historical/ledger_purge 100→0)

## Summary

Firestore reads loop **URGENT guard flag-off** (autonomous, loop RUNBOOK
step 1): four `FIRESTORE_READ_LEVERS`
values 100 → **0**, everything else byte-identical to main. Response to
verify tick 2026-11-02T05:00:20Z FAIL
(pending-actions `flag_off`: singleton_loops, usage_month_cache,
backfill_task_reads, historical_scan_memo,
ledger_purge_coalesce).

- Breach: backend-sync 5xx 3652/271872 = **0.0134** (audio-merge
excluded in both windows) vs ref (prev-week
same window, excl audio-merge) 1805/248696 = **0.0073**. Hourly
trajectory: 0.0041 (22Z) → 0.0048 (23Z–00Z;
restoration #24238 served 23:52Z) → 0.0062 (01Z) → 0.0082 (02Z) → 0.0078
(03Z) → 0.0076 (04Z) → **0.0134 (05Z)**.
Evidence is ambiguous (smooth multi-hour rise, no clean step at the
serve hour), so per the runbook
("flag off on breach anyway when the evidence is ambiguous") the
flag-off proceeds as the discriminating
experiment: rate falls at 0 → restoration cohort implicated (stays 0);
rate stays >ref at 0 → exogenous again
(#23739 / lead RCA e54718 precedent), restoration re-planned with the
lead.
- Flagged off everywhere (base ×11 sites, four Cloud Run overlay sites,
listen/pusher dev+prod charts):
`singleton_loops`, `backfill_task_reads`, `historical_scan_memo`,
`ledger_purge_coalesce` 100 → 0.
`usage_month_cache` base stays 0 (it was already 0 off the #24210
exception scope).
- **Kept on purpose: `prod.overlay` backend-sync
`usage_month_cache`/`usage_month_total` = 100** — the #24210
compute-admission exception. Admission calls backend-sync
`/authorize-compute` with a 5-second client timeout;
zeroing these re-breaks admission (admission stage mean ~5.1s,
unevaluated deferrals ~3.7/s — the exact incident
#24210 fixed under lead ruling dde240). The 05Z tick's
`usage_month_cache` UNSAFE carries the shared
service-scope why (WQ30 precedent: same-why proves service-scope), and
`usage_month_total` was not flagged at
all. If post-flag-off discrimination implicates umc specifically,
zeroing the exception is #24210's documented
  rollback (admission impact accepted; lead decides).
- `queue_age_sample_budget` stays 100 (not flagged; its needle callers
read ~0 since the budget lever —
  readout 402.5M → 0.0M/day). All other keys unchanged.

Config only, generated with `avo/firestore-reads/set_levers.py`
(replace-mode, complete 20-key literal) plus the
four prod.overlay inline sites hand-patched (flagged keys only) and the
third pinned `expected` dict in

`test_firestore_train_preserves_monthly_reader_scope_and_cloud_run_overrides`
updated (set_levers' regexes do not
cover it). Stale #24194-era comment blocks refreshed to the current
scope. Regenerated `runtime_env.yaml` +
feature-flag registry.

## Product invariants affected

- INV-MEM-4 — config-only lever rollout; no data-path, promotion or
authority change; every flagged lever reverts
to flag-off behavior at 0; the #24210 admission exception is unchanged
(epoch c2fs_20261026_r1 preserved).
- INV-DATA-1 — no routing or ownership change; value-only edit of the
existing `FIRESTORE_READ_LEVERS` key.

## Test plan

- `backend/tests/unit/test_render_backend_runtime_env.py` +
`backend/tests/unit/test_verify_pusher_config_references.py`: **119/119
pass** on the lane venv
(`backend/.venv` freshly synced from pylock.macos.toml via `make
setup-backend`).
- Literal audit: 26 deploy value sites JSON-parsed — the 4 flagged keys
= 0 at every site; `usage_month_cache`/
`usage_month_total` = 100 only at the prod.overlay + rendered
backend-sync exception; `queue_age_sample_budget`
  = 100 everywhere; finjob/bpm/mliw/people = 0 everywhere.

## Rollout

1. **URGENT**: lead-owned train, order **listen → pusher → cloud-run**
(FIRESTORE_READ_LEVERS order). The loop
   does not dispatch deploys or approve gates.
2. Post-serve: hourly tick verify runs the discrimination (2 clean ticks
at 0 → cohort implicated, stays 0;
flat >ref → exogenous, restoration re-plan with the lead). Re-baseline
after the served revision changes.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/24348?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/24348?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24348&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. -->
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