feat(app): add crash visibility, memory relief, and clipboard reply work

Squashes the working tree that had accumulated on cloud-agent. Two
strands of work, kept in one commit at the maintainer's request.

Crash and stability (this session):

- Subscribe to MetricKit so crash, hang, CPU, and disk-write diagnostics
  are recorded on device. Keyboard-extension memory kills are the most
  likely way a user loses the keyboard mid-sentence and iOS does not
  classify them as crashes, so they never reach App Store Connect.
- Upload those reports to POST /v1/analytics/diagnostics from internal
  builds only (local Debug and TestFlight), reusing the analytics
  installation identifier and skipping entirely when analytics are off.
  App Store builds keep everything on device.
- Shed the Chinese engine, English lexicon, and in-flight pipeline work
  at the 40 MiB and 48 MiB budget thresholds instead of waiting for a
  system memory warning that jetsam often preempts.
- Install audio taps with the input node's live format through one
  shared adaptive resampler, so an audio-route change mid-recording no
  longer raises an uncatchable format-mismatch exception. Covers the
  dictation preview and the Mac recorder, which still used the pattern
  the Flow capture path had already moved away from.
- Harden the librime bridge: never pass a nil string across a nonnull
  boundary when a user dictionary holds malformed UTF-8, null-check the
  engine API vector, and distrust a candidate count without its array.
- Guard the expanded candidate grid against a list that shrinks while
  the collection view is still laying out against the previous count.
- Resolve localized text without the App Group so the screen shown when
  that container is missing renders its message instead of crashing on
  launch, which is the one situation it exists to handle.
- Gate CI on the App Group and Keychain wiring that the keyboard
  extension hard-depends on, with a self-test proving the check fails.

Clipboard, reply, and semantics (pre-existing working tree):

- Unify the reply center, refresh keyboard AI features, and add native
  event and reminder exporters.
- Expand clipboard semantic routing with authored corpora and a
  product-blind holdout, plus the scripts that build and validate them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-18 17:31:29 -07:00
co-authored by Claude Opus 5
parent 628e983794
commit 0023741455
210 changed files with 14731 additions and 2940 deletions
+25 -6
View File
@@ -16,7 +16,7 @@
"onboarding.api.localReady.body" = "Recognition works on-device. Add an API key in Settings for AI polish.";
"keyboard.onboarding.practice.mic" = "Tap the mic, then tap again when done";
"keyboard.onboarding.practice.translate" = "Tap Translate, then insert the generated text";
"keyboard.onboarding.practice.reply" = "Tap Reply and let AI draft a response";
"keyboard.onboarding.practice.reply" = "AI is drafting a ready-to-send reply for you";
"keyboard.onboarding.practice.askAI" = "Hold the mic and ask your question";
/* Common navigation */
@@ -219,6 +219,7 @@
"keyboard.clipboard.clear.confirm" = "Clear history";
"keyboard.clipboard.suggestion.dismissA11y" = "Dismiss clipboard suggestion";
"keyboard.clipboard.suggestion.dismissHint" = "Hide this clipboard suggestion strip.";
"keyboard.clipboard.paste" = "Paste";
"keyboard.voice.cancel" = "Cancel voice input";
"keyboard.voice.cancelHint" = "Discard the current recording, recognition, and polish result.";
"keyboard.scenario.a11y" = "Polish scenario";
@@ -229,9 +230,6 @@
"mode.transcribe" = "Transcribe";
"mode.polish" = "Polish";
/* Locale chip labels (preview stub) */
"locale.zh-Hans" = "ZH-Hans";
/* Locale menu items (settings) */
"locale.auto" = "Auto";
"locale.zh-Hans" = "Chinese (Simplified)";
@@ -301,6 +299,11 @@
"keyboard.ai.startA11y" = "Start asking AI";
"keyboard.ai.stopA11y" = "Finish the question and send it to AI";
"keyboard.assistant.longPressCoach" = "Tap to dictate · Hold to ask AI";
"keyboard.assistant.autoReply.guidance.cta" = "Try AI auto-reply";
"keyboard.assistant.autoReply.guide.title" = "Let AI reply for you";
"keyboard.assistant.autoReply.guide.body" = "Turn on auto-reply and the keyboard drafts a ready-to-send reply the moment you copy a message.";
"keyboard.assistant.autoReply.guide.close" = "Not now";
"keyboard.assistant.autoReply.guide.closeHint" = "Dismiss the auto-reply suggestion.";
"keyboard.assistant.micA11y" = "Voice and AI";
"keyboard.assistant.micHint" = "Tap to dictate. Hold to ask AI.";
"keyboard.assistant.dictationAction" = "Start voice dictation";
@@ -309,6 +312,8 @@
"keyboard.assistant.delete" = "Delete";
"keyboard.assistant.sendHint" = "Performs the current field's Send, Search, Done, or Go action.";
"keyboard.assistant.insertPending" = "Insert retained AI answer";
"keyboard.assistant.insertTranslation" = "Insert translation";
"keyboard.assistant.insertReply" = "Insert reply";
"keyboard.assistant.discardPending" = "Discard AI answer";
"keyboard.assistant.discardPendingHint" = "Discard the answer retained because the cursor or input field changed.";
"keyboard.ai.replyVariant.ordinary" = "Ordinary";
@@ -326,6 +331,10 @@
"keyboard.ai.replyVariant.clarificationDirect" = "Direct reply";
"keyboard.ai.replyVariant.clarificationQuestion" = "Ask key detail";
"keyboard.ai.replyVariant.clarificationConfirm" = "Confirm & ask";
"keyboard.ai.replyVariant.answerAffirmative" = "Yes";
"keyboard.ai.replyVariant.answerNegative" = "No";
"keyboard.ai.replyVariant.answerConditional" = "It depends";
"keyboard.ai.replyVariant.answerDefer" = "Need to check";
"keyboard.ai.replyVariant.insertHint" = "Insert this complete reply.";
"keyboard.assistant.dismissClipboard" = "Dismiss clipboard suggestions";
"keyboard.assistant.dismissClipboardHint" = "Hide the current clipboard summary and skills.";
@@ -351,9 +360,10 @@
"keyboard.ai.error.requestFailed" = "AI response failed. Try again";
"keyboard.ai.error.clipboardUnavailable" = "This clipboard suggestion expired. Copy the text again";
"keyboard.ai.skill.reply" = "Reply";
"keyboard.ai.skill.speakAsMe" = "My words";
"keyboard.ai.skill.playfulReply" = "Playful";
"keyboard.ai.skill.replyInSourceLanguage" = "Reply";
"keyboard.ai.skill.summarize" = "Key points";
"keyboard.ai.skill.summarize" = "Summary";
"keyboard.ai.skill.openLink" = "Open";
"keyboard.ai.skill.summarizeWebPage" = "Web summary";
"keyboard.ai.skill.callPhone" = "Call";
@@ -364,7 +374,7 @@
"keyboard.ai.skill.declineInvitation" = "Decline";
"keyboard.ai.skill.acceptTask" = "Acknowledge";
"keyboard.ai.skill.clarifyRequest" = "Clarify";
"keyboard.ai.skill.empathyReply" = "Empathize";
"keyboard.ai.skill.empathyReply" = "Empathy";
"keyboard.ai.skill.blessingReply" = "Reply to wishes";
"keyboard.ai.skill.askForDetails" = "Ask details";
"keyboard.ai.skill.businessReply" = "Business";
@@ -386,9 +396,18 @@
"keyboard.ai.skill.extractingAddress" = "Finding an address…";
"keyboard.ai.skill.namingNote" = "Naming the note…";
"keyboard.ai.skill.runningShortcut" = "Running Shortcut…";
"keyboard.ai.skill.savingReminders" = "Adding to Reminders…";
"keyboard.ai.skill.savingEvents" = "Adding to Calendar…";
"keyboard.ai.skill.openingMaps" = "Opening Maps…";
"keyboard.ai.skill.shortcutMissing" = "Companion Shortcut not found. Reinstall it in Skills";
"keyboard.ai.skill.handoffFailed" = "Couldn’t open the app to run the Shortcut";
"keyboard.ai.skill.openLinkFailed" = "Couldn’t open this link";
"keyboard.ai.skill.callPhoneFailed" = "Couldn’t start this call";
"keyboard.ai.skill.createContactFailed" = "Couldn’t open the new contact form";
/* Key / panel accessibility labels */
"keyboard.typing.candidates.collapseA11y" = "Collapse candidates";
"keyboard.typing.candidates.expandA11y" = "More candidates";
"keyboard.key.shiftA11y" = "Shift";
"keyboard.key.deleteA11y" = "Delete";
"keyboard.key.returnA11y" = "Return";