Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
9d87b3e
ADFA-7135 Set the Kotlin JVM target on the compile tasks
davidschachterADFA Nov 13, 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
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
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
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