Skip to content

Update README.md - #15

Merged
akshaynarisetti merged 1 commit into
mainfrom
akshaynarisetti-patch-1
Mar 30, 2024
Merged

akshaynarisetti merged 1 commit into
mainfrom
akshaynarisetti-patch-1

Conversation

@akshaynarisetti

Copy link
Copy Markdown
Contributor

No description provided.

@akshaynarisetti
akshaynarisetti merged commit 732891e into main Mar 30, 2024
@akshaynarisetti
akshaynarisetti deleted the akshaynarisetti-patch-1 branch March 30, 2024 23:47
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
rmulligan added a commit to rmulligan/omi that referenced this pull request Apr 29, 2026
…eline.py)

Replace the broken lilly_query_timeline.py path with the actual
Hermes MCP server entry point (hermes mcp serve). Make it
configurable via HERMES_AGENT_MCP_CMD and HERMES_AGENT_MCP_ARGS.

Also remove the mcp-server-hermes wrapper package I created earlier
since it was the wrong approach -- mcp_serve.py is already a
proper stdio MCP server.

Closes BasedHardware#15.
mdmohsin7 added a commit that referenced this pull request Jun 27, 2026
aryanorastar pushed a commit to aryanorastar/omi that referenced this pull request Jul 22, 2026
…gotchas

docs(windows): bar window gotchas — the four traps + fast verification loop
Git-on-my-level added a commit that referenced this pull request Aug 4, 2026
…ks (#11029)

## Summary

- Make the durable `account_deletions/{uid}` marker a single fail-closed
admission policy across Firebase, developer/MCP keys, OAuth issuance,
HTTP/WebSocket entry points, Agent proxy sessions, and Agent VM
provisioning. Completed and unknown markers remain fenced so an old
token cannot revive a deleted UID.
- Make deletion admission atomic at `pending`, revoke UID-bearing
API/OAuth credentials, delete the account's GCE Agent VM before its
Firestore pointer disappears, and transactionally fence late proxy/VM
writes so in-flight work cannot recreate owner data.
- Make accepted macOS cleanup durable across restart, drain owner-bound
VM/sync work before deleting storage, remove the legacy anonymous
fallback, upload a consistent SQLite snapshot with cancellable
compression and bounded retries, and preserve typed startup errors in
Flutter.

Repeated delete requests during `pending`/`running` intentionally
receive typed `403 account_deletion_in_progress` responses without
marker rollback or requeue. The deletion fence is preserved.

Canonical project: [BasedHardware Project
#15](https://github.com/orgs/BasedHardware/projects/15)

## Sanitized incident evidence

- A delete confirmation preceded a later same-provider
sign-in/onboarding sequence by nine days.
- The deleted UID's user document and GCE instance were gone, while its
durable deletion marker completed after retried queue acceleration
failures.
- No verified event proves old server memory reads after deletion. This
PR treats legacy local-database migration, still-valid old credentials,
and late owner-scoped work as identity-isolation risks; typed readiness
failures remain timeout-class evidence rather than proof of server data
disclosure.

Related lineage: #10444, #7696, #9632, #10597, #9821, #6891, #6892,
#10600, and #10694.

## Failure class

Failure-Class: none

This is an audit-driven hardening sweep across durable deletion
admission, credential revocation, local owner-data disposal, and Agent
VM/proxy lifecycle safety. The reusable prevention surfaces are the
shared fail-closed policy, transactional admission/CAS writers, the
durable local cleanup journal, the effective-owner generation fence, and
behavioral regression tests.

## Product invariants affected

- INV-AUTH-1 — preserves the exclusive effective-owner transition,
clears accepted-deletion storage before credential/session publication,
blocks every credential family after durable admission, and rejects late
owner-bound Agent VM continuations.
- INV-CHAT-1 — drains Agent VM/sync work at the existing owner
transition, transactionally fences late proxy message/session writes,
and preserves typed startup failures without changing canonical
transcript ownership.

## Changed paths

-
`.github/scripts/product_file_line_count_ratchet_baseline/backend-database.json`
-
`.github/scripts/product_file_line_count_ratchet_baseline/backend-routers.json`
-
`.github/scripts/product_file_line_count_ratchet_baseline/desktop-swift-root.json`
- `app/lib/services/agent_chat_service.dart`
- `app/test/services/agent_chat_service_test.dart`
- `backend/agent-proxy/Dockerfile`
- `backend/agent-proxy/main.py`
- `backend/database/account_deletion_projection_fence.py`
- `backend/database/mcp_oauth.py`
- `backend/database/users.py`
- `backend/dependencies.py`
- `backend/routers/apps.py`
- `backend/routers/desktop_agent_vm.py`
- `backend/routers/mcp_sse.py`
- `backend/routers/oauth.py`
- `backend/routers/transcribe.py`
- `backend/services/users/account_deletion.py`
- `backend/testing/e2e/test_account_deletion_cloud_tasks.py`
- `backend/tests/services/users/test_account_deletion.py`
- `backend/tests/unit/test_account_deletion_auth_fence.py`
- `backend/tests/unit/test_agent_proxy_async_boundaries.py`
- `backend/tests/unit/test_agent_proxy_startup_client_gone.py`
- `backend/tests/unit/test_byok_security.py`
- `backend/tests/unit/test_dependency_async_boundaries.py`
- `backend/tests/unit/test_desktop_agent_vm.py`
- `backend/tests/unit/test_mcp_api_key_auth_context.py`
- `backend/tests/unit/test_mcp_oauth.py`
- `backend/tests/unit/test_oauth_token_async_boundaries.py`
- `backend/utils/account_deletion_access.py`
- `backend/utils/other/endpoints.py`
- `desktop/macos/Desktop/Sources/AgentSyncService.swift`
- `desktop/macos/Desktop/Sources/AgentVMService.swift`
- `desktop/macos/Desktop/Sources/AuthService.swift`
- `desktop/macos/Desktop/Sources/Chat/RuntimeOwnerIdentity.swift`
- `desktop/macos/Desktop/Sources/DefaultsKey.swift`
- `desktop/macos/Desktop/Sources/DesktopAutomationBridge.swift`
-
`desktop/macos/Desktop/Sources/MainWindow/Pages/Settings/Components/SettingsContentView+SettingsUpdates.swift`
-
`desktop/macos/Desktop/Sources/Rewind/Core/RewindDatabase+AccountDeletion.swift`
- `desktop/macos/Desktop/Tests/AgentSyncBatchQueryTests.swift`
- `desktop/macos/Desktop/Tests/AgentVMLifecycleFenceTests.swift`
- `desktop/macos/Desktop/Tests/AuthSessionCoordinatorTests.swift`
- `desktop/macos/Desktop/Tests/OnboardingPersistenceClearingTests.swift`
- `desktop/macos/Desktop/Tests/RewindDatabaseLifecycleTests.swift`
-
`desktop/macos/changelog/unreleased/20260802-account-deletion-local-data.json`
- `desktop/macos/e2e/flows/logout.yaml`

## Verification

- Focused backend deletion/auth/proxy/VM suite: `194 passed`.
- Hermetic Cloud Tasks deletion suite: `5 passed`; repeated
pending/running requests are asserted as typed `403` without requeue.
- Focused macOS deletion, owner-fence, snapshot, and sync suite: `32
tests`, `0 failures`.
- Focused Flutter Agent Chat suite: `2 passed`.
- Follow-up MCP OAuth consent suite: `37 passed`.
- Follow-up macOS cleanup/bridge compile suite: `17 tests`, `0
failures`.
- Python runtime sources compile cleanly; pinned Python/Dart/Swift
formatters and `git diff --check` are clean.
- Required CI-lane PR-body preflight: `34 checks passed` in `108.01s`.

Backend Hermetic Merge Gate: in scope because backend runtime and
hermetic contract code changed.

## Limitations

- No production Firebase/Auth, Firestore, Cloud Tasks, GCE, deployment,
release, or customer-data mutation was performed.
- Same-provider recreation is covered hermetically at the UID/auth
boundary; no live Google sign-in was attempted.
- Agent readiness and teardown are covered through backend
state-machine, proxy protocol, owner-generation, snapshot/upload,
credential cleanup, and stale-pointer tests; no live GCE VM was
provisioned.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/11029?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="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Git-on-my-level added a commit that referenced this pull request Sep 24, 2026
- The device pill and the record button wrap their gestures in
  Semantics(excludeSemantics: true), which also dropped the tap and
  long-press actions; the Semantics node now carries onTap (and the record
  options long-press), so VoiceOver/TalkBack can activate them
  (onboarding-home #15, #24).
- Phone-mic offline fallback notice is an OmiFeedback info toast.
- Sweep: auth-gate spinner is OmiSpinner; welcome Continue uses
  OmiHaptics; OmiGlass OTA page formatted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Sep 24, 2026
…d audit fixes (#18436)

* feat(app/ui): add OmiColors tokens and stop using colorScheme.primary as a page background

Add lib/ui/omi_tokens.dart: OmiColors (surfaces, text, neutral accent, status), OmiType ramp,
OmiRadius, OmiSpacing, OmiMotion (honours Reduce Motion) and OmiHaptics.

53 sites read Theme.of(context).colorScheme.primary as a page or app bar background because the
theme's primary was black. They now name OmiColors.surface0 (same black), so the theme can get a
real accent. In the four files over the line-count threshold the explicit colour is dropped
instead; the theme default is the same black.

AppStyles and ResponsiveHelper get doc comments pointing at the tokens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/ui): one theme and shared controls for navigation, buttons, sheets and page states

Theme (lib/ui/omi_theme.dart, used by main.dart and the visual_audit harness so they cannot
drift): a real dark ColorScheme with the white accent as primary, black scaffold, app bar theme
(black, flat, centred 17pt semibold title), white progress indicators (the unstyled spinners were
black on black), floating surface2 snack bars, surface1 dialogs and sheets, neutral switches.
Material 2 stays on. MaterialApp.builder now syncs Intl.defaultLocale to the resolved locale.

Components under lib/ui/components (barrel lib/ui/ui.dart): OmiBackButton / OmiCloseButton
(platform glyph, localized label, 44pt target, circled variants), OmiIconButton (required label,
tooltip), OmiButton (primary/secondary/destructive/tertiary, regular/compact, async loading that
always clears), OmiSpinner, OmiLoadingState / OmiEmptyState / OmiErrorState, showOmiSheet and
OmiSheetScaffold, OmiSwitch, OmiSettingsGroup / OmiSettingsRow / OmiSectionHeader,
OmiSearchField, and omiPageRoute for code that needs a Route object.

HeaderCircleButton is now a wrapper over OmiIconButton.filled and AnimatedLoadingButton over
OmiButton (fixes the spinner that never cleared after a throw, and the 40pt target).
find_device's two unstyled ElevatedButtons keep their black fill explicitly now that primary is
white.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(app/settings): move data privacy, Asana and ClickUp settings onto the shared controls

Proving set for the new primitives. Data & Privacy uses OmiBackButton, a section header and an
OmiSettingsGroup of app rows, OmiEmptyState, and drops its accent tint for neutral tokens.
Asana and ClickUp show an app bar with a back button and OmiLoadingState during their first
load (the page used to be an invisible spinner with no way out), OmiSpinner for section loads,
and tokens for their colours. The shared IntegrationSettingsPage header uses OmiBackButton and a
labelled refresh OmiIconButton, and its disconnect control is an OmiButton.destructive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/ui): one adaptive confirmation system (showOmiConfirm/showOmiAlert)

getDialog, ConfirmationDialog, OmiConfirmDialog and AppDialog become thin
adapters over OmiAlertDialog: Cancel always shown and always closes, real
CupertinoDialogActions on iOS (destructive red, safe choice bold), localized
defaults, a destructive flag, and AppDialog.show no longer drops singleButton
and onCancel. Non-page raw AlertDialogs in providers/widgets migrated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/ui): OmiFeedback toasts and OmiClipboard

One floating neutral toast at a time with contract timings (confirm 1.5 s,
info 4 s, error 8 s with close, undo 5 s with no close, resolving whether the
reader undid). Snackbars with actions no longer persist forever. The home
shell registers its tab-bar clearance. AppSnackbar's ~180 call sites route
through it. OmiClipboard refuses empty text and skips its toast on Android 13+
where the system already confirms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/ui): OmiDateFormat, OmiDuration and shared speaker names

Dates follow the app locale and the 24-hour setting; durations have one
offset/compact/long vocabulary (the playback bar no longer drops hours).
SpeakerNames is the single source for speaker labels in app and export:
You / person / Omi / dense Speaker N, localized in copied transcripts.
Legacy helpers delegate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/ui): PromptQueue for startup and background prompts

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(checks): INV-UI-3 mobile UX contract ratchet

Per-rule, per-file no-increase ratchet over hand-rolled back glyphs,
PageRouteBuilder, raw sheets/dialogs/snackbars/clipboard, date patterns,
colour/font-size/radius literals, raw spinners, '...' and hardcoded Text
copy under app/lib, with an allow-comment escape hatch and a test proving
each rule fires.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(app): mobile UX contract

The numbered rules and the one primitive for each: leaving a surface, sheets,
controls, destructive actions (D5), dialogs, feedback timing, copying, dates
and durations, speakers, tokens, words (D3), settings (D4), page states,
prompts, permissions and accessibility, plus the D1/D2/D6 navigation calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app/ui): dense speaker numbering on live and saved transcripts

Both transcript renderers pass the conversation's segments to speakerLabel so
Speaker N is numbered per conversation. Drops the dead duplicate
formatChatTimestamp in widgets/transcript.dart, makes Material OmiAlertDialog
scrollable, and points primitive docs at the contract's sections.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/l10n): contract words sweep

Task(s) replaces Action Item(s)/To-Do in every locale (D3); Omi capitalised;
'…' instead of '...'; search placeholders drop the ellipsis; Try Again, Not
Now, OK, Title Case buttons. New keys: filterBySpeaker, notNow, discard,
keepEditing, discardChangesTitle, discardChangesMessage. Translates the nine
live-capture keys that only existed in English and removes five orphaned
locale keys, so scripts/l10n.py check passes. The upgrade alert offers Not Now
(postpone, not ignore-forever) and Update, honours barrierDismissible, and
loses the emoji.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(app/ui): export feedback, format and prompt primitives from the ui barrel; token colours

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(app/ui): follow the Title Case clear-search label

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/l10n): strings for the conversation detail pass

Link Event sheet, calendar event actions, search result navigation, playback
labels, the share confirmation, the Tasks tab counts and empty state, and the
speaker identify label, with translations for every locale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app): conversation detail on the shared primitives

- D2: no body-wide swipe to another conversation and no PageRouteBuilder;
  Transcript/Summary(/Tasks) swipe as tabs, the Tasks tab exists only when
  there are tasks.
- Header: OmiBackButton.circled plus same-size OmiIconButton circles (star,
  share, more) and a compact Ask Omi button that pushes Chat (D1).
- Share asks before making a private conversation public and reverts it
  when the share sheet reports a dismissal.
- Copy Conversation ID and Test Prompt only in developer mode; copies go
  through OmiClipboard, toasts through OmiFeedback.
- Link Event and calendar event sheets on showOmiSheet with OmiDateFormat,
  l10n and full attendee names; visibility, summary template, name speaker
  and edit segment sheets on the shared shell.
- Audio download sheet pops with its own context, offers Cancel and blocks
  back with PopScope.
- Title: single line, Done, Untitled placeholder, saves on blur with an
  announced outcome; detail date/duration use OmiDateFormat/OmiDuration.compact
  (same rule as the list).
- Tasks tab: tapping a task opens the shared task editor; labelled count
  pills; Tasks wording (D3); OmiEmptyState.
- Edit segment sheet: speaker from SpeakerNames (You for the owner), Save and
  Cancel, discard guard.
- Extract calendar sheets, search bar, transcript tab and tasks tab; delete
  dead ActionItemsListWidget, GetSheetTitle, GetDevToolsOptions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): keep INV-UI-3 allow comments on the flagged line

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app): transcript bubbles and playback bar on the shared primitives

Transcript: one SpeakerNames resolver per build (dense numbering, live
people), no transcription-provider name, the start time as an OmiDuration
offset, a labelled 44pt play button, labelled speaker targets, neutral user
bubble and search highlight (INV-UI-1), localized 'translated by Omi', and
getLastTranscript numbers speakers across the whole conversation.

Playback bar: neutral surfaces instead of purple, a labelled 32pt play/pause
in a 44pt target, a labelled stop button, OmiSpinner, OmiFeedback errors, the
summary pill ellipsizes by layout instead of a hand-made '...', and the
summary template sheet opens through showSummarizedAppsSheet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/onboarding): shared permission row, real progress, back and resume

- OmiPermissionRow (lib/ui/components): reason, Allow -> system prompt,
  Allowed, Open Settings when the system will not ask again. One
  OnboardingPermissionsPanel drives both the first-run step and the
  returning-user interstitial; Continue never fires prompts and 'Always'
  location is no longer asked during first run.
- Onboarding wrapper: placeholder pages removed, progress dots count the six
  real steps with a spoken 'Step N of M', PopScope makes system back step
  back, the last reached step is saved per account and resumed.
- Consent step offers 'Use a Different Account' (sign out, back to start).
- Acquisition survey is skippable; language step saves with a busy button
  and a Try Again error; picker selects on tap.
- Steps share OnboardingCard (content scrolls, footer stays; min-height, no
  fixed text heights) and OmiButton; completion screen localized, purple gone.
- Voice introduction: mic refusal shows the permission row; 'Skip Question'
  vs 'Skip'; device tutorial exits by a trailing close X.
- Permission reasons rewritten, platform-neutral Location Services copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/conversations): one delete path with Undo, row menu, bulk actions, recaps page

- Conversation delete (list swipe, row menu, detail page) goes through one path:
  confirm unless opted out ("Don't ask again" is allowed because Undo backs it),
  then an Undo toast backed by the provider's pending-delete window (now 6 s,
  longer than the 5 s toast; the toast commits early when it closes) (D5).
- Long-press on a conversation row opens one context menu: Open, Star/Unstar,
  Move to Folder, Share, Select, Delete. The selection bar gains Move and Delete
  (always confirmed) beside Merge.
- Daily Recaps is its own pushed page with a back button; Home's View All pushes
  it and the Conversations tab never switches into a recap mode. Pull-to-refresh
  reloads recaps and a failed load offers Try Again. Recap counts are labelled.
- One date filter for list and search, shown as a removable chip; the search
  field is seeded from the provider and uses OmiSearchField.
- Dates and lengths via OmiDateFormat / OmiDuration (Today gets a header, the New
  badge sits beside the time, WAL/recording offsets keep their hours).
- Discarded rows read "Discarded · 12s" with a plain-text snippet; blank titles
  read "Untitled Conversation".
- Shared capture state table (capture_state_labels.dart) for the in-progress
  card; the processing card shows its real start time.
- Local recording swipe always confirms. Sheets, dialogs, toasts, spinners and
  back buttons in conversations/, sync and recap pages move onto lib/ui.
- Offline Sync is the one name for the device-storage sync screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(app/conversations): cover Undo-backed delete, row menu, recaps page and capture labels

- Provider: the pending-delete window outlasts the Undo toast; undo restores,
  commit sends once, a regroup during the window keeps the row hidden.
- Widgets: Undo restores / timeout commits / bulk toast counts; long-press menu
  entries and Select; untitled and discarded row titles; Today header; the date
  filter chip; Daily Recaps page back button, labelled counts, Try Again and
  pull-to-refresh.
- Unit: the shared capture state table (an audio interruption is Paused).
- The Home preview's row menu leaves out Select (no selection bar there); the
  in-progress card's photo count is labelled; last raw spinner and "..." in the
  capture card go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/pairing): pairing recovery, one Bluetooth prompt, shared sheets

- Find devices: a missing Bluetooth/location permission goes through the one
  BluetoothReadiness guidance prompt (Open Settings); the local 'Enable
  Bluetooth' dialogs are gone.
- Nothing found: 'Scan Again', 'How to Pair' (connection guide), then
  'Contact Support' instead of a lone mailto link.
- Offline saved device: says how to wake it and 'Try Again' rescans (the
  old Retry did nothing).
- Firmware compatibility warning is an acknowledge-only alert; the
  non-critical one keeps its opt-out row.
- Device rows, guide cards and capture cards are real buttons with labels;
  battery shows a glyph and percentage with a spoken label, no emoji.
- Connection guide, pairing steps, Ray-Ban picker/setup and Apple Watch setup
  use showOmiSheet; Apple Watch is only offered on iOS; 'I've Done This'
  becomes 'Done'.
- Connect page: OmiBackButton, labelled settings button, and connecting
  returns to the existing Home (HomeNavigation.returnHome) instead of
  stacking a second one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/ui): edit-sheet dirty guard and row long-press menu primitives

showOmiEditSheet/OmiEditSheet own the drag so swipe-down, scrim tap, the close X and
system back all ask "Discard changes?" while an editor is dirty (the framework's
drag-to-dismiss pops without asking). showOmiRowMenu is the one long-press menu shape
for list rows (Open, edit actions, Select, Delete).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(app): follow the warning token on the paused dot and the Conversation Map title

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/l10n): lane 2 strings for memories, tasks, goals and people

Sheet titles without emoji, read-only memory hint, Undo toasts, task plural titles and
counts, shared-task strings, memory review card and People page labels, with every
locale translated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/memories): Undo-only deletes, openable read-only memories, guarded edit sheet

- Every memory delete (swipe, long-press menu, edit sheet) goes through
  deleteMemoryWithUndo: no "cannot be undone" dialog, the shared OmiFeedback undo
  toast with no X, and a commit scoped to the memory the toast offered. The
  provider's pending window becomes an 8 s backstop that outlasts the toast.
- Every memory opens: locked/superseded/ledger rows open the same sheet read-only
  with full text; swipe-delete only where editing is allowed.
- Long-press menu Open / Edit / Delete.
- Edit and new-memory sheets: explicit Cancel and Save, dirty guard, OmiButton.
- Page: OmiBackButton, OmiSearchField, labelled 44pt header buttons, neutral FAB,
  OmiEmptyState / error state, management sheet on showOmiSheet with a confirm
  that names the action and toasts that reach the page after the sheet closes.
- Memory graph: OmiBackButton, localized title, OmiLoading/Error/EmptyState, no purple.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/tasks): fixed swipe meaning, Undo deletes, guarded task and goal sheets

- One swipe meaning on every task row at every indent: right completes (or reopens),
  left deletes. Indent/outdent move to the long-press menu (and drag keeps its
  horizontal indent); long-press shows Open / Mark Complete / Indent / Outdent /
  Select / Delete.
- Single task and goal deletes are immediate with an Undo toast, backed by new
  staged-delete APIs on ActionItemsProvider and GoalsProvider (nothing hits the server
  until the toast closes). Bulk and clear-completed deletes confirm with a plural,
  verb-named dialog (the old one said "This will only remove deadlines").
- ActionItemFormSheet keeps its constructor; adds showActionItemFormSheet, explicit
  Cancel/Save, a close X in edit mode, a dirty guard and instant completion.
  The date picker and time picker are neutral (no purple) and locale/24-hour aware.
- Home and Tasks share one GoalFormSheet (Cancel/Save, dirty guard, localized).
- Tasks page: OmiSearchField "Search tasks", labelled overflow button, OmiEmptyState,
  neutral FAB/selection/drop indicators, localized "Exported to", counts with labels.
- Selection bar, shared-tasks sheet and Home Today card on the primitives (44pt
  targets, rows open the task sheet).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/people): tapping a sample plays it; delete is a labelled control behind a confirm

People page gets OmiBackButton, labelled Add/Help controls, an adaptive person dialog,
OmiEmptyState/OmiLoadingState and confirms that name the action. The memory review
card is localized with 44pt controls and tokens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app): one header for live, processing and saved conversations; one media viewer

- Live and processing pages share ConversationStateAppBar: the circled back
  button of the saved page and the state as the title (Recording / Paused /
  Reconnecting / Processing, one local mapping until lane 1a's shared
  capture_state_labels lands). No emoji status, no back button inside the
  title row.
- Live page: remove the unreachable Summary tab and its TabController; Process
  Now is an OmiButton, mute a labelled OmiIconButton; the stop confirmation is
  showOmiConfirmWithOptOut with a verb; speaker names from SpeakerNames;
  photo-group time from OmiDateFormat and a localized photo count; tokens for
  the timeline and the upload indicator.
- Processing page: one view (the transcript so far) under the shared header
  instead of Content/Summary tabs whose Summary only said 'Processing'.
- Media viewer: always a full-screen modal with a trailing OmiCloseButton and
  swipe-down to close (MediaViewerPage.open), labelled share button,
  OmiSpinner; photo grids and the live timeline open it that way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/chat): contract composer, drawer and failed-reply retry

Chat is a pushed page with a leading back (D1). Composer controls are
labelled 44pt targets; Send that cannot send (offline, uploading) is drawn
disabled with an offline hint. The apps drawer keeps Clear Chat at the
bottom behind a destructive confirm, and each app has one labelled Disable
(with Undo). A failed reply shows a localized error with Try Again that
resends the user's message instead of raw server text. The feedback sheet
is localized with a neutral Submit, thumbs read Helpful / Not Helpful, and
copy/share analytics send the message length, not its text.

Adds the lane-3 l10n keys for chat, apps and announcements.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/apps): one app action button, one consent dialog, Undo on disable

AppListActionButton reads Open / Enable / View with the same meaning in every
store list (no decorative Install). Enabling an app that works outside Omi
asks one localized question naming what leaves Omi; Disable is immediate with
a 5 s Undo on the detail page and in the chat drawer. The detail page moves
onto the header, button, sheet, dialog and feedback primitives, splits its
cards into widgets, and its cancel-subscription dialog reads Keep
Subscription / Cancel Subscription. Referral and app home pages share one web
page with a loading state, an error state with Try Again, and back within web
history.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/announcements): answer-only dismissal through the prompt queue

Announcements, feature screens and the changelog present through
PromptQueue. The dialog's scrim no longer dismisses; the close X or the call
to action marks an announcement seen, Not Now postpones it. The feature
screen is a full-screen modal route with a trailing close; the changelog
uses the shared sheet shell and error state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app/ai-app-generator): one leading back, system back steps to the prompt

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(app): sweep conversation sheets and small widgets onto the primitives

- Share via SMS and Create Template sheets use showOmiSheet, OmiSearchField,
  OmiButton, OmiSwitch, OmiEmptyState/OmiLoadingState and tokens; no purple
  (INV-UI-1). Create Template blocks back while the app is being created and
  opens the template picker from the navigator, not its own popped context.
- Markdown and expandable text: neutral search highlight and link colour.
- OmiSpinner and type/radius tokens in the speaker summary action, test
  prompts, photo image, person chip and waveform section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(app/ui): edit sheets and row menus in the barrel and the contract

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(app): conversation detail UX contract cases

Attendee names, detail duration rule, speaker numbering across the
getLastTranscript window, transcript bubble chrome (no provider, offset time,
44pt labelled play), the shared capture state header, search bar position,
the audio download sheet's own-context close/Cancel/back, the edit segment
discard guard, and the media viewer's trailing close.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): show conversation developer tools in debug builds too

No settings row writes devModeEnabled yet, so gating on it alone would hide
Copy Conversation ID and Test Prompt from everyone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(app): lane 3 checkpoint after spend-limit stop (uncommitted work preserved, not reviewed)

* wip(app): lane 4 checkpoint after spend-limit stop (uncommitted work preserved, not reviewed)

* wip(app): lane 5 checkpoint after spend-limit stop (uncommitted work preserved, not reviewed)

* test(app/settings): device page stub getters and sign-out keep-list

The one device page reads battery, charging and firmware getters the
double-tap test stub lacked, and its connected picture pulses; stub the
getters and turn on Reduce Motion so pumpAndSettle settles. Cover the
Sign Out keep-list: paired device and display preferences survive,
account values are cleared, and no credential is ever kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(app): name speaker sheet saves through the shared OmiButton

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(app/ai-app-generator): sweep the generator page onto the primitives

App bar with a leading OmiBackButton on both steps; neutral accent instead
of indigo/purple (INV-UI-1); OmiButton for Create App (busy state built in),
OmiIconButton for send and regenerate-icon (labelled, 44pt), OmiSwitch for
Make Public / Paid App, OmiSpinner, tokens for every colour, size and
radius. Description and Features headings come from l10n; category and
capability names use the shared localized titles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app/lane-3): plans sheet in the sheet shell, review fixes to the WIP checkpoint

- chat: the quota plans sheet opens through showOmiSheet (lane 4 handoff).
- chat evidence card: localized screen-reader hint.
- capability apps page: localized category titles, token refresh colours.
- const constructors and block-bodied ifs the WIP left for the analyzer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app/chat): conversation links push through routeToPage; evidence test hosts l10n

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(app): every push takes the platform route; shared-task link copy localized

- routeToPage builds its route with omiPageRoute (defaultTargetPlatform)
  instead of dart:io Platform, the Foundation A handoff.
- Deep links in AppShell, the People link in the name-speaker sheet and the
  firmware prompt in DeviceProvider push through routeToPage/omiPageRoute,
  never a bare MaterialPageRoute (iOS back swipe intact).
- The shared-tasks deep link's not-found toast and unknown-sender fallback
  were hardcoded English; now sharedTasksLinkExpired and
  sharedTasksUnknownSender in all 49 locales.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(app): drop imports the ui barrel already provides

Lane 2's edit-sheet and row-menu primitives joined the ui.dart barrel, which
left seven direct imports redundant and pushed unnecessary_import over the
analyzer baseline (CI's Dart Analyze & Tests failed on it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app/payments): labelled overflow menu, titled country picker sheet

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(app): people samples follow the one Voice Profile name

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/home): links open inside the one Home; startup prompts queue

- Notification taps and app links open inside the Home already on screen
  (HomeNavigation.openRoute: pop to Home, select the tab, push the page)
  instead of pushReplacement-ing a second Home over whatever was showing.
  Home registers itself while mounted, so "Done" at the end of the firmware
  and connect flows also returns to it (nav #3).
- Deep links move to home_deep_links.dart: parent before child (the
  Settings sheet opens before Data & Privacy is pushed over it), every push
  through routeToPage, and a removed app or deleted conversation now says so
  instead of only logging (nav #18).
- D1: the home chat bar, its mic, chat deep links and the Ask Omi / Voice
  quick actions push chat as a normal page (no fullscreenDialog). The chat
  bar is one labelled button.
- D6: Android back on the Tasks, Conversations or Apps tab returns to Home
  before it leaves the app (root PopScope).
- Settings: the language / speech profile / transcription model comparison
  runs once the reader is back on Home, not the moment the sheet opens
  (onboarding-home #25).
- Startup prompts go through PromptQueue (onboarding-home #23): upgrade
  alert (a required update first), changelog + announcements, the CV1
  tutorial (waits for the pendant), firmware announcements, the Plus-meter
  plans sheet (only when the meter crosses its threshold, once per session,
  showOmiSheet) and Bluetooth guidance. HomePromptGate holds the queue while
  phone recording, on a call or during a firmware update and pumps it when
  that clears; passive pendant capture does not hold it.
- Handoffs applied: dead toggleDailySummaries call removed (lane 1a); sync,
  task-export and quick-action pushes use routeToPage (lanes 2, 4). Header
  controls use neutral tokens (INV-UI-1) and OmiHaptics.
- New strings (7 keys, every locale): appNotFoundOrRemoved plus the startup
  failure and discard-recording strings used by the next commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/startup): startup failure offers Try Again and Contact Support

- The failure screen words the message by error class: a rejected build
  configuration (Env / startup-routing checks, now thrown as
  StartupConfigurationError) says the build is at fault and offers Contact
  Support; any other failure says to check the connection and offers Try
  Again, which re-runs start-up, plus Contact Support (onboarding-home #27).
- main() moves start-up into _start() so Try Again can run it again;
  ServiceManager.init, which refuses a second call, runs once.
- Localized without a localization scope (lookupAppLocalizations for the
  device locale, English fallback); tokens replace literal colours/sizes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app/speech-profile): confirm before discarding a recording in progress

- Back or swipe while the voice sample is recording asks "Discard
  Recording?" (Discard / Keep Recording) instead of dropping it
  (onboarding-home #26).
- "Reconnecting…" is an info toast, not an error.
- The help control is a labelled OmiIconButton ("How to take a good
  sample?") opening showOmiAlert; back is OmiBackButton.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app/home): header pill and record button expose their actions

- The device pill and the record button wrap their gestures in
  Semantics(excludeSemantics: true), which also dropped the tap and
  long-press actions; the Semantics node now carries onTap (and the record
  options long-press), so VoiceOver/TalkBack can activate them
  (onboarding-home #15, #24).
- Phone-mic offline fallback notice is an OmiFeedback info toast.
- Sweep: auth-gate spinner is OmiSpinner; welcome Continue uses
  OmiHaptics; OmiGlass OTA page formatted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(app): delete webhooks.dart, reachable only from the removed dev-tools widget

Its one importer was GetDevToolsOptions in conversation_detail/widgets.dart,
which nothing constructed and lane 1b deleted. The dead-code ratchet flags the
now-unreachable file; the webhook settings themselves live in
DeveloperModeProvider and the users API and are unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app/home): a link counts as opened once its page is pushed

openHomeDeepLink awaited each push, so HomeNavigation.openRoute (and the
notification-open telemetry behind it) only resolved when the reader closed
the page. It now resolves once the destination is on screen. A missing app
or conversation is an info toast, as the contract says; the contract names
HomeNavigation.openRoute / returnHome.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): address review round 1 (ZCode GLM-5.3)

- A memory's Undo restores only that memory: restoreLastDeletedMemory takes
  the toast's id, so a stale toast cannot restore a newer delete (test added).
- A failed task delete no longer inserts a Home-only task into the Tasks
  list; the staged index goes straight to _restoreDeletedItem, which skips -1.
- The conversation pending-delete window is 10 s, so an Undo toast that
  starts late behind other snack bars still gets its full time; the toast
  still commits early when it closes.
- The integration page's button reads "Disconnect" instead of stripping the
  question mark from a translated sentence (broke ¿…? and ? locales).
- mounted checks after the long awaits in the Create Template sheet and
  Wrapped 2025 generation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(app): keep memories_provider under its line-count ceiling

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(app/apps): app creation forms on the shared form pieces and primitives

Submit App and Manage App draw their screenshot strip and GitHub URL card
from app_form_fields (screenshots open as a modal viewer with a trailing
close), use AppFormCard/section titles/input decoration, OmiSwitch rows
for Public/Paid (no indigo/green thumbs), OmiButton for submit/update,
a leading OmiBackButton, and l10n for every string. Update asks with
showOmiConfirm and a verb button (Update App); Submit's confirm reads
Submit App; Start Earning is an Omi sheet with Not Now.

App metadata pickers are Omi sheets, App ID copy goes through
OmiClipboard. API keys: adaptive dialogs, destructive Revoke confirm,
OmiFeedback toasts, localized dates. Add MCP Server: OmiBackButton,
OmiButton, OmiFeedback. Provider snackbars and picker titles localized.

New l10n keys: generateDescription, selectImageFileTitle,
selectThumbnailImageTitle, appIdNotFoundError, manifestRefreshedSuccess,
manifestRefreshFailed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(app/apps): store home, filters and reviews on the primitives

The store's filter sheet opens in the Omi sheet shell; header icon
controls are labelled 44pt OmiIconButtons; empty search is OmiEmptyState.
Reviews: OmiBackButton, adaptive reply dialog, OmiFeedback toasts,
OmiButton busy state, localized Add/Edit Your Review and rating counts,
readable (not grey-700) secondary text. App summary and capabilities
card localized. Screenshot taps on the detail page open through
openAppScreenshots (modal, trailing close). Review avatar palette drops
its purple entry (INV-UI-1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(app/apps): Disable hides at once, commits after the Undo toast, Undo restores

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app/lane-3): localized pricing value on Manage App and file-picker title in chat

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): address review round 2 (lane 5)

- A throw while preparing the Omi firmware update (for example a corrupt
  download that fails zip extraction) now ends in the failed state instead
  of an installing spinner with back blocked and every prompt held.
- Home drops the prompts it enqueued when it is disposed, so after sign-out
  and sign-in the new Home's announcements, device tutorial and firmware
  notices are not deduplicated against dead closures.
- The speech step re-reads the microphone permission when the app resumes,
  so granting it in Settings clears the Open Settings row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(app): retire AnimatedLoadingButton

Lane 3 moved its last callers (payments, app detail) onto OmiButton, which
owns the busy state and recovers when the action throws; the dead-code
ratchet flags the unreachable widget. Its throw-recovery test now runs
against OmiButton directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): address review round 3 (lane 3)

- Try Again on a failed reply releases the composer when the failure was
  already cleared, and the first app message releases it even if chat
  closes mid-request (both could leave typed sends blocked).
- Enabling an app again inside its 5 s disable Undo window cancels the
  pending disable instead of being overwritten when the toast ends; tests
  for that and for a refused disable.
- Stripe setup names the selected country from the full list, not the
  picker's filtered one, and always stops polling on dispose.
- The AI app generator shows a failed submit on the generated view.
- OmiWebPage's Try Again reloads the page that failed, not the first URL;
  a malformed app home URL shows the error state instead of throwing.

The reported Stripe double-submit is already prevented: OmiButton ignores
taps while its onPressed future runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): address review round 4 (#17297 merge and rulings)

- Share from a conversation row now behaves like the page: a private
  conversation asks first ("Anyone with the link can view") and goes back
  to private when the share sheet is dismissed (was: made public at once).
- Developer Settings gains a Conversation Developer Tools switch (writes
  devModeEnabled), so release users can still reach Copy Conversation ID
  and Test Prompt; 2 keys in 49 locales.
- The row's Separate… always disposes its controller; tests cover a
  confirmed separation from a row (the other recording, never the row) and
  the row share confirmation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(app): phone number verified date holds in every timezone

The fixture was UTC midnight, which is Jan 1 in Pago Pago; CI runs the
suite at UTC+14 and UTC-11. Local noon reads Jan 2 everywhere.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): conversation title and emoji share one line in the header

The title field kept Material's 48pt input height, which pushed the title
below the emoji; it is dense now and the one-line row centres both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app): every voice-profile entry opens the guided introduction

David's ruling (2026-09-24): the voice profile is the guided fill-in-the-
blank flow from #14514 (sentence starters, review, then voice, memories and
a goal). Two entry points still reached the old question-based page: the
Settings/Profile Voice Profile row for anyone who already had a profile, and
the capture card's "Teach Omi your voice". Both now open the guided flow.

The old page is unreachable, so it goes, with its two widgets, the
getDialog helper and the fade-in text widget only it used (dead-code
ratchet). Open PR #12531 edits the old page and will need to drop those
hunks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app): Star and Share back in the conversation top bar; record conversation actions

David, 2026-09-24 (overrides the earlier one-overflow ruling):
- the conversation page's top bar is Ask Omi (the primary, filled), Star
  and Share as matching 44pt icon buttons, then one "…" holding Rename,
  Move to Folder, Recordings and the rest, Delete last and destructive;
- one registered event, Conversation Action, records every conversation
  action with two closed enums: action (ask_omi, star, unstar, share,
  rename, move_folder, recordings_open, separate, delete, copy_transcript,
  …) and surface (top_bar, overflow, detail_body, row_long_press,
  row_swipe). No ids, titles or content. It goes through the C7 typed
  registry (contracts/analytics/events.json, generated Dart, a presence
  consumer) and AnalyticsManager, so consent and queueing apply.
Tests cover the event shape for every action and the top bar, overflow,
row long-press and row swipe call sites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(app): the people chip names only named speakers

David, 2026-09-24: never label a participant "Speaker 1". The conversation
header's people chip now shows the first named participant ("You" for the
account owner) and counts everyone else: "David + 3 others"
(participantsSummary, an ICU plural in 49 locales). With nobody named it
hides; a linked calendar event's attendees still stand in when the
transcript names no one. The transcript's own per-line speaker labels are
unchanged. Tests cover named, mixed and none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: drop pointers to the deleted speech-profile page

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): address review round 5 (voice profile and people chip)

- SpeechProfileProvider drove only the deleted question page; the guided
  introduction records through GuidedVoiceIO. Remove the provider, its
  registration, the onboarding back-step close() that no longer stopped
  anything, and its test.
- Drop pointers to deleted files: the addressability baseline entry and the
  logout flow's covers (now sign_out.dart); a stale doc paragraph.
- participantsSummary carries few/many forms so Polish, Czech and Slovak
  agree for 2-4 and 5+; other Slavic and Baltic locales use a
  count-agnostic "one more" form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Nov 27, 2026
…s 503 (SCA-2225) (#26458)

## What

Every handler-level designed 503 refusal on `POST /v2/sync-local-files`
now writes exactly one INFO record:

`sync_upload_refused uid=%s status=503 reason=%s trace=<32-hex
X-Cloud-Trace-Context id>`

The mechanism lives in `utils/sync/designed_refusal.py`:
- The handler calls `mark_designed_refusal(...)` right before the
designed 503.
- `designed_refusal_outcome`, the innermost decorator, captures the
handler's own response or exception.
- `records_designed_refusals`, outside `custody_upload`, writes the
record only if the final outcome is that same object and is a 503. A 503
that the custody finalizer substitutes is left unrecorded.
- The fence cutover is marked only when `SYNC_LEDGER_FENCE_MODE` is
explicitly `standby`, so an invalid setting that fails closed is not
marked.

The existing `backfill_day_cap` line moves onto this mechanism. Failure
503s write no record. Those include `sync_dispatch_unavailable` (staging
or sequencer), `sync_batch_unavailable` from batch-admission errors,
custody, config and platform 503s.

## Why

SCA-2225. The Cloud Run rollout guard used to exclude every
sync-local-files 503 (`refusal_statuses: [503]`), which hid real
failures. Removing that exclusion outright flips the labelled trip
backtest, because designed backpressure then counts as errors. Luna
approved a design on SCA-2225 (2026-11-27T00:09Z): exclude a 503 only
when the same revision logged a designed-refusal record for the same
request, and hold on anything that cannot be reconciled. The `trace=`
field lets the guard match each record to its own request log
one-to-one, so window edges do not skew the counts. The guard side of
the change is a separate PR stacked on #26438 (linked below).

Production shape check (ro-prod `read-only-bot-account`, 2026-11-27,
projections only, no payloads or uids read): backend-sync 503 request
logs for this route carry `trace=projects/based-hardware/traces/<id>`.
The existing `sync_upload_refused … status=503` records land in
`run.googleapis.com%2Fstdout` with `resource.labels.revision_name`.

### 503 inventory: `POST /v2/sync-local-files` (BasedHardware/omi
`origin/main` f628eab)

Line numbers are at f628eab. "Record" means one `sync_upload_refused
uid=… status=503 reason=… trace=…` line. The handler marks the refusal
right before its 503, and the outermost wrapper writes the line only if
that same 503 is the final response. Before this change, only #8 wrote a
record, and that record had no trace. `sync_upload_refused` is written
only inside `sync_local_files_v2`; no other route or file writes that
string.

| # | file:line | code | trigger | designed? | record before | record
after |
|---|---|---|---|---|---|---|
| 1 | utils/sync/stage.py:50 (router dependency) | stage unavailable |
`OMI_ENV_STAGE` missing or invalid | failure (config) | no | no (counts
as error) |
| 2 | utils/other/endpoints.py:65 | `directory_routing_unavailable` |
directory resolution fails | failure | no | no |
| 3 | utils/other/endpoints.py:112 |
`account_deletion_state_unavailable` | deletion-fence read raises |
failure | no | no |
| 4 | utils/account_cutover/access.py:260/262 |
`account_cutover_state_unavailable` | cutover state unreadable | failure
| no | no |
| 5 | live_upload.py:118 via `memoized_record_wait` (sync.py:852) |
`record_capture_pending` | cached conversation-level wait | designed |
no | **no (gap, see below)** |
| 6 | sync.py:873 | `sync_ledger_fence_cutover` | fence mode STANDBY |
designed pause only when explicitly configured* | no | **yes, explicit
standby only** `sync_ledger_fence_cutover` |
| 7 | sync.py:973 | `backfill_capacity` | backfill lane,
`SYNC_BACKFILL_ENABLED` off | designed (kill switch) | no | **yes**
`backfill_disabled` |
| 8 | sync.py:1040 (log at 1038) | `backfill_capacity` | unlimited_v2
backfill day cap | designed | yes, no trace | **yes**
`backfill_day_cap`, now with trace |
| 9 | utils/sync/record_token_lease.py:120 | custody admission |
`record_custody_append.begin` raises | failure (custody) | no | no |
| 10 | utils/sync/receipt_clock.py:197 / :204 |
`capture_clock_anchor_unavailable` | :197 too many scopes (bounded
refusal); :204 read fails | :197 designed, :204 failure | no | no (gap
for :197) |
| 11 | sync.py:1118 | "Historical recovery is paused" | retained
recovery while backfill is off | designed | no | **yes**
`retained_recovery_disabled` |
| 12 | sync.py:1169 | `capture_clock_identity_required` | future-clock
files with no device id | designed | no | **yes**
`capture_clock_identity_required` |
| 13 | live_upload.py:118 via record router (sync.py:1265,
intake.py:750) | `record_capture_pending` | 9 wait reasons are designed;
4 `*_failed` reasons are failures | mixed | no | no (gap for the waits)
|
| 14 | intake.py:749 | `record_capture_pending` | `record_router` is
None | wiring fault, unreachable | no | no |
| 15 | utils/batch_pipeline/upload_coalescing.py:242 |
`sync_batch_unavailable`, Retry-After 1 | coalescing wait | designed |
no | no (gap) |
| 16 | intake.py:987 | `sync_batch_unavailable` | decode-failure memo
hit | designed repeat | no | no (gap) |
| 17 | intake.py:1271 (`FutureCaptureRetry`) |
`capture_clock_anchor_pending` / `identity_required` /
`anchor_unavailable` | clock anchoring in batch decode | pending and
identity designed; unavailable failure | no | no (gap) |
| 18 | intake.py:1298 | `sync_batch_unavailable` | any batch-admission
exception | failure | no | no |
| 19 | sync.py:1421 | `sync_batch_unavailable` | batch declined an
estimated or retained-clock upload | designed decline | no | **yes**
`repaired_clock_batch_declined` |
| 20 | sync.py:1608 | `backfill_capacity` | backfill lane but not Cloud
Tasks eligible | failure (config, fail closed) | no | no |
| 21 | sync.py:1664 | `dispatch_hold` | staging hit
`DestructiveOperationInProgress` | designed pause | no | **yes**
`dispatch_hold` |
| 22 | sync.py:1675 | `sync_dispatch_unavailable` | GCS staging failed |
failure | no | no (counts) |
| 23 | sync.py:1758 | `sync_dispatch_unavailable` | sequencer
registration failed | failure | no | no (counts) |
| 24 | record_token_lease.py:93 (`@custody_upload` finally) | custody |
`record_custody_append.finish` raises; can replace any response |
failure | no | no |
| — | Cloud Run platform | — | no instance, queue full, crash | infra |
no app log | no (counts) |

\* #6: an invalid fence setting also fails closed to STANDBY
(`database/sync_jobs.py:154`) and returns the same 503. Since 61972e1,
only `SYNC_LEDGER_FENCE_MODE=standby` is marked; an invalid setting
stays unrecorded and counts as an error (regression test included).

**Records gap (designed, but still counted as errors):** #5, #10:197,
the wait reasons in #13, #15, #16, and #17 pending/identity. These 503s
come from below the handler: `live_upload`, batch intake,
`receipt_clock`. There the request's trace is not in scope, and the same
response code is shared with failure paths. Batch intake's outer `try`
also rewrites exceptions into the generic `sync_batch_unavailable`.
Recording them needs the trace passed down (for example a contextvar)
and its own review. Until then they count as errors on both revisions,
which is the conservative direction: a candidate that changes their rate
is scored as a 5xx change.

**Custody finalizer (#24), fixed in 61972e1:** the record used to be
written before `@custody_upload` finished, so a finalizer 503 could
replace a designed response after its record existed. Now
`designed_refusal_outcome`, the innermost layer, captures the handler's
own response or exception, and `records_designed_refusals`, outside
`custody_upload`, writes the record only if the final outcome is that
same object and is a 503. A finalizer-replaced 503 stays unrecorded and
counts (regression test included).

**Logging path:** the `utils/sync/designed_refusal.py` logger propagates
to the root handler that `main.py:27` installs through
`configure_logging(K_SERVICE, default_format='text', …)`. That handler
writes INFO to stdout as `INFO utils.sync.designed_refusal:
sync_upload_refused uid=… status=503 reason=… trace=<32 hex>`. Cloud Run
ingests stdout as `textPayload` in `run.googleapis.com%2Fstdout` and
labels it with `resource.labels.revision_name`. The trace comes from the
`X-Cloud-Trace-Context` header the handler already declares. It is the
trace id Cloud Run writes into the request log's `trace` field. No PII
is added beyond the existing `uid=` pattern.

## Composition and order

- This PR touches no guard files, so it has no conflict with #26438
(`lane/holdback-wiring`). The guard change is a separate PR stacked on
#26438: #26459. The workspace copy is Git-on-my-level/omi-workspace
#586.
- **Order:** this PR should be serving on backend-sync before either
guard change scores Sync. Before that, a revision's old
`backfill_day_cap` record carries no `trace=`, and the guard holds
(`INSUFFICIENT_DATA refusal_records_unparseable_record`) on any window
where that revision logged one. The first comparison against a pre-trace
inverse can therefore hold once.
- Rollback: revert this PR. The records are log-only; responses and
behavior are unchanged.

## Verification

Run with `omi-heavy run -- timeout 1800 bash test.sh …` (local,
hermetic):
- `test_sync_designed_refusal_record.py`: 19 passed.
- `test_sync_backfill_day_cap_upload.py` 11,
`test_logging_entrypoint_guard.py` 51,
`test_sync_ledger_fence_cutover.py` 14, `test_sync_capture_time_skew.py`
160: all passed.
- The other suites that touch `sync_local_files_v2` (future-early
parity, schema inventory, legacy dark, fair use, mobile standard batch,
batch language router, cloud tasks, assignment recovery, `test_sync_v2`,
batch intake outcome, custody admission privacy): 14, 15, 48, 30, 27,
31, 40, 210, 13, 51 and 193 passed.

The new tests cover:
- the record format and trace parsing, and the guard parser reading the
shared text format;
- a raised designed 503, which is recorded once and still raised;
- a mark made without the outer recorder, which writes nothing;
- **custody finish failing after a designed refusal**, which gives the
finalizer's 503 and no record; a clean finish records once;
- a wrapper replacing the response, which writes no record;
- the decorator order: recorder, then custody, then observe, then
capture, then handler;
- **an explicit `standby` fence, which is recorded; an invalid setting
(`stanby`, `on`) gives the same 503 with no record and logs
`invalid_config`**;
- a real over-cap upload, which writes exactly one traced record;
- an AST check that the seven marks each sit directly before a designed
503.

Not proven here: that production records carry the trace id. That needs
this PR serving, then a READBACK that `sync_upload_refused … trace=`
lines match request-log traces on the same revision.

Line-Count-Exception: backend/routers/sync.py | 4393 -> 4405 | seven
designed-refusal marks, the explicit-standby guard and two decorator
lines; the mechanism lives in utils/sync/designed_refusal.py

## Product invariants affected

none

🤖 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.

2 participants