Repository navigation
fix(sync): enforce cohort dedupe and measure widening gates - #23925
Conversation
Run proof-gated lineage incoming dedupe ahead of fleet fuzzy policy for the existing cohort, using committed transcript proof rather than WAV context. Share post-commit append/stamp observations across intake and batch writers, and restart rejected targets for bounded observation-only discovery. Failure-Class: new
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. |
Run lineage lexical and exact-retry passes before the unchanged fleet fuzzy matcher on their survivors. Preserve capture-refactor proposal precedence and measure the final combined plan. Failure-Class: new
Full note processing now waits for merge settlement on main. Hold the STT leaf inside the Cloud Tasks lease so the concurrency gauntlet still proves Redis fencing and exactly one paid invocation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c97ea04be
ℹ️ 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".
| survivors, | ||
| fuzzy_live_overlap=fleet_live_dedupe, |
There was a problem hiding this comment.
Estimate the fleet clock before removing lexical anchors
For cohort uploads with partial capture proof, passing only lexical survivors to the fleet matcher can disable deduplication that previously succeeded. _fuzzy_survivors in backend/utils/sync/merge_dedupe.py requires two exact-text anchors to estimate the clock offset; the preceding lexical/exact-retry pass can remove those anchors. A synthetic three-line replay with capture proof for the first two lines produces zero survivors on the previous fleet-only path, but this composition appends the third duplicate because only one anchor remains. Estimate the offset from the original incoming batch and reuse it when filtering the survivors so stronger capture proof does not cause other repeated speech to be appended.
Useful? React with 👍 / 👎.
Problem
SYN-003 W5 timing triage attributes 1,084.3 s (99.9%) of the 1,085.5 s live-row overlap to legacy intake appends, 0 s to batch projection, and 1.2 s to a donor bridge. All of that snapshot overlap was written in W5. This is timing attribution, not a measured lexical would-drop fraction. The fleet safety-WAL switch bypassed the cohort incoming capture-proof + lexical policy. W5 also could not certify widening gates 4 or 5: 76 nonempty batch assignments into seven existing live rows produced zero fresh-append observations, and ordinary stamp growth was not measured. Explicit targets rejected for device mismatch also created sync rows without discovery, reporting
created_unknown/discovery_skipped.Fix
lineage_admittedboolean lets widening readers exclude non-cohort fleet observations without identifiers. An abandoned live plan cannot leak measurements onto a sync size rollover.Finite zero-length donor intervals now contribute 0 s without invalidating the bridge; inverted/nonfinite timing stays unknown. They remain stored and never become deletion proof.
The missing measurements came from caller-owned emission and dedupe-owned timing. The shared consumer and real batch-entry regression tests prevent that class across writers and policies. Existing SYNC_LINEAGE switches, allowlist and batch admission retain their semantics. No content or identifiers enter telemetry.
Validation
backend/test.sh: sync, lineage, live-dedupe, batch pipeline/projection, capture, safety-WAL and processing-hold suites, including the gauntlet diagnostic/wiring regressions.backend/scripts/run-unit-ci.sh --changed-files <paths> --shard 6/4, selecting the full 2,367-file backend suite before sharding.test_revision_does_not_zero_live_slopremains unmodified and passes. Its new cohort variant uses no capture proof and checks one append line with 0 appended seconds, 0 live-overlap seconds and 16 repeat-drop seconds. The capture-proven repeat plus novel-speech regression remains intact and passes in captureoff,shadowandservemodes.npm run test:sync-cloud-tasks-stack:emulatorgauntlet passed with main fix(backend): hold sync full processing until merges settle #23919 integrated and the processing hold enabled. Before moving the probe, the same merged code reproduced CI's failure: the worker correctly returned HTTP 200 / done after STT while full note processing stayed held. The provider-boundary regression failed before the probe fix and passes after it.make preflight: 36 checks passed. Full backend typecheck: 0 errors.nice -n 15through workspacebin/omi-heavy, retaining file isolation and normal timing/network guards. Ambient Firebase/service-account credentials are removed; unit tests use/dev/nullADC, a synthetic project and the CI-default Redis port, while integration uses isolated loopback Firestore/Redis and deterministic provider leaves. No production endpoint or GCP tier was used.Rollout and rollback
Ships on, no new flag, no cohort widening. Existing gating remains unchanged. Rollback: revert this PR. No production data or GCP access was used, and this PR does not deploy or rewrite historical observations. Markers remain transient, with at-most-once emission attempts and no durable outbox; lost observations still block widening as unknown.
Product invariants affected
none
Failure-Class: new
New class:
FC-commit-observation-bypassed-by-writer; its reusable guards exercise the real batch entry point, policy independence, replay/failed-commit silence, invalid timing, and rejected-target discovery with fence rereads.🤖 Generated with Claude Code