Stitch 0.4.4: saved chats, model guide, Thinai, sturdier web search
Ideas ported from Thinai (github.com/Aravindargutus/Thinai, MIT); none of its Flutter code is used directly. - Chats panel: every conversation saved (ChatStore); new chat, switch, search, rename, delete, delete all. Fixes B-38: AI replies were never saved and the chat screen started empty after every restart. - Model guide: 20 real .litertlm models, the phone's RAM/CPU/storage, use-case chips, fit and speed estimates (ModelGuide). - Thinai preset; any AI server on 127.0.0.1 gets short instructions and the 33 phone tools instead of 70. - Web search: DuckDuckGo Lite/HTML then Bing, challenge-page detection, 10-minute engine rest, relevance filter (B-37). - Other people's text wrapped with a random id and control tokens defused (B-40). - Wake-phrase service no longer crashes the app after an update or reboot; a one-tap notice resumes it (B-39, pre-existing since 0.4.0). - 37 new tests (87 -> 124); fake AI test server kept in tools-dev/. - Docs: DEVELOPMENT_HISTORY, README, STAGE_A2_CHECKLIST section 6.
This commit is contained in:
1 parent
a1d593a4cc
commit
372190f8ec
29 files changed
+2436
-167
No files matched your search
+64
-18
@@ -1,10 +1,10 @@
|
||||
# Stitch: Development History & Audit
|
||||
|
||||
> What this covers: how Stitch was planned, built, tested and fixed, from the first plan to version 0.4.3.
|
||||
> What this covers: how Stitch was planned, built, tested and fixed, from the first plan to version 0.4.4.
|
||||
> It includes every blocker, failure and user-reported bug, with its cause and fix, plus an audit of
|
||||
> testing, security, and the changes made to the build machine.
|
||||
>
|
||||
> Period covered: 19 Sep 2026, 13:12 IST – 24 Sep 2026 (across several Claude Code sessions).
|
||||
> Period covered: 19 Sep 2026, 13:12 IST – 28 Sep 2026 (across several Claude Code sessions).
|
||||
> Author of the code and this document: Claude (AI coding agent), working for the project owner, who tested each build on a real phone.
|
||||
|
||||
---
|
||||
@@ -43,10 +43,13 @@ It uses three layers, cheapest first:
|
||||
|
||||
**Owner constraint, set early and kept throughout:** personal use only, so maximum control and no Google Play restrictions. SMS sending, call-log access, accessibility control and all-apps visibility are all used freely.
|
||||
|
||||
**State at 0.4.3:**
|
||||
**State at 0.4.4:**
|
||||
- 70 tools
|
||||
- 62 Kotlin source files (11,244 lines) plus a JNI bridge
|
||||
- 87 automated unit tests, all passing
|
||||
- 67 Kotlin source files (12,908 lines) plus a JNI bridge
|
||||
- 124 automated unit tests (123 pass, 1 live-network test skipped unless asked for)
|
||||
- Every conversation saved, with a chats panel (new, switch, search, rename, delete)
|
||||
- A model guide that recommends on-phone models by use case and by what the phone can hold
|
||||
- Thinai supported as an on-phone model server
|
||||
- Wake phrase ("Hey Stitch"), trained by your own voice, with a floating bubble that can read the app behind it
|
||||
- Main screen with four tabs (Chat, Schedule, Saved, Workflows) and a Settings page grouped into categories
|
||||
- Needle offline eval: **0 wrong actions** across 64 test phrases
|
||||
@@ -136,16 +139,16 @@ AlarmManager, CameraManager, AudioManager, Settings, LocationManager, Intents…
|
||||
|
||||
| Package | Contents |
|
||||
|---|---|
|
||||
| `agent/` | `Agent` (routing, gates, AI loop, system prompt), `QuickCommands`, `Grounding` (name correction) |
|
||||
| `agent/` | `Agent` (routing, gates, AI loop, system prompt), `QuickCommands`, `Grounding` (name correction), `ChatStore` (saved chats, 0.4.4), `Untrusted` (wrapper for other people's text, 0.4.4) |
|
||||
| `needle/` | `NeedleEngine`, `NeedleNative` (JNI) |
|
||||
| `ai/` | Providers: OpenAI-compatible, Anthropic Messages, OpenAI Responses, `LocalLlmProvider` (LiteRT-LM); `ModelCatalog`, `ModelDownloads`, `TextToolCalls` (recovers tool calls written as text) |
|
||||
| `tools/` | 70 tools: Device, Comms, Messaging, Media, System, Knowledge, Productivity, Info, Screen, Manage (CRUD) |
|
||||
| `ai/` | Providers: OpenAI-compatible, Anthropic Messages, OpenAI Responses, `LocalLlmProvider` (LiteRT-LM); `ModelCatalog` (a provider's model list), `ModelGuide` (on-phone model catalogue, phone profile and recommendations, 0.4.4), `ModelDownloads`, `TextToolCalls` (recovers tool calls written as text) |
|
||||
| `tools/` | 70 tools: Device, Comms, Messaging, Media, System, Knowledge, Productivity, Info, Screen, Manage (CRUD); `WebSearch` (engines, parsing, relevance, 0.4.4) |
|
||||
| `core/` | `Settings`/presets/`SecretBox`, `TimeParser`, `DefaultApps`, `Reminders`, `CalendarReminders`, `Alarms`, `Notes`, `Memory`, `MarkdownParser` |
|
||||
| `accessibility/` | `StitchAccessibilityService`, `ScreenReader`, `AgentOverlay` (status pill, Stop, confirm/result cards) |
|
||||
| `notifications/` | `StitchNotificationListener`, `NotificationStore` (MessagingStyle parsing) |
|
||||
| `voice/` | `Fingerprint` (MFCC + DTW wake-word matching), `HotwordStore` (phrase, samples, policy), `HotwordService` (listening), `PhraseRecorder` (training), `HotwordTile` |
|
||||
| root | `AssistActivity` (the bubble), `Brain` (one shared agent for chat and voice), `Bubble` (step-aside handle) |
|
||||
| `ui/` | Compose screens: Chat (with Schedule / Saved / Workflows tabs), Settings (category list → sub-pages), provider widgets, Default apps, `MarkdownView` |
|
||||
| `ui/` | Compose screens: Chat (with Schedule / Saved / Workflows tabs and the `ChatHistoryPanel`), Settings (category list → sub-pages), provider widgets, `ModelGuideSection`, Default apps, `MarkdownView` |
|
||||
| `app/src/main/cpp/` | `needle_jni.cpp` (real), `needle_stub.cpp` (x86_64 emulator stand-in) |
|
||||
|
||||
---
|
||||
@@ -174,6 +177,8 @@ All times IST. All APKs are in `dist/`.
|
||||
|
||||
| **0.4.3** | 24 Sep, 15:34 | 54 MB | Owner: "I can't save separate settings for each provider" — switching from OpenCode Zen to MiMo and back reported an invalid key | **B-36:** every provider now keeps its own API key, address and model, so you can switch freely. An upgrade moves the existing key onto whichever provider was selected. Plus an eye icon to check a key you've typed, a ✓ in the picker next to providers that are set up, and Robolectric so settings and backups can be tested without a device |
|
||||
|
||||
| **0.4.4** | 28 Sep, 10:53 | 54 MB | Owner asked what could be taken from **Thinai**, an open-source on-device AI app, then asked for all of it: use Thinai as a model, its prompt-injection hardening, its web search, and its chats panel and model guide | **Chats panel** (☰): every conversation saved; new chat, switch, search, rename, delete, delete all (B-38). **Model guide**: 20 real `.litertlm` models, the phone's RAM/CPU/storage, use-case chips, "runs well / tight / too big" and a speed estimate. **Thinai preset**, and any server on the phone gets the small-model treatment. **Web search** with a Bing fallback, engine resting and a relevance filter (B-37). **Random-id wrapper** for other people's text (B-40). **Wake phrase no longer crashes the app after an update** (B-39, found while testing) |
|
||||
|
||||
Every build installs over the previous one: same package `app.stitch`, same signing key, and the version code goes up.
|
||||
|
||||
|
||||
@@ -236,6 +241,15 @@ All times IST.
|
||||
| 25 Sep, ~13:1x | Owner asked for a full review of where the project stands. Every document and the whole source tree were read and checked against the code: 87/87 tests re-run green, the Needle eval re-run (unchanged), the shipped APK's version confirmed with `aapt`, and the Hermes side of the machine re-checked (gateway up, API server still not listening, plugins folder still empty, Tailscale address still `100.x.y.z`). Three stale numbers in this document corrected. Two new findings recorded as risks 17 and 18 below |
|
||||
| 25 Sep, ~13:3x | **The project put under version control** — see C-14. `git init`, one initial-import commit of 112 files, tagged `v0.4.3`. Build outputs, `dist/` and machine-specific files excluded; the prebuilt `libneedle.a` files kept in the repo on purpose |
|
||||
| 25 Sep, ~13:4x | `docs/STAGE_A2_CHECKLIST.md` written: the 0.4.2 and 0.4.3 changes have never run on a phone, so they get their own short checklist before any Hermes work |
|
||||
| 28 Sep, ~09:5x | Owner asked for a status review, then about "a Tamil project named Thinai". Found it on GitHub (Aravindargutus/Thinai, MIT, 8 commits, all made on 26 Sep): a Flutter app that serves GGUF models on the phone. Its code was read; nothing can be copied directly (Flutter vs Kotlin), so ideas were ported |
|
||||
| 28 Sep, ~10:0x | Stitch's web search tested live from the build machine: DuckDuckGo answered 1 of 3 questions, then returned HTTP 202 challenge pages; Bing answered all 3 (B-37) |
|
||||
| 28 Sep, ~10:05 | Owner: go ahead with Thinai as a provider, the injection hardening and web search, plus the chats panel, model catalogue, RAM/CPU guide and use-case recommendations. Branch `release/0.4.4` |
|
||||
| 28 Sep, ~10:1x | Reading the chat code showed AI replies were never saved and the chat screen started empty after every restart (B-38) |
|
||||
| 28 Sep, ~10:2x | 20 `.litertlm` files on Hugging Face's litert-community listed with real sizes for the catalogue |
|
||||
| 28 Sep, 10:28 | 37 new tests (87 → 124). The live web-search test asked the real engines 4 questions (one in Tamil): all answered, via Bing, with DuckDuckGo blocking |
|
||||
| 28 Sep, 10:37 | Emulator: the app crashed on launch — the wake-phrase service, restarted by Android after the reinstall, was refused the microphone (B-39, pre-existing). Fixed and re-tested |
|
||||
| 28 Sep, 10:4x | Emulator run of the chats panel, the Thinai path (simulated with `adb reverse`) and the model guide. Found and fixed: failed exchanges reloaded as unanswered questions (B-41), keyboard covering the panel, "0.0 GHz" on the emulator (B-42) |
|
||||
| 28 Sep, 10:53 | **0.4.4 built**: 124 tests (0 failed), Needle eval unchanged (wrong 0), version confirmed with `aapt`, new features confirmed present in the APK |
|
||||
|
||||
---
|
||||
|
||||
@@ -300,6 +314,12 @@ Every significant failure, in four groups:
|
||||
| B-35 | Replies read like statistics, not conversation ("even AI answers are like stats and info") | The system prompt asked for exactly that: *"Keep them short"* plus *"use small tables for lists of calls/messages/events"* | A "How to talk" section: lead with the outcome in a plain sentence, no narrating steps, no status-report phrasing, and tables only when several items were actually asked for — never as the only place the answer appears, since speech skips them | 0.4.2 |
|
||||
| B-36 | Set up OpenCode Zen, then MiMo, then switched back to Zen — **"invalid API key"**, because it was now sending MiMo's key | Every provider shared one `apiKey`/`baseUrl`/`model` slot, so saving a second provider overwrote the first. The Settings screen made it worse: switching provider reset the URL and model to that preset's defaults but left the key field untouched, so the previous provider's key was carried across and then saved over the new one | Settings are stored per provider (`apiKey.<provider>` and so on), the screen saves the outgoing provider before loading the incoming one, and an upgrade moves the old shared values onto whichever provider was selected rather than dropping them. `configuredPresets()` marks set-up providers with a ✓, and an eye icon reveals a typed key | 0.4.3 |
|
||||
| B-21 | Removal said "removed **8:42**" for an **8:43** alarm, and the alarm stayed on | Some Clock apps register the alarm a few seconds early (e.g. 20:42:57); Stitch dropped the seconds | Round to the nearest minute; snap requested times to a known alarm (±1 min, ±12 h). Verify that Android's next alarm changed; otherwise open the alarm list and say so | 0.3.8 |
|
||||
| B-37 | *(found by testing, 28 Sep)* Web search said "No results" for ordinary questions | Stitch asked only DuckDuckGo's HTML page. After one question from an address, DuckDuckGo answers with an HTTP 202 "anomaly" challenge page, which the parser read as zero results — measured: 1 of 3 questions answered | Ported from Thinai: DuckDuckGo Lite and HTML tried first, then **Bing** (sent keywords, since it ranks "who is the CEO of Nvidia" on "CEO"); challenge pages detected and the engine rested for 10 minutes; results must cover the question (Tamil words kept whole); a clear message when every engine refuses. Live: 4 of 4 answered | 0.4.4 |
|
||||
| B-38 | *(found reading the code)* The chat screen was empty after every restart, and "conversation survives restarts" (0.3.9) was only half true | `ConversationStore.save` was only called by `remember()`, which rules and on-device replies use. Replies from the AI went through `runCloud`, which never saved, and the chat screen never loaded the saved turns at all | `ChatStore`: every exchange is saved from one place (`Agent.handle`), both sides, and the screen loads the current chat. Many chats instead of one. The old store is moved into the first chat on first launch | 0.4.4 |
|
||||
| B-39 | *(found in the emulator, pre-existing since 0.4.0)* "Stitch keeps stopping" on launch after an update, with the wake phrase on | Android restarts the wake-phrase service by itself (`START_STICKY`) after the update kills it, and the update/boot receiver also started it — both from the background, where Android 14 refuses a microphone service with a `SecurityException`. It was uncaught, so the whole app crashed, repeatedly. It would have hit the owner's phone after installing 0.4.2 or later | The service catches the refusal, stops quietly and posts **"Wake phrase is off — tap to turn it back on"**; the update/boot receiver posts that notice instead of starting the microphone. Opening Stitch starts listening from the foreground as before. Verified by reinstalling in the emulator: no crash, notice shown | 0.4.4 |
|
||||
| B-40 | *(security, found comparing with Thinai)* A web page or message could step outside the "this is other people's text" wrapper | The wrapper was a fixed `<untrusted_content>` tag, so text containing `</untrusted_content>` appeared to end it. Small on-phone models also see chat-template tokens (`<\|im_end\|>`, `<start_of_turn>`) raw, which let text fake a new turn | Ported from Thinai: a fresh random id per wrap, forged markers stripped, control tokens broken with an invisible character, inline images defused | 0.4.4 |
|
||||
| B-41 | *(found in the emulator before release)* A reloaded chat sent the AI questions whose answers had failed, back to back | Error replies were rightly excluded from what the AI sees, but their questions were kept | A failed or stopped exchange is dropped whole, the way the live conversation already did | 0.4.4 |
|
||||
| B-42 | *(found in the emulator)* The model guide said "4 cores up to 0.0 GHz" | The emulator reports its CPU speed as "2" | Speeds under 0.5 GHz are treated as unknown | 0.4.4 |
|
||||
|
||||
### C. Mistakes in Claude's own process
|
||||
|
||||
@@ -321,6 +341,7 @@ These are recorded plainly, since they cost the owner time.
|
||||
| C-12 | The 24 Sep planning session rewrote `README.md` and wrote `docs/UPGRADE_PLAN.md`, but never updated this document — breaking the standing rule in `CLAUDE.md`. It also listed `PLAN.md` and `HOTWORD_PLAN.md` as needing "historical" labels and then didn't apply them, while presenting its Phase 0 as essentially done | Two days of project history were missing, and two docs still described shipped features as unbuilt. Anyone reading the docs would have believed the cleanup was finished | All four documents brought into line on 24 Sep. The rule stands: docs are part of the change, and a plan may not mark its own cleanup complete while the files still contradict it |
|
||||
| C-14 | **The project had no version control at all for its first six days and 16 releases.** Nobody asked for it, and I never raised it | Every edit was a one-way change to the only copy. C-01 (a script that inserted text between every character of `NeedleEngine.kt`) had no undo — the file had to be rewritten from scratch. Any accidental overwrite of working code between releases would have been unrecoverable, and there is no record of what changed between the 16 APKs beyond this document | `git init` on 25 Sep, one initial-import commit, tagged `v0.4.3`. From now on each release is its own commit and tag. The history before 0.4.3 cannot be reconstructed; the APKs in `dist/` are all that remains of it. Rule: a project that is producing releases gets a repository on day one, whether or not it was asked for |
|
||||
| C-13 | The same session's plan stated 16 things that were not true — most importantly that the `hermes-android` bridge was "not installed locally" when it is cloned in the next folder along, and "42 tools" when the project's own README says 38. It also proposed creating files that already exist and omitted every package the app actually has | The plan read as researched but had not been checked against the source tree or the machine. Acting on it would have meant rebuilding things that exist and missing the two real blockers (the API server's loopback bind and its mandatory key) | Every claim re-verified against code, `~/.hermes`, and the upstream sources. Full list kept as §12 of `docs/UPGRADE_PLAN.md`. Rule: a plan that quotes a number must say where the number was read from |
|
||||
| C-15 | The fake AI server used for every emulator test since 19 Sep was never saved in the project | On 28 Sep the emulator still pointed at it, every AI request failed, and it had to be rewritten from memory before anything could be tested | Now kept at `tools-dev/fake-ai/fake_ai.py`, with instructions. Rule: a tool the testing depends on lives in the repository |
|
||||
|
||||
### D. Platform limits
|
||||
|
||||
@@ -366,8 +387,12 @@ These are recorded plainly, since they cost the owner time.
|
||||
| `ProviderSettingsTest` | Per-provider settings, under Robolectric: two providers keep their own keys, switching back restores the whole configuration, a fresh restart agrees, an untouched provider falls back to its preset defaults, the picker knows which are set up, a blank key clears only that provider, and an upgrade from the old shared slot keeps the key |
|
||||
| `ClockScreenTest` | Reading alarm rows off a Clock app's screen: several time formats, and rows without a time ignored (the B-22/B-30 path) |
|
||||
| `BackupTest` | Backup encryption and the SharedPreferences round-trip: seal/open, wrong passphrase refused, a single flipped character detected, two backups of the same data differ, unicode survives, a non-backup file is rejected, a newer-version backup is refused, the header reads without the passphrase, every preference type returns as the type it was (a Long does not collapse to an Int, a Float does not become a Double), wake-phrase fingerprints survive byte-identical, an unknown type is skipped rather than crashing |
|
||||
| `ChatStoreTest` | Saved chats (Robolectric): titles from the first question, new chat keeps the old one and reuses an empty one, deleting the current chat moves to the newest other, rename, search by text, delete all, the one-time move from the old single chat, failed exchanges dropped whole from what the AI sees, only the last ~40 lines sent |
|
||||
| `WebSearchTest` | DuckDuckGo HTML and Lite parsing (adverts dropped, redirects unwrapped, lookalike hosts refused), a **real saved Bing page** with its tracking links decoded, the real DuckDuckGo challenge page recognised, off-topic results dropped, Tamil words kept whole, question → keywords, the fall-through to Bing with 10-minute resting, "blocked" and "unreachable" reported honestly. Plus a live test (`STITCH_LIVE=1`) against the real engines |
|
||||
| `UntrustedTest` | Other people's text can't close its wrapper early (random id, forged and old-style markers removed), split forged markers, chat-template tokens broken, inline images defused, ordinary text (including Tamil) unchanged |
|
||||
| `ModelGuideTest` | Catalogue entries unique and well-formed, phone classes, fit on 4 GB vs 12 GB, "not enough storage" unless installed, Tamil strictness (Gemma 3 1B is English-only), untried models capped for phone commands, Gemma 4 recommended on a mid-range phone, a 3 GB phone only offered models that fit, a 32-bit phone told why, speed in plain words, servers on 127.0.0.1 counted as on-phone |
|
||||
|
||||
**Result at 0.4.0:** 50 tests, 0 failures. **At 0.4.1 (22 Sep, 12:51):** 53 tests in 10 files, 0 failures, 0 skipped. **At 0.4.3 (24 Sep, 15:34):** 87 tests in 14 files, 0 failures — `ProviderSettingsTest` adds 7. **At 0.4.2:** 80 tests in 13 files, 0 failures. The 27 added since 0.4.1 are `BackupTest` (15), `SpokenReplyTest` (6) and `WakePhraseTest` (6). **Compose screens still have no automated tests**, so the backup UI, the routing radio buttons, the Phone control tile and the wake-phrase training scores are only checked by compiling. The 3 new tests (in `NumberGroundingTest`) cover B-26 and B-27: a name missing its last letter still matches the right contact but not a different person, and the user's own number is found in their message. B-28 is covered by the existing `TimeParser` tests plus a code change in `Agent`; no dedicated test. **The Settings and Chat-tab UI changes have no automated tests.** Compose screens aren't unit-tested in this project, so the only check is that they compile.
|
||||
**At 0.4.4 (28 Sep, 10:53):** 124 tests in 18 files, 0 failures, 1 skipped (the live web-search test, which runs only with `STITCH_LIVE=1`; run separately, it passed: 4 of 4 questions answered). The 37 new tests are `ChatStoreTest` (8), `WebSearchTest` (12), `UntrustedTest` (6) and `ModelGuideTest` (11). The chats panel and model guide screens have no automated tests; they were checked by hand in the emulator (below). **Result at 0.4.0:** 50 tests, 0 failures. **At 0.4.1 (22 Sep, 12:51):** 53 tests in 10 files, 0 failures, 0 skipped. **At 0.4.3 (24 Sep, 15:34):** 87 tests in 14 files, 0 failures — `ProviderSettingsTest` adds 7. **At 0.4.2:** 80 tests in 13 files, 0 failures. The 27 added since 0.4.1 are `BackupTest` (15), `SpokenReplyTest` (6) and `WakePhraseTest` (6). **Compose screens still have no automated tests**, so the backup UI, the routing radio buttons, the Phone control tile and the wake-phrase training scores are only checked by compiling. The 3 new tests (in `NumberGroundingTest`) cover B-26 and B-27: a name missing its last letter still matches the right contact but not a different person, and the user's own number is found in their message. B-28 is covered by the existing `TimeParser` tests plus a code change in `Agent`; no dedicated test. **The Settings and Chat-tab UI changes have no automated tests.** Compose screens aren't unit-tested in this project, so the only check is that they compile.
|
||||
|
||||
**Needle offline eval** (`tools-dev/needle/run_eval.py`, 64 phrases, the app's real safety rules, threshold 0.4; first run 19 Sep at 0.3.8, re-run at 0.4.1 with identical results). The eval doesn't model the time re-reading step, so it doesn't exercise B-28:
|
||||
- Correct tool: 48/64. Correct tool and arguments: 47/64.
|
||||
@@ -395,6 +420,7 @@ Verified at various versions:
|
||||
- bubble opened over the Clock app (app stays visible), Stitch offered by Android as a digital assistant, and "read what's on screen" returning the **Clock's** contents, not Stitch's own window
|
||||
- wake-phrase service running as a microphone foreground service with its notification, no crashes
|
||||
- alarm turned off **through the Clock app's screen** with phone control on: the switch read back as off and Android reported no next alarm
|
||||
- **0.4.4, 28 Sep** (fake AI server, now in `tools-dev/fake-ai/`): the app survives an update with the wake phrase on and shows "Wake phrase is off"; a conversation survives an update, AI replies included; the chats panel — new chat (the AI saw a fresh 2-message history), switching back (the AI saw that chat's history), rename, search by message text, delete with confirmation, keyboard closing when the panel opens; the **Thinai path** simulated by forwarding the emulator's 127.0.0.1:11434 to the fake server: Sync found the model, Test connection passed, and a request carried **33 tools, not 70**; the model guide on the 2.4 GB emulator: "Budget-class", one fitting pick for phone commands with the "too big" caveat, Qwen 3 1.7B marked "Tight fit" for Tamil
|
||||
|
||||
### Real phone, 24 Sep (the owner, against `docs/STAGE_A_CHECKLIST.md`)
|
||||
|
||||
@@ -407,6 +433,11 @@ The first real-device test of 0.4.1, and the first time the wake phrase heard an
|
||||
### Not yet verified
|
||||
|
||||
These are known gaps:
|
||||
- **Everything new in 0.4.4 on a real phone** — see section 6 of `docs/STAGE_A2_CHECKLIST.md`
|
||||
- **The real Thinai app.** Only its address and API shape were simulated. Whether a small GGUF model in Thinai handles Stitch's 33 tools well is unknown
|
||||
- **18 of the 20 catalogue models have never been loaded by Stitch.** Only Granite 350M (emulator) has run; Gemma 4 is the design target but untested on a phone. Newer families (Qwen 3.5, LFM 2.5, Ministral 3, Granite 4.2) may need a newer LiteRT-LM than 0.17.1 (the newest published on 28 Sep). Each is labelled "Not tried in Stitch yet"
|
||||
- **The model guide's speeds are estimates** from memory bandwidth by phone class, never measured on a phone
|
||||
- Delete all chats, and a backup/restore round trip that includes chats, were only covered by unit tests
|
||||
- Real WhatsApp auto-send and notification replies
|
||||
- Spotify and YMusic playback
|
||||
- A real Google account and calendar sync
|
||||
@@ -434,9 +465,11 @@ These are known gaps:
|
||||
| **API keys** | Encrypted with an Android Keystore-backed key (`SecretBox`) in app-private storage. Sent only to the chosen provider's endpoint |
|
||||
| **Network** | The app talks only to the configured AI, model download hosts (Hugging Face) when downloading, and weather/web-search endpoints when those tools run. No analytics or telemetry |
|
||||
| **Risk levels** | Every tool has LOW/MEDIUM/HIGH risk, set by the tool, never by the AI. HIGH (calls, sending messages, deleting contacts/events) **always** asks first and shows the exact contact, number and text |
|
||||
| **Prompt injection** | Tools that read other people's content (SMS, notifications, screen, web) are marked untrusted. After such a read, MEDIUM actions also need confirmation. Screen taps on Send/Pay/Delete-type buttons ask first (can be turned off in Settings) |
|
||||
| **Prompt injection** | Tools that read other people's content (SMS, notifications, screen, web) are marked untrusted. After such a read, MEDIUM actions also need confirmation. Screen taps on Send/Pay/Delete-type buttons ask first (can be turned off in Settings). Since 0.4.4 the wrapper carries a fresh random id the text cannot forge, and chat-template control tokens inside it are broken (B-40) |
|
||||
| **Runaway agent** | Max 40 steps; stops on repeated identical steps or repeated failures; visible Stop button over other apps |
|
||||
| **On-device mode** | With "On this phone" selected, no request data leaves the phone |
|
||||
| **Saved chats** | Since 0.4.4 every conversation is kept in app-private storage and in backups — only what the user and Stitch said, never tool results, screenshots or the "Show data" sources. Chats can be deleted one by one or all at once |
|
||||
| **Thinai (0.4.4)** | Talked to over `127.0.0.1` only; Stitch sends it the same requests it would send any AI. Thinai's own server is open to other apps on the phone unless a token is set (risk 20) |
|
||||
| **Data sent to cloud AI** | Only what's needed for the request: tool results, and screen text/screenshots during screen control. The "Show data" panel shows what an answer was based on |
|
||||
| **Permissions used** | `ACCESS_COARSE/FINE_LOCATION, ACCESS_NETWORK_STATE, ACCESS_NOTIFICATION_POLICY, ANSWER_PHONE_CALLS, BIND_ACCESSIBILITY_SERVICE, BIND_NOTIFICATION_LISTENER_SERVICE, BLUETOOTH_CONNECT, CALL_PHONE, INTERNET, POST_NOTIFICATIONS, QUERY_ALL_PACKAGES, READ/WRITE_CALENDAR, READ_CALL_LOG, READ/WRITE_CONTACTS, READ_SMS, SEND_SMS, RECEIVE_BOOT_COMPLETED, RECORD_AUDIO, SCHEDULE_EXACT_ALARM, USE_EXACT_ALARM, WRITE_SETTINGS`. Intentionally broad (personal use) and requested just in time |
|
||||
| **Signing** ⚠️ | Releases up to and including 0.4.1 are signed with this machine's **Android debug key** (`~/.android/debug.keystore`). A proper release key now exists at `~/.stitch-release-key/` (RSA 4096, valid to 2056) but is **not in use yet** — it is opt-in via `-PreleaseKey`, because changing keys forces an uninstall. Back up both folders. Cutover steps: `docs/SIGNING.md` |
|
||||
@@ -511,24 +544,37 @@ No system packages were installed. Nothing outside the home folder and the proje
|
||||
from the contact list. This needs deciding before Stage D is written, not during.
|
||||
19. ~~**No version control.**~~ Fixed 25 Sep: the project is a git repository, tagged `v0.4.3`. The
|
||||
history of the first 16 releases is gone; only the APKs in `dist/` remain.
|
||||
20. **Thinai's server has no password by default, and allows any web page's scripts.** Any app on the
|
||||
phone — or a web page open in the phone's browser — can use a running Thinai server's model. That
|
||||
costs battery, not data (Stitch's own tools are never exposed through it). Setting an access token
|
||||
in Thinai and pasting it as Stitch's key closes this. Never turn on its LAN mode.
|
||||
21. **The wake phrase needs one tap after every update or reboot** (B-39). Android forbids a background
|
||||
app from opening the microphone; the "Wake phrase is off" notification is the one-tap way back.
|
||||
22. **Model ratings are editorial**, taken from Thinai's approach: what each model's makers claim, its
|
||||
family and its size. "Tamil" is only claimed where the makers declare Tamil training.
|
||||
23. **Web search depends on keyless public pages** (DuckDuckGo, Bing) whose layouts can change. Two
|
||||
engines and two DuckDuckGo surfaces mean one layout change costs one engine, not the feature.
|
||||
24. **Saved chats are stored in one preferences file.** Fine for hundreds of chats; if it ever grows
|
||||
to thousands it should move to a database (planned with the audit log, Stage D).
|
||||
|
||||
---
|
||||
|
||||
## 14. Project metrics
|
||||
|
||||
| Metric | Value (at 0.4.1, measured 22 Sep) |
|
||||
| Metric | Value (at 0.4.4, measured 28 Sep unless noted) |
|
||||
|---|---|
|
||||
| Kotlin source files | 62 / 11,244 lines (re-counted 25 Sep at 0.4.3; 59 / 10,102 at 0.4.1) |
|
||||
| Kotlin source files | 67 / 12,908 lines at 0.4.4 (measured 28 Sep; 62 / 11,244 at 0.4.3; 59 / 10,102 at 0.4.1) |
|
||||
| Native code | `needle_jni.cpp` + x86_64 stub |
|
||||
| Test files / tests | 14 / 87 at 0.4.3 (all pass; 80 at 0.4.2, 53 at 0.4.1, 50 at 0.4.0) |
|
||||
| Needle eval (64 phrases, threshold 0.4) | tool 48 · tool+args 47 · on-device 24 · **wrong 0** (re-run 25 Sep at 0.4.3: identical) |
|
||||
| Version control | git, since 25 Sep. One commit, tagged `v0.4.3`; 112 files tracked, `dist/` and build outputs excluded |
|
||||
| Test files / tests | 18 / 124 at 0.4.4 (0 failed, 1 live test skipped by default; 87 at 0.4.3, 80 at 0.4.2, 53 at 0.4.1, 50 at 0.4.0) |
|
||||
| Needle eval (64 phrases, threshold 0.4) | tool 48 · tool+args 47 · on-device 24 · **wrong 0** (re-run 28 Sep at 0.4.4: identical) |
|
||||
| Version control | git, since 25 Sep. Tags `v0.4.3` and `v0.4.4` (committed 28 Sep on `release/0.4.4`, merged into `master`). `dist/` and build outputs excluded |
|
||||
| On-phone model catalogue | 20 `.litertlm` models from litert-community (sizes from the Hugging Face API, 28 Sep); 8 use cases |
|
||||
| Tools available to the AI | 70 |
|
||||
| Tools available to Needle on-device | 32 |
|
||||
| Deterministic quick commands | flashlight, play X on Y, alarm set/remove/list, timer set/cancel, reminder set |
|
||||
| AI provider presets | 15, each with its own saved key/URL/model since 0.4.3 (Anthropic, OpenAI, OpenRouter, OpenCode Zen, OpenCode Go, DeepSeek, Xiaomi MiMo ×2, Gemini, Groq, on-device, local server, Ollama, Hermes, custom) |
|
||||
| AI provider presets | 16, each with its own saved key/URL/model since 0.4.3 (Anthropic, OpenAI, OpenRouter, OpenCode Zen, OpenCode Go, DeepSeek, Xiaomi MiMo ×2, Gemini, Groq, on-device, **Thinai** (0.4.4), local server, Ollama, Hermes, custom) |
|
||||
| API formats | OpenAI Chat, OpenAI Responses, Anthropic Messages, LiteRT-LM local |
|
||||
| Releases | 16 APKs (0.1.0 → 0.4.3) |
|
||||
| Releases | 17 APKs (0.1.0 → 0.4.4) |
|
||||
| APK size | 54 MB (Needle ~14 MB + LiteRT-LM engine ~22 MB) |
|
||||
| Min / target Android | 9 (API 28) / 15 (API 35) |
|
||||
| Stack | Kotlin 2.4.20, AGP 8.7.3, **Gradle 8.14.5** (was 8.11.1), Compose BOM 2024.12.01, OkHttp 4.12, LiteRT-LM 0.17.1, NDK r30 |
|
||||
|
||||
Reference in new issue
Block a user