Repository navigation
feat(backend): prevent Firestore query contract regressions - #9668
Merged
Git-on-my-level merged 2 commits intoJul 14, 2026
Merged
Git-on-my-level merged 2 commits into
Git-on-my-level merged 2 commits into
Conversation
Root cause: concurrent same-user reads can raise Firestore Aborted before the SDK commit retry path, and the memory ledger reused a stateful transactional wrapper across threads. Add bounded fresh-transaction retries for direct or explicitly caused Aborted errors, isolate SDK wrappers per call, preserve idempotent writes, enqueue projections only after success, and map exhaustion to a generic 503. Verification: focused memory/action-item/task-sharing tests passed; full functional backend suite completed with unrelated duration-guard reruns; Pyright 0 errors; import-purity, module-stub, and async-blocker scans passed.
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
Closes #9662.
READYbefore backend traffic shiftsRoot cause and durable guard
The serving attention-override query had no generated composite-index declaration, while direct serving query chains had no repository-wide registration or deployment-readiness contract. Action-item and memory-ledger transactions could also surface retryable Firestore
Abortedcontention before the SDK retry path.This PR makes the index source of truth explicit, blocks new unregistered/unsupported serving query shapes, verifies the checked-in manifest, waits for every declared index to become
READY, and uses fresh bounded transaction retries with regression coverage.Product invariants affected
Verification
cd backend && bash test.sh— passed (the codebase-wide AST assertions are correctly markedslow; the mandatory preflight ratchet executes them)cd backend && bash scripts/typecheck.sh— 0 errorsmake preflightwith this PR body — 15 checks passedactionlint .github/workflows/gcp_backend.yml .github/workflows/gcp_backend_auto_dev.ymlThe post-deploy smoke is exercised by the development workflow after traffic moves; it intentionally emits only its HTTP status and requires the pre-provisioned
OMI_TASK_INTELLIGENCE_SMOKE_UIDsecret.