Repository navigation
fix: align wave-2 cohorts and enforce speaker/media safety - #23669
Conversation
…ssion Keep uncertain speech out of eager memory formation, preserve anonymous summary attribution, hide retained media on restore-capable clients, and use one wave2 percentage bucket across producer and consumer modes. Failure-Class: FC-memory-subject-trusts-diarization-label
Profile identity, calendar attendance and likely suggestions do not bind an unresolved voice. Preserve supported labels and explicit corrections. Failure-Class: FC-memory-subject-trusts-diarization-label
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71a159fcae
ℹ️ 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".
| and ( | ||
| getattr(segment, 'speaker_identity_status', None) == 'user' | ||
| or getattr(segment, 'speaker_label_source', None) == 'manual' |
There was a problem hiding this comment.
Distinguish explicit owner decisions from synthesized legacy status
For legacy segments containing is_user=True and an explicit speaker ID but no identity status, TranscriptSegment.__init__ automatically sets speaker_identity_status='user' (backend/models/transcript_segment.py:206–208). Consequently, this new admission check accepts those segments without any positive identity decision, allowing legacy owner booleans to authorize memory formation despite the documented safety boundary. Preserve or check the provenance of the status so constructor-synthesized values cannot satisfy this gate, and cover a legacy segment with an explicit speaker ID in the admission tests.
Useful? React with 👍 / 👎.
Require match provenance beyond compatibility status, retain scoped manual evidence for media classification, and carry restored keep choices through reprocessing. Update fixtures to use actual voice evidence and prompt keys.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1b1868183
ℹ️ 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".
| manual_ids = {sid for c in owners for sid in c.segment_ids or ()} | ||
| if not manual_ids or not manual_ids.issubset(cluster.segment_ids): | ||
| return None | ||
| for segment in segments: | ||
| if str(value(segment, 'id')) not in manual_ids: |
There was a problem hiding this comment.
Preserve manual segment scopes when merging voice clusters
When manually confirmed owner excerpts belong to clusters combined by merge_surplus, the new duration calculation can undercount confirmed owner speech. In utils/speakers/refinement.py, candidates are deduplicated by (person_id, source) without unioning their new segment_ids, so only one merged cluster's manual scope survives. For example, three mergeable clusters with 1.5-second owner excerpts and a participant hint of one retain only 1.5 seconds instead of 4.5. With foreground-media evidence, this incorrectly classifies protected owner speech as media, suppressing derived outputs and potentially hiding the conversation. Union matching manual candidates' segment IDs during refinement and cover the merged-cluster path.
Useful? React with 👍 / 👎.
Persist explicit keep authority in the same fenced content write before downstream effects, retain every scoped manual excerpt through surplus merges, and keep unknown legacy scope conservative. Align the shared title fixture prefix and prove that plausible acoustic protection grants no owner identity.
|
Round-2 response for follow-up
A separate synthetic endpoint test also exposed post-persistence failure before the router saved durable keep authority. The follow-up saves the keep marker and review-to-keep transition in the existing fenced canonical content write, before downstream work can fail. It adds no early unfenced write and does not bypass memory readiness or deletion/revision fences. Validation: six regressions failed before the fixes; 292 current-source tests across seven targeted files pass through |
…ings (#23693) Hidden media/noise/bystander conversations on macOS can now be found with Filter → Show Discarded and restored from the row menu or detail. Audio/transcripts remain accessible; discarded detail withholds derived notes. Restore publishes the full canonical response only after the server confirms success, rejects stale account responses, and keeps list/count/search/cache scope aligned. This is the desktop companion for #23669 / #23358. The phone-compatible POST reprocess endpoint must include #23669's backend keep-intent fix: it derives `user_kept` from stored discard/keep state before classification; it accepts no client `user_kept` body or query field. Desktop uses the phone's 180-second timeout. No backend deploy, flag/cohort change, data repair, workflow change, or new icon is included. Validation: 56 focused Swift tests passed (repository, search filtering, restore API and finalization projection); compact cross-surface gate passed 71 Swift tests, agent contracts and harness failure propagation. The named non-production app compiled/signed and passed its 19-file Mach-O audit. Actual mounted UI checks against loopback synthetic fixtures covered list filtering, retained transcript, search scope and restore POST200; persisted readback confirmed discarded=false and user_kept=true. LLM/provider leaves were controlled: this is REST/persistence/UI acceptance, not an LLM-quality or audio-playback claim. Production source is unchanged since those checks. After the test-only lint correction, m1 package compile passed and all 52 bounded normal push gates passed. An extra m1 filtered XCTest run stalled at unrelated VoiceTurnDomainTests startup and was stopped; that runtime is inconclusive. New head 28857c4 (retain-detail fix, merge of 17 upstream commits, authorized test seed correction): m1 package compile passed, and the bounded intended-bundle runner for the expanded 59-test selection produced real XCTest output but stalled in its first async case and exited its own 60-second bound as INCONCLUSIVE (124); per instruction it was not retried or loosened — the 59-test runtime claim stays inconclusive on m1. The prior-head 56-test and mounted-UI evidence above is unchanged. Canonical read-only Luna round 1 returned SHIP with no P0/P1 at prior head 1e16305; its one non-blocking P2 is deferred to #23695 (restoring changed summary text can leave a stale text-search hit until refresh). Luna round 2 (delta-only, since 1e16305) returned SHIP with no findings at 08:44Z (ledger round 2, out review-23693-r2.md). Terminal exact-head CI is GREEN: Desktop Swift Static & Test Contracts passed in 35m55s at 28857c4 along with all other non-skipping checks. UI-Evidence: David approved the Show Discarded / Restore Conversation controls and wording shown in screenshots 001–003 on 2026-10-26, relayed by lead ruling 9eddbf at 07:54Z. The PR is ready for review; canonical Luna and terminal CI still gate merge, which the lead owns. Broader wave-2 expansion also requires the desktop companion and backend dependency to ship. Backend durability when a later processing step fails remains owned by wave2ramp in #23669. No merge or deployment is claimed.    Invariant-Impact: INV-AUTH-1, INV-NAV-1, INV-UI-1, INV-UI-2. Session-generation fences remain authoritative; restore adds no alternate mutation authority and uses existing desktop controls and navigation. Failure-Class: none
…am (#23710) Required memory submissions stayed pending because their only production caller was an undeployed maintenance job. This change normalizes required intake immediately after canonical capture commits and makes the existing Dream sweep retry stragglers. It does not deploy a job, scheduler or IAM change. Inline capture gets one Flex attempt with a 12-second batch budget. Async callers await provider IO after the DB worker returns; raw synchronous DB-pool submissions defer to Dream. Returned single/batch memory views and prompt caches reflect successful normalization. Existing revision leases, receipts, backoff and raw-submission idempotency remain authoritative. Scheduled retries are independent of Dream cleanup gates, with rotating owner and per-owner row cursors. The sweep also completes receipts through the existing canonical consolidation/graph route without another model call. Account deletion fences precede provider calls; rejection, dismissal and locks are checked again in the completion transaction. Historical submissions before 2026-10-26 07:55Z stay hidden until Dream's separate retrospective ramp resolves them. Its planner and two verifiers compare fully read canonical records. Uniqueness requires exhaustive coverage within 100 raw rows and the read-byte budget; top-k or paginated search cannot establish it. Larger/inaccessible corpora may resolve a proven positive duplicate while uncertain unique submissions stay pending. Lead ruling 91e4aa accepts this guard and requires coverage-tail/budget measurement in David-first, with the larger-corpus decision by October 27. Unique items use the shared processor; duplicates preserve a superseded source audit row and leave the durable Long-term survivor intact. A covering Short-term neighbor or split vote stays pending. Canonical-head, source-revision and switch fences reject stale/in-flight disabled results. Dream uses a private planner/tool model for the new capability and its bounded 101-ref inventory. The released Review model remains unchanged with its ten-ref limit. Server authority selects the private schema, and the Review-offer boundary rejects private capabilities. User authority cannot resolve hidden intake candidates. Generated public OpenAPI/client artifacts match main. Automatically conversation-derived required items in the SPEAKER_EVIDENCE_MODE serving cohort require confident owner-bound quotes before paid normalization or backlog search. Explicit text retains separate authority. This uses the shared provenance rule from #23669, which must ship in the same or earlier release. Original transcripts/audio and pending records are retained. Lead owns merge, deploy and ramp. MEMORY_REQUIRED_INTAKE_ENABLED defaults on (false rolls back inline/retry). DREAM_REQUIRED_INTAKE_BACKLOG_ENABLED defaults off and requires an explicit cohort: David first, then 5%, 25%, 100% by 2026-10-28. Historical dedupe also needs normal Dream admission, eligibility and capacity; the lead must align those gates for the intended cohort. Before each expansion, hold a full scheduled lookback with zero known duplicate admissions, lost details or source/privacy/owner fence violations, declining pending age/counts and measured spend within forecast. Disable the backlog switch to contain new historical effects; preserve committed receipts. Normalization forecast: 470/day × $0.000245 ≈ $0.115/day; 20,681 all-unique backlog items ≈ $5.07. Dream search/planning/verification and Firestore reads are additional metered costs. Recorded to Plans & Cost/margin50 and card:memreq-required-intake-20261026. No production account content was read or changed by this lane. Required normalization re-admits inside the actual LLM worker after its queue wait, and transactionally rechecks account deletion and memory tombstone/disposition before writing a processed result. Six regressions cover account deletion and memory tombstones while queued (zero provider calls), in flight (discard the result), and immediately before the real transaction. A deterministic deadline test covers the final metadata wait. Provider SDKs, parsers and audio helpers load at use so importing the shared hook on a canonical read does not pull in model stacks; the public Flex exception identity remains unchanged. Validation: 303 targeted backend/test.sh cases (intake, real Session dispatch, released/private schema isolation, API response/cache, privacy races, cursors, executor cancellation/bulkheads, compatibility Flex routing, consolidation queries and delete/re-add identity), 1,039 Firestore/Dream guard and regression cases (one harness deselection), 2,046 exact CI slow-guardrail cases, full-tree Pyright, additional existing Session/isolation suites, and the released app-client compatibility gate. Fake metadata/delete tests defer the external normalizer while retaining real admission, lease, deletion and evidence paths; no timing allowances or weaker admission were added. Luna privacy/deadline and final import/fixture reviews returned SHIP. Lead ruling9caa64 waives another review for the final two test-only fixture changes; production code is unchanged from reviewed e6549e5. Final-head terminal CI follows before lead handoff. Normal hooks run without skips, through omi-heavy and nice -n 19. The lead must verify serving release identity and metadata-only runtime receipts after deployment. Luna's nonblocking P2: a lazy SDK import fault outside model setup handling can consume quality retries. Supported deployment dependencies are locked; lead ruling2bf926 keeps that fix in a small follow-up PR from main after this merge, with one Luna round. The validated patch is preserved and owned by memreq on card:memreq-required-intake-20261026. Why this is a shared primitive: all required captures use the canonical post-commit hook, shared normalization receipts and source fences; the existing Dream scheduler owns retries. No per-surface repair or parallel memory writer is introduced. Product invariants: INV-MEM-1, INV-MEM-2, INV-MEM-3, INV-MEM-4, INV-MEM-5, INV-DATA-1, INV-INT-1. New intake remains Short-term; no direct Long-term/graph promotion or legacy mutation authority is added. Failure-Class: FC-pending-queue-without-dispatch-owner UI-Evidence: none -- backend lifecycle, internal Dream schemas and runbooks; no rendered UI changes. Line-Count-Exception: backend/database/memory_apply_store.py | 2865 -> 2869 | Four lines invoke shared Dream lease and required-source transaction fences at the existing canonical write boundary. Line-Count-Exception: backend/utils/memory/canonical_memory_adapter.py | 3953 -> 3970 | The existing canonical commit boundary must invoke the extracted intake module and recognize its current normalization receipt for raw-submission idempotency. Line-Count-Exception: backend/utils/memory/memory_service.py | 4698 -> 4708 | The existing write boundaries register post-normalization API view/cache refreshes; hidden candidate scope stays with the owner-search instance. Intake orchestration and backlog implementation live in separate modules.
Uncertain or other speakers can currently reach eager conversation-memory formation, media minima remain in the feed, and equal wave-2 percentages select different accounts across producer and consumer modes. This change admits only confidently owner-attributed speech to eager memory input in the aligned speaker serve cohort, hides retained media on clients with restore support, keeps uncertain summary speakers anonymous, and aligns all nine wave-2 percentage cohorts.
The original transcript/audio and canonical memory authority stay intact. No confident owner means no memory model call or empty source replacement. External explicit-text intake retains its existing authority. The synthetic durable-finalization harness now establishes the positive owner fixture through the real manual-label HTTP route. The code-coupled design note scopes the missing streaming cross-device reconciliation and secondary-socket dispatch; those paths are not implemented by this PR.
Owner admission requires recognized positive-match provenance or a manual decision; the deserializer's compatibility
is_userstatus and carried labels cannot establish confidence. V2 writes positive decision provenance. Manual evidence carries the exact segment IDs it binds, so an excerpt contributes only its own duration to media classification. Surplus merges union all manual excerpt scopes, and unknown legacy scope remains unknown. The existing two-second owner floor is preserved: a six-second genuine owner excerpt still protects speech; a one-second excerpt cannot turn a twenty-minute bystander voice into owner speech. Plausible acoustic owners retain their existing conservative protection against exclusion, independently of manual excerpts; that protection grants no owner label or memory authority. Reprocessing a discarded card, and later regenerating a restored card, pass explicit/persisted keep choice before classification. Keep authority is saved with restored visibility in the fenced canonical write, so a downstream failure cannot strand a visible row without its durable keep marker.The owner-memory guard uses the existing SPEAKER_EVIDENCE_MODE serve cohort. Shadow/off and non-cohort accounts retain the previous extraction input, avoiding fleet-wide withholding before V2 evidence is available. Bounded, content-free source/segment admitted-withheld counters use the already exported media/noise family; they measure attempts including retries, not unique memories. Sweep-owned formation is outside this eager entrypoint and needs its own acceptance receipt.
No deployment, cohort/flag enablement, data mutation, notification, workflow or firmware change. The current nine serving cohorts were verified empty before changing their percentage salt. Deploy the parser consistently across producers and consumers before any percentage ramp. Desktop Show discarded/restore remains a separately tracked acceptance blocker; the existing client-capability fence is retained.
Validation: 292 current-source cases across seven focused backend/test.sh files pass, including both excerpt merge orders, unknown legacy scope, the title fixture, and restored-content persistence before a forced downstream failure. Six regressions failed before their fixes. Exact-head CI at 0ec2d75 passes all 58 checks, including all backend unit shards and hermetic E2E. The strict serve-cohort LISTEN/pusher/Firestore gauntlet and all 13 contention tests also passed. Pinned formatting and all normal publication hooks pass without skip flags. Both required Grok rounds are collected; all accepted findings are fixed, and lead explicitly accepted the final fixes and the likely-acoustic policy rebuttal under the two-round cap. No third round or production application. Synthetic data only.
Failure-Class: FC-memory-subject-trusts-diarization-label
Product invariants affected: INV-MEM-4, INV-TASK-2. This preserves canonical Short-term intake, consolidation/promotion and fenced replacement authority; it adds only a conservative source-admission filter. Task Candidate/direct-write policy and explicit user acceptance are unchanged.
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3261 -> 3282 | Enforce cohort-scoped owner-only memory input before paid work, observe admitted/withheld attempts, persist restore authority with content, and retain the capability fence and source-replacement authority.
Line-Count-Exception: backend/testing/listen_pusher_stack/run.py | 1868 -> 1896 | Establish positive memory fixtures via the real manual-label HTTP authority and serve cohort so durable replay and memory-fence scenarios remain behavioral coverage after stricter admission.
Line-Count-Exception: backend/routers/conversations.py | 2432 -> 2436 | Propagate explicit restore and durable user-kept authority through the existing reprocess entrypoint before content classification.