Open source under Apache 2.0, with a new README

- LICENSE (Apache 2.0), NOTICE with credits (Needle 2, LiteRT-LM, Thinai),
  LICENSES/Thinai-MIT.txt, SPDX headers on every source file
- CONTRIBUTING (fork, branch from develop, PR into develop, maintainer
  merges), CODE_OF_CONDUCT (Contributor Covenant 2.1), SECURITY, Gitea
  issue and pull-request templates
- README rewritten with screenshots; the detailed guide moved to
  docs/USER_GUIDE.md
- Personal details removed: made-up contact names in examples and tests,
  a placeholder for the Tailscale address, made-up web-search fixtures
  in place of saved third-party pages
- B-43: the emulator reports Needle as unavailable instead of "init failed"
- B-44: chat previews show plain text, not Markdown symbols
This commit is contained in:
thekhalidsha committed 2026-09-28 12:40:28 +05:30
1 parent 0bd9888335
commit 917d4632c2
109 files changed
+1080 -179

No files matched your search

+80
View File
@@ -0,0 +1,80 @@
# Contributing to Stitch
Thanks for wanting to help. Stitch is maintained by one person, so this guide keeps things simple and
predictable for everyone.
## The short version
1. **Fork** the repository and clone your fork.
2. Create a branch **from `develop`**: `git checkout -b feature/short-name develop`
(use `fix/short-name` for bug fixes).
3. Make your change, **with tests**, and run the checks below.
4. Open a **pull request into `develop`** (never into `main`).
5. The maintainer reviews it. Only the maintainer merges; `main` and `develop` are protected.
Please open an issue first for anything larger than a small fix, so no one spends a weekend on
something that won't be merged.
## How the branches work
| Branch | What it holds | Who writes to it |
|---|---|---|
| `main` | Released versions only | Maintainer, by merging a release |
| `develop` | The next version, as it comes together | Maintainer, by merging pull requests |
| `feature/*`, `fix/*` | One change each | You, in your fork |
| `release/<version>` | One per version | Maintainer |
Releases are tagged `v<version>-alpha.N` (tests pass), `v<version>-beta.N` (tested on a real phone) and
`v<version>` (final). See the README for the full model.
## Before you open a pull request
```sh
export JAVA_HOME=/path/to/jdk-17
./gradlew testDebugUnitTest # every test must pass
./gradlew assembleDebug # it must build
```
If you touched how requests reach the on-device model (tool descriptions, `agent/Agent.kt`, `QuickCommands`),
also run the Needle eval; its "wrong" count must stay **0**:
```sh
python3 tools-dev/needle/run_eval.py path/to/needle app/build/needle-tools.json 0.4
```
No paid AI key is needed to test: `python3 tools-dev/fake-ai/fake_ai.py` runs a stand-in AI server.
## What a good change looks like
- **Safety comes first.** Stitch can call, text and tap on someone's phone. Anything that sends,
deletes, pays or posts must go through the existing confirmation path (`Tool.risk`,
`needsConfirmation`). Values that must be exact — phone numbers, names, times — come from the phone's
data or the user's own words, never from a model's memory.
- **Match the surrounding code**: Kotlin, Jetpack Compose, one module, comments that explain *why*.
- **Plain language** in anything a user reads: Stitch is used by people who are not developers.
- **Tests** for behaviour, especially bug fixes: a test that fails before the fix and passes after.
- **New source files** start with the license header:
```kotlin
// SPDX-FileCopyrightText: 2026 Your Name
// SPDX-License-Identifier: Apache-2.0
```
## Commit messages
A short summary line (under ~70 characters), a blank line, then *why* the change was needed. Reference
the issue if there is one (`Fixes #12`).
## Licensing of contributions
Stitch is licensed under the **Apache License 2.0**. By submitting a pull request you agree that your
contribution is licensed under the same terms (section 5 of the license), and that you have the right
to submit it. No separate agreement is needed.
## Reporting bugs and asking for features
Use the issue templates. For a bug, the Stitch version (Settings shows it), your phone model and Android
version, what you said to Stitch, and what happened are the four things that matter most.
Security problems: please **don't** open a public issue — see [SECURITY.md](SECURITY.md).
Everyone taking part is expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md).