Skip to content

test(backend): port recovery and admission parity invariants - #23763

Closed
Git-on-my-level wants to merge 1 commit into
mainfrom
lane/parity-pl-023
Closed

Git-on-my-level wants to merge 1 commit into
mainfrom
lane/parity-pl-023

Conversation

@Git-on-my-level

Copy link
Copy Markdown
Member

Accepted speech must survive vendor failures and admission holds when the job store moves from Firestore to Postgres. This adds one shared conformance suite for daily parity rows PL-057, PL-072 and PL-086, and includes it in the existing emulator-proof runner.

  • Vendor credit failure or an uncertain reply keeps original speech and the spent paid intent; replay after coordinator restart cannot pay again. A lost result acknowledgment reconciles the same intent/object without repeating STT.
  • Admission refusal backoff and explicit policy delays survive scheduler restart, refund provider attempts, fence stale tokens and allow a same-owner sibling to finish. The refusal streak resets only after successful completion.
  • Deletion before recovery or during download must cancel before paid work/result upload. This exposed Recovery cancellation bypasses Store and crashes after privacy fencing on Postgres #23761: cancellation directly uses a Firestore client on sim/Postgres. Four strict expected failures are limited to the two affected backends and their exact AttributeError; no provider/result-upload calls are permitted even in those cases. Firestore cancellation passes. Recovery cancellation bypasses Store and crashes after privacy fencing on Postgres #23761 remains open and these cases do not satisfy cutover acceptance.

KB acceptance is published in backend-target-architecture Plans A/C and parity-ledger.md. The suite follows the existing Store factory matrix, uses synthetic owners/audio/vendor/VAD/artifact IO, and exercises the production scheduler, intent transactions, policy pinning and privacy checks. The Postgres harness customer tables do not qualify the serving A4 bridge; no physical erasure, real ASR-quality or vendor-transport retry claim is made. No production modules, configuration, workflow or language-gate files change.

Validation

  • Before expected-failure annotation: strict all-store matrix 23 passed, 4 failed, zero skips; the four failures reproduce Recovery cancellation bypasses Store and crashes after privacy fencing on Postgres #23761.
  • Final shared suite: 23 passed, 4 strict expected failures, zero skips, real local Postgres and loopback Firestore plus simulator (OMI_REQUIRE_STORE_BACKENDS=all).
  • Combined Store/shared conformance: 112 passed, one existing inapplicable simulator concurrency skip, four strict expected failures.
  • make preflight: 33 checks passed through omi-heavy.
  • Adjacent canonical backend/test.sh selection (one worker, through omi-heavy): 152 passed across admission backoff, quarantine recovery and emulator-harness wiring.
  • bash -n backend/scripts/run-emulator-proofs.sh and diff whitespace checks passed. scripts/pr-preflight --pr-body-file <body> passed all 33 checks after commit; normal push hooks passed, including whole-backend Pyright with zero errors. Remote branch hash verified with git ls-remote.

Local invocation, serially through omi-heavy (Java 21 selected from the existing installation):

OMI_REQUIRE_STORE_BACKENDS=all PROVIDER_MODE=offline firebase emulators:exec --only firestore --project demo-omi-isolated-tests \
  'backend/.venv/bin/python -m pytest -q -m integration backend/tests/integration/test_store_conformance.py backend/tests/integration/test_recovery_admission_conformance.py --tb=short'

Product invariants affected

none

Failure-Class: none

UI-Evidence: none -- test-only migration acceptance and pipeline documentation.

Rollback: revert the test, existing-runner addition and documentation commit. No merge or deploy is requested.

🤖 Generated with Claude Code

Carry PL-057, PL-072 and PL-086 through the shared Store matrix. Keep the new-store cancellation gap strict and linked to issue #23761.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T00:57:05.549450Z 2d714a2 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.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Folded into survivor #24591 (lane/lcinv, pushed head b8e0b1e0b3). As part of consolidating the open PR batch, origin/main and every other listed PR were merged into the survivor branch; all tests were kept. This PR is being closed as folded — its content lives on in #24591.

Carried as-is: test_recovery_admission_conformance.py and its run_proof entry in run-emulator-proofs.sh.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hey @Git-on-my-level 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Git-on-my-level added a commit that referenced this pull request Nov 12, 2026
…3761) (#23806)

Fixes #23761

Restores the recovery-cancellation prerequisite tracked by SCA-1689.
Account deletion during recovery now durably cancels the prepared or
running recovery through the shared Store interface before paid work or
result upload on Firestore, Postgres, and the simulator.

The coordinator delegates to `cancel_fenced_recovery`; each adapter
rechecks the privacy fence and changes only the cancellation marker when
blocked. Firestore refreshes the shadow after commit. Main is merged
into the existing branch without rewriting its history, retaining the
SQL identifier hardening from #25116 and the newer privacy-defer
methods. The overlapping #23763 is already closed.

## Verification

Run from `backend/` under a loopback Firestore emulator, with a
throwaway local Postgres cluster and synthetic customer authority:

- `OMI_REQUIRE_STORE_BACKENDS=all .venv/bin/python -m pytest -v -rxX -p
no:cacheprovider
tests/integration/test_recovery_admission_conformance.py`: exit 0, 27
passed; all three adapters, no skips or xfails. PL-057/072/086 cover
cancellation before recovery and after download, restart/redelivery, no
paid calls or result uploads, and unrelated-owner progress. Only the
PL-072 strict xfails whose contract now passes were removed.
- `OMI_REQUIRE_STORE_BACKENDS=all .venv/bin/python -m pytest -q -rxX -p
no:cacheprovider tests/integration/test_store_conformance.py
tests/integration/test_recovery_custody_conformance.py`: exit 0, 267
passed, 6 adapter-specific not-applicable skips; every adapter
available.
- `backend/.venv/bin/python -m pytest -q -p no:cacheprovider
backend/tests/unit/test_batch_pipeline_scheduler.py`: exit 0, 62 passed.

This source repair books **$0/day**. Production serving parity,
cross-database privacy safety, physical erasure, reverse
migration/rollback, pooler readiness, deployment/readback,
production-fence decisions, and a full settled before/after day of
normalized net cost remain separate gates owned by the pipeline driver
and SCA-1683. Existing dark/staging selectors and production fences
remain in force.

## Product invariants affected

none

## Failure-Class

Failure-Class: none

## UI-Evidence

UI-Evidence: none -- internal recovery Store integration and conformance
evidence.
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