Skip to content

test: add durable finalization, Sync, and Rewind gauntlets - #9981

Merged
Git-on-my-level merged 9 commits into
mainfrom
codex/gauntlet-durable-finalization
Jul 19, 2026
Merged

Git-on-my-level merged 9 commits into
mainfrom
codex/gauntlet-durable-finalization

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add a non-production Rewind artifact/recovery bridge gauntlet covering privacy admission, HEVC, SQLite, readback, recovery, and cleanup.
  • Make memory-read fixtures inject their reference time so CI never expires a fixed visibility window.
  • Keep the shared vector-fixture seam signature-aligned with production's explicit now snapshot, including callers that inject a custom fixture clock.
  • Fix Rewind lifecycle ownership: cleanup, writes, and finalization are generation-fenced; concurrent shutdown flushes join the active trailer write, cancellation surfaces failure, and chunk paths are collision-proof and recover at their absolute capture time.
  • Extend the upstream two-process Listen Cloud Tasks gauntlet with a deterministic public REST finalization race: four stale-read requests create one outbox job and one named task, prove the three AlreadyExists handoffs, then rehydrate that task after listener restart and prove exactly-once worker completion.
  • Repair the Firestore contention the new REST race exposed in CI: recreate the transaction and SDK wrapper for bounded Aborted retries, preserve the atomic outbox boundary, and return the existing retryable 503 contract only after that budget is exhausted. Failed gauntlet jobs now retain and tail their synthetic backend logs for actionable diagnosis.
  • Adopt the stronger upstream Sync (fix(sync): converge durable Cloud Tasks ledger retries #10008) and Listen (test(listen): cover durable finalization recovery through Cloud Tasks #10000) gauntlets during rebase instead of restoring the older overlapping harnesses.

Final verification (rebased onto current origin/main)

  • BACKEND_PYTEST_WORKERS=4 bash backend/test.sh — all 675 backend unit test files passed
  • backend/testing/listen_pusher_stack/run.sh --keep --state-dir /tmp/omi-listen-pusher-final-head.X326dN — passed all inline and Cloud Tasks scenarios, including the deterministic REST/restart case
  • bash backend/test.sh — all 675 backend unit test files passed again after the contention repair
  • backend/testing/listen_pusher_stack/run.sh --state-dir /tmp/omi-listen-pusher-contention-fix — passed all inline and Cloud Tasks scenarios after the contention repair
  • bash backend/scripts/typecheck.sh — 0 errors
  • cd desktop/macos && bash test.sh — launcher tests, Rust tests, and isolated Swift suites passed
  • make preflight — deterministic CI manifest passed
  • scripts/pr-preflight --pr-body-file /tmp/omi-gauntlet-pr-body.md and scripts/failure-class validate --base origin/main --head HEAD --pr-body-file /tmp/omi-gauntlet-pr-body.md — passed

The former PR head was GitHub-conflicted, which suppressed normal pull_request runs. This branch is rebased cleanly onto current origin/main; these are the final-head checks before its fresh CI run.

Guard scope

The four-party read barrier intentionally lives only in the Listen gauntlet entrypoint, rather than in a shared or production primitive. It coordinates a controllable harness race after the real authenticated lookup; the production route, Firestore transaction, Cloud Tasks task construction, listener restart, and worker all remain unmodified. It extends the recovery surface introduced by merged #10000.

Product invariants affected

  • INV-MEM-1
  • INV-MEM-2

Failure class

Failure-Class: none

The Rewind lifecycle defects and bounded Firestore transaction-contention recovery have behavioral regression guards, but no existing semantic failure class describes either failure boundary.

@mintlify

mintlify Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 18, 2026, 6:27 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00f8de458c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

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

Copy link
Copy Markdown
Member Author

Monitor review pass (20260719T022039Z)

Both open trusted-bot review threads were checked against the current PR HEAD (2e07507196). Both concerns are already addressed by commits already in this PR — no code changes were needed.

Thread 1 — desktop-flow-lint.py (#discussion_r3608947676, Codex, P2): "Add the Rewind gauntlet source to the T0 trigger."

  • Addressed by ca6768b4b6 fix(rewind): fence active chunk lifecycle, which added - "desktop/macos/Desktop/Sources/Rewind/Core/RewindArtifactGauntlet.swift" to .github/workflows/desktop-backend-contracts.yml pull_request.paths. Verified present at HEAD.

Thread 2 — RewindStorage.swift cleanup race (#discussion_r3608947678, Codex, P2): "Recheck the active Rewind chunk under the lock."

  • Addressed by the same commit, which replaced the stale protectingActiveVideoChunkPath snapshot with RewindVideoDirectoryMutation.withActiveChunk { activeVideoChunkReservation in ... } — the active chunk reservation is now read inside the same directory-mutation lock as the cleanup sweep. GitHub marks the original hunk isOutdated. Verified at HEAD (RewindStorage.swift cleanupEmptyVideoSubdirectories).

Actions taken: resolved both threads as addressed by existing code.

Verification:

  • git diff origin/main...HEAD -- .github/workflows/desktop-backend-contracts.yml — confirms RewindArtifactGauntlet.swift path added.
  • RewindStorage.swift read at HEAD — confirms RewindVideoDirectoryMutation.withActiveChunk lock scope reads the active chunk reservation before the cleanup sweep.
  • gh pr checks — comment-on-declined-pr: pass; Mintlify Deployment: skipped. No failing checks.

Note: PR merge state is DIRTY/CONFLICTING due to add/add conflicts in backend/testing/sync_cloud_tasks_stack/* and backend/testing/workflow_contracts.json where main landed a more advanced version of the same gauntlet. That is a mergeability reconciliation for the PR author and outside the scope of this review-comment pass.

CI added 8 commits July 19, 2026 02:15
Protect the current video chunk's day directory across the first-frame writer startup window while retaining cleanup of unrelated empty directories.

Verified: xcrun swift test --package-path Desktop --filter RewindActiveChunkRetentionCleanupTests; xcrun swift test --package-path Desktop --filter RewindRetentionCleanupTests

Failure-Class: none
Exercise synthetic privacy admission through the real Rewind indexer, HEVC chunk encoder, SQLite lifecycle, finalized-video readback, and cleanup in a non-production bridge flow.

Verified: xcrun swift test --package-path Desktop --filter RewindArtifactGauntletTests; omi-harness rewind-artifact-recovery bridge flow
Thread an optional evaluation timestamp through each vector read surface so fixed historical fixtures remain deterministic as wall time advances. The product vector route takes one request-time snapshot; default callers retain the existing real-time behavior.

Verified: BACKEND_PYTEST_WORKERS=4 bash backend/test.sh (664 selected files passed); focused affected vector suites (98 passed).
Use generation-tagged writing/finalizing ownership so a stale frame or finalizer cannot mutate a restarted writer. Serialize first-frame cleanup with startup and give new chunks collision-proof paths that preserve absolute recovery time while retaining legacy parsing.

Verified: xcrun swift test --package-path desktop/macos/Desktop --filter 'RewindChunkTimestampParseTests|RewindArtifactGauntletTests|RewindStorageVideoFrameExtractionTests|RewindActiveChunkRetentionCleanupTests'; cd desktop/macos && bash test.sh

Failure-Class: none
Treat an in-flight MP4 trailer write as a shared durability barrier. Concurrent flushes now join the owning finalizer, and cancellation reports a failed flush instead of a successful shutdown. Fence a stale finalizer before it can invoke AVFoundation after cancellation.

Verified: xcrun swift test --package-path desktop/macos/Desktop --filter RewindFlushFinalizationTests; cd desktop/macos && bash test.sh

Failure-Class: none
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor pass (20260719T083232Z) — no code changes

Unresolved trusted review threads: 0 (live reviewThreads query). The two Codex P2 threads from the prior pass (02:27Z) remain resolved by existing commits in this PR (ca6768b4b6 and related) — no regression.

"Failed" checks: false positives. The flagged Detect Changes / Hygiene / Formatting are CANCELLED from run 29677295252 (9s auto-cancelled duplicate). The superseding run 29677297823 (2m9s) is SUCCESS; those same jobs resolved to SKIPPED (out-of-scope for a backend-only PR). Latest conclusion per check name: all SUCCESS or SKIPPED. No genuinely failing required check.

Merge state: MERGEABLE / BLOCKED solely due to reviewDecision: REVIEW_REQUIRED. Requires maintainer approval — outside monitor scope.

No commit, no push, no thread resolution performed this pass — nothing met the actionable bar.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor pass (20260719T124207Z) — no code changes

Unresolved trusted review threads: 0. Both Codex P2 threads (PRRT_kwDOLkKqys6SAuKQ desktop-flow-lint T0 trigger, PRRT_kwDOLkKqys6SAuKS RewindStorage active-chunk lock) remain resolved by ca6768b4b6 fix(rewind): fence active chunk lifecycle and related commits already in this PR. No new trusted review comments since the prior pass.

"Failed" checks: false positives. Detect Changes / Hygiene / Formatting are CANCELLED from auto-cancelled duplicate run 29677295252. The superseding run 29677297823 resolved them to SKIPPED (out-of-scope for this PR's diff). Real checks all green:

  • Backend unit suite — pass (11m8s)
  • Hermetic Backend E2E — pass (1m41s)
  • Listen Pusher Stack Gauntlet — pass (4m20s)
  • Sync Cloud Tasks Stack Gauntlet — pass (3m29s)
  • Desktop Swift Build & Tests — pass (21m14s)
  • Public Developer API contract — pass

Merge state: MERGEABLE / BLOCKED solely on reviewDecision: REVIEW_REQUIRED. Requires maintainer approval — outside monitor scope.

Worktree rebase: the monitor auto-rebased the worktree onto the latest origin/main. The only delta is CHANGELOG churn — upstream promoted the 20260719-fault-reset-double-clear unreleased entry into release 0.12.83. No PR code changes. Pushing this rebase would rewrite the branch, re-run the full gauntlet CI, and re-trigger bot reviews for zero mergeability benefit (the PR is already MERGEABLE), so it was intentionally not pushed.

No commit, no push, no thread resolution performed this pass — nothing met the actionable bar.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Durable finalization/Sync/Rewind test gauntlets. Approve-only (large test-only change).

@Git-on-my-level
Git-on-my-level merged commit 2da0374 into main Jul 19, 2026
36 of 39 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/gauntlet-durable-finalization branch July 19, 2026 18:37
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