Repository navigation
ADFA-7135, ADFA-7136: SQLite debugger extension and MCP server for debug builds - #2259
Merged
Merged
Conversation
sqlite-js 1.3.7 (Apache-2.0, with QuickJS/quickjs-ng amalgamated in libs/quickjs.c, MIT), only the files the AAR build uses, with patches/ applied: 0001-0008 are the Termux package's (terminal-packages packages/sqlite-js), 0009 makes each call measure its own thread's stack, and 0010 adds sqlitejs_cancel_all(). 0001-0009 are sent upstream as sqliteai/sqlite-js #11-#19. vendor.sh rebuilds upstream/ and the license notices from the release (checked against its SHA-256) and patches/, or with --check tells whether they match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
The AAR the JavaScript-in-SQLite project template depends on: libsqlitejs.so for arm64-v8a, armeabi-v7a and x86_64 (minSdk 26), and SqliteJs: cancelAll(), libraryPath(), ENTRY_POINT (loads the functions stored in js_functions on every connection) and ENTRY_POINT_FOR_DEFINING. sqlitejs_android.c, ours, holds the JNI and that entry point; the version script exports only the entry points and JNI_OnLoad. Nothing in CoGo depends on the module. AndroidModuleConf leaves it without the v7/v8 flavors, like :plugin-api, since one AAR serves every ABI, and without core-library desugaring, like :logsender, so apps need not enable it. Tested in a trial app (requery 3.49.0, Room 2.8.4) on a Galaxy Note20 Ultra as a 64-bit and a 32-bit process: scalar and aggregate from DAOs, deep recursion on pool threads, 32 parallel queries under WAL, and a runaway query stopped by cancelAll() within 5 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
A manual workflow, like release-plugin-api.yml: checks the vendored sqlite-js, builds the AAR from main, and replaces the moving sqlite-js-latest release, from which dev-assets fetches it into the template that uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
Apps built with Code on the Go run on ARM phones, so the AAR no longer carries x86_64. ADR 0005 says so. CLAUDE.md's ABI section now names the two modules without v7/v8 flavors, as ARCHITECTURE.md and ADR 0005 do (review of PR #2244, F07). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
…ests From the reviews of PR #2244 (independent F02, F03, F05, F06; CodeRabbit): - ENTRY_POINT (sqlite3_sqlitejs_init, also the name SQLite derives from libsqlitejs.so) now loads sqlite-js alone. The old entry point loaded the functions stored in js_functions, which runs their code, so any database file the app opened ran its stored JavaScript at once. Loading them is now ENTRY_POINT_FOR_TRUSTED_DATABASE (sqlite3_sqlitejs_trusted_init), for databases the app made. ENTRY_POINT_FOR_DEFINING is gone: ENTRY_POINT does that job. - The trusted entry point loads each stored function on its own, so one that fails is logged and skipped instead of dropping those after it. - cancelAll()'s Javadoc and the README say it stops JavaScript in every query, so call it only for a known runaway and repeat it until the query ends. - test.sh runs upstream's test suite with patches/, and glue_test.c, the first test of sqlitejs_android.c. test-sqlite-js.yml runs vendor.sh --check and test.sh on pull requests for this module. glue_test.c passes 14 of 14; against the old glue 5 fail (stored functions loaded by ENTRY_POINT, functions after a broken one dropped). The AAR builds and exports the two entry points, sqlite3_js_init and JNI_OnLoad. Not run on a device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
…lection release-sqlite-js.yml deleted the release and its tag before making the new one, so a failed upload left dev-assets nothing to fetch. It now uploads the new assets over the old ones, putting the old ones back if that fails, then moves the tag and the notes. The release is created and kept with --latest=false, so it never becomes the repository's latest release (CodeRabbit, PR #2244). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
vendor.sh built LICENSE.quickjs with sort -u in the machine's locale, so the new test-sqlite-js workflow's vendor.sh --check failed on the runner: en_US.UTF-8 and C order "2017" and "2017-2018" differently. It now sorts with LC_ALL=C, and upstream/LICENSE.quickjs and the META-INF notice are regenerated; only the order of their copyright lines changes. --check passes under C, C.UTF-8 and en_US.UTF-8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
…move From CodeRabbit's review of the previous commits: - The trusted entry point returned silently when it could not list the stored functions (busy, out of memory, an odd table), opening the connection with some or none of them. Each failure is now logged; the connection still opens. It first looks js_functions up in sqlite_master, so a database without stored functions makes SQLite log no "no such table" error on each connection, as it did. - release-sqlite-js.yml moves the tag and edits the notes in the same guarded sequence as the upload. If any step fails, the previous assets and tag are put back. glue_test.c passes 16 of 16; the two new tests fail on the previous glue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
Patches 0002, 0003, 0004 and 0010 are regenerated after three reviews: the independent reviews of terminal-packages #6 and of this PR, and CodeRabbit's review of this PR. - 0002: garbage is collected before the memory limit fills. Running out of memory through small allocations reports "out of memory". - 0003: the README says TEMP views and triggers can call the js_* functions. - 0004: db.exec throws for a buffer it cannot read instead of binding NULL. A typed array's own offset and length are used, not properties a script defines. - 0010: a cancel also interrupts the cancelled call's statement, so a runaway JavaScript collation stops. Before, nothing could stop one. The other patches change only in their headers and line numbers. upstream/ is regenerated with vendor.sh, and vendor.sh --check passes. SqliteJs.cancelAll() and the README say a cancel interrupts the statement too. Tested: - test.sh: upstream's suite passes 16 of 16, and the glue test 16 of 16. - In the work repo, the same suite passes under ASan and UBSan with leak checking, and each new test fails without its fix. - The AAR builds for arm64-v8a and armeabi-v7a. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
…ails From CodeRabbit's review: under bash -e, a failed restore of the previous assets stopped the rollback before it put the tag back, so the tag could name the new build while the release held the old one. Each restore is now attempted, reported if it fails, and the step still fails. Checked with gh stubbed out: when the update fails and the asset restore fails, the tag restore still runs and the step exits 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
…aveats From CodeRabbit's review of the vendored patches: - The trusted entry point looks up js_functions with COLLATE NOCASE, as SQLite resolves a table name, so a table named JS_FUNCTIONS loads. A new glue test, now 18 of 18, fails without it. - Patch 0010's Cancel all test cancels once the JavaScript under test has called started(), an SQL function, instead of after a fixed 200 ms. A slow start can no longer end the test at its alarm. It still hangs without the fix it tests. - SqliteJs.cancelAll() and the README now say two more things. An interrupted INSERT, UPDATE or DELETE in an explicit transaction rolls the whole transaction back. And a cancel reaches SQL that JavaScript runs through db.exec only when that SQL returns to JavaScript. Tested: - test.sh: upstream's suite passes 16 of 16, also under ASan and UBSan in the work repo, and the glue test 18 of 18. - vendor.sh --check passes. - The AAR builds with the new lookup for arm64-v8a and armeabi-v7a. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
A run that stops during `gh release upload --clobber` can leave an asset
missing. The next run then failed at the backup download ("no assets match
the file pattern") before it uploaded anything, so re-running could not
repair the release. The step now backs up only the assets that exist and
puts the previous ones back only when it has both.
Tested with a stub gh over a fake release: both assets missing now ends with
the new pair and the tag moved (before: exit 1 at the download); the other
five cases are unchanged. Checked against gh 2.46: download fails only when
no pattern matches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
Upstream merged our patches 0001 to 0009 (sqliteai/sqlite-js #11 to #19) on 2026-11-12, with fixes of its own. One fixes a bug in our 0002: a memory limit lowered under memory that is garbage left the connection out of memory until the limit was raised again (ef06558). upstream/ is now sqlite-js main at c8ae85a, the same source as the Termux package 1.3.7-p20261112, with one patch: 0001, sqlitejs_cancel_all(), our old 0010 rebased. Its test now fails with a message when the JavaScript under test has not started within 10 seconds, instead of cancelling anyway, and uses upstream's watchdog thread instead of alarm(). The patch is offered upstream in sqliteai/sqlite-js issue 20. vendor.sh, test.sh and test-sqlite-js.yml take the commit (COMMIT, URL) instead of the release tag. vendor.sh --check passes; test.sh passes: upstream's suite 16 of 16 with Cancel all, glue_test 18 of 18. The upstream suite with the patch also passes under ASan + UBSan; without the patch's sqlite3_interrupt() its collation case runs until the watchdog, and with started() never called the worker fails with its message. The native library builds with NDK 29 for arm64-v8a and armeabi-v7a, with no warnings in sqlitejs.c or sqlitejs_android.c, and exports the same four symbols. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
Upstream released 1.4.0 and 1.4.1 on 2026-11-12, after c8ae85a. Both contain it, and 1.4.1 differs from it in src/ and libs/ only in SQLITE_JS_VERSION, so js_version() now reports 1.4.1. vendor.sh, test.sh and test-sqlite-js.yml take the release's archive again (VERSION, SHA256, URL). Patch 0001 is unchanged but for its context. The scripts now take the archive's one top directory whatever its name (tar --strip-components=1). They named it after COMMIT, so the README's "point URL at its tag again" would have failed: a tag's archive unpacks to sqlite-js-<tag> (independent review). The README says how to vendor a release, and a commit between releases. vendor.sh --check passes on the 1.4.1 archive (SHA-256 d45d394f...3078). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
…ng a cancel A cancelAll() that landed while another thread opened a connection made that connection fail to load sqlite-js (SQLITE_NOMEM), so a Room query on a new pool connection failed (independent review). Setting up the runtime runs JavaScript of its own, which the interrupt handler stopped. Patch 0001 now cancels only JavaScript inside a call (js_enter), and its Cancel all test opens 200 connections while another thread cancels without pause: the first one failed before. A cancel that lands while the trusted entry point loads a stored function stops that function's code the same way, and the function was then missing from the connection for good. load_stored_function now tries such a load again, up to three tries in all; its stored code runs again each time. glue_test.c stores a function whose code cancels the first time it loads: it loads on the second try, and with one try it is missing. The README and SqliteJs's Javadoc say both. test.sh passes: upstream's suite 16 of 16, glue_test 22 of 22. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
0002, after CodeRabbit's review: code that called itself without end crashed the process instead of failing with "Maximum call stack size exceeded" in two cases. - On a thread with less than 64 KB of stack left, js_enter kept the connection's 1 MB size rather than the room it measured. It now keeps any measurement, and 1 rather than 0, which turns the check off. - On the main thread, RLIMIT_STACK was counted from where the first measurement was taken. Loaded 2 MB deep, the extension allowed 10.2 MB of an 8 MB stack. It is now counted from the stack's top, as the kernel counts it. 0003, after the independent review of terminal-packages #6: garbage could leave an allocation that fits in the memory limit failing on every try. After 40 MB of cyclic garbage, new ArrayBuffer(30 MB) failed under the 64 MB default. And after a limit was lowered to 32 MB above the garbage, new ArrayBuffer(16 MB) failed. The extension now collects after any "out of memory" error and whenever a limit is set. Each patch adds tests to upstream's suite that fail without it. The suite passes 16 of 16 with all three patches, also under ASan and UBSan, and test.sh's glue_test 22 of 22. The NDK 29 build for arm64-v8a and armeabi-v7a has no warnings outside QuickJS and exports the same four symbols. Both fixes are offered upstream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
gh release create makes a draft and publishes it once its assets are uploaded. A first run that stopped during that upload left a draft: the next run found it, skipped the create, and failed fetching its tag, which a draft does not have yet. Every re-run then failed (independent review). The step now deletes a draft release, which dev-assets cannot fetch from, and creates the release again. Tested with a stub gh over a fake release, eight cases. The draft case failed with a 404 before, and now ends with the new assets and tag. The other seven are unchanged: no release, normal, upload fails, tag update fails, both assets missing, one missing, and upload fails with both missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
Spotless wraps the cancelAll() Javadoc paragraph, which the previous commits lengthened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
CodeRabbit: SQLite keeps an interrupt in effect while any statement of the connection runs, and a db.exec result set that JavaScript keeps open is a running statement. After cancelAll() stopped JavaScript that kept one in a global, every later statement on that connection failed with "interrupted", until the connection closed. A stored function whose code kept one could not load on any of its three tries. sqlite3_interrupt() does the same, without our cancel patch. Patch 0004 lists each connection's result sets. When the outermost call into JavaScript returns on an interrupted connection, it finalizes those still open. Reading on from one that JavaScript kept throws "interrupted". Reproduced on the host, with a cancel and with sqlite3_interrupt(): every later statement failed before, and all run after. Upstream's Interrupt test interrupts code that keeps a result set, in a global and as garbage, and fails without the patch. glue_test.c stores a function whose code keeps one and cancels the first time it loads. It loads on its second try, and the connection runs SQL afterwards; without the patch, those three checks fail. test.sh passes: upstream's suite 16 of 16, also under ASan and UBSan, and glue_test 26 of 26. The NDK 29 build for arm64-v8a and armeabi-v7a has no warnings outside QuickJS and exports the same four symbols. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
…on old SQLite CodeRabbit, on 0004: - 0005: finalizing a result set that is computing a JavaScript window function runs the function's final, whose js_leave() ended the result sets again on the interrupted connection, finalizing the same statement twice. Under ASan that is a use after free in sqlite3VdbeMemFinalize, reproduced on the host. Each statement is now taken from its result set before it is finalized, the list is walked again from its head after each one, and a nested call does nothing. Upstream's Interrupt test now keeps a result set computing a window function; it fails under ASan without 0005. - 0006: on SQLite before 3.41, which has no sqlite3_is_interrupted(), 0004 never ran, though a cancel still interrupts the connection. The interrupt handler now records the interrupt it sends. Built to report SQLite 3.40, a cancel of JavaScript that keeps a result set left every later statement failing before 0006, and not after. test.sh passes: upstream's suite 16 of 16, also under ASan and UBSan, and glue_test 26 of 26. The NDK 29 build for both ABIs has no warnings outside QuickJS and exports the same four symbols. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
….exec sees CodeRabbit, two more cases on SQLite before 3.41, both in patch 0007: - Ending result sets after a cancel can run a window or aggregate function's final, which begins after the cancel, so nothing stopped it: a final that never ended hung the cancelled query. The interrupt handler now stops any JavaScript while result sets are being ended. - A direct sqlite3_interrupt() that reached a db.exec statement's SQL, with another result set kept open, went unseen. A result set whose step returns SQLITE_INTERRUPT now records it. Checked with the patched source built to report SQLite 3.40: the endless final hung before and ends after, and a direct interrupt during db.exec's SQL, caught or not, left later statements failing before and not after. Still unseen before 3.41, and said in the README: an interrupt that never reaches the SQL that JavaScript runs. Android's cancelling never calls sqlite3_interrupt(), and cancelAll() is covered. test.sh passes: upstream's suite 16 of 16, also under ASan and UBSan, and glue_test 26 of 26. The NDK 29 build for both ABIs has no warnings outside QuickJS and exports the same four symbols. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
- 0009: a result set's SQLITE_INTERRUPT now counts as an interrupt only before SQLite 3.41. A progress handler that stops a statement, as Android's cancelling does, gives the same code and interrupts nothing else, yet it ended the result sets earlier calls kept, on any SQLite. - 0008: the Interrupt test's "garbage" result set was freed by reference counting, so the case passed without 0004. It is now a reference cycle, and fails on 1.4.1 without 0004. Also pushed to sqliteai/sqlite-js#24. - Tests for 0006, 0007 and 0009, which had none: glue_test.c cancels JavaScript that keeps a result set, then a kept window function whose final never ends, then has a progress handler stop a statement. test.sh runs it twice, the second time with sqlitejs.c built to report SQLite 3.40. Without 0009 the progress-handler check fails; without 0007 the 3.40 run hangs until the test's 30 s alarm; without 0006 seven checks fail in the 3.40 run. - README: a cancel ends every result set open on the connection, not only the stopped call's. And on any SQLite, an sqlite3_interrupt() that lands while no JavaScript runs leaves the connection failing while JavaScript keeps a result set, so finish result sets before a call returns. Reproduced on 3.49: every later statement fails, and sqlite3_close returns SQLITE_BUSY. test.sh passes: upstream's suite 16 of 16, also under ASan and UBSan, and glue_test 34 of 34 in both runs. The NDK 29 build for both ABIs has no warnings outside QuickJS and exports the same four symbols. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
CodeRabbit: the case that 0007's record of a step's SQLITE_INTERRUPT is for had no automated test. glue_test.c now keeps a result set, has another thread call sqlite3_interrupt() while db.exec runs a query that never ends otherwise, and checks that the connection runs SQL and that the kept result set was ended. In the run as SQLite 3.40, those checks fail without the record. The checks that a kept result set was ended now tell an ended one (caught in JavaScript: "ended: interrupted") from a connection that is still interrupted, whose error is the same word. test.sh passes: upstream's suite 16 of 16, and glue_test 37 of 37 in both runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
… and its server sqlitedbg.h is what the extension implements and its JNI layer calls; DebugEngine.kt is what the server (ADFA-7136) builds against, with a fake for JVM tests. Not yet built by Gradle: the module has no build file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
McpHttp.kt and McpProtocol.kt from Local Store Server Combined with only the package, server name, title, instructions and 401 texts changed. McpProtocolTest.kt still names that project's tools and does not compile; ADFA-7136 rewrites it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
Module build file modelled on sqlite-js (no ABI flavors, both ABIs, no STL, 16 KiB pages), plus Kotlin at API 2.0 for apps built with CoGo. Registered in settings, modulesWithoutAbiFlavors and disableCoreLibDesugaringForModules. The CMake file arrives with the extension in the next commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
Binds 127.0.0.1 on port 0 with a new token per process start, and serves list_databases, list_connections, get_schema, query, explain_query_plan, get_stats, integrity_check and get_events against DebugEngine. JVM tests run against FakeDebugEngine (51 pass). DebuggerStartup.kt and the manifest are Android-only and not yet compiled. Formatting follows in its own commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
sqlitedbg.c implements sqlitedbg.h as a loadable-extension client. Per-connection state is freed only from the xDestroy of sqlitedbg_connection_id; the trace CLOSE event only marks it closing. Events live in a ring of records in their exported layout. Server connections are recognised by a thread-local flag set around sqlitedbg_open_server's own open. test.sh builds SQLite 3.49.1 from the amalgamation (pinned) and runs sqlitedbg_test.c under ASan+UBSan and under TSan. The same run writes or checks the fixture the EventDecoder JVM test reads. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
sqlitedbg_jni.c registers NativeBridge's natives from JNI_OnLoad (the version script exports nothing else) and reaches SQLite only through the extension's api table. ServerConnection.query steps the statement in C, binds args by type, applies QueryLimits, and stops at the deadline through a progress handler on the server connection. EventDecoder mirrors the exported record layout and is tested against the fixture the host C test writes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
Collaborator
Author
|
@Daniel-ADFA, all ten threads of your review now have a reply naming the fix:
Stage at 759474f is merged in (f21b3ac, no conflicts). At ee7fa6f: the module's JVM tests (103), |
davidschachterADFA
added a commit
that referenced
this pull request
Nov 23, 2026
…138: Daniel's #2259 review fixes and stage at 759474f Brings in #2259's merge of stage (f21b3ac: ADFA-6967 #2273, ADFA-3570 #2242, ADFA-5763 #2279) and #2259's seven fixes for Daniel's review (f6de53d through ee7fa6f). No conflicts. This PR's own diff is unchanged (its added and removed lines are identical before and after). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA
requested review from
hal-eisen-adfa
and removed request for
Daniel-ADFA
November 24, 2026 00:17
hal-eisen-adfa
approved these changes
Nov 24, 2026
Brings in ADFA-7258 (#2301), which waits for the editor's async layout in IDEEditorAccessibilityTest. stage requires a PR to be up to date before it merges. No conflicts; the only file stage changed is that test. This PR's own diff is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Brings ADFA-7274 (#2303, package name change dialog: MainActivity, PackageNameChangeDialogFragment, GeneralPreferences, strings.xml) and ADFA-7244 (#2299, spotless-apply workflow). None touches this module. This PR's own diff is unchanged. Checked: the +/- lines of `git diff 8ab2028 4fc9885` (old merge-base to the previous head) and of `git diff origin/stage HEAD` after the merge are identical (6686 lines each, sorted and compared with cmp). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…starts Failure: bridge_query returned early when the deadline had already passed, when GetStringChars failed, and when prepare_one failed, all before the sqlitedbg_end_transaction backstop at its end. A transaction left open on the server connection stayed open after such a call. Fix: the three early returns now go to the `done` label, so the backstop runs. A failing rollback does not replace the original error: throw_engine returns when an exception is already pending. Checked: the other return NULL paths in bridge_query already reach `done`. Tests (JniQueryTest, Helper.autocommit = sqlite3_get_autocommit): a transaction is opened with sqlite3_exec on a writable server connection (outside the query path; the read-only authorizer refuses BEGIN there), then a syntax error, a second statement, a NUL, a missing table and a past deadline each leave it closed, and a refused rollback keeps the syntax error. The GetStringChars failure has no test (it needs an out-of-memory JVM). With only the fix reverted, 10 checks fail, first "rolled back after a failed prepare: SELEKT 1: 0 vs 1" and "rolled back after a deadline already past: 0 vs 1"; the rest follow because BEGIN then runs inside the open transaction. test.sh passes with it. CodeRabbit thread PRRT_kwDONcONtM66nRMs (F03) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Failure: JNI_OnLoad checked the class globals and the UTF-8 string together and only after that made the g_utf8_name global ref, which it never checked; a failed lookup left the next call running with a pending exception. Fix: each class lookup, the UTF-8 name and its global ref are checked in turn and return JNI_ERR at the first failure; the local ref of the name is freed. The method id lookups after them were already checked as a group. Checked: test.sh builds the library with -Wall -Wextra -Werror and the JNI test passes (205 checks, 0 failures). No test: a failing FindClass or NewGlobalRef needs a JVM that fails on demand. CodeRabbit thread PRRT_kwDONcONtM66nRMz (F05) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
The comment said only "what sqlite3_open_v2 returns". In sqlitedbg.c a failure of PRAGMA query_only, of the authorizer or of the busy timeout closes the connection (sqlite3_close_v2), sets *db to NULL and returns that code; so does a failed open itself. The comment now says so. Checked against sqlitedbg_open_server in sqlitedbg.c. Comment only, no test. CodeRabbit thread PRRT_kwDONcONtM66nRM1 (F06) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Failure: get_stats reads the table list with a limit of MAX_ROWS (1000) rows and then said "The database has N tables" with N the length of that list, so a database with 1200 tables was reported as having 1000. Fix: when the list holds MAX_ROWS names the message says "at least 1000 tables" (a list of exactly 1000 is still a correct lower bound); a shorter list keeps the exact wording. Test (DatabaseToolsTest.getStatsSaysAtLeastWhenTheTableListHitTheCap, with the fake engine, whose query applies the same maxRows cut as the native one): 1005 tables give "at least 1000", 999 give "999 tables". With only the fix reverted it fails: "The database has 1000 tables; counts are given only under 10." CodeRabbit thread PRRT_kwDONcONtM66nRM6 (F09) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Failure: McpHttp never sent "HTTP/1.1 100 Continue". A client that sends "Expect: 100-continue" with its POST waits for it before sending the body, and so stalls until its own timeout (how long depends on the client; unverified). Fix: once the head has passed auth and every check that can refuse before the body (Host, Origin, path, token, and in readBody the Transfer-Encoding, Content-Length and size checks), and just before the body is read, the server writes "HTTP/1.1 100 Continue" and flushes, when the request asks for it (value compared case-insensitively). A request refused earlier gets only its final response. HTTP/1.0 requests are ignored. A Content-Length of 0 gets no interim reply. A refusal that comes after the body (415 in handle) is not covered: it needs the body read first. RFC 9110 section 10.1.1 (read from rfc-editor.org): the value is case-insensitive, a server must ignore the expectation in an HTTP/1.0 request, and may omit the 100 when it has already received the body. Tests (McpProtocolTest, raw socket): with "Expect: 100-Continue" the interim line arrives before the body is sent, then the body gets 200; without Expect there is no interim line; a wrong token (401) and a body over the limit (413) send only their final reply. With only the fix reverted, httpAnswers100ContinueBeforeTheBodyWhenAsked fails with "java.net.SocketTimeoutException: Read timed out" (McpProtocolTest.kt:564, the read of the interim line); the other three pass either way, as intended. CodeRabbit thread PRRT_kwDONcONtM66nRNA (F11) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Failure: in readChunked, after the zero-size chunk the trailer loop did `shortLine(...) ?: break`, so end of stream there counted as the end of the body. A request cut off after "0\r\n" was handled as if complete, while the chunk size line already answered 400 for the same cut. Fix: end of stream in the trailer section throws HttpError(400, "The request ended early."), as the size line does. Test (McpProtocolTest.httpChunkedBodyThatEndsInTheTrailerSectionIsA400): a valid initialize request sent as one chunk, then "0\r\n", then the output is shut down; expects 400. With only the fix reverted it fails: the server answers "HTTP/1.1 200 OK" with a session id (the message of the failed assertTrue is that whole reply). Checked the other readers: shortLine(input, 2) after a chunk and readExactly already throw 400 on end of stream. CodeRabbit thread PRRT_kwDONcONtM66nRNE (F13) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…n fail Problem: FakeDebugEngine.openServerConnection throws for a path no app connection has open before it records anything, and openedServerConnections holds only successes. So the assertions that the engine was never asked to open a path (isEmpty / emptyList) passed whether or not the server asked. Change: openAttempts counts every call, before any refusal. DatabaseToolsTest asserts it is 0 at the six sites that claim the engine was not asked (the unknown-path listing, the bad-argument tools, two "Unknown database" cases, the in-memory empty path, the bad paging arguments); the old assertions stay. Checked: the six sites are every assertTrue(isEmpty) / assertEquals(emptyList) of openedServerConnections in the file; the other uses assert sizes after a successful open. Test-only change, no production code. Not run with a mutant that opens anyway: the counter is incremented on the first line of the method, so any call to it is counted. CodeRabbit thread PRRT_kwDONcONtM66nRNF (F14) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…inally Problem: the test helper waited for Thread.State.BLOCKED in an unbounded loop, awaited its `holding` latch without a limit, and counted `release` down only on the success path with plain join(). A failure in between (the queued call never blocking, or an assertion) left the slow worker parked on `release` and the test hanging. Change: holding.await and the BLOCKED loop give up after 10 s with an assertion; release.countDown() and both joins (10 s each) are in a finally, joining only threads that were started; afterwards both threads must not be alive. Test-only, no production code. Checked: the four callers of the helper pass unchanged in the full run of 108 tests. CodeRabbit thread PRRT_kwDONcONtM66nRNI (F15) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
… the timing test Problem: httpAcceptBacksOffAfterFailuresAndKeepsServing slept 1200 ms and then read a synchronizedList's size and iterated it without its lock, so a slow machine could see fewer attempts than the sleeps need (and the iteration is not atomic with the list's writer, as the Collections.synchronizedList docs require for iteration). Change: the test polls (bounded at 10 s, every 10 ms) until the fifth attempt is recorded, then copies the list under synchronized(attempts) and checks the gaps of the copy: 100, 200, 400 and now also 800 ms of back-off (the fourth gap). The check that a spinning loop did not run is now the attempt count of the copy being five or six, and the gaps. Checked: the test passes in the full run (108 tests). Not run under load to see the old version fail: unverified. CodeRabbit thread PRRT_kwDONcONtM66nRNK (F17) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…the result Problem: test/jni/helper.c opened the "app" connection with GetStringUTFChars, which is modified UTF-8 (a NUL as C0 80, a character outside the BMP as two three-byte surrogates), while the server is opened with real UTF-8 bytes from String.getBytes; and it ignored sqlite3_open's result, so a failed open returned a handle to a failed connection and the test went on. Change: Helper.open takes the path as UTF-8 bytes (Java side getBytes(UTF_8), native openBytes), opens it as such, closes and returns 0 on a failed sqlite3_open, and Helper.open throws when it gets 0. Checked: test.sh passes, JNI part 205 checks, 0 failures. All three callers of Helper.open use ASCII paths today, so no check changes outcome; no test of a non-BMP path (whether the host's file names take one depends on the JVM's sun.jnu.encoding: unverified). CodeRabbit thread PRRT_kwDONcONtM66nRNP (F18) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Problem: in JniQueryTest the check of the "N parameter(s) but M argument(s)" message sat in the catch block of a try around the query, so if the query ran and returned (no exception) the test passed without checking anything. Change: a check(false, ...) after the query call in the try, so a successful query fails the test. Checked: the test passes against the real library (JNI part: 205 checks, 0 failures), where the query is refused with SQLITE_RANGE. Not run against a mutant that accepts the mismatch: unverified. CodeRabbit thread PRRT_kwDONcONtM66nRNX (F20) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…re best effort The README and the tool descriptions called the 1.5 s (database not in WAL mode) and 50 s statement limits plain limits. They are checked by the progress handler every 1000 SQLite VM instructions (sqlite3_progress_handler(db, 1000, ...) in sqlitedbg_jni.c), so not while a statement waits in the busy handler (SQLITEDBG_SERVER_BUSY_MS, 3000) and not inside one long instruction: a result can arrive up to about 3 s late; the client waits 60 s. Also documented: the column names are read before the first sqlite3_step (sqlitedbg_jni.c), so a schema change by the app between prepare and first step can return the old column set; and turning off bound-value recording after the idle time goes through expireIdleClient, which takes the tools' lock that a running query holds for up to 50 s, so it can be up to 50 s late. The README gets three bullets before its "Limits" bullet; every existing value is kept. NON_WAL_NOTE, the text of every tool that runs SQL, now says "best effort" and "up to about 3 s longer" after its unchanged first words (DatabaseToolsTest still checks them). Checked in the code as quoted above; the claim that the progress handler does not run during the busy wait is from SQLite's documented behaviour (it runs in the VM), not from a test. CodeRabbit threads PRRT_kwDONcONtM66nRMj (F01), PRRT_kwDONcONtM66nRMo (F02), PRRT_kwDONcONtM66nRMw (F04), PRRT_kwDONcONtM66nRM2 (F07) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA
added a commit
that referenced
this pull request
Nov 25, 2026
…gger/ADFA-7137 #2259's final head, the one squash-merged into stage as 122cc41: stage at b5931b2 (5bf99a1) and the fixes for CodeRabbit's review of 2026-11-22 (c78cc27..ba78ebb). This prepares the merge of origin/stage that comes next, in which #2259's lines are then the same on both sides. No conflicts. This PR's own diff is unchanged: the +/- lines of `git diff ee7fa6f 915bc3f` and `git diff ba78ebb HEAD` are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA
added a commit
that referenced
this pull request
Nov 25, 2026
Stage now holds #2259 squash-merged (122cc41), so this PR's base moved to stage while its branch still carried #2259's original commits. Four add/add conflicts, each a file #2259 added and this PR changes (subprojects/sqlite-debugger README.md, build.gradle.kts, AndroidManifest.xml and DebuggerStartup.kt). Stage's side of each is exactly #2259's version at ba78ebb, merged in the commit before, so each is resolved to this PR's side. Stage's tree equals ba78ebb's, so the merged tree equals the previous commit's (63ce517), and this PR's own diff is unchanged: the +/- lines of `git diff ee7fa6f 915bc3f` and `git diff origin/stage HEAD` are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA
added a commit
that referenced
this pull request
Nov 25, 2026
…gger/ADFA-7138 #2259's final head, the one squash-merged into stage as 122cc41: stage at b5931b2 (5bf99a1) and the fixes for CodeRabbit's review of 2026-11-22 (c78cc27..ba78ebb). This prepares the merge of origin/stage that comes next, in which #2259's lines are then the same on both sides. No conflicts (strings.xml and the SQLite debugger's README merged on their own). This PR's own diff is unchanged: the +/- lines of `git diff ee7fa6f 0b4ebca` and `git diff ba78ebb HEAD` are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA
added a commit
that referenced
this pull request
Nov 25, 2026
Stage now holds #2259 squash-merged (122cc41), and GitHub moved this PR's base to stage while its branch still carried #2259's original commits. Four conflicts, each in lines that both #2259 and this PR change: ARCHITECTURE.md and CLAUDE.md (the module lists), AndroidModuleConf.kt (the modules without ABI flavors) and the SQLite debugger's README (add/add). Stage's side of each is exactly #2259's version at ba78ebb, merged in the commit before, so each is resolved to this PR's side. Stage's tree equals ba78ebb's, so the merged tree equals the previous commit's (662206a), and this PR's own diff is unchanged: the +/- lines of `git diff ee7fa6f 0b4ebca` and `git diff origin/stage HEAD` are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA
added a commit
that referenced
this pull request
Nov 25, 2026
…gger/ADFA-7139 #2260's merge-up after #2259 was squash-merged into stage (122cc41): #2259's final head ba78ebb (stage at b5931b2 and the fixes for CodeRabbit's review of 2026-11-22), then origin/stage at 122cc41. No conflicts. This PR's own diff is unchanged: the +/- lines of `git diff 915bc3f 47512a2` and `git diff 790730f HEAD` are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA
added a commit
that referenced
this pull request
Nov 25, 2026
Stage now holds #2261 (ADFA-7139, the plugin API for endpoints), squash-merged as ade5cc2, after #2259 and #2260. This PR is the last of the stack. Two conflicts, both in subprojects/sqlite-debugger/README.md and both the ones this PR's description lists, resolved as it says: - The component list, after the DebuggerStartup item: #2260's two items and #2261's DebuggerEndpointService item, then this PR's "Gradle plugin wiring" item. - "Not done yet": #2261's item and this PR's are dropped, and so is the sentence that introduced the list ("These are outside this module and come in the PRs stacked on it:"), since no stacked PR is left. The paragraph about device runs stays. No other file conflicted. Outside the README, this PR's own diff is unchanged: the +/- lines of `git diff acca2c3 8bd3e26` and `git diff origin/stage HEAD` without the README are identical. In the README, the only change to this PR's diff is the removed introducing sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADFA-7135 and ADFA-7136
The SQLite debugger for debug builds of apps built with Code on the Go (design: ADFA-7131): a SQLite extension that tracks the app's connections and traces its statements, and an MCP server inside the app with eight read-only database tools. New module
:subprojects:sqlite-debugger. The module's Kotlin compile tasks target JVM 1.8 (the root build sets everyKotlinCompiletask to 17, which made the first compile of the Android-only files fail).consumer-rules.prois registered, so an app's R8 keepsNativeBridge.Stack: on
stage. #2244 (ADFA-7082, the sqlite-js AAR) was squash-merged into stage as 5f3d76a; stage at 759474f is merged into this PR (f21b3ac; before it, 5a49afd in 2d7c135) and from here up the stack, and this PR's own diff is unchanged. Stage at b5931b2 (ADFA-7274 #2303 and ADFA-7244 #2299) is merged in 5bf99a1, which touches nothing in the module; this PR's own diff is unchanged. The head is ba78ebb, with the fixes for Daniel's review and CodeRabbit's review of 2026-11-22 (below). The README's "Not done yet" list says where the rest lands and that the device runs predate the review fixes. Above this PR: #2260 (ADFA-7137), then #2261 (ADFA-7139); #2262 (ADFA-7138) also sits on this PR. Merge order: this PR, then #2260, then #2261, then #2262. #2262 goes last because the SQLite debugger AAR it bundles sends the endpoint only with #2260, and AI-Agent-MCP connects only through #2261. CodeOnTheGo allows only squash merges and deletes the head branch on merge, so after each squash the next layer's base moves to stage while its branch still carries the squashed layer's original commits: merge origin/stage into that layer, resolve to the layer's own side only the conflicts that duplicate the squashed PR, and prove nothing else changed (CLAUDE.md's squash recipe; no rebase).Verified
:subprojects:sqlite-debugger:assembleDebugbuilds both ABIs; the C compiles without warnings under-Wall -Wextra;libsqlitedbg.soexports onlyJNI_OnLoad;testDebugUnitTestpasses (108 tests at ba78ebb on 2026-11-24), and so doestest.sh(0 failures; ASan+UBSan 15736 checks, TSan 15721 and JNI 205 at ba78ebb; the two thread-test counts vary a little between runs). The host C and JNI tests run in CI (.github/workflows/test-sqlite-debugger.yml), and the Kotlin tests run indebug.yml(f683484).setQueryCallback) matched the trace in order, per thread, across Room's pool (202/202 on each ABI, 0 dropped). Extra time per statement: arm64 +1.6 us per select with no client, +2.9 us with a client connected; armeabi-v7a within noise with no client, +8.8 us with a client.Application.onCreateis traced (synchronous install inDebuggerStartup.onCreate).Tools:
list_databasesmatches files through a symlinked folder, so a database is listed once (ADFA-7136);get_schemasays when it cut a CREATE statement, names both limits that can leave entries out (the first 1000 entries, the 4 MiB budget), and its paging advice usesORDER BY type, name; the tool descriptions say that functions the app adds to its own connections are missing on the server's connections, and which uses of them makequick_checkandintegrity_checkfail.query,explain_query_planandintegrity_checklist the cells they cut intruncated_cell_indexes([row, column]pairs). Everyget_eventsresult carriesrun, fixed for the app process; a cursor from another process (a differentrun, or anafterpast the newest event) reads from the start withreset: true. A client that sends norunand holds an old cursor still below the new process's count gets no reset.Known: statement durations have 1 ms resolution (SQLite's unix VFS clock).
Limits the server enforces:
queryandexplain_query_planrun exactly one statement per call; SQL with a second statement, no statement, or a NUL is refused with a message saying so. Each POST has 50 s from when it is handled, shared by every tool call of a batch and waits for other calls included, so the server gives up before a client's 60 s timeout; a call that starts after that fails at once, except the three tools that run no SQL; a call that spent at least half of that waiting says so and suggests a retry (a test pins exactly half the limit). On a database that is not in WAL mode, a statement is also stopped after 1.5 s, below requery's 2.5 s busy timeout, because a running read holds a SHARED lock and would make the app's own commit fail with "database is locked" (ADFA-7136 criterion 5); the error says why and suggests a narrower query or a LIMIT, and the mode is read on each call withPRAGMA journal_mode.integrity_checkon a big database not in WAL mode therefore stops early. Both time limits are best effort: the progress handler checks them every 1,000 SQLite VM instructions, not during the busy wait (up to 3 s) or within one long instruction, so a result can arrive up to about 3 s late, still inside the client's 60 s. A query result holds at most 4 MiB of cell bytes, but its first row always comes back whole, so one very wide row can pass the cap. A JSON-RPC batch holds at most 32 messages (else HTTP 400 with a nullid, nothing run); once its replies reach 8 MiB, the remaining requests get error -32000 without running. The reply that crosses that line is sent whole and can be several times 8 MiB, because the 4 MiB cap counts cell bytes, not the JSON, whose escaping can multiply them. The request head is bounded and authenticated before the body, and a request withExpect: 100-continuegets100 Continueonly after those checks pass (a 415 for a wrong Content-Type still comes after the body); a chunked body that ends inside its trailers is a 400; the heap-limit and temp-directory PRAGMAs are denied on server connections; server connections wait up to 3 s for a lock; a query whose argument count differs from its parameter count fails with SQLITE_RANGE; the server refuses a path the app no longer has open, or whose app connections are all closing, andlist_databasesand the unknown-database error report such a path as not available. After a refusal or an error reply, the server shuts down its output and discards up to 64 KiB of the rest of the request, for at most 500 ms (100 ms on the accept thread), before closing, so the client gets the reply instead of a connection reset.get_statsleaves out only the reservedsqlite_prefix, so a table such assqlitecacheis counted. The query backstop's ROLLBACK gets past the authorizer, and a rollback that fails is the query's error.Review fixes (2026-11-22): Hal's three findings and CodeRabbit's two are fixed in a522456..f683484, each with tests: the 1.5 s limit (df22b7a), the reply before close (3a3d57a), the Kotlin tests in CI (f683484), paths whose connections are all closing (4ee1506) and the
sqlite_prefix (a522456). With the oldsqlitedbg_jni.c, the new JNI check fails: the app's commit gives up after 2.51 s and the read runs 8 s. The reply-before-reset tests pass on the oldMcpHttp.kttoo on this Linux computer, so they could not reproduce Hal's failure, which was on macOS; with the fix they pass on Linux as well.Daniel's review (2026-11-23): all ten threads are answered. Three were fixed by the review fixes above (df22b7a, 3a3d57a, f683484). The other seven, one commit each, each behaviour fix with a test that fails with the fix reverted: separator comments removed (f6de53d); the README says
test.shruns on Linux only (12a3bd6); a connection'sclosingflag is cleared when a later statement shows its close failed (212c143); one pending idle check (3db82a5);truncated_cell_indexes(c84d987); one deadline per POST (4911b94);get_events'runandreset(ee7fa6f,SQLITEDBG_INTERFACE_VERSION2). CI passes at ee7fa6f.CodeRabbit's review (2026-11-22, 20 comments): all answered. Fixed, one commit each (c78cc27..f3fce48), each behaviour fix with a test that fails with only that fix reverted: a query that fails before it starts (a deadline already past, a failed prepare) now rolls back a transaction left open (c78cc27);
JNI_OnLoadstops at the first failed lookup (c84ae0c);sqlitedbg_open_server's comment says what a setup failure does (a645f21);get_statssays "at least N tables" when the list hit its cap (dcb5506);Expect: 100-continueis answered (a24a886); a chunked body ending inside its trailers is a 400 (afaf027); and five test fixes (18304ca, 242f68a, 860cac5, 29f355d, f3fce48). Documented in the README as limits (ba78ebb): the time limits are best effort, a schema change between prepare and first step can return the old columns, and turning off bound-value recording after the client goes idle can be up to 50 s late. Answered without code:get_statsis not an atomic snapshot by design, the listener is started once, a stall after the head is buffered is negligible, and the batch budget counts JSON characters on purpose. Ticket: ADFA-7293, a signal instead of a sleep in the JNI overlap test. CI passes at ba78ebb.No screens added or changed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Code Reviewer: Code Reviewer couldn't review this pull request
The pull request author does not have access to AI for the associated Atlassian organization.