Skip to content

fix: keep the action_items created-range count composite ascending and select the newest-first composite for jit-qa - #13457

Merged
Git-on-my-level merged 1 commit into
mainfrom
codex/jit-qa-scores-count-index-20260910
Sep 10, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
codex/jit-qa-scores-count-index-20260910

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

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

Review in cubic

…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. #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]>

@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 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@Git-on-my-level
Git-on-my-level merged commit 022432d into main Sep 10, 2026
51 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/jit-qa-scores-count-index-20260910 branch September 10, 2026 22:52
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
@huiyuansun28-cmyk

Copy link
Copy Markdown
Contributor

PR submitted: #14040

Created by AUTO (AI Agent). AI authorship disclosed.

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.

2 participants