Repository navigation
fix: declare the descending action_items created-range composite and select action_items indexes for jit-qa - #13454
Merged
Conversation
…select action_items indexes for jit-qa The created-range action-items read orders created_at descending, but the registry declared the composite ascending; databases without an undeclared descending index (the isolated jit-qa database) failed the read with FailedPrecondition. The bounded jit-qa operator also never selected the action_items composites, so /v1/action-items and /v1/scores returned 500 at signed-in QA app startup while the index plan reported nothing missing. Failure-Class: FC-undeclared-serving-query-index Co-Authored-By: Claude Fable 5.1 <[email protected]>
Git-on-my-level
deleted the
codex/jit-qa-action-items-indexes-20260910
branch
September 10, 2026 22:23
Git-on-my-level
added a commit
that referenced
this pull request
Sep 10, 2026
…d select the newest-first composite for jit-qa (#13457) ## Summary Follow-up to #13454. After its indexes were applied to the isolated `jit-qa` database, `GET /v1/action-items` returned 200 but `GET /v1/scores` still returned 500 (`FailedPrecondition`): the weekly count in `get_scores` is `ACTION_ITEMS_COMPLETED_CREATED_RANGE_QUERY.build(...)` with no ordering, and Firestore serves that aggregation only from the **ascending** `(completed, created_at, __name__)` composite. #13454 had flipped that spec to descending, which is what the newest-first *list* read needs but not what the count needs, and the ascending composite is declared by an index-only requirement (`action_items_completed_created`) the bounded jit-qa operator never selected. Changes (registry stays truthful for both consumers; the generated manifest's index set is unchanged, only entry order moves): - `backend/database/firestore_index_registry.py`: `ACTION_ITEMS_COMPLETED_CREATED_RANGE_QUERY` is ascending again, documented as the `get_scores` count aggregation; the newest-first list composite `(completed ASC, created_at DESC, __name__ DESC)` is now the index-only requirement `action_items_completed_created_newest_first`, beside its `action_items_*` siblings. - `backend/scripts/jit_qa_firestore_index_operator.py`: selects index-only requirements by identifier and adds `action_items_completed_created_newest_first` (16 → 17 composites for jit-qa). - Tests: contract test adds the scores-count case (ascending composite declared); operator tests updated. Verified so far on jit-qa: after #13454's apply, six `/v1/action-items` reads returned 200 in Cloud Run logs and only `/v1/scores` remained at 500 with the ascending-index suggestion. Failure-Class: FC-undeclared-serving-query-index Line-Count-Exception: backend/database/firestore_index_registry.py | 1533 -> 1542 | one new index-only requirement plus its rationale comment in the single generated-manifest source; not splittable for one composite 🤖 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/13457?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="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
pull Bot
pushed a commit
to codingwatching/omi
that referenced
this pull request
Sep 11, 2026
…d select the newest-first composite for jit-qa get_scores counts completed tasks created in the last week through ACTION_ITEMS_COMPLETED_CREATED_RANGE_QUERY.build with no ordering, which Firestore serves only from the ascending composite. BasedHardware#13454 flipped that spec to descending for the newest-first list read; declare that ordering as an index-only requirement instead and select it in the bounded jit-qa operator. Failure-Class: FC-undeclared-serving-query-index Co-Authored-By: Claude Fable 5.1 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Sep 11, 2026
…e database (#13464) ## Summary The isolated `jit-qa` Firestore database is provisioned by the bounded QA operator, which selected 17 of the 78 registry composites. Every shared query outside that set returns `FailedPrecondition` on the QA plane while the plan reports "none missing": - 2026-09-10: `GET /v1/action-items` and `GET /v1/scores` (closed by #13454 / #13457 with three more composites) - 2026-09-11: `POST /v2/chat/materialize-prompts` → `chat_first_intents.release_due_deferrals` needs `chat_first_deferrals (account_generation, state, due_at)`, which the registry already declares as `chat_first_deferrals_due` The QA app now runs the full shared desktop path for real working days, so adding composites one measured failure at a time costs a PR plus an apply run per path. The registry is exactly the set production is reconciled against, so the operator now selects all of it. Project, database, confirmation, and the QA-only single-field target are unchanged, and `firestore.indexes.json` is untouched (no prod reconciliation run is queued by this change). ## Verification - `backend/tests/unit/test_jit_qa_firestore_index_operator.py` and `test_action_items_due_range_index_contract.py`: 28 passed - After merge: dispatch `jit_qa_manual_operator.yml` `operation=indexes-apply` and confirm the deferral query serves on jit-qa Failure-Class: FC-undeclared-serving-query-index 🤖 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/13464?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="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
huiyuansun28-cmyk
added a commit
to huiyuansun28-cmyk/omi
that referenced
this pull request
Sep 15, 2026
Contributor
|
PR: #14044 AUTO (AI Agent). Authorship disclosed. |
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
GET /v1/action-items?start_date=…&completed=falseorderscreated_atdescending (_apply_action_item_date_filters), but the index registry declared the composite as(completed ASC, created_at ASC, __name__ ASC), which serves only the reverse ordering. The development(default)database happened to carry an undeclared descending composite, so the gap never surfaced there. The isolatedjit-qadatabase, provisioned from the manifest alone, returned 500 FailedPrecondition "The query requires an index" on that read at signed-in app startup, and also on the due-range reads (/v1/action-items?due_start_date=…and/v1/scores) because the bounded JIT QA operator never selected theaction_itemscomposites at all while its plan reported "none missing" (measured 2026-09-10, Cloud Run request logs forbackend-jit-qa).Changes:
backend/database/firestore_index_registry.py:ACTION_ITEMS_COMPLETED_CREATED_RANGE_QUERYnow declares(completed ASC, created_at DESC, __name__ DESC), matching the production query builder. The ascending composite stays in the manifest because another spec declares it; reconciliation is create-only.firestore.indexes.json: regenerated (one newaction_itemsentry).backend/scripts/jit_qa_firestore_index_operator.py: the bounded jit-qa set addsACTION_ITEMS_COMPLETED_DUE_RANGE_QUERYandACTION_ITEMS_COMPLETED_CREATED_RANGE_QUERY(14 → 16 composites) so the named QA app's task dashboard and scores reads are served.Not covered:
conversation_id+ created-range reads have no declared composite either; nothing in the app issues that shape today, so it is left as is rather than adding a speculative index.Operational note
Merging changes
firestore.indexes.json, which queuesgcp_firestore_indexes.ymlfor prod (create-only; the prod GitHub Environment reviewer approves it). The jit-qa database is reconciled separately by dispatchingjit_qa_manual_operator.ymlwithoperation=indexes-applyandconfirmation=APPLY_JIT_QA_INDEXES.Failure-Class: FC-undeclared-serving-query-index
Line-Count-Exception: backend/database/firestore_index_registry.py | 1527 -> 1533 | six comment lines explaining why the created-range composite is declared descending; the registry is the single generated-manifest source and cannot be split for one direction fix
🤖 Generated with Claude Code