Repository navigation
fix(memory): make projection invalidation safe across Commit retries - #23464
Git-on-my-level wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Folded into #24602 (the consolidation of this batch onto the age-gate survivor branch |
|
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:
Before your next PR, please skim:
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! |
Summary
A successful Firestore Commit can lose its acknowledgement and be retried by GAPIC with the same prepared request. The old request UUID can then restore an older projection key: after another write deletes a memory, the deleted row can reappear from cache. A retried source Increment without another writer also returned the first value. Both failures were reproduced through the pinned SDK's real retry policy against the emulator.
The existing head Write now atomically increments a server generation. Readers key raw projections by generation, request token and exact server update_time, including nanoseconds. Schema1, missing/restarted/invalid/saturated versions and unproved epochs retain the source path. Source writes, preconditions, result cardinality, authorization and deletion fences stay unchanged. This fixes the P1 automated review finding on #23402.
Rollout and dependencies
Reader preference remains default on with
MEMORY_RELEASED_PROJECTION=offas kill switch. Reuse now requiresMEMORY_RELEASED_WRITERS_COVERED=v2:<fresh-epoch>; clear v1 coverage before rollout. Old readers reject v2 and new readers reject v1/schema1. The writer remains on and the head document path stays unchanged; no backfill or production account changes.Lead owns writer-fleet release verification and synthetic ambiguous-success/create/update/delete parity, then v2 activation by T3 cutoff 2026-10-24 07:30Z. Leave coverage absent and report a blocker if proof is incomplete. Clear coverage before any writer gap/rollback and rotate the epoch afterward. Existing levers and reads-loop ramp ownership remain intact.
MCP reuse also requires a P1 v2 epoch and schema2/server-generation head capability. Current UUID-only P1 heads lack it, so MCP keeps its source path. P1's owner must fix the analogous retry issue and attest the capability before that share is enabled. P2 does not modify the P1 writer or ETag policy.
Attribution remains
origin=job:released_memory_projectionfor head reads and the original caller origin for source reads. One head Write and two warm head reads remain. The counted 100-document warm-page proof stays 100 -> 2. The 50M/day P2 target remains conditional; MCP's share waits for its dependency. No live savings or deploy is claimed.Product invariants affected
Verification
All local verification ran through omi-heavy at nice19 with explicit FILE_LIST and workers4, using cached pinned dependencies in the existing worktree. 214 targeted unit tests passed, including writer/reader, SDK-stub, P1 composition, custody/privacy and read-count coverage. The dedicated real-SDK emulator test failed both cases before the fix and passed both afterward: interleaved deletion following ambiguous success, and repeated source Increment. Existing atomic failed-batch/transaction retry, sync/async deletion, bulk exclusion, canonical correction/revert, competing/concurrent reopen and privacy-race emulator proofs also passed.
Evidence:
/Volumes/Ephemeral/scratch/fs-p2/retry-before.log,retry-after.log,retry-unit.log,retry-contract-emulator.log. Required bounded pre-push passed, including typecheck with zero errors. Luna review and exact-head CI are reported before final handoff. No new workflow, production reads/writes, GCP tier, deployment or fresh dependency install.Failure-Class: new