Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.
docs: add README and repair references to removed internal docs
Durganshu Mishra6d745822d855
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 67eac60..4179fc2 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -4,7 +4,7 @@ name: CI# triggers (push / pull_request / schedule) are intentionally removed; the# nightly full-matrix job no longer runs. The workflow can still be triggered# manually via Actions → Run workflow (opt-in, consumes budget), but prefer the-# equivalent local commands in docs/RUNNING_TESTS.md. See AGENTS.md → CI.+# equivalent local commands in docs/RUNNING_TESTS.md.on:workflow_dispatch:diff --git a/.gitignore b/.gitignoreindex bc6eaea..ec877da 100644--- a/.gitignore+++ b/.gitignore@@ -22,6 +22,13 @@ out/.gradle/build/+# Release build outputs (bundles, baseline profiles, metadata)+app/release/++# Python bytecode+__pycache__/+*.pyc+# Local configuration file (sdk path, etc)local.propertiesdiff --git a/README.md b/README.mdnew file mode 100644index 0000000..dcfa778--- /dev/null+++ b/README.md@@ -0,0 +1,92 @@+# Gotcha++An Android assistant that actually operates the phone. You describe a task in+chat; an LLM plans it and carries it out through a catalog of on-device tools —+reading the screen via the accessibility service, tapping and typing, opening+apps and settings, managing files, alarms, media, mail and calendar.++Gotcha talks to **any OpenAI-compatible `/chat/completions` endpoint**, so it+runs against OpenAI, OpenRouter, Groq, or a model served locally by+llama.cpp / LM Studio / Ollama.++> **Status:** early (`versionName 0.1.0`). Expect rough edges, and read the+> safety notes below before pointing it at a phone you care about.++## What it can do++101 tools are catalogued and classified. A sample:++| Area | Tools |+|---|---|+| Screen control | `read_screen`, `tap`, `swipe`, `input_text`, `press_key`, `global_action`, `navigate_app` |+| Apps & settings | `open_app`, `open_setting` |+| Files | `read_file`, `write_file`, `edit`, `list_files`, `glob`, `grep`, `run_command` |+| Communication | `send_email`, `compose_email`, `send_sms`, `dial_number`, `call_number` |+| Calendar & tasks | `create_calendar_event`, `edit_calendar_event`, `create_task`, `complete_task` |+| Device | alarms, timers, media control, camera and audio capture, screenshots |+| Connectors | Google, Microsoft Graph, Notion, generic IMAP |++The full table — every tool, its test tier, and how it is verified — is+generated from a manifest into [`docs/FEATURE_TEST_COVERAGE.md`](docs/FEATURE_TEST_COVERAGE.md).++### Monitor vs Operator++Two agent modes, switchable mid-conversation:++- **Monitor** — read-only. Inspects, lists, and reads; cannot create, modify, or+ delete. Safe for exploration.+- **Operator** — full permissions, including accessibility automation, SMS,+ calls, deletion, and root commands.++Sensitive actions — dialling, writing files, running commands, and similar —+additionally pop an Allow/Deny prompt before they run. That gate can be turned+off in Settings.++## Requirements++| | |+|---|---|+| Device | Android 11 (API 30) or newer — phone or emulator |+| Build | Android Studio Hedgehog+, JDK 17, Android SDK Platform 34 |+| LLM | An API key for any OpenAI-compatible endpoint |++## Quick start++```bash+./gradlew installDebug+```++Then open the app — it lands on Settings, because no model is configured yet.+Fill in **API key**, **Base URL** (including `/v1/`), and **Model name**, and+grant the permissions the app prompts for.++Full setup, permission-by-permission notes, on-disk layout, and troubleshooting+live in [`RUNNING.md`](RUNNING.md). For the test suite, see+[`docs/RUNNING_TESTS.md`](docs/RUNNING_TESTS.md).++## Safety++Gotcha drives a real device through the accessibility service and, in Operator+mode, can send messages, place calls, delete data, and run shell commands. An+LLM planning those actions will sometimes get them wrong.++- Start in **Monitor** mode.+- Prefer a spare device or an emulator while evaluating.+- API keys are stored in `EncryptedSharedPreferences` and are never logged, but+ screen contents are sent to whichever model provider you configure.++## Development++```bash+./gradlew testDebugUnitTest # JVM unit tests+./gradlew detekt lintDebug # static analysis — no baselines, everything must pass+./gradlew assembleDebug+```++The unit tests shell out to a POSIX `sh`, so run them from Linux, macOS, or Git+Bash. CI (`.github/workflows/ci.yml`) is disabled by default to conserve Actions+budget and can be run manually from the Actions tab.++## License++[GNU Affero General Public License v3.0](LICENSE) — Copyright © 2026 Samosa AI.diff --git a/RUNNING.md b/RUNNING.mdindex e263ac1..f8dca8a 100644--- a/RUNNING.md+++ b/RUNNING.md@@ -94,7 +94,7 @@ other device recording, independent of which chat produced them.Chat folders are named `slug(title)_<first 8 chars of the session UUID>` and renamed in placewhen the title becomes known. Deleting a chat moves its working directory to `old_chats/` instead-of deleting it. See `STORAGE_PLAN.md` for the full rationale.+of deleting it.## 5. Configure the LLM (required before chatting)diff --git a/app/src/main/java/com/gotcha/data/GotchaStorage.kt b/app/src/main/java/com/gotcha/data/GotchaStorage.ktindex be9d891..1756a55 100644--- a/app/src/main/java/com/gotcha/data/GotchaStorage.kt+++ b/app/src/main/java/com/gotcha/data/GotchaStorage.kt@@ -13,7 +13,7 @@ import java.io.IOException/*** Single source of truth for every path Gotcha reads or writes under shared- * storage. See STORAGE_PLAN.md for the full layout and rationale.+ * storage.*/object GotchaStorage {diff --git a/app/src/main/java/com/gotcha/tools/SettingsRouter.kt b/app/src/main/java/com/gotcha/tools/SettingsRouter.ktindex 6ec4f1e..de5f3bb 100644--- a/app/src/main/java/com/gotcha/tools/SettingsRouter.kt+++ b/app/src/main/java/com/gotcha/tools/SettingsRouter.kt@@ -7,8 +7,7 @@ import android.provider.Settings/*** How a settings destination is reached. The tier is dictated by what Android- * permits a non-privileged app to do, not by preference — see the tier model in- * `AGENTS.md`.+ * permits a non-privileged app to do, not by preference.** Tier 1 (change it silently through an API) is not represented here: those are* ordinary tools on [DeviceTool] / [SystemTool]. This router owns tiers 2 and 3,diff --git a/app/src/main/java/com/gotcha/tools/ToolExecutor.kt b/app/src/main/java/com/gotcha/tools/ToolExecutor.ktindex 1a6f7a3..ee60984 100644--- a/app/src/main/java/com/gotcha/tools/ToolExecutor.kt+++ b/app/src/main/java/com/gotcha/tools/ToolExecutor.kt@@ -158,7 +158,7 @@ class ToolExecutor(?: "Send an email (details unavailable)."// Single when-dispatch over the entire fixed tool catalog; size and branch count are- // inherent to the design (see AGENTS.md).+ // inherent to the design.@Suppress("CyclomaticComplexMethod", "LongMethod")private suspend fun dispatch(name: String, args: JsonObject, hidden: Set<String>): ToolResult {com.gotcha.connectors.ConnectorRegistry.toolHandler(name)?.let { return it.invoke(name, args) }diff --git a/app/src/test/java/com/gotcha/tools/FeatureCoverageManifestTest.kt b/app/src/test/java/com/gotcha/tools/FeatureCoverageManifestTest.ktindex 8591593..56804ae 100644--- a/app/src/test/java/com/gotcha/tools/FeatureCoverageManifestTest.kt+++ b/app/src/test/java/com/gotcha/tools/FeatureCoverageManifestTest.kt@@ -229,7 +229,7 @@ class FeatureCoverageManifestTest {"| OEM behaviour | **Not covered.** No emulator reproduces Samsung/Xiaomi battery " +"managers killing overlay services and background agents — this app's largest " +"real-world risk. Firebase Test Lab on physical devices is the only path; " +- "parked pending a GCP project (see `docs/TESTING_PLAN.md`). |"+ "parked pending a GCP project. |")appendLine()appendLine("### Instrumented suite")diff --git a/docs/FEATURE_TEST_COVERAGE.md b/docs/FEATURE_TEST_COVERAGE.mdindex 4a7923c..a3a3274 100644--- a/docs/FEATURE_TEST_COVERAGE.md+++ b/docs/FEATURE_TEST_COVERAGE.md@@ -145,7 +145,7 @@ The tiers above say *whether* a feature is tested. This says *where*.|---|---|| Android versions (JVM) | `ROBOLECTRIC` tests run under `@Config(sdk = [...])`, typically API 30/33/34, so version-branching logic is covered in seconds without an emulator. || Android versions (emulator) | Nightly `instrumented-full` matrix: API 30 (minSdk), 33, 34, 35, 36. Per-PR smoke runs API 34 only. |-| OEM behaviour | **Not covered.** No emulator reproduces Samsung/Xiaomi battery managers killing overlay services and background agents — this app's largest real-world risk. Firebase Test Lab on physical devices is the only path; parked pending a GCP project (see `docs/TESTING_PLAN.md`). |+| OEM behaviour | **Not covered.** No emulator reproduces Samsung/Xiaomi battery managers killing overlay services and background agents — this app's largest real-world risk. Firebase Test Lab on physical devices is the only path; parked pending a GCP project. |### Instrumented suitediff --git a/docs/RUNNING_TESTS.md b/docs/RUNNING_TESTS.mdindex f770bdc..9a3e134 100644--- a/docs/RUNNING_TESTS.md+++ b/docs/RUNNING_TESTS.md@@ -2,8 +2,8 @@Operational guide: environment setup, every way to run the tests, and everygotcha hit while getting Android 11–16 (API 30–36) coverage working on this-machine (Windows, SDK at `%LOCALAPPDATA%\Android\Sdk`). For *why* this suite-was built the way it was, see [`TESTING_PLAN.md`](TESTING_PLAN.md).+machine (Windows, SDK at `%LOCALAPPDATA%\Android\Sdk`). For what the suite+covers, see [`FEATURE_TEST_COVERAGE.md`](FEATURE_TEST_COVERAGE.md).## 1. One-time environment setup@@ -140,8 +140,7 @@ making a visible AVD from it):convenience path rather than a required one. Not run end-to-endin this session — check it works before depending on it.- **`scripts/maestro_run.sh`** + **`.maestro/flows/*.yaml`** — the Maestro- smoke layer. Requires Maestro installed separately (see- `TESTING_PLAN.md` §Phase 5 for the install command). Not exercised in this+ smoke layer. Requires Maestro installed separately. Not exercised in thissession either.- **CI** (`.github/workflows/ci.yml`) — **disabled by default** to conserve GitHub Actionsbudget: automatic triggers (push, PRs, the nightly full-matrix schedule) are removed. The