Skip to content

Improve Smart Tasks signal quality and isolation - #9591

Merged
Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/smart-tasks-signal-quality
Jul 13, 2026
Merged

Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/smart-tasks-signal-quality

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Make Smart Tasks substantially calmer and more trustworthy for daily use while keeping every user-facing intelligence surface behind the composed canonical-memory cohort plus read workflow gate.

  • raise capture quality at the shared transcript/screen boundary and version the new contract as capture.v2
  • collapse exact cross-source Candidate creates, preserve idempotent replay, and prevent terminal actions from resurrecting historical duplicates
  • project at most five fresh, grounded Suggested creates and zero to three What Matters Now recommendations from a typed, balanced recall set
  • make Later/Dismiss suppression consistent across devices and resilient to retry failures
  • fence Candidate, What Matters Now, Suggested, Dashboard, and contextual-resurfacing reads across account-generation and owner changes
  • keep generic Candidate CRUD universal; only the Suggested/What Matters Now product surfaces use the memory-cohort gate

Supports the dogfood and quality work in #9530. This PR does not close the issue because the post-deploy two-day precision gate is still outstanding.

Product invariants affected

  • INV-AUTH-1

Root cause and recurrence evidence

The existing system had several reinforcing failure classes rather than one bad ranking prompt:

  1. Capture accepted vague or weakly owned work and transcript/screen paths could drift.
  2. Caller idempotency did not prevent the same concrete task from being captured by multiple sources, and terminal actions could reveal a sibling duplicate.
  3. Recommendation eligibility treated recency as enough signal, so old/generated/no-evidence work competed with deadlines, blockers, context matches, and review loops.
  4. Suppression and async UI state were not consistently owner/generation fenced, allowing retry resurrection and account-switch races.
  5. Material caching did not identify the full judgment contract, so prompt/model-only changes could reuse stale decisions.

The dogfood account showed the product impact without exposing private task text: 129 active local tasks, a bounded UI snapshot of 61 items (10 overdue, 1 today, and 50 capped no-due/recent items), no canonical provenance or confidence on that bounded set, and zero useful Suggested/What Matters Now cards because the currently deployed API is returning server failures.

Durable guards

  • capture.v2 freezes the concrete-owner and dual 0.8 confidence floors across transcript, screen, Python, Swift, TypeScript, and Dart fixtures.
  • Exact task-create semantic claims use normalized description, owner, exact due time, recurrence, goal, and workstream while treating evidence/source/confidence as mergeable annotations. Stale pending claims roll over after the shared 14-day product window; active accepted tasks continue to enrich until their semantics or liveness change.
  • Suggested filters current-generation create Candidates by routeability, evidence, confidence, freshness, exact semantic identity, terminal resolution cutoff, and active attention overrides before its five-card cap.
  • What Matters Now uses typed gates, reserved recall across urgency classes, one strict holistic judgment, and an empty-by-default zero-to-three result. Cache identity includes prompt, policy, fact-definition, model, displayed fields, and evidence identities.
  • Reads recheck rollout/generation before publication. Desktop async work uses owner revisions/load tokens, clears prior-owner state, and drops queued context rather than crossing accounts.
  • Malformed Candidate logging records only opaque IDs, counts, and bounded validation error types; private input values/keys are never rendered.

Rollout and user impact

No cohort was broadened. Suggested and What Matters Now remain available only when the user is on canonical memory and task workflow mode is read; outside that composition the product surfaces return a calm 404. As canonical memory eventually becomes universal, the same composition naturally makes Smart Tasks universal without a second whitelist.

The desktop now shows fewer grounded cards, preserves backend ordering, reports real service errors instead of false empty success, keeps Later/Dismiss hidden during retries, and never fabricates a workstream-success outcome merely because a recommendation was opened or a Candidate accepted.

Real-path exercise

  • Built and launched /Applications/omi-smart-tasks-quality.app (com.omi.omi-smart-tasks-quality) as a separate named bundle.
  • Seeded and verified the signed-in dogfood account, main app state, and completed onboarding.
  • Exercised Tasks, Suggested refresh, What Matters Now refresh, Dashboard, and privacy-safe automation dumps using only counts and opaque IDs.
  • Confirmed client device identity now uses the full header-bound ID and server failures stay visible. Backend ranking/projection changes are not deployed yet, so the live dogfood verdict remains YELLOW until this PR is deployed and measured.

Verification

  • BACKEND_UNIT_TEST_FILE_LIST=/tmp/smart-tasks-backend-tests.txt bash backend/test.sh — 163 changed backend tests passed under the repository timing guard.
  • OMI_SWIFT_TEST_SUITE_WORKERS=4 bash desktop/macos/test.sh — launcher contracts, 319 Rust tests, and 251 isolated Swift suites passed.
  • affected owner-sensitive Swift suites — 77 tests passed; independent review ran the complete affected set (101 tests).
  • backend/scripts/task_intelligence_fixture_runner.py — capture/association/ranking fixtures passed.
  • backend/scripts/task_recommendation_live_eval.py — all five recorded ranking cases passed, including compound kind+ID validation.
  • app-client/public/integration OpenAPI snapshots, compatibility check, and Swift/TypeScript/Dart generators are current.
  • backend import-purity, module-stub, async-blocker, Black, and diff-hygiene checks passed.
  • agent contract fixture: 2 tests passed; Flutter contract fixture: 5 tests passed in independent review.
  • mobile analyzer ratchet passed without raising its baseline after declaring the existing direct markdown/fake_async imports; the Flutter contract fixture plus native-mic unit suite passed 12/12.
  • independent Sol review: approved with no blocking findings.

Remaining gate

After deployment, continue #9530 for at least two days and at least ten presented/accepted items. The release gate remains at least 80% useful precision, at most 10% not-useful feedback, zero notification-bypass violations, stable repeated evaluations, and verified attribution. Until that evidence exists, this is a high-confidence implementation PR, not a claim that the production rollout is already green.

Raise shared capture floors, coalesce exact Candidate creates, bound Suggested and What Matters Now output, and preserve suppression across retries.

Fence backend reads and desktop async state across account generation and owner changes; keep product surfaces composed with the canonical-memory cohort.

Verification: 163 timing-harness backend tests; full desktop launcher/Rust/251-suite Swift harness; OpenAPI and client generators; recorded ranking eval; import, stub, async, formatting, and diff checks; named-bundle real-account exercise.
Declare directly imported markdown and fake_async packages and remove a redundant typed_data import.\n\nVerification:\n- PATH=/Users/dazheng/fvm/versions/3.44.6/bin:\u0024PATH bash app/scripts/analyze_ratchet.sh\n- flutter test app/test/backend/task_intelligence_contract_fixture_test.dart app/test/unit/native_mic_recorder_service_test.dart
@Git-on-my-level
Git-on-my-level merged commit 8f162a4 into BasedHardware:main Jul 13, 2026
23 of 26 checks passed
Git-on-my-level added a commit that referenced this pull request Jul 13, 2026
## Summary

Review-swarm findings from a 10-agent code review of the last 2 days of
merged PRs (62 PRs / 1072 files). Seven isolated bugs were found and
fixed; no behavior change beyond the fixes. Each commit is independent
and reviewable on its own.

### High-severity correctness
- **`fix(chat)`: tz-aware `created_at` sort sentinel** —
`get_chat_files_desc` (>30 file_ids merge path) used naive
`datetime.min`, which TypeError-compares against tz-aware Firestore
dates and 500s. Last instance of the #9571 failure class; all four
`datetime.min` sort sentinels in `backend/` are now tz-aware.
- **`fix(agent-control)`: derive consent for `request_permission` in
PTT/voice mode** — both voice paths never built a
`PermissionRequestAuthorization`, so the consent gate always silently
denied `request_permission` while the system prompt told the model to
call it. The feature was non-functional in voice mode. Fixed by deriving
authorization from the spoken turn transcript (mirrors the text path;
fail-closed).

### Medium
- **`fix(translation)`: NLLB native-language-code case resolution** —
`_resolve_nllb_code` lowercased input before checking the mixed-case
`NLLB_TO_BCP47` keys, making the native-code passthrough dead. README
documents `eng_Latn` as valid input.
- **`fix(nllb)`: autoscale on active requests instead of CPU-only** —
the NLLB GPU HPA scaled only on CPU, which stays low during GPU
inference, so it never scaled past minReplicas. Added a
concurrency-based External metric on the existing `nllb_active_requests`
gauge (`requestsPerPod: 4` in prod), mirroring the parakeet pattern, and
wired the adapter rule into the cluster-wide prometheus-adapter
(dev+prod). CPU retained as a secondary floor.
- **`fix(firmware)`: propagate `t5838_aad_init` failure from
`mic_start`** — the init powers the 1.8V mic rail; on failure it only
logged and returned 0 (false-ready at the caller: mic "starts" but
captures silence). `main()` already handles a nonzero `mic_start` return
via `error_microphone()`, so propagate the failure. Closes the #9048
false-ready goal at the caller level.

### Low / defense-in-depth
- **`fix(tasks)`: re-add defensive newest-first sort for suggested
candidates** — #9591 removed the client-side sort, leaving the top-5
slice dependent on backend return order with no test. Re-added the sort
as defense-in-depth.
- **`fix(ci)`: drop duplicate isinstance-ratchet exempt entry** — two
commits registered the same script in the manifest `exempt:` list.

### Desktop changelog
Fragments added for the two user-visible desktop fixes (PTT permission
consent, suggested-tasks ordering).

## Product invariants affected
- INV-CHAT-1

## Verification
- Each fix reviewed hunk-by-hunk by a dedicated reviewer; the chat.py
fix was cross-confirmed by two reviewers (sync/memory found it, API
owner fixed it).
- Pre-push manifest checks pass (check-manifest-contract, diff-hygiene,
architecture-guardrails, product-invariants with this citation,
desktop-changelog-entry, brand-ui INV-UI-1, backend-import-purity,
backend-async-blockers).
- No new tests added in this PR; the underlying behavior is covered by
the existing suite for each touched area. The tz-sentinel and consent
fixes are the kind of regression a follow-up test should pin (noted
below).

## Notes / follow-ups
- The NLLB HPA active-requests metric requires the documented
prometheus-adapter helm upgrade (same manual step parakeet needs) before
it takes effect in-cluster.
- Reported-but-not-fixed concerns from the review (out of scope here):
NLLB model re-downloaded every pod restart (emptyDir), gateway 13-label
metrics cardinality monitoring, a static guard to prevent recurrence of
the naive-`datetime.min` sort class.

🤖 Generated with Claude Code


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/9600?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Git-on-my-level added a commit to Git-on-my-level/omi that referenced this pull request Jul 13, 2026
…es — review swarm

PR BasedHardware#9591 removed the client-side .sorted { createdAt > } from
SuggestedTasksStore.load(), leaving the top-5 slice dependent on the
backend return order with no test asserting that order. Re-add the sort
as defense-in-depth so a backend ranking regression can't silently show
stale candidates. ISO8601 createdAt strings sort correctly lexicographically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant