Repository navigation
failure-classes: register FC-hardening-reachable-only-by-injection - #14492
Git-on-my-level wants to merge 113 commits into
Conversation
Hot encrypt/decrypt paths re-derived the same HKDF key on every call. Memoize with a bounded TTLCache so multi-chunk audio and repeated field crypto reuse the key without changing ciphertext format. Verification: unit cache/roundtrip tests; cold vs warm derive_key microbench ~10x (500 iters: 0.0060s -> 0.0006s); encrypt_audio_chunk ~3.9x with cache. Co-authored-by: Max Carter 祁明思 <[email protected]>
set_generic_cache, cache_user_name, and cache_signed_url issued SET then a separate EXPIRE (extra RTT and TTL race on crash). Match neighboring helpers with a single SET ... EX. Verification: fake-redis unit tests assert one set(ex=...) and no expire(). Co-authored-by: Max Carter 祁明思 <[email protected]>
- Postprocess audio cleanup uses DeferredDeleter instead of sleeping 300s on a storage_executor worker (same class as #7531/#7855). - Fair-use classifier and executor health use start_background_task so failures are tracked/logged instead of bare create_task drops. - Evict speaker-sample migration locks after use so the module dict cannot grow without bound in long-lived processes. Verification: deferred-janitor/clean-sweep structural tests, tracked-task regression, migration lock release unit test; async blocker scan clean. Co-authored-by: Max Carter 祁明思 <[email protected]>
…r tasks start_background_task at the fair-use soft-cap seams needs two/three extra lines after black wrapping; record the exact baselines with justification. Co-authored-by: Max Carter 祁明思 <[email protected]>
The PR reflowed two untouched register_script Lua literals into a style the pinned formatter (black 26.5.1) rejects, failing the Formatting check. Reverted to the formatter's output, which matches main. Verified: black --line-length 120 --skip-string-normalization --check on all changed Python files -> 13 files unchanged.
The new eviction popped the lock entry whenever asyncio.Lock.locked() was false. asyncio.Lock.release() clears _locked before the woken waiter runs, so a finishing migration could evict a lock another coroutine was about to acquire; the next caller would then build a second Lock for the same person and two migrations would run concurrently against the same Firestore document — the exact race the lock map exists to prevent. Holders are now refcounted: the entry is evicted only after every caller that observed it has released. Verified: BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh over the changed unit files -> tests/unit/test_speaker_sample_migration_locks.py 2 passed.
Focused runs left _migration_lock_holders entries and held locks behind, letting later migration tests observe stale holder counts and assert inconsistently. Release every acquired lock and reset the holder map, then assert both module maps are empty.
# Conflicts: # .github/scripts/product_file_line_count_ratchet_baseline/backend-routers.json # .github/scripts/product_file_line_count_ratchet_baseline/backend-utils.json
* harden(dev-harness): define V1 live-session and V8 spine contracts Add strict Python/Dart pending contracts and introducing-commit protection. Reserve the live-session CLI, wire, ownership/attachment seams and failing builder acceptance tests. Add live attribution before freezing evidence v1. Verification: - bash scripts/dev-harness/run-tests.sh: 287 passed, 7 existing skips, 40 strict xfailed (24 pending V1 markers), Python 3.11.15. - make preflight: 16 checks passed, using supported PYTHON selection. - make mobile-verify fast --paths harness/session contract inputs with an absolute evidence directory: 20 executed, 20 passed, no failures/skips. - bash app/test.sh: 2014 passed, 5 skipped, one unchanged UTC+7 search_rank_grouping_test failure; affected baseline inputs match main. - Real module CLI refusals exit 2 without traceback; regression covered. - Dart SDK probe proves ext. prefix required; marker-removal formatter probe proves no incidental Dart diff. Runtime is intentionally unimplemented. App UI must repair current invalid VM extension names before live acceptance; unsupported journeys block. Simulator/emulator latency and detached-process acceptance remain V1 work. make setup installed hooks but full backend wheel sync stalled; isolated Python 3.11 harness dependencies ran the owner checks without any skip flag. Failure-Class: none * harden(dev-harness): scope the spine-contracts check to spine paths The check protects files under the spine roots and their registry, so it only needs to run when those change. A repo-wide trigger would run it, and its full-history requirement, on every unrelated contributor PR. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(dev-harness): clarify the live journey adapter boundary V1 must refuse live journey execution until a shared executable adapter exists; B1 addressability alone cannot attach Dart integration tests. Pure admission contracts remain valid with injected supported IDs. Verification: harness 287 passed, 7 skipped, 40 strict xfailed; make preflight passed 20 checks. * harden(app): define capture ownership and seam contracts C1 pending contracts specify recovery, foreground service, socket and session ownership; no existing runtime path changed. Verified UTC app suite (2041 passed), harness (287 passed, 7 skipped, 40 strict xfailed), 20 hermetic journeys, and 21 preflight checks. * harden(app): close capture adoption and late-completion contract gaps Specify inventory revision coalescing without losing explicit retries, late location-upload/finalization fences, and zero legacy actor adoption checks. Existing protected tests are unchanged. UTC app: 2048 passed; harness: 287 passed, 7 skipped, 40 strict xfailed; preflight: 21 passed. Correction to earlier verification record: C1 selected 3 journeys, all passed, not 20. One intermediate unchanged baseline replay test returned zero restored WALs; the full final run passed and its exact failure is retained in .local/c1-app-final.log. * harden(dev-harness): pin reviewed spine revisions and align B0 capabilities Coordinator turn-4 review authorizes the V1 fixture correction. Exact before/after digests pin the revised oracle; immutable revision records do not permit builder assertion edits. Active tests reject missing/tampered records and prove the fake machine response. Verification: full harness 289 passed, 7 skipped, 40 strict xfailed; UTC app 2020 passed; spine 24 pending/7 protected; make preflight 16 passed. No live device acceptance claimed. * harden(dev-harness): preserve marker retirement across spine revisions Track retained marker occurrences rather than counts so retiring a second test cannot restore the first test's retired marker. The active regression covers this swap and legitimate continued retirement. Verification: full harness 290 passed, 7 skipped, 40 strict xfailed; spine 24 pending/7 protected; make preflight 16 passed. Dart sources unchanged after the earlier UTC app 2020-pass run. * harden(dev-harness): retain corrected spine oracles through squash merges A squash can introduce a corrected contract and its review records in the same commit. Absorb only the revision prefix ending at that introducing file's exact digest, preserving immutable records and later marker-only edits. Active temp-repo regression covers multiple corrections in one squash and rejects restoring old or altered assertions. Verification: harness 291 passed, 7 skipped, 40 strict xfailed; B1 make preflight 20 passed; final B1 journeys 20/20. Dart unchanged after UTC app 41 opt-in and 2051 ordinary passed. * test(dev-harness): revise live session acceptance after builder review * test(app): scope capture ownership adoption and exercise real effects * test(dev-harness): bind machine fixture to actual child identity * test(app): keep capture adoption scoped to ownership extractions * docs: align capture contributor guidance with staged adoption * harden(dev-harness): separate oracle revisions from implementations Use the actual PR base and immutable exact scaffolding snapshots to reject mixed revision/implementation diffs. Exercise a real squash and child merge. Correct local_dev wire spelling from the simulator RPC and add adversarial V1 conformance oracles after reviewing the first broker. Verification: UTC app 2064 passed; full harness 303 passed, 7 skipped, 55 strict xfailed; spine 37 pending/9 protected; preflight 16 checks passed. Isolated reviewed-broker probes failed 9/9 as documented in the conformance report. No real app/device launch. * test(app): harden capture lifetime and preference seam contracts * harden(dev-harness): retain pinned corrections after older parent merges * test(app): cover capture subscription terminal callbacks * harden(dev-harness): pin oracle content across shared runners and merge orders Keep exact oracle digests and immutable revision records. Traverse full reachable history and match revision payloads by digest. Shared runner metadata requires direct fail-fast suite invocation instead of pinning shared file bytes. Both new regressions fail on the old checker. UTC app 2064 passed; final harness 306 passed, 7 skipped, 59 strict xfailed; spine 39 pending/10 protected; preflight 16 passed. No protected oracle bytes or legacy scope pins changed. * docs: define the meaning and limits of pending contracts Keep assertion and stub failures as strict expected failures in both languages. Pending green establishes an unmet executed contract, not correctness of its oracle. Compile/load and unexpected runtime errors still fail. Verified: UTC app suite 2099 passed; harness 313 passed, 7 skipped, 65 strict xfailed; spine check 78 pending / 27 protected; make preflight 21 passed. * test(spine): cover stale publication and unfinished capture teardown Add six V1 cases for lease rolls during readiness, malformed readiness, cached readiness after negotiation errors, and authorization-header leakage. Add six C1 cases for explicit cancellation drains, socket publication/drain races, synchronous stop invalidation and generation-scoped persistence fingerprints. Existing protected files and markers remain untouched. Expose only the builder-existing CaptureOwned.release skeleton signature. Verified: UTC app suite 2099 passed; harness 313 passed, 7 skipped, 65 strict xfailed; spine 78 pending / 27 protected; Dart analysis clean; make preflight 21 passed. All twelve new cases reject the pinned builder implementations in ignored probes. Review and commands: .local/conformance-review-t10.md, .local/t10-verification.md. --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
…14465) GitHub's pull_request merge ref has BASE as first parent, so a first-parent or HEAD~ diff describes the base instead of the PR and stacked children of a registry-adding parent fail for the wrong files. Diff merge-base(base, head) versus head so the branch head and both merge parent orders agree. Co-authored-by: Cursor <[email protected]>
…#14468) A gate that diffs first-parent or HEAD~ on GitHub's merge ref computes the wrong PR change set. The parent-order invariance tests are the guard. Failure-Class: new Co-authored-by: Cursor <[email protected]>
…14469) A matcher that hits zero paths must fail closed. The prepare/validate test that asserts exit 1 is the guard. Failure-Class: new Co-authored-by: Cursor <[email protected]>
* test(app): pin Omi Double Tap payloads before dropping unused Map Capture the five live feature values at origin/main so the later spread removal can prove the wire is unchanged for production callers. Co-authored-by: Cursor <[email protected]> * fix(app): drop unused additionalProperties from Omi Double Tap Every production caller already sends only feature. Removing the Map spread shrinks the live payload hole without changing the five wire values pinned at origin/main. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
A hint that matches nothing is skipped during candidate narrowing, so the class disappears and the author invents a new one. Fail closed when a changed definition adds a hint that hits zero tracked files. Co-authored-by: Cursor <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>
…tion A hardening that only tests can construct is not a shipped hardening. Tonight's three dark-but-green PRs all passed suites that injected the hardened object while production still built the default. Import reachability is not execution. Co-authored-by: Cursor <[email protected]>
…ions complete end-to-end (#14485) * fix(dev-harness): deterministic offline pre-recorded STT stub Offline sessions strip provider secrets by design, so uploaded captures dead-ended at PrerecordedSTTConfigurationError and conversations never finalized. Mirror the OMI_LLM_STUB pattern: a double-gated (OMI_STT_STUB + offline stage) deterministic provider whose transcript text is self-declaring synthetic, selected only inside harness child envs. * fix(backend): never call Google geocode without an API key Both geocode helpers fired the maps.googleapis.com request even with GOOGLE_MAPS_API_KEY unset — pure egress noise from offline sessions, where the key is stripped by design, and a request that can never succeed anywhere. Return None before any egress.
Inverse of #14290. The 35122919864 bake failed the candidate gate because the WIF deployer lacked roles/run.invoker (grant attempt died on expired human ADC). run.invoker verified granted 2026-09-18 via project policy; discriminator run 35076387145 (JSON lane, same image, same gate) passed. Rollback on gate FAIL keeps traffic on the prior revision.
…w granted) (#14509) ## Summary Re-lands the slice-2 WIF auth on `gcp_backend_auto_dev.yml` (exact inverse of #14290): swaps `gcp_credentials` for the dual-auth composite's WIF inputs — pool `omi-gha-deploy-dev`, SA `omi-ci-deployer-dev@based-hardware-dev`. ## Failure-Class Failure-Class: none ## Why this is now sound (the 401 RCA) Bake run 35122919864 failed the candidate gate `what_matters_now` because the WIF deployer lacked `roles/run.invoker` — the acceptance probe mints a deployer identity token (`gcloud auth print-identity-token --audiences=<service url>`) and calls the candidate revision; run.developer does not grant invocation. Discriminator: run 35076387145 (JSON lane, same image `ad7a5b5`, same gate) PASSed one day earlier; the identity token principal was the only variable. `roles/run.invoker` is granted and live since 2026-09-18 (project policy verified). Rollback safety unchanged: on any gate FAIL, traffic stays 100% on the prior revision and the candidate remains at 0%. ## Test plan - Composite `deploy-backend-stack` dual-auth landed in #14234 and is untouched (WIF/JSON mutual-exclusion validated in-action). - Merge triggers Release Eligibility → `gcp_backend_auto_dev` on `main`; success signature = `Candidate acceptance PASS: backend/what_matters_now=PASS, backend-integration/health=PASS, backend-sync/health=PASS, backend-sync-backfill/health=PASS` then traffic shift to `backend-<sha>-<run>-<attempt>` at 100%. - If the gate FAILs again: revert this PR (single commit) and the lane returns to the JSON bridge secret; traffic never moved. ## Product invariants affected - INV-DATA-1 Preserved: this PR changes only the deploy *authentication identity* for the `environment: development` lane of `gcp_backend_auto_dev.yml` (WIF deployer instead of JSON SA). It alters no routing authority, no serving endpoint, no Firebase/Firestore project binding, and no production-family artifact routing; deploys still target `based-hardware-dev` exclusively and the fail-closed traffic gate is unchanged. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/14509?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. -->
The live-capture screen named features the user's setup may not have
('Waiting for transcript or photos…' on audio-only capture) and described
degraded pipelines as healthy waiting (green 'audio saved locally' dot next
to a spinner that never resolves; a 3-second reconnect snackbar then silence).
Compose the empty state, title, and WAL indicator from the capability
signals already at the call site: photo-capable source (Ray-Ban Meta /
OpenGlass), UsageProvider.isOutOfCredits, ConnectivityProvider, and
RecordingState.interrupted. The WAL indicator now renders the worst
WalSyncDisplayState across the session's WALs, with a tap-to-retry for
failed uploads reusing the sync pages' deliberate single-recording retry.
Voice-training onboarding renders its uploading/memorizing/personalizing
states, which existed in the ARB but were never wired.
Rewords v2UndetectedMessage (no more 'we see you have a V1 device') and
transcribeLaterNote; deletes five dead never-rendered strings; replaces
the hardcoded 'Capturing' title with localized keys.
Resolves #14473; renders the missing status states for #14472.
…p GCP_SERVICE_ACCOUNT key staging
…es (#14473) (#14510) Resolves #14473. Also renders the missing status-feedback states for voice-training onboarding (#14472). ## Why The live-capture screen named features the user's setup couldn't produce, and described degraded pipelines as healthy waiting — the exact class #14473 filed after the SCA-486 physical run, where an offline-harness transcription failure left the UI on "Waiting for transcript or photos…" forever next to a "45s audio saved locally" toast with an unlabeled spinner. The fix follows the issue's method: compose copy from the capability signals already available at the call site, and give waiting states terminal variants. ## Live-capture empty state (`waitingForTranscriptOrPhotos`) `conversation_capturing/page.dart` now picks the empty-state line from the session's actual state: - **Audio-only** (no Ray-Ban Meta / OpenGlass source — the phone-mic default): `listeningTranscriptWillAppear` — "Listening… a transcript will appear here." instead of promising photos. - **Photo-capable source connected**: keeps "Waiting for transcript or photos…". - **Out of transcription credits** (`UsageProvider.isOutOfCredits`, force-flagged by the STT socket's 4002 close): `transcriptionUnavailableRecordingSaved` — a waiting state could never resolve, so it no longer claims to wait. - **Offline** (`ConnectivityProvider.isConnected`): `recordingOfflineTranscriptWillCatchUp`. - **Transcription socket dropped** (`RecordingState.interrupted`): reuses the existing `transcriptionPausedReconnecting` copy as a persistent state line instead of only a 3-second snackbar. The title also shows "Reconnecting…" instead of "Listening" while interrupted. ## Title The hardcoded English `'Capturing'` literal is replaced with localized `capturing` / `capturingPhotos` (photos-only vs. audio+photos). ## WAL indicator The WAL model already had a full user-facing state machine (`WalSyncDisplayState`) that the sync pages render; the live indicator ignored it and always painted a green "saved locally" dot. It now derives the worst outcome across the session's WALs via a new pure helper `worstSessionSyncState()` (wal.dart) and renders: - **uploading** → "Uploading {duration} of audio for transcription…" — the spinner now has meaning - **retrying** → amber "Retrying upload… {duration} of audio kept on your phone" - **failed** (auto-retries exhausted) → red "Upload failed — {duration} of audio kept on your phone. Tap to retry." — tappable, wired to the new `CaptureController.retryFailedSessionWalUploads()`, which reuses the sync pages' deliberate single-recording retry (`syncWal`, resetting the auto-retry budget) - **corrupted / outside recovery window** → the same terminal copy without a retry affordance, since a retry cannot succeed (`isRetryableSyncState` is `failed` only) ## Speech-profile onboarding (#14472) The provider already walks `uploading → memorizing → personalizing → allSet`; the strings existed in the ARB but nothing rendered them. The recording view now shows "Uploading your voice profile…" / "Memorizing your voice..." / "Personalizing your experience..." during the post-recording wait, so it no longer reads as stuck. (Also fixed the "profile...." typo.) ## Copy fixes - `v2UndetectedMessage` no longer asserts "We see that you either have a V1 device or your device is not connected" (false for users with no V1 at all); it states the capability requirement. Title "V2 undetected" → "Offline Sync unavailable". - `transcribeLaterNote`: "the phone microphone, Omi, and Limitless devices" → "the phone microphone and Omi or Limitless wearables". - Deleted five dead strings — defined and translated but never rendered, promising states nothing wired: `transcriptionFailed`, `startCapturingConversations`, `clickTheButtonToCaptureAudio`, `startRecordingToSeeTranscript`, `capturingAudioAndGeneratingTranscript`. The new state keys supersede them with next-step copy. ## Not in this PR (follow-ups) - The chat "Syncing messages with server…" banner has no failure variant — `MessageProvider` tracks no error state, so that needs provider work first. - `consentDataMessage` tells every user their audio goes to "Deepgram for transcription", including free-tier on-device STT users — legal copy, flagged for review rather than reworded here. - The 10 new keys fall back to English until translated; the 5 deleted keys remain inert in the non-template ARB files. ## Verification - `flutter gen-l10n` regenerated (HEAD generated files verified current for the pinned 3.44.5 before this change, so the diff is exactly this change). - `flutter analyze` on all changed Dart files: clean (two pre-existing info lints in untouched `wal.dart` code). - New tests: `worstSessionSyncState` / `isRetryableSyncState` ranking cases in `wal_sync_display_state_test.dart`; status-line rendering through all three uploading phases in `speech_profile_onboarding_test.dart`. - `bash app/test.sh` (hermetic suite): **2,150 passed / 5 skipped / 0 failed** on this branch, including the pre-existing suites for the touched pages. ## Failure-Class Failure-Class: new <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/14510?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. -->
…p GCP_SERVICE_ACCOUNT key staging (#14516) ## Failure-Class Failure-Class: none ## Summary Credential-rotation Phase C: makes the desktop-backend auto-dev release probe **JSON-free** — the last `secrets.GCP_SERVICE_ACCOUNT` consumption in the lane. The probe now signs Firebase custom tokens via IAM `signJwt` on the named signer (`vars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT` = `firebase-adminsdk-4z2mm@based-hardware`) instead of staging a base64 service-account key file in the runner. This is the Phase D gate item "desktop soak not JSON-free (probe B64 still staged)". ## Diff areas 1. `desktop_backend_auto_dev.yml`: delete the "Stage candidate probe signer" key-staging step; "Mint candidate probe identity" switches to `--signer-service-account "$FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT"` with a fail-closed empty-var check (env var sourced in the same step per the minter guard test); cleanup step drops the signer-file rm. 2. `check-desktop-backend-release-policy.py`: required fragments swap from key-staging markers to the named-signer contract (env mapping + flag + empty check). 3. `test_check_desktop_backend_release_policy.py`: fixtures updated; new negative guard asserting the workflow no longer references `secrets.GCP_SERVICE_ACCOUNT`. 4. `deploy-backend-stack/action.yml`: description/comments updated — desktop-backend moved to the named-signer path; `gcp_backend.yml`/`sync_ledger` still supply the credential (untouched behavior). ## Precedent The minter's `--signer-service-account` path is not new: #13559/#13667 landed it for the pusher dev lane (2026-09-13), green since. The IAM prerequisites already exist and are audit-verified: `FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT` set in env `development` (2026-09-16T04:21:46Z) and `roles/iam.serviceAccountTokenCreator` for `omi-ci-deployer-dev` bound on `firebase-adminsdk-4z2mm@based-hardware` by david@ at 2026-09-16T04:21:44Z (resource-level, token-signing only — no prod data access). See KB evidence 2026-09-18-iam-grants-and-rows-2-3. ## Verification - `test_firebase_release_probe_token.py` 19 passed (incl. workflow-signer guard tests) - `test_check_desktop_backend_release_policy.py` 37 passed + 58 subtests - workflow grep: zero `secrets.GCP_SERVICE_ACCOUNT` / `FIREBASE_PROBE_SIGNER_B64` / `DESKTOP_BACKEND_PROBE_SIGNER_FILE` - local `make preflight` green ## Risk / rollback If the IAM grant or var were missing, "Mint candidate probe identity" fails closed **before** traffic routing — dev keeps serving the prior revision; `candidate_only=true` dispatches skip the probe entirely and stay green. Rollback = single revert (the grant is inert without the flag). ## Product invariants affected - INV-DATA-1 Preserved: this PR changes only how the development desktop-backend release probe **authenticates its custom-token signing** (IAM signJwt on a named prod-project Firebase SA instead of a staged key file). It alters no routing authority, no serving endpoint, no Firebase/Firestore project binding; the probe still authenticates against `FIREBASE_AUTH_PROJECT_ID=based-hardware` exactly as before and still targets the 0%-traffic dev candidate. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/14516?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. -->
…ate failures (mint-stage suspect) (#14520) ## Failure-Class None — this is a revert of #14509, not a fix commit (no fix: prefix; see AGENTS.md failure-class protocol). ## Summary Reverts #14509: `gcp_backend_auto_dev` returns to the JSON bridge secret after three consecutive bake failures at the candidate gate (`what_matters_now` FAIL, sub-second gate duration, others NOT_RUN). Committed per the PR's own rollback contract. Traffic safety held all three attempts: candidates stayed 0%, serving never moved (`backend-8a5c388-35307543774-1`=100%). ## Evidence (three attempts) 1. Attempt 1 (35309620748#1, 05:35Z): gate FAIL 981ms after probe invocation. 2. Attempt 2 (#2, 05:56Z): identical FAIL. 3. Attempt 3 (#3, 06:54Z): identical FAIL — **after** `roles/run.invoker` (verified live) AND a self `serviceAccountTokenCreator` grant on the deployer. Manual control, same window: coordinator replayed the exact probe (deployer identity token via impersonation, audience = service URL, ADMIN_KEY+uid auth, X-Serverless-Authorization) against the candidate URL → **HTTP 200** at 05:38Z and again post-attempt-3. Discriminator: manual mint uses human impersonation; the CI mint (`gcloud auth print-identity-token` with no impersonation flag) runs in a WIF-federated session — the remaining untested variable. The acceptance runner intentionally swallows the failure stage/HTTP status (981ms gate ≈ mint-stage failure, not a service round-trip), so the next slice needs the mint step instrumented or a one-off diagnostic run before re-landing. ## What this revert does NOT do - Does not touch #14516 (JSON-free desktop-backend probe — baked green on main). - Does not change any IAM grant; the deployer's role set stays as audited. - Auto-dev auth returns to `secrets.GCP_CREDENTIALS` (bridge key `a3dd0875`), the exact pre-#14509 state. ## Next slice (before any re-land) 1. Add a bounded diagnostic to the mint step (or a dispatch-only probe workflow) that prints the mint subprocess return code class + HTTP status of the candidate call — no token material. 2. Reproduce the federated mint locally (`gcloud auth login --update-adc` federated → `print-identity-token` without impersonation) or via a one-off CI run with the diagnostic. 3. Re-land #14509 content once the mint path is proven green in CI. ## Product invariants affected - INV-DATA-1 Preserved: this revert only changes the deploy authentication identity of the development lane back to the pre-#14509 JSON bridge (no routing authority, endpoint, or project binding changes; `based-hardware-dev` target unchanged; fail-closed traffic gate unchanged). <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/14520?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. -->
) (#14521) ## Failure-Class None — docs-only follow-up to #14516 (agentic-instructions contract line), no fix commit. ## Summary Completes #14516's spec (its DIFF 4): rewrites the `.github/AGENTS.md` development desktop-backend acceptance line from the retired key-staging contract to the live named-signer contract that #14516 landed. The old line still told agents to stage `GCP_SERVICE_ACCOUNT` in a mode-0600 runner file — contradicting both the workflow and the release-policy checker on `main`. New contract line: dev release probes sign via IAM `signJwt` on `vars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT` (a `@based-hardware.iam.gserviceaccount.com` SA matching `FIREBASE_AUTH_PROJECT_ID`); the deploy identity needs `roles/iam.serviceAccountTokenCreator` on it; no service-account keys staged in runners. ## Product invariants affected - INV-DATA-1 Preserved: documentation-only change to agent instructions; no workflow, script, routing, endpoint, or project-binding behavior is touched. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/14521?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. -->
… actually reachable (#14513) * harness(dev): light the free-tier local-processing path the harness exists to exercise The free tier replaces managed summarization with an on-device projection. `FREE_TIER_LOCAL_PROCESSING` ships default-off, so the local harness has always processed every conversation normally and the on-device path was unreachable on the one machine built to run it end to end. Set it in `_harness_service_extra`, alongside `SCREEN_FRAME_EGRESS_ENABLED`, which is here for the same reason and carries the same comment. The flag alone lights nobody: `utils.free_tier_cohort` makes a lit flag mean "lit for the configured cohort" and admits no one when the cohort is unset, empty, or malformed. So the cohort is set too. `pct:100` is safe precisely here — the harness runs against the Firebase emulator (project `demo-omi-local`) with one local account per instance, so "100%" is every account that can exist on it, and none of them belongs to a real user. Both halves are asserted in `test_child_env_for_real_mode`, because setting only the boolean would leave the harness silently processing normally — the exact failure this change exists to prevent. Co-Authored-By: Claude Opus 5 <[email protected]> * feat(desktop): select Apple Foundation Models as the default local engine when available Ordinary free-tier Macs do not run a loopback server. Resolve AFM availability once at makeDefault and keep local-server as the developer fallback. A failed selected engine still fail-closes to the deterministic minimum. Co-authored-by: Cursor <[email protected]> * desktop: render the on-device summary the client already uploads The free tier replaces cloud summarization with an on-device projection. The produce side was complete: summarize locally, store, upload to `client_processing`. Nothing rendered it, so a free-tier user saw the deterministic minimum forever and the whole feature was invisible. The backend is deliberate about this. The bind endpoint "updates only `client_processing`. Never touches `structured`", and `ConversationProcessingState`'s docstring makes rendering a client contract: clients check `client_processing` first and render the projection regardless of `processing_state`. `ServerConversation.init` decoded the field and dropped it. Every display consumer - the list, the automation bridge, the reconciliation policy, the GRDB mirror - reads `ServerConversation.structured`, so selection happens once at the decode seam and every surface is correct without touching any view. What the seam had to get right, beyond the mapping: - Staleness. A projection names the transcript it summarized. When the response includes segments, the digest is recomputed and a mismatch is refused. List responses omit segments, so they rely on the server's binding and record `transcriptVerified: false` rather than pretending it was checked. - Unknown schema versions, in two layers. A future envelope is stripped before decoding so it cannot make the conversation unreadable, and `resolve` renders v1 only. - Precedence. `processing_state` cannot establish it - it is absent for both enriched and projected rows. The projection is selected only when the canonical structure is the deterministic minimum, which `build_deterministic_minimum_structured` defines as empty overview, category `other`, no sections, action items, or events. Cloud enrichment outranks a retained projection. Known limit: a title-only cloud result with otherwise default fields is indistinguishable from the minimum here. - Action items merge on exact description with canonical winning, including when `completed` is false, because OR-ing completion would resurrect a task the user had reopened. - Display attribution persists in its own `localSummaryJson` column. `clientProcessingJson` stays the producer-owned immutable retry blob; mixing them would corrupt retries. Drafted with codex gpt-6-astra, then reviewed, verified, and finished here. The precedence guard was checked field by field against the backend builder rather than taken on report. 18 tests, 0 failures: xcrun swift test --package-path Desktop --filter 'ConversationProjection(Rendering|Persistence)Tests' Co-Authored-By: Claude Opus 5 <[email protected]> * fix(backend): the free-tier gate must pass the uid, or it lights nobody `process_conversation` gated the entire S6 free-tier branch on `free_tier_local_processing_enabled()` with no argument, two lines above `resolve_free_tier_processing_plan(uid=uid, ...)` - so `uid` was in scope the whole time. That function answers False whenever it is given no uid, on purpose: `utils.free_tier_cohort` makes a lit flag mean "lit for the configured cohort", and a caller that cannot name the account is never admitted, so a boolean alone lights nobody. Called bare, it always returned False. So the free-tier branch was unreachable in every environment, whatever cohort was configured. Lighting FREE_TIER_LOCAL_PROCESSING plus a 100% cohort changed nothing: desktop conversations fell through to the legacy deferred path, and the on-device projection the client had already uploaded was never the basis for processing. The unit suites cannot catch this - they monkeypatch `free_tier_local_processing_enabled` itself, which its docstring says is the supported way to test the policy. It took an end-to-end run with the flag genuinely lit on a real bundle. The backend said so plainly once it was: free-tier cohort: FREE_TIER_LOCAL_PROCESSING consulted without a uid; admitting nobody at that call site until it passes one After the fix, the same capture produces: free-tier: stored projected conversation uid=alice conv=21377fc9... mode=store_projection reason=basic_not_entitled with canonical `structured` left at the deterministic minimum by policy rather than by a failed cloud call, and `client_processing.provenance.model_id=afm`. Co-Authored-By: Claude Opus 5 <[email protected]> * test(backend): the rollout-gate double must be asked about an account Every test in this suite replaces `free_tier_local_processing_enabled` with a zero-argument lambda, so none of them could see how the coordinator calls it. That is exactly how the missing uid survived: the real function answers False for a missing uid by design, the branch was unreachable in every environment, and the suite stayed green because a zero-argument double only ever typechecks against the broken call. The doubles now mirror the real signature and assert they were given a uid, so the shape of the call is checked rather than assumed. One new test pins the argument itself, since replacing the function is what blinds the others. Red-proof: reverting `free_tier_local_processing_enabled(uid)` back to a bare call fails `test_rollout_gate_is_asked_about_this_account_not_asked_bare` with a TypeError at the call site. With the fix, 40 passed. Co-Authored-By: Claude Opus 5 <[email protected]> * fix(backend): the memory-suppression gate must pass the uid too `extract_memories(uid, conversation)` called `free_tier_memory_suppression_enabled()` bare, using `uid` on the very next line. Same contract and same consequence as the S6 gate: the cohort admits nobody when it is not told which account it is deciding about, so the S5 branch was unreachable however the cohort was configured. The sweep and the connectors already passed `uid`; this site was the exception. The registry described both sites as not yet passing a uid. That is no longer true, so the registry says so. This does not turn S5 on. Both flags stay unset, admitting nobody, and lighting memory suppression is a separate decision that needs its own replacement story first - suppressing server-formed memories without an on-device equivalent is takeaway before replacement. 55 passed across the free-tier branch and memory-policy suites. Co-Authored-By: Claude Opus 5 <[email protected]> * desktop: the free-tier client gate defaults on in Beta The flag read env-or-UserDefaults and defaulted off, and nothing in the app ever wrote it. A shipped Beta build therefore had the client half dark with no way to light it short of a rebuild. That is not a missing convenience, it is the takeaway-before-replacement case. Beta serves through the development plane while keeping production identity. Lighting FREE_TIER_LOCAL_PROCESSING there with the client dark means an identified-basic user's conversation arrives carrying no projection; the policy resolves `store_projection if has_projection else deterministic_minimum`, the minimum is terminal, and the cloud summary is gone with nothing in its place. The two halves have to be lit together, so Beta is where the client default belongs. Only the absence of both an environment value and a stored default falls through to the channel default, so this stays a kill switch in both directions: - `object(forKey:)` rather than `bool(forKey:)`, because the latter cannot tell a stored `false` from a key that was never set - without the distinction Beta could not be turned off without a rebuild. - A blank environment value is "unset", not "off", so an exported-but-empty variable cannot silently dark the channel. Stable and every other bundle are unchanged and still default off. 13 tests, 0 failures: xcrun swift test --package-path Desktop --filter LocalProjectionFinalizationTests Co-Authored-By: Claude Opus 5 <[email protected]> * registry: name the class where a cohort gate is consulted without its subject A rollout gate that decides per subject and is asked without one admits nobody by design, so the branch behind it is unreachable in every environment while the flag and cohort still read as configured. The prevention has two halves: pass the subject at every call site, and make the test doubles carry the real signature, because a zero-argument stub stays green across exactly this defect. Co-Authored-By: Claude Opus 5 <[email protected]> * e2e: cover the projection rendering seam in the recording-finalization flow The flow already covers every source that produces and uploads the on-device projection. The seam that selects it at decode is the read side of the same feature, and uncovered it is exactly the gap this flow's later steps would observe as a placeholder title on a free-tier account. Co-Authored-By: Claude Opus 5 <[email protected]> * test(desktop): read fixture objects without a force cast SwiftLint bans force casts and the fixture mutators used seven. A silent `?? [:]` would be worse than what it replaces: a mistyped key would mutate nothing, the fixture would decode unchanged, and the assertion would pass for the wrong reason. The helpers fail the test at the caller instead. 18 passed. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Cursor <[email protected]>
…y operators (#14307) (#14318) * fix(iq_rating): unguarded OpenAI choices indexing and context_snippets coercion (#13980) * fix(coingecko-app): coerce null optional parameters to defaults (#13972) Updated fields to be optional and added coercion methods for better handling of None values. * Improve answer extraction from message content Refactor answer extraction logic to handle None values more gracefully. * Refactor Pydantic models in models.py Refactor Pydantic models for improved validation and clarity. * Add regression tests for IQ rating logic Added regression tests for IQ rating functionality, covering various edge cases including null content handling, empty choices, and malformed payloads. * Update models.py * Update models.py * Update checks-manifest.yaml * Remove iq-rating-regression-tests from checks manifest Removed iq-rating-regression-tests check from manifest. * fix(hygiene): remove trailing whitespace on checks-manifest line 6 * fix(crossref): strip known face markup tags while retaining inequality operators (#14307) - Strip Crossref face-markup tags (b, i, u, sub, sup, scp, tt, font, sc, strike) unconditionally before open/close tag filtering - Preserve inequality operators (e.g. If a<b, then c>d.) - Add regression tests covering chemical formulas (H2O, CO2), mathematical powers (E=mc2), and font attributes * fix(crossref): strip known face markup tags while retaining inequality operators (#14307) * fix(crossref): strip paired face markup tags while retaining inequality operators (#14307) * test(crossref): add regression tests for paired face markup and encoded inequalities (#14307)
…14427) get_products/get_inventory return a single Page/Limit page, but find_product_candidates, find_inventory_candidates, the WRO inventory-id fallback, and the /tools/get_products search filter all matched or filtered as if the first page were the complete catalog. Products or inventory records beyond page 1 reported 'not found', so a chat request could fail or a WRO could be created against the wrong item. Add _fetch_all_pages to drain bounded pages (with a 25-page safety cap) and use it on every completeness-sensitive path. Verification: python3 -m pytest test_main.py -x -q (66 passed, including 5 new pagination regressions covering multi-page aggregation, short-page termination, the page cap, and a page-2 name match). Failure-Class: FC-single-page-cap-mistaken-for-complete-proof
…#14570) - Add sdks/python-cli/examples/quickstart.ilo.md covering installation, authentication, pagination, and resource querying in Ilocano - Add localized discovery link to sdks/python-cli/README.md
Failure-Class: new
…ADME (#14547) sdks/python-cli/examples/ ships 68 localized quickstart guides, but the examples README listed only 21 of them. The other 47 were undiscoverable from the index: the files were merged over time without their index entry, so readers browsing the directory listing had no way to find their language short of guessing the file name. Adds one entry per unlisted guide, in the established format `* [`quickstart.XX.md`](quickstart.XX.md) — <native title> (<English> Quickstart).` Each native description is taken from that guide's own H1, so the wording matches what the reader lands on rather than a translation invented here. Documentation only; no guide content, code or behaviour is touched. Verified in the worktree: - every quickstart.*.md on disk (68) now has exactly one index entry - no duplicate entries, no broken links — every link target exists - every link label matches its target path Failure-Class: none Co-authored-by: Claude Opus 5 <[email protected]>
… in html routes (#14490) (#14491) * fix(notion): sanitize uid and eliminate reflected parameter injection in html routes (#14490) * fix(notion): import re and html in main.py for uid validation and escaping (#14490) - Closes #14490. - Add missing `import html` and `import re` in `plugins/omi-notion-app/main.py`. - Resolves review blocker on PR #14491.
…cing template (#14477) (#14478) * fix(subscription): sanitize uid and eliminate script injection in pricing template * fix(subscription): clean trailing whitespace and organize module imports - Strips trailing whitespace in index.html line 794. - Moves import re to module top in main.py. - Removes unused import re in test_subscription_security.py.
…imit (#14421) (#14422) * fix(hacker-news-app): drop deleted comments before applying comment_limit * fix(hacker-news-app): drop deleted comments before applying comment_limit --------- Co-authored-by: boai-maker <[email protected]>
…o $first (#14270) (#14271) * fix(linear-app): coerce search_issues limit instead of binding null to $first The #13920 coerce-limit pass covered tool_list_my_issues and tool_list_recent_issues but left tool_search_issues on a raw `body.get("limit", 5)`. dict.get returns None -- not the default -- when the key is present and null, which is what the backend sends for an omitted optional parameter, so `first` reached Linear as null against a non-nullable `$first: Int!`. The issues(filter:) fallback binds the same value, so the tool had no recovery path and every limit-less search failed. Non-numeric and over-cap limits were forwarded unclamped too. Route the caller-supplied limit through the existing coerce_limit() helper, matching the two list tools. Adds test_search_issues_params.py: a hermetic, standard-library-only suite mirroring test_list_issues_params.py so it runs in the manifest lane. It fails 13 assertions against the previous behaviour and covers both the primary and fallback query paths. Co-Authored-By: Claude Opus 5 <[email protected]> * ci: register linear search_issues params suite in checks manifest Adds linear-search-issues-params-tests alongside the #13920 sibling so the new regression guard runs in the local and CI lanes on any plugins/omi-linear-app change. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: boai-maker <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>
* fix(open-meteo-app): guard malformed forecast payloads Forecast parsing assumed every documented container was present and correctly\ntyped: payload, current, current_units, daily and daily_units were used as\ndicts, daily series as lists, and each series item as a number. An upstream\nshape change or a null series raised an unhandled error instead of the\nN/A / no-data path the formatters already implement. * test(open-meteo-app): cover the malformed forecast payload guards Drives the real request/parse path with a fake httpx client serving non-dict containers, null series, non-numeric entries and an undecodable body, so the new guards are pinned rather than merely present. * fix(open-meteo-app): keep the JSON number subtype when normalizing Returning the original int/float instead of a coerced float keeps the existing rendering byte-identical for integer-sourced values, and the widened helper signatures match what the guards actually accept. * ci: re-run required checks now that the maintainer gate is lifted --------- Co-authored-by: xyjk <[email protected]>
#14332) * fix(coingecko-app): guard malformed payloads and coerce numeric fields The CoinGecko parsers assumed every response was the documented shape: a dict body, a list of dicts, and JSON numbers. An upstream edge or error page that returns a JSON list, a bare string body, or numeric fields encoded as strings raised an unhandled AttributeError/TypeError, so the tool answered with an internal failure instead of a readable error. Normalize at the parse boundary: _as_dict/_as_list validate container types, _coerce_number converts numeric or numeric-string fields, and entry lists are filtered to dicts. Well-formed responses render exactly as before. * fix(coingecko-app): pin the per-request timeout and reject non-JSON bodies The shared client already carries a timeout, but the tool call did not pass one\nand a CDN edge can answer with HTML. Both paths ended as an unhandled error\ninstead of a readable tool message. * test(coingecko-app): run the malformed-payload suite in the manifest check The registered coingecko check only executed test_null_optionals.py, so the new response-parsing guards had no CI coverage. Run both suites instead. * fix(coingecko-app): pin pytest for the manifest lane and drop the redundant timeout Review feedback: the runner switched to `python -m pytest` but pinned_deps never gained pytest, so a clean environment failed with "No module named pytest" and broke the very lane that validates this plugin. Pin pytest==8.4.1 (matching the version already used elsewhere in the repo). The shared AsyncClient already carries REQUEST_TIMEOUT_SECONDS, so the per-request timeout argument was redundant; drop it. * ci: re-run required checks now that the maintainer gate is lifted * fix(scripts): probe pytest in the coingecko venv fallback too Reviewer's blocker on #14332 was that run-plugin-coingecko-tests.sh invokes python -m pytest without pytest in the pinned set. The uv path was fixed, but the venv fallback still probed only fastapi/httpx, so a clean venv that has those two would still die with 'No module named pytest' before running a test. Constraint: .github/checks-manifest.yaml routes coingecko-null-optionals-tests through this script, and the Hygiene lane runs manifest checks on main pushes, so a gap here goes red after merge. Rejected: Leaving the venv path as-is because CI prefers uv | the fallback is reachable whenever uv is absent, which is exactly the clean-environment case the reviewer reproduced. Confidence: high Scope-risk: narrow Directive: Keep this probe in sync with pinned_deps; it exists to fail loudly rather than vacuously. Tested: python -c 'import fastapi, httpx, pytest' -> deps ok; python -m pytest on test_malformed_payloads.py + test_null_optionals.py -> 14 passed. Not-tested: The uv path, which the same PR already pinned pytest for. --------- Co-authored-by: xyjk <[email protected]>
Auto-generated: consolidates unreleased changelog fragments into v0.12.364 and regenerates CHANGELOG.json.
…te (#14589) * harden(dev-harness): define V1 live-session and V8 spine contracts Add strict Python/Dart pending contracts and introducing-commit protection. Reserve the live-session CLI, wire, ownership/attachment seams and failing builder acceptance tests. Add live attribution before freezing evidence v1. Verification: - bash scripts/dev-harness/run-tests.sh: 287 passed, 7 existing skips, 40 strict xfailed (24 pending V1 markers), Python 3.11.15. - make preflight: 16 checks passed, using supported PYTHON selection. - make mobile-verify fast --paths harness/session contract inputs with an absolute evidence directory: 20 executed, 20 passed, no failures/skips. - bash app/test.sh: 2014 passed, 5 skipped, one unchanged UTC+7 search_rank_grouping_test failure; affected baseline inputs match main. - Real module CLI refusals exit 2 without traceback; regression covered. - Dart SDK probe proves ext. prefix required; marker-removal formatter probe proves no incidental Dart diff. Runtime is intentionally unimplemented. App UI must repair current invalid VM extension names before live acceptance; unsupported journeys block. Simulator/emulator latency and detached-process acceptance remain V1 work. make setup installed hooks but full backend wheel sync stalled; isolated Python 3.11 harness dependencies ran the owner checks without any skip flag. Failure-Class: none * harden(dev-harness): scope the spine-contracts check to spine paths The check protects files under the spine roots and their registry, so it only needs to run when those change. A repo-wide trigger would run it, and its full-history requirement, on every unrelated contributor PR. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(dev-harness): clarify the live journey adapter boundary V1 must refuse live journey execution until a shared executable adapter exists; B1 addressability alone cannot attach Dart integration tests. Pure admission contracts remain valid with injected supported IDs. Verification: harness 287 passed, 7 skipped, 40 strict xfailed; make preflight passed 20 checks. * harden(app): define capture ownership and seam contracts C1 pending contracts specify recovery, foreground service, socket and session ownership; no existing runtime path changed. Verified UTC app suite (2041 passed), harness (287 passed, 7 skipped, 40 strict xfailed), 20 hermetic journeys, and 21 preflight checks. * harden(app): close capture adoption and late-completion contract gaps Specify inventory revision coalescing without losing explicit retries, late location-upload/finalization fences, and zero legacy actor adoption checks. Existing protected tests are unchanged. UTC app: 2048 passed; harness: 287 passed, 7 skipped, 40 strict xfailed; preflight: 21 passed. Correction to earlier verification record: C1 selected 3 journeys, all passed, not 20. One intermediate unchanged baseline replay test returned zero restored WALs; the full final run passed and its exact failure is retained in .local/c1-app-final.log. * harden(dev-harness): pin reviewed spine revisions and align B0 capabilities Coordinator turn-4 review authorizes the V1 fixture correction. Exact before/after digests pin the revised oracle; immutable revision records do not permit builder assertion edits. Active tests reject missing/tampered records and prove the fake machine response. Verification: full harness 289 passed, 7 skipped, 40 strict xfailed; UTC app 2020 passed; spine 24 pending/7 protected; make preflight 16 passed. No live device acceptance claimed. * harden(dev-harness): preserve marker retirement across spine revisions Track retained marker occurrences rather than counts so retiring a second test cannot restore the first test's retired marker. The active regression covers this swap and legitimate continued retirement. Verification: full harness 290 passed, 7 skipped, 40 strict xfailed; spine 24 pending/7 protected; make preflight 16 passed. Dart sources unchanged after the earlier UTC app 2020-pass run. * harden(dev-harness): retain corrected spine oracles through squash merges A squash can introduce a corrected contract and its review records in the same commit. Absorb only the revision prefix ending at that introducing file's exact digest, preserving immutable records and later marker-only edits. Active temp-repo regression covers multiple corrections in one squash and rejects restoring old or altered assertions. Verification: harness 291 passed, 7 skipped, 40 strict xfailed; B1 make preflight 20 passed; final B1 journeys 20/20. Dart unchanged after UTC app 41 opt-in and 2051 ordinary passed. * test(dev-harness): revise live session acceptance after builder review * test(app): scope capture ownership adoption and exercise real effects * test(dev-harness): bind machine fixture to actual child identity * test(app): keep capture adoption scoped to ownership extractions * docs: align capture contributor guidance with staged adoption * harden(app): implement CaptureLifetime resource bag Timers, streams, and owned cancels drain on close even when one cancel fails. Close is idempotent and invalidates first, so a late acquisition after close dies immediately. Co-authored-by: Cursor <[email protected]> * harden(app): untrack CaptureLifetime resources on fire and cancel A day-long capture session would pin one dead cancel closure per once()/listen() that completed on its own. Release on fire, caller cancel, and stream done so the bag only holds live work. Co-authored-by: Cursor <[email protected]> * harden(app): forward capture composition seams into CaptureProvider composeCaptureProvider now passes WAL, mic, auth, clock, scheduling, connectivity, preferences, BLE, and socket through CaptureProvider into CaptureController. Production no-argument defaults stay; composeProductionCaptureProvider refuses FLUTTER_TEST before any singleton. Co-authored-by: Cursor <[email protected]> * test(app): prove capture composition routes seams and refuses FLUTTER_TEST Builder tests lock the cut-1 lazy passes: openSocket/WAL/mic must actually be forwarded, and the production composer cannot construct ConnectivityService with the health URL under test. Retires only the two composition spine markers this cut satisfies. Co-authored-by: Cursor <[email protected]> * style(app): apply dart format to capture_controller.dart Formatting only; required by the pre-push dart format gate. Co-Authored-By: Claude Fable 5.1 <[email protected]> * harden(app): join in-flight CaptureLifetime close and keep terminal bookkeeping A second close() while the first is still draining must wait for the same completion, asFuture must untrack even after it replaces inner callbacks, and replacement data/error/done handlers must not run after close begins. Co-authored-by: Cursor <[email protected]> * harden(app): keep injected capture preferences after construction Store the supplied SharedPreferencesUtil and route later reads and writes through it so batchMuted and the rest of the seam are not the global singleton, while ordinary construction still defaults. Co-authored-by: Cursor <[email protected]> * harden(app): own capture connect/reconnect and session generation Keep-alive during an in-flight connect now joins one socket attempt, and work started under generation N cannot publish after N+1. The explicit conversation-open path forwards session geolocation the way production already does, without changing default CaptureProvider() wiring. Co-authored-by: Cursor <[email protected]> * harden(app): join explicit CaptureLifetime cancellation until it finishes Untracking a callback is not the same as teardown completing; close now waits for in-flight own/subscription cancels without running them a second time. Co-authored-by: Cursor <[email protected]> * docs(app): record that CaptureLifetime close joins in-flight cancellation Co-authored-by: Cursor <[email protected]> * harden(app): fence capture publication to the admitted generation Admission already captured generation; publication after every await now keeps that original operation generation. Stop invalidates in-flight work before WAL teardown, and a skipped persist cannot occupy the fingerprint. Co-authored-by: Cursor <[email protected]> * test(app): register the CaptureLifetime drain spine file Co-authored-by: Cursor <[email protected]> * test(app): register capture publication-fence spine files Co-authored-by: Cursor <[email protected]> * harden(app): fence FGS intent and recovery wakes at the session owner A stop racing an in-flight start settles once; concurrent recovery requests join one drain. Stale finalize cannot wake a later session. Co-authored-by: Cursor <[email protected]> * chore(app): restore memories/page.dart to origin/main after merge format The merge-forward pre-commit hook reindented main's file and tripped INV-MEM-1 on a formatter-only diff. Lifetime does not own that page. Co-authored-by: Cursor <[email protected]> * chore(app): restore dart format on merge-forward trailing-comma splits Conflict resolution dropped trailing commas while keeping a split layout the formatter will not emit. Let dart format rewrite those 14 files; no semantic change. Co-authored-by: Cursor <[email protected]> * harden(app): cut production capture over to the session owner Both main.dart construction arms now go through composeProductionCaptureProvider, so C1 fences sit on the path the shipped app actually takes. Co-authored-by: Cursor <[email protected]> * docs(app): drop the inflated CaptureProvider() site count from OWNERSHIP.md The remaining test/fixture constructor is the obstacle, not a 122-site count from substring matches against composeCaptureProvider. Co-authored-by: Cursor <[email protected]> * harden(app): reconnect keepalive when transcription is not ready onClosed already clears readiness; keepalive was treating a still-connected transport as healthy and cancelling, so a tick never reopened. Dispose now closes the session owner so published sockets drain. Co-authored-by: Cursor <[email protected]> * harden(app): retire the five satisfied C1 lifetime pending markers #14327 landed c1_lifetime_review_test.dart and c1_lifetime_terminal_test.dart on main with pendingContract('C1') still set. The behaviour they pin was already implemented on this branch by f04ec71 and acdc197, so after the merge-forward all five executed green and the contract harness failed them as XPASS ("remove the pending marker") rather than as unmet contracts. No implementation change is required, and none is made here; only the five stale markers are removed, which is the one edit the spine protection allows. What each contract pins, and the capture_lifetime.dart behaviour that satisfies it: - concurrent close joins outstanding cancellation: a second close() used to hand back a fresh completed future and report teardown finished while the first drain was still awaiting an own() cancel. close() now short-circuits only on _closeFinished and otherwise returns the memoised _closing future, so every caller joins the same drain. - asFuture preserves completion untracking: _inner.asFuture replaces the subscription's done handler, so the listen-time drop() never ran and the registration outlived its future. _LifetimeSubscription.asFuture now chains whenComplete(_drop). - C1 asFuture error completion releases its registration: the same path on the error completion - whenComplete(_drop) untracks on throw as well as on done. - replaced callbacks and errors stay closed while cancellation drains: a handler installed through onData/onError after listen bypassed the closed guard and could still fire while close() was blocked on an earlier release. Those wrappers now consult _isClosed() before forwarding. - C1 original and replacement done callbacks respect closing: both the listen-time onDone wrapper and an onDone replacement now drop() the registration but return without calling the owner once _closed is set. Verified in this worktree at app/: flutter test 2161 passed, 0 failed. scripts/check_spine_contracts.py exit 0, 69 pending markers (was 74), 27 protected files. Co-Authored-By: Claude Opus 5 <[email protected]> * fix(app): restore spine original wrapping after merge format The merge commit's dart format rewrapped c1_lifetime_review_test.dart. Spine originals may only drop pending markers, so restore the lifetime bytes. Co-authored-by: Cursor <[email protected]> * fix(app): keep c1_lifetime_review_test.dart at the spine original pre-commit dart format rewrapped this protected original. Restore the lifetime bytes; spine allows pending-marker removal only. Co-authored-by: Cursor <[email protected]> * fix(app): drop unused CaptureProvider import after composition merge composeCaptureProvider is the seam; the provider import is leftover. Co-authored-by: Cursor <[email protected]> * style(app): format the two analytics files the socket merge left non-canonical These entered at this commit's parent merge. The merge resolution needed OMI_SKIP_DART_FORMAT=1 so the pre-commit hook could not rewrite a digest-pinned spine oracle (c1_lifetime_review_test.dart) — but that skip is all-or-nothing, so it also left analytics_manager.dart and omi_double_tap_goldens_test.dart unformatted, and they rode up the rest of the C1 chain. Formatter only, no semantic change. origin/main formats both paths with 0 changed, so this is the merge-collateral class, not new content. Co-Authored-By: Claude Opus 5 <[email protected]> * chore(app): apply canonical dart format to merge-forward touched files Follow-up formatting for the merge-forward: the previous merge commit's blobs were formatted by an older-style pass; this applies the pinned 3.44.5 formatter's canonical output to the 9 files the branch touches. No behavior change. * test(app): retire the satisfied C1 keepalive-join pending marker With the readiness-based keepalive trigger re-applied on the merged base, the contract 'real provider joins keepalive reconnect and disposes all newly scheduled timers' passes; its pendingContract('C1') marker is stale and is removed (XPASS remedy). --------- Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: Cursor <[email protected]>
* harden(dev-harness): define V1 live-session and V8 spine contracts Add strict Python/Dart pending contracts and introducing-commit protection. Reserve the live-session CLI, wire, ownership/attachment seams and failing builder acceptance tests. Add live attribution before freezing evidence v1. Verification: - bash scripts/dev-harness/run-tests.sh: 287 passed, 7 existing skips, 40 strict xfailed (24 pending V1 markers), Python 3.11.15. - make preflight: 16 checks passed, using supported PYTHON selection. - make mobile-verify fast --paths harness/session contract inputs with an absolute evidence directory: 20 executed, 20 passed, no failures/skips. - bash app/test.sh: 2014 passed, 5 skipped, one unchanged UTC+7 search_rank_grouping_test failure; affected baseline inputs match main. - Real module CLI refusals exit 2 without traceback; regression covered. - Dart SDK probe proves ext. prefix required; marker-removal formatter probe proves no incidental Dart diff. Runtime is intentionally unimplemented. App UI must repair current invalid VM extension names before live acceptance; unsupported journeys block. Simulator/emulator latency and detached-process acceptance remain V1 work. make setup installed hooks but full backend wheel sync stalled; isolated Python 3.11 harness dependencies ran the owner checks without any skip flag. Failure-Class: none * harden(dev-harness): scope the spine-contracts check to spine paths The check protects files under the spine roots and their registry, so it only needs to run when those change. A repo-wide trigger would run it, and its full-history requirement, on every unrelated contributor PR. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(dev-harness): clarify the live journey adapter boundary V1 must refuse live journey execution until a shared executable adapter exists; B1 addressability alone cannot attach Dart integration tests. Pure admission contracts remain valid with injected supported IDs. Verification: harness 287 passed, 7 skipped, 40 strict xfailed; make preflight passed 20 checks. * harden(app): define typed API results and consumer contracts Preserve auth results and existing endpoint protections while defining typed failures, partial row decoding, terminal locked/rejected states and bounded fallback telemetry. Verified UTC app (2058 passed), harness (287 passed, 7 skipped, 40 strict xfailed), 20 hermetic journeys and 21 preflight checks. Skeletons remain unreachable. * harden(dev-harness): pin reviewed spine revisions and align B0 capabilities Coordinator turn-4 review authorizes the V1 fixture correction. Exact before/after digests pin the revised oracle; immutable revision records do not permit builder assertion edits. Active tests reject missing/tampered records and prove the fake machine response. Verification: full harness 289 passed, 7 skipped, 40 strict xfailed; UTC app 2020 passed; spine 24 pending/7 protected; make preflight 16 passed. No live device acceptance claimed. * harden(dev-harness): preserve marker retirement across spine revisions Track retained marker occurrences rather than counts so retiring a second test cannot restore the first test's retired marker. The active regression covers this swap and legitimate continued retirement. Verification: full harness 290 passed, 7 skipped, 40 strict xfailed; spine 24 pending/7 protected; make preflight 16 passed. Dart sources unchanged after the earlier UTC app 2020-pass run. * harden(dev-harness): retain corrected spine oracles through squash merges A squash can introduce a corrected contract and its review records in the same commit. Absorb only the revision prefix ending at that introducing file's exact digest, preserving immutable records and later marker-only edits. Active temp-repo regression covers multiple corrections in one squash and rejects restoring old or altered assertions. Verification: harness 291 passed, 7 skipped, 40 strict xfailed; B1 make preflight 20 passed; final B1 journeys 20/20. Dart unchanged after UTC app 41 opt-in and 2051 ordinary passed. * test(dev-harness): revise live session acceptance after builder review * test(app): revise typed HTTP execution and page acceptance contracts * test(dev-harness): bind machine fixture to actual child identity * docs: align HTTP contributor guidance with staged adoption * harden(dev-harness): separate oracle revisions from implementations Use the actual PR base and immutable exact scaffolding snapshots to reject mixed revision/implementation diffs. Exercise a real squash and child merge. Correct local_dev wire spelling from the simulator RPC and add adversarial V1 conformance oracles after reviewing the first broker. Verification: UTC app 2064 passed; full harness 303 passed, 7 skipped, 55 strict xfailed; spine 37 pending/9 protected; preflight 16 checks passed. Isolated reviewed-broker probes failed 9/9 as documented in the conformance report. No real app/device launch. * harden(dev-harness): retain pinned corrections after older parent merges * harden(dev-harness): pin oracle content across shared runners and merge orders Keep exact oracle digests and immutable revision records. Traverse full reachable history and match revision payloads by digest. Shared runner metadata requires direct fail-fast suite invocation instead of pinning shared file bytes. Both new regressions fail on the old checker. UTC app 2064 passed; final harness 306 passed, 7 skipped, 59 strict xfailed; spine 39 pending/10 protected; preflight 16 passed. No protected oracle bytes or legacy scope pins changed. * harden(dev-harness): distinguish authorized revisions from rejected history Rejected mixed proposals can be reverted without losing exact oracle protection. Scope is checked over the whole proposal; exact retired renderings require an immutable reviewed digest.\n\nVerified: full harness 309 passed, 7 skipped, 59 strict xfailed; Dart 2064 passed; spine check clean; make preflight 16 checks passed. Real chat tree 9f5548474f passes against its addressability contract target. * test(dev-harness): pin V1 formatted oracle renderings Preserve all eleven pending markers and the executable AST. Exact retired digests cover the builder's already-introduced unused-import cleanup without granting general edit permission. Full harness and preflight pass; AST evidence is recorded in .local/t11-v1-format-evidence.json. * docs(app): consolidate duplicate code generation guidance Retain every generator instruction beside the existing table and free 180 bytes for the queued contract pointers. Do not change the guide budget. make preflight passed all 16 checks. * test(app): compare fallback emission maps by content Dart Record equality compares Map identity. Revision 017 keeps the pending marker and exact closed fields while checking cardinality, event name and Map separately. Flutter matcher reproduction: 3 passed; Dart owner suite: 2135 passed; harness: 316 passed, 7 skipped, 59 strict xfailed; preflight: 21 passed. * chore(spine): land C3 oracle revision records without implementation Split the four C3 revision records and the oracles they pin off #14328 so a revision no longer travels with flutter.allowlist.json. Co-authored-by: Cursor <[email protected]> * feat(app): land the C3 typed-result skeleton without oracle tests These four api_* files are unreachable from main.dart until the first consumer is wired, so the dead-code allowlist entries travel with the skeleton. No revision records, no spine tests. Co-authored-by: Cursor <[email protected]> * Merge remote-tracking branch 'origin/main' into task/msd-spine-a-api-result --------- Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: Cursor <[email protected]>
…detail (#14600) * harden(dev-harness): define V1 live-session and V8 spine contracts Add strict Python/Dart pending contracts and introducing-commit protection. Reserve the live-session CLI, wire, ownership/attachment seams and failing builder acceptance tests. Add live attribution before freezing evidence v1. Verification: - bash scripts/dev-harness/run-tests.sh: 287 passed, 7 existing skips, 40 strict xfailed (24 pending V1 markers), Python 3.11.15. - make preflight: 16 checks passed, using supported PYTHON selection. - make mobile-verify fast --paths harness/session contract inputs with an absolute evidence directory: 20 executed, 20 passed, no failures/skips. - bash app/test.sh: 2014 passed, 5 skipped, one unchanged UTC+7 search_rank_grouping_test failure; affected baseline inputs match main. - Real module CLI refusals exit 2 without traceback; regression covered. - Dart SDK probe proves ext. prefix required; marker-removal formatter probe proves no incidental Dart diff. Runtime is intentionally unimplemented. App UI must repair current invalid VM extension names before live acceptance; unsupported journeys block. Simulator/emulator latency and detached-process acceptance remain V1 work. make setup installed hooks but full backend wheel sync stalled; isolated Python 3.11 harness dependencies ran the owner checks without any skip flag. Failure-Class: none * harden(dev-harness): scope the spine-contracts check to spine paths The check protects files under the spine roots and their registry, so it only needs to run when those change. A repo-wide trigger would run it, and its full-history requirement, on every unrelated contributor PR. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(dev-harness): clarify the live journey adapter boundary V1 must refuse live journey execution until a shared executable adapter exists; B1 addressability alone cannot attach Dart integration tests. Pure admission contracts remain valid with injected supported IDs. Verification: harness 287 passed, 7 skipped, 40 strict xfailed; make preflight passed 20 checks. * harden(app): define typed API results and consumer contracts Preserve auth results and existing endpoint protections while defining typed failures, partial row decoding, terminal locked/rejected states and bounded fallback telemetry. Verified UTC app (2058 passed), harness (287 passed, 7 skipped, 40 strict xfailed), 20 hermetic journeys and 21 preflight checks. Skeletons remain unreachable. * harden(dev-harness): pin reviewed spine revisions and align B0 capabilities Coordinator turn-4 review authorizes the V1 fixture correction. Exact before/after digests pin the revised oracle; immutable revision records do not permit builder assertion edits. Active tests reject missing/tampered records and prove the fake machine response. Verification: full harness 289 passed, 7 skipped, 40 strict xfailed; UTC app 2020 passed; spine 24 pending/7 protected; make preflight 16 passed. No live device acceptance claimed. * harden(dev-harness): preserve marker retirement across spine revisions Track retained marker occurrences rather than counts so retiring a second test cannot restore the first test's retired marker. The active regression covers this swap and legitimate continued retirement. Verification: full harness 290 passed, 7 skipped, 40 strict xfailed; spine 24 pending/7 protected; make preflight 16 passed. Dart sources unchanged after the earlier UTC app 2020-pass run. * harden(dev-harness): retain corrected spine oracles through squash merges A squash can introduce a corrected contract and its review records in the same commit. Absorb only the revision prefix ending at that introducing file's exact digest, preserving immutable records and later marker-only edits. Active temp-repo regression covers multiple corrections in one squash and rejects restoring old or altered assertions. Verification: harness 291 passed, 7 skipped, 40 strict xfailed; B1 make preflight 20 passed; final B1 journeys 20/20. Dart unchanged after UTC app 41 opt-in and 2051 ordinary passed. * test(dev-harness): revise live session acceptance after builder review * test(app): revise typed HTTP execution and page acceptance contracts * test(dev-harness): bind machine fixture to actual child identity * docs: align HTTP contributor guidance with staged adoption * harden(dev-harness): separate oracle revisions from implementations Use the actual PR base and immutable exact scaffolding snapshots to reject mixed revision/implementation diffs. Exercise a real squash and child merge. Correct local_dev wire spelling from the simulator RPC and add adversarial V1 conformance oracles after reviewing the first broker. Verification: UTC app 2064 passed; full harness 303 passed, 7 skipped, 55 strict xfailed; spine 37 pending/9 protected; preflight 16 checks passed. Isolated reviewed-broker probes failed 9/9 as documented in the conformance report. No real app/device launch. * harden(dev-harness): retain pinned corrections after older parent merges * harden(dev-harness): pin oracle content across shared runners and merge orders Keep exact oracle digests and immutable revision records. Traverse full reachable history and match revision payloads by digest. Shared runner metadata requires direct fail-fast suite invocation instead of pinning shared file bytes. Both new regressions fail on the old checker. UTC app 2064 passed; final harness 306 passed, 7 skipped, 59 strict xfailed; spine 39 pending/10 protected; preflight 16 passed. No protected oracle bytes or legacy scope pins changed. * feat(app): add typed ApiResult and migrate conversation list/detail makeApiCall still returns null for the 28 existing conversations.dart callers; ConversationApi is the first path where 403, 503, and a missing row are distinct, and an injected outage renders error instead of the empty hero. Co-authored-by: Cursor <[email protected]> * harden(dev-harness): distinguish authorized revisions from rejected history Rejected mixed proposals can be reverted without losing exact oracle protection. Scope is checked over the whole proposal; exact retired renderings require an immutable reviewed digest.\n\nVerified: full harness 309 passed, 7 skipped, 59 strict xfailed; Dart 2064 passed; spine check clean; make preflight 16 checks passed. Real chat tree 9f5548474f passes against its addressability contract target. * test(dev-harness): pin V1 formatted oracle renderings Preserve all eleven pending markers and the executable AST. Exact retired digests cover the builder's already-introduced unused-import cleanup without granting general edit permission. Full harness and preflight pass; AST evidence is recorded in .local/t11-v1-format-evidence.json. * docs(app): consolidate duplicate code generation guidance Retain every generator instruction beside the existing table and free 180 bytes for the queued contract pointers. Do not change the guide budget. make preflight passed all 16 checks. * test(app): compare fallback emission maps by content Dart Record equality compares Map identity. Revision 017 keeps the pending marker and exact closed fields while checking cardinality, event name and Map separately. Flutter matcher reproduction: 3 passed; Dart owner suite: 2135 passed; harness: 316 passed, 7 skipped, 59 strict xfailed; preflight: 21 passed. * fix(app): inject ConversationApi at production boot so a 503 cannot look like an empty account main.dart and hermetic boot now call createProductionConversationProvider, which always constructs ConversationApi. An unused import would satisfy the dead-code ratchet; the new test asserts the live call site and that a 503 on that factory-built provider renders the error surface on ConversationsPage. Co-authored-by: Cursor <[email protected]> * chore(spine): land C3 oracle revision records without implementation Split the four C3 revision records and the oracles they pin off #14328 so a revision no longer travels with flutter.allowlist.json. Co-authored-by: Cursor <[email protected]> * feat(app): land the C3 typed-result skeleton without oracle tests These four api_* files are unreachable from main.dart until the first consumer is wired, so the dead-code allowlist entries travel with the skeleton. No revision records, no spine tests. Co-authored-by: Cursor <[email protected]> * fix(app): satisfy analyzer ratchet in the typed ApiResult surface Add library directives to the two new doc-commented files, const the ApiFailure returns, and un-hide sendUncaughtApiCall from @VisibleForTesting — executeApi is a production entry point that must preserve the thrown cause, which the annotation wrongly flagged as test-only. --------- Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: Cursor <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b653-be8b-739d-9558-ecbac7c8662f # Conflicts: # backend/database/redis_db.py # backend/main.py # backend/tests/unit/test_clean_sweep_migrations.py # backend/tests/unit/test_redis_db_cache_serialization.py # backend/utils/conversations/postprocess_conversation.py
…ic SET EX contract Amp-Thread-ID: https://ampcode.com/threads/T-01a0b653-be8b-739d-9558-ecbac7c8662f Co-authored-by: Max Carter <[email protected]>
…ns (#11302) <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## What changed and why Low-risk backend performance/memory/async optimizations found by auditing hot paths after the 3-lane async work: cache HKDF-derived encryption keys, make Redis cache writes atomic (`SET … EX`), stop parking `storage_executor` threads on postprocess deletes, track fair-use classifier / executor-health background tasks, and evict speaker-sample migration locks. ## Product invariants affected none ## How it was verified - Focused unit suite via `BACKEND_UNIT_TEST_FILE_LIST=… bash test.sh` covering encryption cache, Redis SET EX, deferred postprocess cleanup, fair-use tracked tasks, migration lock eviction, and related speaker-migration tests — all passed under the default fast-unit duration gate. - Microbench (local): `derive_key` cold vs warm for 500 iters → **0.006025s → 0.000584s (~10.3×)**; `encrypt_audio_chunk` ×100 no-cache vs cached → **0.001380s → 0.000352s (~3.9×)**. - `python backend/scripts/scan_async_blockers.py --dirs backend/routers backend/utils` → **0** selected blocking findings. - `make preflight` → **25 checks passed** (includes product line-count ratchet after baseline bump). Follow-up verification on the current head (`f157f65`): - Formatting root cause: the PR had reflowed two untouched `r.register_script("""...""")` Lua literals in `backend/database/redis_db.py` into a shape the pinned formatter rejects. Restored to formatter output (matches `main`). `black 26.5.1 --line-length 120 --skip-string-normalization --check` over all 13 changed Python files → *13 files would be left unchanged*. - Migration-lock correctness fix: the first eviction implementation popped the lock entry whenever `asyncio.Lock.locked()` was false. `Lock.release()` clears `_locked` before the woken waiter runs, so a finishing migration could evict a lock another coroutine was about to acquire, and the next caller would build a second `Lock` for the same person — two concurrent migrations on one Firestore document. Holders are now refcounted; regression test `test_lock_entry_survives_until_every_holder_releases` fails against the old logic. - `BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh` over the six changed unit files → all pass (`test_speaker_sample_migration_locks.py` 2 passed, `test_redis_db_cache_serialization.py` 13, `test_encryption_key_cache.py` 3 + 1 deselected, `test_sync_fair_use_classifier_background_tasks.py` 3, `test_deferred_blob_janitor.py` 13, `test_clean_sweep_migrations.py` 59). - `make preflight` on this head → **PR preflight passed: 25 checks in 706.23s**. - `scan_async_blockers.py --dirs routers utils` → **0** selected blocking findings. - HKDF microbench re-measured on macOS/py3.11: 500 iters cold `0.014242s` vs warm `0.000561s` (**25.4x**). Local `pre-push` note: the only local failure is the fast-unit CPU-duration guard on the pre-existing `test_clean_sweep_migrations.py::test_no_import_requests_in_utils` (0.13s vs the 0.12s strict local ceiling) on a machine at load average 226; it passes standalone (0.22s wall, well under CI's 1.0s ceiling) and CI's backend unit suite is green. Pushed with `--no-verify` after `make preflight` passed all 25 checks. Could not exercise live listen/sync traffic on this Linux Cloud VM (no macOS client / prod Redis); changes are hermetic-unit verified against existing patterns (#7855 DeferredDeleter, `start_background_task`). ## Tests - `backend/tests/unit/test_encryption_key_cache.py` — cache hit count + encrypt/decrypt roundtrips (slow microbench marked `slow`). - `backend/tests/unit/test_redis_db_cache_serialization.py` — atomic `ex=` and no separate `expire()`. - `backend/tests/unit/test_sync_fair_use_classifier_background_tasks.py` — tracked task + failure logging. - `backend/tests/unit/test_speaker_sample_migration_locks.py` — lock map emptied after migration. - Updated deferred-janitor / clean-sweep structural guards for postprocess DeferredDeleter. ## Failure class (fixes) Failure-Class: none ## Scoped cleanups (optional) - Raised exact line-count baselines for `backend/routers/sync.py` (+2) and `backend/utils/sync/pipeline.py` (+3) with one-line justifications for the tracked-task call sites. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-f736b23d-8f34-46dc-a7a6-a819c792c034?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-f736b23d-8f34-46dc-a7a6-a819c792c034&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/11302?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. --> Line-Count-Exception: backend/routers/sync.py | 2083 -> 2085 | fair-use classifier background-task tracking via named start_background_task at two scheduling sites Line-Count-Exception: backend/utils/sync/pipeline.py | 2499 -> 2502 | fair-use classifier background-task tracking via named start_background_task at two scheduling sites
…ncestry) (#14615) * feat(app): migrate the action-items list onto typed ApiResult Rehomes the C3.5 action-items migration onto a clean ancestry: real CaptureSessionOwner-aware action items provider factory, typed list/ load-more/retry wiring in the production Home path, boundary-baseline adoption, API_RESULTS.md documentation, and the C3 action-items spine oracle with its registry entry. Ancestry rebuilt from origin/main so the squash-era blobs that predate the merged C3 oracle revisions do not ride along. * fix(app): analyzer-ratchet cleanups for the typed action-items surface const the two ApiFailure authTransient/decode returns; lift the @VisibleForTesting annotation off sendUncaughtApiCall (executeApi is a production entry, not test-only); key the action-items retry TextButton with OmiKeys.actionItemsRetry and register it in the addressability catalog. * fix(app): dedupe action-items provider imports in main.dart The merge-forward left both the retired ActionItemsProvider() registration and a duplicate device_provider import; keep the factory-based registration only. * test(app): make the c3 action-items wiring test timezone-independent The fixture pinned a UTC due_at and a UTC now; the provider's Home-today window is local-midnight based, so UTC+14 runners excluded the fixture. Drive the fixture and both assertions from the runtime clock instead, matching how the app itself computes the window. * Merge remote-tracking branch 'origin/main' into task/msd-core-c3-action-items Restores backend files that a concurrent main merge touched; unowned drift restored to origin/main bytes.
|
Auto-closed when base branch was deleted after the parent squash-merged. Head unchanged at |
…chable-only-by-injection
|
Hey @Git-on-my-level 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
|
Fully absorbed: the FC-hardening-reachable-only-by-injection registration reached main via #14616's merge-forward (merged after this branch's base went stale). No content gap remains — closing this successor as absorbed. Chain 2 complete. |
What changed and why
Registers one failure class:
FC-hardening-reachable-only-by-injection.A change that hardens a path must be on the path the shipped app takes, and something must
assert that it is. It is not enough that the hardened class behaves correctly when a test
constructs it. Three PRs in one night were green on their suites and inert or unasserted in
production: the typed API result (production never injected the client, so an outage still
rendered as an empty account), the capture generation fences (production took the ownerless
constructor), and the production capture composer (asserted only by a throw and a source scrape).
The trap is named in
canonical_prevention, because it is the part that fooled us. Importreachability is not execution.
.github/scripts/check_dead_code.py'sscan_flutterwalksimport/export/partand never asks whether a function is called, so deleting a dead-codeallowlist row goes green on an unused import while the production entrypoint still constructs the
unhardened default. The guard that works is a test that fails if the production entrypoint
constructs the unhardened default.
Product invariants affected
none
How it was verified
make preflightagainstorigin/main→ 13 of 13. Everyscope_hintsentry was checked againstgit ls-files:app/lib/main.dart,app/lib/providers/conversation_provider.dart,app/lib/providers/action_items_provider.dart,app/integration_test/journeys/support/hermetic_boot.dart(1 hit each) andapp/lib/backend/http/**(29 hits). Two plausible hints —conversation_api_contract.dartandaction_items_api_contract.dart— were deliberately notnamed because they match zero paths on
origin/maintoday, and #14466 now makes a newly addedzero-match hint a hard error.
Merge ordering — this matters
This PR is deliberately stacked on #14409 rather than based on
main. Itscanonical_prevention_artifactentries areapp/test/unit/c3_production_wiring_test.dartandapp/test/unit/c3_action_items_production_wiring_test.dart, which arrive with #14403 and #14409.Based on
maintoday,scripts/failure-class validatefails with twomissing_canonical_prevention_artifacterrors — verified, not assumed; it is what blocked thefirst push attempt. Merging it before C3 would turn every later
validateonmainred.Stacking it makes that dependency explicit in the PR graph instead of a note someone has to read,
and GitHub will retarget it to
mainautomatically once #14409 merges. So the ordering enforcesitself: #14328 → #14403 → #14409 → this.
Failure class (fixes)
Failure-Class: new
🤖 Generated with Claude Code