Skip to content

fix(app): back account deletion responses with generated wire models - #23936

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/account-deletion-wire-models
Oct 29, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/account-deletion-wire-models

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Generate Dart wire models for the account deletion status, action, and restore responses already defined in OpenAPI.
  • Decode account deletion API responses through those generated types while preserving legacy aliases and conservative normalization.
  • Add coverage for generated-backed responses and preserve the existing deletion behavior.

This is separate from #23935: it fixes an existing main-branch backend unit failure after the account deletion API changes in #23873 and #23897. test_app_client_schema_inventory.py::test_inventory_separates_generated_backed_adapters_from_raw_manual_dtos reported one remaining manual Dart response adapter, account_deletion.dart.

Verification

  • backend/test.sh with BACKEND_UNIT_TEST_FILE_LIST=tests/unit/test_app_client_schema_inventory.py under nice: 14 passed.
  • cd app && flutter test test/unit/backend/http/deletion_contract_test.dart: 6 passed.
  • cd backend && .venv/bin/python scripts/generate_dart_models.py --group users --check: passed.
  • cd app && dart run build_runner build --delete-conflicting-outputs: completed; no tracked generated-file changes.

Metadata

Product invariants affected: none

Failure-Class: none

UI-Evidence: none

View guided diff Turn on auto-fix

Register the existing OpenAPI deletion response schemas in the users wire generator and use them in the account-deletion adapter. Preserve the conservative legacy normalization for grace, deadlines, counts and pending deletion acknowledgements.

This fixes the sole pre-existing CI failure on the Sync stack gauntlet PR without relaxing the zero-manual-DTO assertion.

Failure-Class: none

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

chatgpt-codex-connector Bot commented Oct 29, 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-29T03:16:06.873709Z 6d270e3 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
Git-on-my-level merged commit b5b32f1 into main Oct 29, 2026
62 checks passed
Git-on-my-level added a commit that referenced this pull request Oct 29, 2026
The Sync Cloud Tasks concurrency gauntlet must hold paid STT inside the
upload worker lease. PR #23919 (merge `0dee519a`) deferred full note
processing until merge settlement, so waiting for that processor could
never enter the gate. Current main already moved the call to STT; this
finishes that fixture contract and makes the hold behavior executable.

- Rename the gate, evidence and diagnostics to STT throughout the
fixture and its callers.
- Pin `SYNC_PROCESSING_HOLD_ENABLED=true` for normal scenarios. The held
concurrency scenario verifies one STT call, Redis fencing before
pipeline work and during STT, completed upload/ledger readback, pending
conversation hold, and a durable deferred enrichment obligation with
zero full-processor calls.
- Run the same concurrency scenario with the hold disabled and require
exactly one eagerly persisted full-processing result. Terminal duplicate
delivery must repeat neither STT nor full processing in either mode.

Product behavior, worker budgets and CI timeouts are unchanged.

Failure-Class: none

This is test-fixture phase drift after a deliberate product scheduling
change; no existing semantic failure class describes it. Why isn't this
a shared primitive instead? Both hold modes use the same STT gate and
`_assert_full_processing_policy` verifier in the existing blocking
emulator gauntlet, rather than adding a separate guard. The regression
instance is merged PR #23919, with the supplied bisect showing its
parent passes and merge fails waiting for the processor gate.

## Product invariants affected

none (test harness and fixture only)

## Validation

- Related units: 154 passed across
`test_sync_cloud_tasks_stack_ci_wiring.py`,
`test_sync_stack_postgres_hook.py`, `test_sync_processing_hold.py` and
`test_sync_reprocess_coalesce.py` (separate pytest processes).
- Full gauntlet: passed via `nice -n 10
backend/testing/sync_cloud_tasks_stack/run.sh --state-dir
/Volumes/Ephemeral/scratch/gauntlet-holdfix-20261029/full`, under
`omi-heavy` (both hold modes, all legacy Sync and batch scenarios, plus
5 passing Firestore shard-spread integration tests).
- Preflight: `make preflight` passed all 33 selected checks;
`scripts/pr-preflight --pr-body-file` also passed all 33 checks on
commit `d3981e1de54`.
- GCP tier: none; all services are local emulators/fakes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/23935?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/23935?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23935&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->



## Main CI follow-up

The backend unit failure is independent of the Sync gauntlet: main
currently fails
`tests/unit/test_app_client_schema_inventory.py::test_inventory_separates_generated_backed_adapters_from_raw_manual_dtos`
because account deletion is the remaining manual Dart response adapter
after #23873/#23897. The fix is split into [PR
#23936](#23936). This PR
excludes the app change; its unit checks need a rerun after the
main-branch fix lands.
Git-on-my-level added a commit that referenced this pull request Oct 29, 2026
…e/firestore-reads-flagoff-people-1029: the shard-5/6 red is the main-side inventory break between #23873/#23897 and #23936 per its own commit message; fixes the failing test on our base
@Git-on-my-level
Git-on-my-level deleted the lane/account-deletion-wire-models branch October 29, 2026 04:24
Git-on-my-level added a commit that referenced this pull request Oct 29, 2026
A silence-split conversation currently buys full notes before Jev
decides to absorb it. This moves automatic absorption to the shared
relevance-to-notes boundary, so raw donors never buy
notes/title/tasks/memories or run their derived effects. Late sync
bridges also keep every already-processed identity instead of deleting a
summarized donor after its maximum hold expired.

Failure-Class: FC-sync-enrichment-before-merge-settles

This is occasion architecture step 2 following #23919 and #23920. The
fix extends the existing shared processing/hold primitive with a
pre-notes absorption boundary and transactional donor fence. Historical
generated title-only results without rich-note receipts keep their
identity; known-owner deterministic minima receive raw-title provenance
independently of the first-summary cohort and remain mergeable before
full notes.

Product invariants: INV-MEM-4, INV-TASK-2. Existing memory promotion and
task-authority rules remain; donor intelligence is suppressed and
canonical processing uses the same authorities.

### Design and path audit

- **Live smart/Jev merge:** budget and relevance gates run first, then
the bounded existing Jev decision, then full notes only if the row
survives. The absorb transaction rechecks live job ID/revision, dispatch
generation, lease epoch/expiry, deletion and both content revisions. A
completed rich row cannot newly become a donor. The donor's committed
cleanup resumes under the existing durable job after errors or rollback.
- **Canonical refresh:** before-notes absorbs delegate to the existing
durable enrichment outbox. Further absorbs share the 600-second quiet
window and 3,600-second maximum hold. A processed survivor supplies the
baseline; at least 30 seconds of new speech or 80 words permits one
automatic late run. A donor that has never completed derived processing
bypasses the immaterial cutoff and forces a full survivor refresh,
preserving its action items and memories. Ordinary unchanged/immaterial
work settles without paid notes or vectors. A budget denial at the
maximum hold settles the hold and merge ledger without re-arming;
earlier denials keep their outbox wake. Raw survivors still pass
relevance on their first full run.
- **Offline sync / late bridges:** intake already assigns content before
enrichment. Beyond step 1's hold, assignment now prefers a processed
canonical and replans excluding any other processed would-be donors, so
late content cannot merge away existing notes. Explicit live targets and
manual speaker owners retain priority; incoming content remains
appendable.
- **Untitled self-heal:** recovery currently does not merge. Raw/minimum
recovery now uses the same pre-notes decision; rich recovery rows and
explicit user-ended rows retain their identities.
- **`sync_merged_into` chains:** workers resolve to the canonical row
and transfer durable custody before acknowledging the donor. Cycles,
deletion, leases, privacy and revision fences remain. No donor full run
is used to resolve a chain.
- **Desktop/pendant capture groups:** these are shared-speech metadata
associations, not destructive transcript merges. Both transcripts can
contain unique speech and retain independent relevance/processing.
Existing primary identity-evidence refreshes remain
fingerprint-deduplicated and capped at three attempts per group.
Collapsing these independent transcripts is not introduced here.
- **Cross-device duplicates:** overlap hints do not delete, discard or
append secondary transcripts; coverage grouping also remains
metadata-only. No unproven speech is suppressed. Home row absorption
remains step 3b; no UI change.
- **Other owners:** batch record lanes retain their
merge-before-projection authority; the legacy merger never claims their
rows. Manual merges remain explicit user intent over completed sources
with the existing durable merge job.
- **Explicit ends:** client finalize, first open, user reprocess, funded
backlog choice and manual merge stay immediate, and successful explicit
processing satisfies an outstanding hold without consuming its late-run
allowance.

### CI integration repair

Retry routing follows the canonical shared persistence-fence exception
so a handled retryable 409 stays retryable after the helper extraction.
Current main now supplies the generated account-deletion wire adapter
(#23936); this PR carries no duplicate client adapter.

UI-Evidence: none -- this PR changes backend processing only; no
widgets, navigation, copy, layout or user-visible behavior changed.

### Aggregate production baseline (read only)

Tier: **ro-prod**, only in a subshell sourced with
`~/.local/bin/gcp-agent-env.sh ro-prod`. No production writes,
account/document reads, API calls to api.omi.me or secrets output. Fixed
window: **2026-10-28 01:35:36.946711 UTC through 2026-10-29
01:35:36.946711 UTC**. GKE in-cluster Prometheus
`sum(increase(...[24h]))` estimates, rounded below; counters count
events/attempts, not unique conversations. Re-querying the fixed window
can shift counter estimates slightly as scrape samples settle.

| Path | Observed 24h aggregate | Already-processed-then-merged evidence
|
| --- | ---: | --- |
| Smart/Jev | 1,269.55 absorbs; 1,278.54 successful survivor refreshes |
Existing code places all new decisions after `_get_structured`/completed
persistence. Exact rich-note donor count is unavailable from the old
metric. |
| Desktop/pendant groups | 218.59 applied joins | 0 destructive merges
by code; grouping happens after member processing and retains both
transcripts. |
| Cross-device hints | 663.74 hints | 0 destructive merges by code;
hints do not suppress either transcript. Coverage-fold metric has no
series (unknown activity). |
| Untitled self-heal | 0 merges by code | `SERVER_RECOVERY` was excluded
by the old `capture_end` gate. Recovery volume is not measured by a
merge counter. |
| Sync assignment / bridge | ~945.6K merged intake operations; ~51.4K
creates | Includes appends, not a count of processed donors. The old
metrics cannot isolate processed-donor absorbs. |
| Redirect chains / flatten | 1,350.56 absorbed flatten events | Not a
chain-depth histogram or count of processed donors; redirects are
followed before callback processing. |

Queries:
`sum(increase(omi_conversation_smart_merge_decision_total{mode="merge",decision="merge",reason="absorbed"}[24h]))`;
refresh and flatten equivalents grouped by outcome/reason; `sum
by(event,outcome)(increase(omi_product_event_total{event=~"capture_group_joined|duplicate_capture_detected"}[24h]))`;
`sum by(outcome)(increase(omi_sync_intake_total[24h]))`. Sync hold and
bridge-retraction series were absent. GKE and Cloud Run scrape coverage
differs; do not infer zero or fleet totals from missing series.

Two metadata-only Firestore COUNT aggregations (smart donor `merged_at`
window, with/without `summary_output_present=true`) returned
`FailedPrecondition`; no index was created or document fetched. The new
bounded
`omi_conversation_merge_processing_stage_total{stage,donor_notes}`
measures actual note-bearing donors separately after rollout. This PR
does not invent an exact rich-note waste rate or dollar estimate from
event counts.

Planning estimate for the same 24h baseline: about **1,279 added
pre-notes Jev calls/day**, using 1,278.54 successful survivor refreshes
as a proxy for eligible candidate volume; there is no direct eligible
`SYNC_UPDATE` Jev-call counter. About **1,270 donor notes runs/day** are
avoided, using the 1,269.55 absorbs as a proxy. Jev's rate card is
$42,000 micro-USD per million input tokens ($0.000042 per 1,000 input
tokens; output is unpriced). At an assumed 1,000 input tokens/call,
1,279 calls cost about **$0.054/day**; actual mean input tokens are
unavailable in this aggregate, so spend scales linearly with token
usage. The refresh and absorb counters describe adjacent outcomes in
this flow and are not added together.

### Verification

Line-Count-Exception: backend/utils/sync/pipeline.py | 3919 -> 3935 |
mirror max-hold terminal settlement in the frozen legacy callback so
both callback bodies remain structurally identical.

#### Review follow-up (2026-10-29; head
`440544dbe2eccb98eaf7a11657447ae038071964`)

- A funded refresh denied at the one-hour maximum now settles the
processing hold and merge refresh without re-arming a quiet-window wake.
The frozen sync callback mirrors this behavior to preserve callback
parity.
- A donor with no completed derived processing bypasses the immaterial
cutoff and uses the existing full survivor refresh, which extracts its
derived effects. This is the cheaper correct path versus a separate
donor extraction run; the regression test uses a 40-word, 20-second
donor.
- Focused verification:
`BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-23931-review-followup-tests.txt
nice -n 10 bash test.sh` from `backend/` passed the callback-parity,
occasion-merge, and process-usage files. The tests cover max-hold budget
denial and the 40-word donor.
- Push preflight passed all 40 checks against
`f60de9b011ec70cfcab05fde0a6c2669a652ab02`; backend typecheck had 0
errors; runtime-image contracts passed; all 15 selected backend unit
test files passed. GitHub CI returned **GREEN OPEN CLEAN MERGEABLE** on
this exact head with **0 pending, 0 failed**.

- Prior review head `080863f6e46`:
`BACKEND_UNIT_TEST_FILE_LIST=/tmp/occasion-focused-49.txt nice -n 10
bash backend/test.sh` through `omi-heavy` exited **0** across **49
selected backend unit files** (**513 passed, 1 deselected; 13 dependency
warnings**), covering smart/Jev merges, sync assignment and redirects,
capture groups, holds, leases, deletion fences, explicit ends,
retry/rollback and the kill switch.
- The standalone flag-budget suite passed **21 tests** with the
one-second fast-unit guard active. Replacing the Python YAML loader with
the safe C loader preserves safe parsing and removes the timing overrun;
the duration exception added by newer `origin/main` was removed as
unnecessary.
- Occasion-specific suite: **56 cases passed** for historical title-only
receipt protection, raw-minimum provenance, real structuring/finalizer
boundaries, late-bridge protection, donor ancestry and SDK contention.
- CI regression follow-up: **524 passed across 11 files**; the shared
generated account-deletion adapter test also passed locally (**6
tests**). No workflow, timeout, skip or test-duration exception was
added.
- `make preflight`: **40 checks passed** against current main
`e0cc9e13096f` on head `080863f6e46`.
- Backend typecheck: **0 errors**; async blocker gate: **0 findings**.
No live endpoint or production canary was run.
- The first exact-head GitHub run exposed the flag-budget test exceeding
its one-second fast-unit guard (21 assertions still passed). The safe C
loader fixes the runtime without a duration exception. GitHub CI passed
all **57 checks** on prior head `80f52633746`. Integrated head
`ffb346aefd3` passed all **58 checks** on retry after its first attempt
had no assertion failures but exceeded the shard-5 720-second budget by
8 seconds. Prior review head `080863f6e465` passed **58 GitHub checks**:
0 pending and 0 failed. `~/.local/bin/ci-wait 23931 BasedHardware/omi
90` returned **GREEN OPEN CLEAN MERGEABLE**. The review follow-up below
records the current head separately.

### Rollout and rollback

Default **on for every processing host**. Independent
`CONVERSATION_MERGE_BEFORE_PROCESSING` ops kill switch is registered in
`config/feature-flags.yaml` and the backend flag budget; owner
rollout-meetings; review 2026-11-28. Coordinator deploy train owns
production promotion; this draft does not deploy.

After deployment, observe the new stage/note-presence counter,
smart-merge rejects/failures, finalization failures and summary
debt/max-hold outcomes for one full hold window. Verify no automatic
`before_notes` donor has notes and no held canonical loses its wake. Jev
now sees transcript excerpts without a generated donor summary; merge
precision/recall must be checked on the rollout train before claiming
product acceptance.

Rollback: set `CONVERSATION_MERGE_BEFORE_PROCESSING=false` on every
processing host. It restores post-notes live merging, legacy sync donor
selection and immediate live survivor refresh; live-only merge holds
drain through their stored wakes/repair sweep; mixed sync work retains
the independent step-1 window and committed donor cleanup remains
retryable. `SYNC_PROCESSING_HOLD_ENABLED` is independent. No historical
data rewrite.

Unverified: production deployment/behavior, rich-note waste percentage,
Cloud Run-only events, Jev accuracy with an empty donor summary, and
destructive unification of metadata-only capture-group transcripts.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/23931?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/23931?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23931&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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