From a1d593a4ccb63c36e51d768a0cb884cba0b55921 Mon Sep 17 00:00:00 2001 From: thekhalidsha Date: Fri, 25 Sep 2026 14:25:14 +0530 Subject: [PATCH] docs: record the 25 Sep review, the new repository, and two Stage D blockers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DEVELOPMENT_HISTORY.md - timeline: the full review, git init, and the new checklist - C-14: no version control for the first six days and 16 releases, and why that mattered (C-01 had no undo) - risks 17 and 18: there is no standalone executor for the Hermes bridge to call (it is a private method of Agent, wired to the chat UI) and no audit log at all; and the number/name grounding rules depend on the user's own words this turn, which a remote command does not have - risk 19: no version control — now fixed - corrected counts: 62 Kotlin files / 11,244 lines (was 63, unmeasured), and ClockScreenTest added to the test audit - metrics: Needle eval re-run at 0.4.3, unchanged (wrong 0); version-control row docs/STAGE_A2_CHECKLIST.md (new) - 0.4.2 and 0.4.3 have never run on a phone. Covers the six 0.4.1 failures, the per-provider keys, a backup/restore round trip, the routing setting and tile, and the overnight battery cost. README.md - points at the new checklist, and notes the repository and tagging convention. --- DEVELOPMENT_HISTORY.md | 24 +++++++++- README.md | 8 ++++ docs/STAGE_A2_CHECKLIST.md | 92 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 docs/STAGE_A2_CHECKLIST.md diff --git a/DEVELOPMENT_HISTORY.md b/DEVELOPMENT_HISTORY.md index c93ac11..cebdaab 100644 --- a/DEVELOPMENT_HISTORY.md +++ b/DEVELOPMENT_HISTORY.md @@ -233,6 +233,9 @@ All times IST. | 24 Sep, ~13:5x | **Owner ran `docs/STAGE_A_CHECKLIST.md` on the real phone** — the first real-device test of 0.4.1, and of the wake phrase with an actual voice. Tabs, Settings pages, WhatsApp send, notification reply, a real API key and screen control all worked; six things did not | | 24 Sep, 15:34 | **0.4.3 built**: per-provider settings (B-36), API-key eye toggle, Robolectric added. 87/87 tests pass; Needle eval unchanged (wrong 0) | | 24 Sep, 14:11 | **0.4.2 built**: B-29–B-34 fixed, plus the routing setting, the Phone control tile and wake-phrase training scores. 80/80 tests pass; Needle eval unchanged (wrong 0) | +| 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 | --- @@ -316,6 +319,7 @@ These are recorded plainly, since they cost the owner time. | C-10 | The first version of the B-26 name fix only checked "within 2 letters", which would have let "Alia" match "Ali Khan" | Caught while writing the test, before any build | The matched name must also be one the user typed this turn | | C-11 | The Settings and Chat-tab changes were written in two separate sessions that weren't allowed to run Gradle, so neither was compiled when it was finished. Both were told to "only touch" one file, so neither updated these docs | Unverified code sat in the project; one session ended mid-compile with no result | Compiled for the first time in the 0.4.1 release build (it built cleanly and tests passed). Rule: a change isn't finished until it compiles; if a session can't build, it says so and the next release build is the check | | 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 | ### D. Platform limits @@ -491,7 +495,22 @@ No system packages were installed. Nothing outside the home folder and the proje accessibility page, because Android forbids an app from granting itself that access. 16. **Still on SharedPreferences.** The Room/DataStore migration in Stage B of the upgrade plan has not been done. It is now safe to attempt, because the backup exists as a fallback — that was the point - of building it first. + of building it first. (Recommendation added 25 Sep: for one user, the migration buys little now that + the backup exists. Room is better introduced with the audit log in Stage D, where it is needed.) +17. **There is no single executor object to plug the Hermes bridge into.** `docs/UPGRADE_PLAN.md` §3 + promises remote commands will "call the existing executor", but that executor is a private method, + `Agent.execute()` (`agent/Agent.kt:365`), reached only through `Agent.handle()` and tied to the chat + screen through the `AgentUi` interface. Stage D therefore has to start by lifting it out into its own + class with a confirmation interface that a notification can satisfy. Related: **no audit log exists + anywhere in the code** (nothing matches "audit"), although the plan requires one for every remote + command. +18. **The value-grounding rules have no remote equivalent.** `ToolContext.userInput` carries the user's + own words for this turn, and the number and name checks (B-23, B-26, B-27) depend on it: a phone + number is trusted only if the user typed it or it belongs to a contact. A command arriving from + Hermes has no such turn, so remote messaging and calling must be restricted to recipients resolved + 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. --- @@ -502,7 +521,8 @@ No system packages were installed. Nothing outside the home folder and the proje | Kotlin source files | 62 / 11,244 lines (re-counted 25 Sep 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** | +| 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 | | 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 | diff --git a/README.md b/README.md index d2c0d54..a279062 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ Stitch turns what you type or say into actions on your phone. **Current release:** Stitch 0.4.3. The live Android registry contains 70 tools, 32 are exposed to Needle, and the current test suite has 87 unit tests. The original [docs/PLAN.md](docs/PLAN.md) is retained as a historical design document; it is not the current implementation contract. +**Before anything else:** 0.4.2 and 0.4.3 have never been tested on a phone, and between them they +changed the six things that were broken in 0.4.1 plus the provider keys. [docs/STAGE_A2_CHECKLIST.md](docs/STAGE_A2_CHECKLIST.md) +is a 25-minute list to confirm they work. + See [docs/UPGRADE_PLAN.md](docs/UPGRADE_PLAN.md) for what happens next: connecting Stitch and Hermes in both directions, so Hermes can use your phone and Stitch can use your server. **None of it is in 0.4.3 yet.** It will all be built **inside Stitch** — there will never be a second app to install. [docs/PLAN.md](docs/PLAN.md) and [docs/HOTWORD_PLAN.md](docs/HOTWORD_PLAN.md) are historical design documents, kept for the reasoning; neither describes current behaviour. ## Install on your phone @@ -65,6 +69,10 @@ Stitch currently exposes 70 Android tools through the live registry. They cover ## Build it yourself +The project is a git repository as of 25 Sep 2026, starting at tag `v0.4.3`; each release from here on is +its own commit and tag. Build outputs and the APKs in `dist/` are deliberately not tracked, the prebuilt +`libneedle.a` files are. + Requirements: JDK 17, Android SDK (platform 35, build-tools 35.0.0), NDK `30.0.16248370`, CMake 3.22.1. The prebuilt Needle engine needs NDK r30's C++ runtime; older NDKs fail to link. Gradle is 8.14.5 (the wrapper downloads it on first build). ```sh diff --git a/docs/STAGE_A2_CHECKLIST.md b/docs/STAGE_A2_CHECKLIST.md new file mode 100644 index 0000000..26e98ae --- /dev/null +++ b/docs/STAGE_A2_CHECKLIST.md @@ -0,0 +1,92 @@ +# Stage A2 — does 0.4.3 actually work on the phone? + +> About 25 minutes, plus one overnight battery check. Install `dist/Stitch-0.4.3.apk`, then work down +> this list and write **works** or **broken: what happened** after each line. Plain words are best — +> "it played the wrong song" tells me more than a guess at the cause. +> +> **Why again?** You last tested 0.4.1 and found six things broken. They were fixed in 0.4.2, and 0.4.3 +> added per-provider keys. Neither release has ever run on a phone. So this list is deliberately short: +> it only covers what changed, plus the two things that can lose your data. +> +> Written 25 Sep 2026 for 0.4.3 (versionCode 16). The earlier list, `STAGE_A_CHECKLIST.md`, was for +> 0.4.1 and is done. + +**First, after installing:** open Settings → Phone control. If it says "on but not running", switch it +off and on again. Android always stops it when an app is updated. + +--- + +## 1. The six things that were broken in 0.4.1 (B-29 – B-34) + +These are the whole reason 0.4.2 exists. If any is still wrong, nothing else this week matters. + +| # | Do this | Result | +|---|---|---| +| 1.1 | "play [a song] on Spotify" — does it actually **play**, or does it stop at the search screen? | | +| 1.2 | Same on YouTube Music | | +| 1.3 | Set an alarm for an odd time (2:14 AM), then say "remove the 2:14 AM alarm". Did it say it removed it? | | +| 1.4 | Now open your Clock app yourself. Is that alarm really gone or switched off? | | +| 1.5 | Open any other app (Reddit, a browser), say your wake phrase. Behind the bubble, do you see **that app** or Stitch's own screen? | | +| 1.6 | Ask something with a long answer ("list my alarms") and let it speak. Can you **stop** it mid-sentence? | | +| 1.7 | Does it read tables aloud, or say the rest is on screen? (It should not recite a table) | | +| 1.8 | Leave the wake phrase on for an hour of normal use. How many times did the bubble open **by itself**? | | +| 1.9 | Say the phrase 10 times over the day. How many did it hear? | | +| 1.10 | Open a Settings category, turn the phone sideways. Does it stay on that page? | | + +## 2. Per-provider keys — the whole of 0.4.3 + +The bug: setting up a second provider overwrote the first one's key, so switching back said "invalid key". + +| # | Do this | Result | +|---|---|---| +| 2.1 | Settings → AI & provider. Is your existing key still there and working after the update? (**Test connection**) | | +| 2.2 | Set up a **second** provider with its own key. Test it | | +| 2.3 | Switch back to the first one. Does it still work **without** retyping the key? | | +| 2.4 | Close Stitch completely, reopen, switch between the two again. Still fine? | | +| 2.5 | Does the picker show a ✓ next to both? | | +| 2.6 | Does the eye icon next to the key field show what you typed? | | + +## 3. Backup and restore — untested, and it guards everything else + +This is the safety net for the signing-key change that comes next. It has only ever been tested on the +PC, never on a phone. + +| # | Do this | Result | +|---|---|---| +| 3.1 | Settings → Backup & restore → **Save a backup.** Pick a passphrase and **write it down** — there is no recovery without it | | +| 3.2 | Did it write a file? Roughly what size? | | +| 3.3 | Copy that file off the phone (PC, cloud, anywhere else) | | +| 3.4 | Open the file in any text viewer. Does the first line contain `"format": "stitch-backup"`? | | +| 3.5 | **Restore** that same file back over your current install. Does it say it worked? | | +| 3.6 | Are your notes, memories, reminders and provider keys all still right afterwards? | | +| 3.7 | Try restoring with a **wrong** passphrase on purpose. Does it refuse cleanly, without breaking anything? | | + +**Don't uninstall Stitch to test the restore.** That comes later, once, during the signing-key change in +`docs/SIGNING.md`. A restore over the existing install is enough for now. + +## 4. Routing and the Phone control tile (new in 0.4.2) + +| # | Do this | Result | +|---|---|---| +| 4.1 | Settings → On-device model → **on-device only**. Ask something that needs an AI ("summarize my last 5 calls"). Does it say plainly that it won't use your AI? | | +| 4.2 | Set it to **always my AI**. Does "turn on the flashlight" still work instantly? (the built-in rules should still run) | | +| 4.3 | Back to **Hybrid** | | +| 4.4 | Add the **Phone control** tile to your Quick Settings. Tap it — does phone control switch off? | | +| 4.5 | Open a banking app with it off. Does the bank work normally? | | +| 4.6 | Tap the tile again — does it take you to the Android page to switch it back on? | | + +## 5. Battery — the one number still missing + +| # | Do this | Result | +|---|---|---| +| 5.1 | Leave the wake phrase listening overnight. In the morning: Android Settings → Battery → Stitch. What percentage? | | + +--- + +## When you're done + +Send me the list with your answers. + +- Anything broken gets fixed and shipped as **0.4.4** before any Hermes work starts. +- If it all passes, the next steps are the signing-key changeover (`docs/SIGNING.md`) and then Stage C + of `docs/UPGRADE_PLAN.md` — making Hermes on your PC and Stitch on your phone actually talk.