Skip to content

config: enable WQ13 finjob candidate queries at 5, graduate memory_list_index_window to 100 - #23646

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/c2fs2
Oct 26, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/c2fs2

Conversation

@Git-on-my-level

Copy link
Copy Markdown
Member

Summary

Firestore reads loop config: enable the WQ13 finjob_candidate_queries lever at 5%
and graduate memory_list_index_window 25 → 100 in one literal (18 keys, generated
with avo/firestore-reads/set_levers.py, REPLACE-mode, byte-identical at all
declaration sites).

  • finjob_candidate_queries: 0 → 5. The WQ13 rework (perf(firestore): narrow finalization candidate queries behind WQ13 lever #23614, 91ac171) replaces the
    conversation_finalization_jobs per-tick full-collection candidate re-scans with
    predicate-equivalent narrow queries behind this default-off lever. The code is
    serving everywhere since tonight's trains (Cloud Run 528f97f 23:17Z, listen 86a15ac
    22:30Z, pusher fca00e4 00:24Z; all contain 91ac171) and all three composite
    indexes it needs are READY live (CICAgJiVqpoK, CICAgJjH44cK, CICAgPjgiJoK).
    Why now: the three finjob candidate scans are the top Firestore read caller —
    ~61M reads/h fleet-wide in the 22–23Z hour (snapshot 2026-10-26T00-40Z.json;
    29.0M/h already at 17–18Z pre-serve), concentrated on backend-sync and
    backend-sync-backfill. queue_age_sample_budget and singleton_loops at 100
    since 23:17Z did not collapse them; the re-scan amplifier is the code path this
    lever narrows.
  • memory_list_index_window: 25 → 100. verify SUPPORTED at 25 since 2026-10-18
    (no FALSIFIED/UNSAFE tick); graduation follows the loop runbook ramp5 rule and
    the c2fs ranked plan (item 5, bundle with the WQ13 enable).

Config only; no code paths change. Off-path for both levers is the current served
behavior (finjob_candidate_queries 0 = byte-identical scans; 25 was already
SUPPORTED).

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 via backend/test.sh with BACKEND_UNIT_TEST_FILE_LIST (local shard green on this branch before push).
  • Literal verified byte-identical at all declaration sites; regenerated runtime_env.yaml, flag registry, and both pinned contract tests.
  • Post-merge watch: verify.py per-lever gates + backend-sync/backend-sync-backfill 5xx rates hourly; any UNSAFE/FALSIFIED lever flags off via config PR.

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). Handoff to the two-lane lead via bus after merge; the ramp5 clock starts at the served revision carrying this literal.
  2. finjob_candidate_queries follows the 5 → 25 → 100 ladder with soaks between steps (3h soak + verify PASS ×2 per runbook); ramp5 gates decide each step. memory_list_index_window rides the same literal at 100.
  3. D+2 absolute readout per lever vs a fresh post-serve baseline; 0 for any FALSIFIED/UNSAFE lever.

…st_index_window to 100

Firestore reads loop config PR (18-key FIRESTORE_READ_LEVERS literal, generated
with avo/firestore-reads/set_levers.py, REPLACE-mode, byte-identical at all
declaration sites):

- finjob_candidate_queries 0 -> 5: first enable of the WQ13 rework from #23614.
  Code serves on all services (Cloud Run 528f97f 23:17Z, listen 86a15ac,
  pusher fca00e4); the three composite indexes are READY (CICAgJiVqpoK,
  CICAgJjH44cK, CICAgPjgiJoK). Pre-enable evidence: finjob candidate scans
  ~61M reads/h fleet-wide at 22-23Z (snapshot 2026-10-26T00-40Z.json), the top
  Firestore read caller; queue_age_sample_budget and singleton_loops at 100
  since 23:17Z did not collapse them.
- memory_list_index_window 25 -> 100: verify SUPPORTED at 25 since 2026-10-18;
  graduation per runbook ramp5 rule and the c2fs ranked plan (bundle with the
  WQ13 enable).

Config only; off-path is the current served behavior for both levers.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-10-26T06:07:07.017250Z 373fe46 New commits
ℹ️ 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 5461a06 into main Oct 26, 2026
56 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/c2fs2 branch October 26, 2026 06:25
Git-on-my-level added a commit that referenced this pull request Oct 26, 2026
… breach) (#23731)

## Summary

Firestore reads loop EMERGENCY flag-off: set 8 levers to 0 in
`FIRESTORE_READ_LEVERS`
(19-key literal, generated with `avo/firestore-reads/set_levers.py`,
REPLACE-mode,
byte-identical at all 16 declaration sites + both pinned contract
tests).

Levers 100/5 -> 0: `singleton_loops`, `usage_month_cache`,
`backfill_task_reads`,
`historical_scan_memo`, `ledger_purge_coalesce`,
`queue_age_sample_budget`,
`batch_privacy_memoize`, `finjob_candidate_queries`.

Trigger: the 2026-10-26T14:00Z tick's verify graded all 8 UNSAFE on the
shared
backend-sync 5xx guard (rate 0.0073 = 2401 errors vs ref 0.0011;
evidence in
pending-actions.json, snapshot 2026-10-26T14:00:39Z). The rate was
already elevated
pre-train (0.0120 in the 10-25T17Z window) and code trains (op1custody
06Z,
op1dfield 10:35Z) are alternate suspects, so the evidence is ambiguous -
the loop
runbook 5xx rule says flag off anyway on a breach, and re-enable at 5%
only if the
rate persists below ref with these levers at 0 (exoneration). This
matches the
pre-committed watch condition recorded 10-26T05:55Z ("next tick
re-raises flag_off
with bpm pct=100 -> flag off URGENT").

Keepers unchanged at their served values: `action_items_page`,
`candidates_page`,
`canonical_statuses_dedupe`, `deletion_marker_cache`,
`mcp_conversation_cards_cache`,
`memory_list_index_window`, `request_read_dedupe`,
`serving_config_cache`,
`subscription_cache` at 100; `people_scan_dedupe` 0; `usage_month_total`
100.
Off-path for the 8 flagged levers is pre-ramp behavior; all are
config-gated
read-path levers whose code is default-off at 0.

Tooling note: `avo/firestore-reads/set_levers.py` LEVERS allowlist and
the loop's
`levers.json` did not yet know `usage_month_total` (added to backend
KNOWN_LEVERS by
#23646); both updated in the omi workspace repo separately.

## Product invariants affected

- INV-MEM-4 - config-only lever rollback; 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

- Both pinned contract tests green locally on this branch:
`tests/unit/test_verify_pusher_config_references.py` +
`tests/unit/test_render_backend_runtime_env.py` (28 passed via
`backend/test.sh` with `BACKEND_UNIT_TEST_FILE_LIST`).
- Literal verified: exactly one distinct 19-key literal across
`_base.yaml` (12 sites) + 4 chart values files; all 8 flagged keys at 0;
keepers unchanged; no stale `:5` remains.
- Post-merge watch: hourly verify gates +
backend-sync/backend-sync-backfill 5xx rates; levers re-enable at 5%
only after rate < ref for 24h with levers at 0.

## Rollout

URGENT train order **listen -> pusher -> Cloud Run**
(FIRESTORE_READ_LEVERS order;
the Cloud Run candidate check compares GKE env against main's
runtime_env).
Handoff to the two-lane lead via bus after merge; this is a guard-breach
rollback,
not a ramp - no ramp clock starts until exoneration.
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