Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
d89431e
ADFA-7082: Vendor sqlite-js 1.3.7 with our patches
davidschachterADFA Nov 12, 2026
ae04160
ADFA-7082: Build the sqlite-js AAR for apps in subprojects:sqlite-js
davidschachterADFA Nov 12, 2026
f766299
ADFA-7082: Release the sqlite-js AAR to sqlite-js-latest
davidschachterADFA Nov 12, 2026
3372d3b
ADFA-7082: Build the sqlite-js AAR for arm64-v8a and armeabi-v7a only
davidschachterADFA Nov 12, 2026
1391c4b
ADFA-7082: Run no stored code by default; test sqlite-js on pull requ…
davidschachterADFA Nov 12, 2026
e0f400a
ADFA-7082: Update sqlite-js-latest in place, out of latest-release se…
davidschachterADFA Nov 12, 2026
362ad7f
ADFA-7082: Sort the QuickJS copyright lines the same on every machine
davidschachterADFA Nov 12, 2026
2f3460f
ADFA-7082: Log stored functions that cannot be listed; guard the tag …
davidschachterADFA Nov 12, 2026
401a052
ADFA-7082: Vendor the reviewed sqlite-js patches
davidschachterADFA Nov 12, 2026
44a6e88
ADFA-7082: Put back both the assets and the tag if a release update f…
davidschachterADFA Nov 12, 2026
3c93bda
ADFA-7082: Find js_functions in any case; sync the cancel test; doc c…
davidschachterADFA Nov 12, 2026
0d1f9db
ADFA-7082: Let a re-run repair a release left without its assets
davidschachterADFA Nov 12, 2026
ac748be
ADFA-7082: Vendor sqlite-js main with our changes merged, one patch left
davidschachterADFA Nov 12, 2026
8086fd1
ADFA-7082: Vendor the sqlite-js 1.4.1 release
davidschachterADFA Nov 12, 2026
6957c71
ADFA-7082: Let a connection open, and its stored functions load, duri…
davidschachterADFA Nov 12, 2026
763bb47
ADFA-7082: Patch two stack-bound crashes and two garbage cases
davidschachterADFA Nov 12, 2026
c084450
ADFA-7082: Let a re-run replace a release left as a draft
davidschachterADFA Nov 12, 2026
7f8e40c
style: spotless reformat, no functional change
davidschachterADFA Nov 12, 2026
a113c80
ADFA-7082: End the result sets an interrupted call leaves open
davidschachterADFA Nov 13, 2026
64269ea
ADFA-7082: Make ending result sets safe when it runs JavaScript, and …
davidschachterADFA Nov 13, 2026
851ee17
ADFA-7082: Stop what ending result sets runs; count the interrupts db…
davidschachterADFA Nov 13, 2026
8973b29
ADFA-7082: Answer the independent review of patches 0004 to 0007
davidschachterADFA Nov 13, 2026
db04941
ADFA-7082: Test a direct interrupt during db.exec with a result set kept
davidschachterADFA Nov 13, 2026
e538658
Merge branch 'stage' into feat/ADFA-7082-sqlite-js-aar
davidschachterADFA Nov 13, 2026
b8f7aa6
ADFA-7135: Define the interface between the SQLite debugger extension…
claude Nov 13, 2026
c603f89
ADFA-7136: Copy the MCP server from ShareYourApps, renamed
claude Nov 13, 2026
fab6cff
ADFA-7135 Add the sqlite-debugger module skeleton
claude Nov 13, 2026
1b53c59
ADFA-7136: MCP server with the eight read-only database tools
claude Nov 13, 2026
acddbd2
ADFA-7135 Implement the SQLite debugger extension and its host tests
claude Nov 13, 2026
ff0312f
ADFA-7135 Add the JNI layer and NativeDebugEngine
claude Nov 13, 2026
31dc721
style: spotless reformat of the SQLite debugger module, no functional…
claude Nov 13, 2026
16a006f
ADFA-7135 Fix three review findings in the extension
claude Nov 13, 2026
f03521d
ADFA-7136: Document the SQLite debugger module
claude Nov 13, 2026
e21aae3
ADFA-7136: List sqlite-debugger among the modules without ABI flavors
claude Nov 13, 2026
8dd5efb
ADFA-7136 Never let the debugger crash or miss the host app's early c…
claude Nov 13, 2026
c862c5c
ADFA-7135 Keep read-only server connections from holding locks
claude Nov 13, 2026
05c2a2b
ADFA-7136 Bound query results and report truncation per cell
claude Nov 13, 2026
d309d28
ADFA-7136 Drop stale server connections and stop expanding SQL when idle
claude Nov 13, 2026
d1f0feb
ADFA-7136 Test the JNI query path
claude Nov 13, 2026
7684331
ADFA-7136 Document the JNI test and the requery trace limit
claude Nov 13, 2026
3a5cb53
ADFA-7082: Vendor the sqlite-js 1.4.2 release
davidschachterADFA Nov 13, 2026
464e6e7
ADFA-7082: Test sqlite-js 1.4.2's result-set rule and patch 0002
davidschachterADFA Nov 13, 2026
5b9b062
ADFA-7082: Keep a call's cancel for the finals its result sets run
davidschachterADFA Nov 14, 2026
5b5cd20
ADFA-7082: Say what a late cancel does to a call's finals
davidschachterADFA Nov 16, 2026
9d87b3e
ADFA-7135 Set the Kotlin JVM target on the compile tasks
davidschachterADFA Nov 13, 2026
0ec489a
ADFA-7082: Read result sets as interrupted when the cancel lands whil…
davidschachterADFA Nov 16, 2026
5fc4976
ADFA-7082: Address review of the sqlite-js cancel patches
davidschachterADFA Nov 16, 2026
3e1830f
ADFA-7136 Bound the request head and refuse before reading the body; …
davidschachterADFA Nov 16, 2026
7cf251b
ADFA-7135 Refuse the process-wide heap limit and temp directory PRAGM…
davidschachterADFA Nov 16, 2026
f785f96
ADFA-7135 Give server connections a 3 s busy timeout
davidschachterADFA Nov 16, 2026
dcd342e
ADFA-7135 Fail a query whose argument count differs from its paramete…
davidschachterADFA Nov 16, 2026
d90b7b4
ADFA-7136 List an open database once when the databases folder is rea…
davidschachterADFA Nov 16, 2026
3527173
ADFA-7135 Run the sqlite-debugger host tests in CI
davidschachterADFA Nov 16, 2026
b15fa5d
ADFA-7082: Vendor the sqlite-js 1.4.3 release, with no patches
davidschachterADFA Nov 16, 2026
d6e0d1a
style: spotless rewrap of the cancelAll() javadoc, no functional change
davidschachterADFA Nov 16, 2026
0c2e603
ADFA-7082: Answer the independent review of the 1.4.3 move
davidschachterADFA Nov 16, 2026
f46e68e
ADFA-7082: Record the phone run of the 1.4.3 build
davidschachterADFA Nov 16, 2026
e9e3f7d
ADFA-7135: Merge #2244 (sqlite-js 1.4.3) into the debugger stack
davidschachterADFA Nov 16, 2026
5b54c33
ADFA-7135: Correct two README lines the CI and device work made false
davidschachterADFA Nov 16, 2026
49c84c0
ADFA-7135 Refuse SQL that holds more than one statement
davidschachterADFA Nov 17, 2026
ff0bd0c
ADFA-7136 Say when a query ran out of time waiting for another tool call
davidschachterADFA Nov 17, 2026
0da5af2
ADFA-7136 Start a tool call's time limit when the call begins
davidschachterADFA Nov 17, 2026
d097e5d
ADFA-7135 Let the query backstop's ROLLBACK past the server's authorizer
davidschachterADFA Nov 17, 2026
0d40222
ADFA-7136 Say when get_schema cut a CREATE statement
davidschachterADFA Nov 17, 2026
403746b
ADFA-7136 Say that functions the app adds to its own connections are …
davidschachterADFA Nov 17, 2026
9c916ca
ADFA-7136 Name both limits that can leave get_schema entries out
davidschachterADFA Nov 17, 2026
6468cff
ADFA-7136 Say that a full integrity_check fails on the app's index fu…
davidschachterADFA Nov 17, 2026
cee95ac
ADFA-7136 Give get_schema's paging advice an ORDER BY and the right unit
davidschachterADFA Nov 17, 2026
bc76c14
ADFA-7136 Say which app functions make quick_check and integrity_chec…
davidschachterADFA Nov 17, 2026
e1864d2
ADFA-7136 Advise ORDER BY type, name to page through sqlite_master
davidschachterADFA Nov 17, 2026
299266e
ADFA-7135 Register consumer-rules.pro so an app's R8 keeps NativeBridge
davidschachterADFA Nov 17, 2026
8acd4bd
ADFA-7135 Refuse a server connection to a path the app no longer has …
davidschachterADFA Nov 17, 2026
e6d9171
ADFA-7135 Bound a JSON-RPC batch by message count and reply size
davidschachterADFA Nov 17, 2026
bc94eaa
ADFA-7135 State the true bound on a batch's replies
davidschachterADFA Nov 17, 2026
0defc3f
ADFA-7135 Document the batch limits in the README
davidschachterADFA Nov 17, 2026
85fbbd9
ADFA-7135 Refuse a server connection when every app connection to the…
davidschachterADFA Nov 17, 2026
9200772
ADFA-7135 Say the first row of a result can pass the 4 MiB cap
davidschachterADFA Nov 17, 2026
dcadfe1
ADFA-7135 Say a call that waited half its time limit says so
davidschachterADFA Nov 17, 2026
82ba6e7
ADFA-7135: Merge stage (#2244 squash-merged as 5f3d76aad) into the st…
davidschachterADFA Nov 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test-sqlite-debugger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test sqlite-debugger

# The tests the Android build cannot run (ADFA-7135): the extension's C tests under AddressSanitizer,
# UBSan and ThreadSanitizer, and the JNI query test on a host JVM. See subprojects/sqlite-debugger/test.sh,
# which downloads the SQLite amalgamation itself and checks its hash.

on:
pull_request:
paths:
- 'subprojects/sqlite-debugger/**'
- 'subprojects/sqlite-js/upstream/libs/**'
- '.github/workflows/test-sqlite-debugger.yml'

permissions:
contents: read

jobs:

test-sqlite-debugger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Run the sqlite-debugger tests

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR: this job runs only test.sh, so DatabaseToolsTest, McpProtocolTest and EventDecoderTest (80 tests) never run in CI. That includes the Kotlin side of the events.bin record-layout check. debug.yml runs only :plugin-api:testDebugUnitTest, and the jacoco/sonar chain keys off testV8DebugUnitTest, which this flavorless module doesn't have. No workflow in #2260, #2261 or #2262 adds it either.

The gap already hides a real failure: McpProtocolTest.clientsThatTrickleOrNeverAuthenticateAreDroppedAndDoNotBlockTheRealOne fails locally in every full-suite run (see the comment on McpHttp.kt), while CI is green.

Suggested fix: a step in this job (or in debug.yml, next to the plugin-api step) that runs ./gradlew :subprojects:sqlite-debugger:testDebugUnitTest.

run: subprojects/sqlite-debugger/test.sh
5 changes: 3 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Strategy: **layer-and-subsystem based**, not feature-by-feature. The Gradle buil

- **`app` depends inward; libraries never depend on `app`.** Subsystems are consumed by `app`, not vice versa.
- **Vendored forks are substituted, not imported ad hoc.** `composite-builds/build-deps` and `build-deps-common` provide forked `javac`/`jdt`/`layoutlib`/etc.; `settings.gradle.kts` substitutes them in for `com.itsaky.androidide.build:*`. Don't add a Maven coordinate for something already substituted. Pebble is likewise built from source, as `subprojects:pebble`, for a lexer fix Android needs (its `NOTICE` says what changed); depend on `projects.subprojects.pebble`, not `io.pebbletemplates:pebble`.
- **All module config flows through `composite-builds/build-logic`.** Every Android module gets the `v7`/`v8` ABI flavors centrally (`AndroidModuleConf.kt`) — there is no flavorless `assembleDebug`. `:plugin-api` and `:subprojects:sqlite-js`, libraries for other projects that need one artifact, are intentionally excluded from flavors.
- **All module config flows through `composite-builds/build-logic`.** Every Android module gets the `v7`/`v8` ABI flavors centrally (`AndroidModuleConf.kt`) — there is no flavorless `assembleDebug`. `:plugin-api`, `:subprojects:sqlite-js` and `:subprojects:sqlite-debugger`, libraries for other projects that need one artifact, are intentionally excluded from flavors.
- **`RepositoriesMode.FAIL_ON_PROJECT_REPOS`** — repositories are declared once in `settings.gradle.kts`; modules must not declare their own.
- **Avoid new dependencies.** Check `gradle/libs.versions.toml` first; the build almost certainly already has it.

Expand All @@ -104,10 +104,11 @@ Strategy: **layer-and-subsystem based**, not feature-by-feature. The Gradle buil
These structural facts shape every module. Day-to-day build *commands* live in `CLAUDE.md`; the rules that produce them live here.

- **Centralized convention logic.** All Android module setup flows through `composite-builds/build-logic` (`conf/AndroidModuleConf.kt`). Modules stay thin and share configuration, so understanding any module's setup starts here.
- **ABI product flavors.** Every Android module *except* `:plugin-api` and `:subprojects:sqlite-js` gets two flavors on the `abi` dimension — `v7` (`armeabi-v7a`) and `v8` (`arm64-v8a`) — defined centrally. There is no flavorless variant; tasks are `assembleV8Debug`, `assembleV7Release`, etc.
- **ABI product flavors.** Every Android module *except* `:plugin-api`, `:subprojects:sqlite-js` and `:subprojects:sqlite-debugger` gets two flavors on the `abi` dimension — `v7` (`armeabi-v7a`) and `v8` (`arm64-v8a`) — defined centrally. There is no flavorless variant; tasks are `assembleV8Debug`, `assembleV7Release`, etc.
- **SDK levels** (`build-logic/.../build/config/BuildConfig.kt`): `COMPILE_SDK=36`, `MIN_SDK=28`, `TARGET_SDK=28`. **`TARGET_SDK` is deliberately pinned at 28:** higher targets enforce W^X (write-xor-execute), which blocks executing code from app-writable files. That is fatal for an on-device IDE that compiles and runs code (Gradle, `javac`, Termux binaries), so it is a hard requirement, not tech debt. `MIN_SDK_FOR_APPS_BUILT_WITH_COGO=16` is the floor for the apps a *user* builds with CoGo — distinct from CoGo's own `MIN_SDK`.
- **Native asset bundling.** The on-device LLM (`llama-impl`) ships as a per-flavor native AAR, wired through the root `build.gradle.kts` (`bundleLlamaV8Assets` / `assembleV8Assets`, …); prebuilt per-flavor assets live under `assets/release/v7/` and `assets/release/v8/`.
- **sqlite-js for apps built with CoGo** (ADFA-7082). `subprojects:sqlite-js` builds the AAR that the JavaScript-in-SQLite project template depends on: the sqlite-js release vendored (see its README), for arm64-v8a and armeabi-v7a, minSdk 26, without core-library desugaring. Nothing in CoGo depends on it. Its default entry point runs no code stored in a database; loading stored functions is a separate entry point, only for databases the app made, since loading runs their code. `test-sqlite-js.yml` runs its host tests on pull requests. The manual `release-sqlite-js.yml` publishes it to the moving `sqlite-js-latest` release, from which dev-assets fetches it into the template, as it fetches `plugin-api-latest` for the plugin template.
- **SQLite debugger for apps built with CoGo** (ADFA-7131). `subprojects:sqlite-debugger` builds an AAR with a debug-only SQLite debugger and MCP server for apps built with CoGo: a native extension on requery's SQLite plus a loopback HTTP server. Like sqlite-js it has no ABI flavors, and nothing in CoGo depends on it; see its README.
- **Native lib compression** (ADFA-2306, ADFA-4729). The app manifest hard-codes `android:extractNativeLibs="true"` (required: the installer must materialize libs in `nativeLibraryDir`, e.g. `libshizuku.so` is an executable the adb shell runs from there). That attribute overrides the `jniLibs.useLegacyPackaging` DSL, so AGP packages `lib/<abi>/*.so` deflate-compressed in **every** APK — ~5.9 MB smaller (`libtree-sitter-kotlin.so` alone is 4.18 MB → 339 kB). The trap is the `recompressApk` post-step (release always, debug in CI only): its no-compress lists in `app/build.gradle.kts` must NOT contain `"so"`, or it silently re-stores the libs and undoes the saving — which is what ADFA-2306 fixed for release and ADFA-4729 for CI debug. Locally built debug APKs (including the e2e farm's) never run that step and were always fine.
- **Quick Build shares the Gradle distribution's toolchain** (ADFA-4931). `:app`'s `quickBuildDaemonZip` leaves the Kotlin compiler and eight other jars out of the daemon zip, because the on-device Gradle distribution already carries them; `QuickBuildArtifactStager` links them in at provision time. That makes the daemon's Kotlin version the distribution's, so `:quickbuild:daemon` takes its Kotlin artifacts at `org.adfa.constants.GRADLE_DISTRIBUTION_KOTLIN_VERSION`, and `:app:quickBuildDistJarCheck` fails the build when the distribution it packages lacks a linked jar. See [ADR 0016](docs/adr/0016-quick-build-compiles-outside-gradle.md).
- **`app` package layout is by concern, not feature:** `activities`, `fragments`, `services`, `di`, `agent`, `viewmodel(s)`, `repositories`, `roomData`, `localWebServer`, `preferences`, `ui` (Compose screens live under `ui/compose`), `templates/manager` (the Manager screen's `.cgt`-parsing data layer, with direct filesystem access to `Environment.TEMPLATES_DIR` — distinct from the plugin-facing `IdeTemplateService` in `plugin-api`/`plugin-manager`), `utils`, ….
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ flox activate -d flox/local -- ./gradlew <task>
```

- **Debug APK (arm64, the usual target):** `flox activate -d flox/local -- ./gradlew :app:assembleV8Debug --parallel --max-workers=6`
- **Module unit tests:** `flox activate -d flox/local -- ./gradlew :editor:testV7DebugUnitTest` - unit tests are per-flavor, there is no plain `test` task. `:plugin-api` and `:subprojects:sqlite-js` are the modules without flavors: `:plugin-api:testDebugUnitTest`.
- **Module unit tests:** `flox activate -d flox/local -- ./gradlew :editor:testV7DebugUnitTest` - unit tests are per-flavor, there is no plain `test` task. `:plugin-api`, `:subprojects:sqlite-js` and `:subprojects:sqlite-debugger` are the modules without flavors: `:plugin-api:testDebugUnitTest`.
- **Single unit test:** append `--tests "com.itsaky.androidide.SomeTest"` to the flavored task above.
- **Fast iteration:** during multi-file/multi-module changes, verify with targeted `:module:compileV8DebugKotlin`/`compileV8DebugJavaWithJavac` invocations (batch several modules into one Gradle call) rather than a full assemble. Reserve `:app:assembleV8Debug` for final end-to-end verification — it's slow (multi-minute) in this multi-module project, and running it after every small change adds up.
- **Long-running commands: narrate them, and background only the read-only ones.** Anything that can exceed ~60s — `assembleV8Debug`, a full test sweep, a cold Gradle invocation of any kind (daemon start plus configuring this many modules is ~20s before any task runs, and far worse under memory pressure), and `git push`, which runs Spotless through the hook — gets a line before it starts saying what is running and roughly how long it takes, and a status line every couple of minutes while it runs: elapsed time, the last output line, whether it is still progressing. A silent terminal is indistinguishable from a hang, and saying which it is is your job, not the user's to ask.
Expand All @@ -26,7 +26,7 @@ When the user names a CI/CD job ("the sonar job", "the analyze workflow"), read

### ABI product flavors (v7 / v8)

Every module except `:plugin-api` and `:subprojects:sqlite-js` carries `v7` (`armeabi-v7a`) and `v8` (`arm64-v8a`) flavors, so build tasks are `assembleV8Debug`, `assembleV7Release`, etc. — there is **no** flavorless `assembleDebug`. Those two build one artifact for other projects. See [ARCHITECTURE.md](ARCHITECTURE.md) (Build & Module Configuration) for flavors, native asset bundling, and SDK levels.
Every module except `:plugin-api`, `:subprojects:sqlite-js` and `:subprojects:sqlite-debugger` carries `v7` (`armeabi-v7a`) and `v8` (`arm64-v8a`) flavors, so build tasks are `assembleV8Debug`, `assembleV7Release`, etc. — there is **no** flavorless `assembleDebug`. Those three build one artifact for other projects. See [ARCHITECTURE.md](ARCHITECTURE.md) (Build & Module Configuration) for flavors, native asset bundling, and SDK levels.

### Emulator / device

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,17 @@ private val disableCoreLibDesugaringForModules =
":quickbuild:runtime",
// The AAR is a dependency of apps built with CoGo (ADFA-7082).
":subprojects:sqlite-js",
// Injected into debug builds of apps built with CoGo like :logsender (ADFA-7131).
":subprojects:sqlite-debugger",
)

/**
* Modules without the v7/v8 flavors: libraries for other projects, which need one artifact.
* :subprojects:sqlite-js is an AAR for apps built with CoGo, with all the ABIs they run on.
* :subprojects:sqlite-js and :subprojects:sqlite-debugger are AARs for apps built with CoGo, with
* all the ABIs they run on.
*/
private val modulesWithoutAbiFlavors = setOf(":plugin-api", ":subprojects:sqlite-js")
private val modulesWithoutAbiFlavors =
setOf(":plugin-api", ":subprojects:sqlite-js", ":subprojects:sqlite-debugger")

/**
* The name of the build type used for automated testing.
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ include(
":subprojects:shizuku-server-shared",
":subprojects:shizuku-shared",
":subprojects:shizuku-starter",
":subprojects:sqlite-debugger",
":subprojects:sqlite-js",
":subprojects:tooling-api",
":subprojects:tooling-api-events",
Expand Down
Loading
Loading