Repository navigation
ADFA-7302 SQLite debugger P2-7: .read with Pebble SQL templates rendered in Code on the Go - #2329
davidschachterADFA wants to merge 33 commits into
Conversation
A read-only tool that returns in one call what a SQL template can use without reading the app's rows: - app and device fields; - per database: pragmas, tables, columns, indexes, foreign keys, views, triggers, FTS tables and Room's master-table identity hash; - a library database recognised by file name. The lists are read through pragma_table_list and the other pragma table functions, paged to 20,000 rows. A database that fails is listed in errors, and the others still come. The JNI test runs the same SQL through the read-only authorizer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
…ings ProjectTemplatePebble in :common holds the delimiters, StringLoader and strict variables that ZipRecipeExecutor built inline. The SQL templates in the next commits use the same builder, so the two cannot drift. No behaviour change: ZipRecipeExecutor builds the same engine. The DELIM_ constants had no other users and are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
…mplates What it does: - AI-Agent-MCP passes a template's path in the open project, the variables it fetched from the app and the functions that read the app's data, and gets back the SQL. - The engine is the project templates' (ProjectTemplatePebble), with autoescaping off. - sql_ident and sql_literal quote what a template splices in. - A Supplier variable is read only when the template uses it, and once. - A function runs only when called. - The render runs on its own thread, under one time limit. - listTemplates lists the *.sql.peb files. - getRoomSchemas reads Room's exported schemas, with indices, foreignKeys and views present where Room left them out. Access: gated on debugger.endpoints, the permission a plugin already needs to reach the debugger; refused on the main thread. A template path must stay inside the project once links are resolved. API records: the plugin-api.api dump is updated by hand from the compiled descriptors. Run apiDump to confirm. Also updated: the changelog, plugin-api.md, PLUGIN_AUTHORING.md and the permission's description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
ktlint wraps and Eclipse member sorting on the new plugin-api, plugin-manager and sqlite-debugger files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Pebble never checks the interrupt flag, so a busy template such as an empty loop over range(1, 2000000000) kept a core after the time limit passed (the size cap never trips as nothing is written), one more per retry. Its range also builds the whole boxed list first, so range(1, 9999999999) exhausted the app's memory. In the SQL engine only (SqlExtension; the project templates keep Pebble's own): a for tag whose loop checks the interrupt on every pass, and a range that fails past 100,000 values, with Pebble's arguments and steps otherwise. An extension's tag and function replace the core ones of the same name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…ase it did not read After the time limit passed, the databases left were in neither databases nor errors, so a client could not tell a short answer from a whole one; each is now in errors with a 'not read' message (documented in the tool description and README). Any exception other than an McpToolError from one database (a ClassCastException from a row, say) failed the whole call; it is now that database's entry in errors, and an Error or an interrupt still propagates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
own_tables listed every table whose name starts with room_, so an app's room_booking table was reported as Room's. Room 2.8.4's runtime creates room_master_table and room_table_modification_log (read from the room-runtime-android 2.8.4 classes: the only room_ table names there, besides the room_table_modification_trigger_ and room_fts_content_sync_ trigger prefixes); the list is now those two names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
… the list truncated rows() returned what it had, without truncated, when a page came back empty with hasMore set, so a short list looked whole. FakeDebugEngine gets rawPage to hand back a page as given, since its paging rule cannot make an empty page with hasMore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…d a function's supplier
sql_literal wrote -5 as -5, so 1-${{ x | sql_literal }} became 1--5, a SQL comment; negative numbers are now in parentheses. A call such as fn(a=1) reached the function as an argument keyed "a" while the renderer read positions, so the function silently got null; named arguments now fail the render. A function that returned a Supplier had its toString written, as only the elements of a returned list or map were resolved; the result is now read once, as a variable's is. The Javadoc and changelog line formatting from the previous commit's blank Javadoc line is fixed by spotlessApply here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…keep path errors in the documented types The size check used length(), which is 0 for a FIFO named x.peb, and readText() then blocked forever, outside the time limit and not interruptible; and length() then readText() raced. The template is now read from the path that passed the containment check, only if it is a regular file (NOFOLLOW_LINKS), taking at most the size cap plus one byte whatever the file system reports. A NUL in the template path (or the project folder) made canonicalFile throw an undeclared IOException; the path is rejected up front and a failure resolving the project folder is an IllegalStateException. A swap of a folder on the path between check and read needs write access to the project and is noted in the KDoc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
… disabled or unloaded SqlTemplateServiceImpl had no closed state, so a disabled or unloaded plugin that kept a reference could still read the project and render. It now has close() and reopen() like DebuggerEndpointServiceImpl, and starts closed for a plugin saved as disabled; PluginManager closes it where it closes that service (a failed load, unload, markDisabled, and the unload that races an enable) and reopens it on enable. Calls then throw CancellationException, also when the plugin is closed while a render runs (the render itself is not stopped: it ends at its time limit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…0-entry cut is sorted and logged A deeply nested schema file could overflow the stack in the recursive JSON conversion and fail getRoomSchemas for every file; JSON nested past 64 levels (Room's nest about six) is now not a schema, and a StackOverflowError or other exception in one file skips only that file. Note the runtime Gson (nesting limit 255 from 2.11) already refuses very deep files at parse time; the bound makes the behaviour independent of its version. The walk stopped silently at 2,000 matches in its own order and sorted afterwards, so which entries survived depended on the folder order: it now collects candidates (up to 50,000), sorts, then keeps the first 2,000, and the service logs a warning when a list reaches the limit. Documented in the Javadoc and changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…unction that ignores the interrupt keeps running
{@code }}}, {@code %}} and {@code #}} close at the first brace and rendered as stray braces; they are now written with } entities. After a time-out a function that ignores the interrupt keeps running on the render thread, which the approved time-limit behaviour allows; the SqlTemplateService Javadoc, the renderer KDoc and the changelog now say so. The changelog entry is rewrapped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
The tests for close() and a service that starts closed were left out of the previous F04 commit (a staging slip: the file was committed without them). They pass against it; their revert proof (close() a no-op) failed as expected, in proofs.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
The two tests for the previous commit's depth bound and sorted cut were left out of it (a staging slip). They pass against it; their revert proofs (depth check off; walk cut back to 2,000) failed as expected, in proofs.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…gger/ADFA-7302 Brings in the 2026-11-26 review fixes of #2311 and #2323. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…gger/ADFA-7302 Brings in the #2311 review fix through #2319 and #2323. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA
left a comment
There was a problem hiding this comment.
Review of #2329 at 2760274706. Stacked on #2323 (P2-6); checked at this head.
IMPORTANT
- plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/sqltemplate/ProjectSqlFiles.kt:84 - readNBytes(int) is API 33; minSdk 28 and the desugaring rewrite covers only org.eclipse.jgit, so render/getRoomSchemas fail with NoSuchMethodError on Android 9-12
- plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/sqltemplate/SqlPebbleParts.kt:23 - exponential recursive macro is never interrupted; the render thread spins after the time limit, contrary to the PR body and Javadoc
Verdict: COMMENT. This PR is authored by the account posting the review, and GitHub refuses APPROVE and REQUEST_CHANGES on your own PR. Severity rules: CodeOnTheGo REVIEW.md and CLAUDE.md (a ticket moves to QA with no outstanding critical, high or medium findings); addons has no written rule, so the default applied.
Generated by Claude Code
…PI 33 readBounded called InputStream.readNBytes(int), which Android added in API 33; minSdk is 28. Desugaring does not backport it for this package (app/build.gradle.kts gives JavaIOReplacements org.eclipse.jgit only), so on Android 9 to 12 render() and getRoomSchemas() would throw NoSuchMethodError, an Error that no catch there handles (review of #2329, ADFA-7131 comment 41657). The dex of a debug APK built before this has "invoke-virtual Ljava/io/InputStream;.readNBytes:(I)[B" in ProjectSqlFiles, the only API-33 InputStream call in the app; one built with it has none. It now reads in a loop, at most MAX_FILE_BYTES + 1 bytes as before. Lint does not flag the call here and the JVM tests run on a JDK that has it, so a new test looks for readNBytes and skipNBytes in the template package's classes. Before the fix it fails with "ProjectSqlFiles.class: readNBytes". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…e limit Only for and range checked for an interrupt, so a macro that calls itself twice per level, f(40), kept the render thread busy after render() threw its time-limit error: about 2^40 calls that write nothing, so neither the output cap nor the stack ends it (review of #2329, ADFA-7131 comment 41657). A template that includes itself does the same: a template is its own text (StringLoader), so it can. A node visitor now puts an interrupt check at the start of every body of every template the engine compiles, included ones too. Besides for, a template repeats work only by rendering a body again, so this covers macros and includes (tested) and block(), whose block body the visitor also reaches (read, not tested). Both new tests time out as before but, before the fix, find the render thread still alive 5 s later. The Javadoc, the KDoc and the plugin API changelog say macros and includes stop too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…more The guard from 39daeac searched the template package's class files for the names readNBytes and skipNBytes. It now reads each class file's constant pool and refuses a call to readAllBytes, readNBytes, skipNBytes or transferTo whose owner is an InputStream class, so the older Files.readAllBytes and FileChannel.transferTo cannot trip it. It also checks SqlTemplateServiceImpl and ProjectTemplatePebble with their nested classes (follow-up from the re-check, ADFA-7131 comment 41663; David). It moves to MinSdkCallsTest. With 2760274's ProjectSqlFiles.kt it fails with "ProjectSqlFiles.class: java/io/InputStream.readNBytes". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
|
@hal-eisen-adfa A new commit since you were asked to review: c1df230, test-only, a follow-up from the cloud agent's re-check (ADFA-7131 comment 41663).
With the old |
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
@hal-eisen-adfa This PR is ready for review now (David, 2026-11-28). ADFA-7302's device check passed on the Note 20 (ADFA-7302 comment 41698), and the description now records it. The client side, addons #184 (AI-Agent-MCP 2.2.0), is ready too. Head: c1df230. |
…s without printing them The output cap only counts what a template prints, so s ~ s in a loop could grow a string to hundreds of MB inside the time limit and take down the IDE. In the SQL engine, ~, +, set, replace and join now fail the render once a string passes the output limit (4 MiB) or a list or map passes 1,000,000 entries. Project templates keep Pebble's own operators. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
… and say what is skipped Listing followed a link but reading refused it, so a linked Room schema vanished without a word. A link that resolves inside the project is now listed and read by its resolved path; one that leads outside is skipped, and each skipped or unreadable file is logged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…ks the database; fix views text; note no snapshot A virtual table whose module the server lacks failed the whole column join. The join now falls back to reading each table alone, and the table that fails gets an error field and empty lists. The description said views have a table; only triggers do. Both description and README now say the lists are not one snapshot. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
… failure, bound join's last item, document the limits get_template_variables read each table alone after any bulk failure, so a dropped connection or corruption came back as success with every table in error. It now falls back only for SQLite's generic error naming a module or a virtual table's constructor; any other failure, and every table failing, puts the database in errors. join now checks its length after each item, so the last item and separator cannot pass the limit. The public render Javadoc and the API changelog state the string and list limits. The templateFile KDoc says the link-swap gap holds for linked Room schemas too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
The Javadoc and the changelog said a render past the string or list limit fails with "is too long". That is the wording of the ~, + and set checks only; replace and join word theirs differently. Both now say the failure names the operation and the limit. Javadoc and changelog only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
|
@hal-eisen-adfa Seven new commits since you were asked to review (David, 2026-11-28), answering an independent review of this PR and its re-check: 298a36f to 8c56eb2. The description's Commits section lists what each does. In short:
Local: plugin-manager (329), plugin-api (251) and |
…in the per-table read, cap rows across it, state unbounded cases Pebble's split returns an array, which SqlLimits.check ignored, so a set of a split could hold millions of entries; arrays are now checked. In the one-table-at-a-time read any error became that table's, so a lock or corruption on one table reported the database as read; the same per-table-failure check now applies there. The 20,000-row cap now counts all tables together in that read. The KDoc, the public render Javadoc and the changelog say plainly that chained filters and self-nested lists can still run the app out of memory. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
A set of a split into more than a million entries was refused only after the array was built, so one split of a 4 MiB string with an empty delimiter built millions of Strings first. The SQL engine now has its own split filter: an empty delimiter is counted by the string's length without allocating, any other delimiter is split with a limit that builds at most one past the cap, and a result over 1,000,000 pieces fails the render. Pebble's regex delimiter and limit argument behave as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
|
@hal-eisen-adfa Two more commits since my last note, from a check by David's cloud session (ADFA-7131 comment 41720): 6c82b69 and d2d7d02.
plugin-manager (331), plugin-api (251) and |
Brings #2329's two commits after 8c56eb2 (6c82b69, d2d7d02: arrays and split bounded, the per-table fallback's errors, the row cap across tables) into the Note 20 integration build. #2262 stays at bee421c. Not for merging; delete when the check is done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…DFA-7302 Brings #2311's row-event fixes up the stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…e) into ADFA-7302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
… and #2319) into ADFA-7302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
and #2319) into ADFA-7302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
ADFA-7302
Phase 2, P2-7 of the SQLite debugger (ADFA-7131):
.readwith Pebble templates that Code on the Go renders, with variables the debugger supplies. Stacked on #2323 (P2-6). The template functions use P2-6'ssuggest_indexesandlint_foreign_keys. The client is addons #184 (sqlite-debugger/ADFA-7302, AI-Agent-MCP 2.2.0), stacked on addons #178.What it adds
get_template_variables(subprojects/sqlite-debugger, read-only,readOnlyHint) returns, in one call:sqlite_sequence;room: identity hash, Room's own tables (room_master_table,room_table_modification_log) and its FTS sync triggers;library, recognised by file name.Lists are paged to 20,000 rows, with
truncated. A database that fails, or that the call's time limit leaves unread, goes inerrors. A table that can't be read on its own (a virtual table whose module the server lacks) loses only its own lists, with anerroron its entry; any other failure still puts the database inerrors. Views havename; triggers havenameandtable. The lists are separate queries, not one snapshot.ProjectTemplatePebble(:common): the project templates' delimiters,StringLoaderand strict variables, now in one place.ZipRecipeExecutoruses it. A review compared every engine setting before and after and found no change for new projects.Plugin API
SqlTemplateService(render,listTemplates,getRoomSchemas), withSqlTemplateFunction,SqlTemplateExceptionandRoomSchema. It's implemented in plugin-manager (SqlTemplateServiceImpl,sqltemplate/).ProjectTemplatePebblewith autoescaping off, a 4 Mi output cap, and thesql_identandsql_literalfilters.sql_literalwrites a negative number in parentheses.Suppliervalue is read only when used, and once. Functions run only when called, with positional arguments; named arguments fail.forchecks on every pass, andrangeis capped at 100,000 values. A string a template builds with~,+,set,replaceorjoinis capped at 4 Mi characters, and a list, map or array (includingsplit's) at 1,000,000 entries. Chained filters, self-nested lists and a few other forms can still exhaust memory, as the Javadoc says: render only templates you trust. A stopped render therefore ends instead of using a core until the app restarts..pebinside the project. A link that resolves inside the project is listed and read by its resolved path; one that resolves outside is skipped and logged. At most the size cap is read.debugger.endpointspermission and are refused on the main thread.DebuggerEndpointServiceis.<class>/<n>.json. It skipsbuild/and hidden folders, reads a missingindices,foreignKeysorviewsas empty, and skips a bad file. Linked schema files follow the templates' rule, and a skipped file is logged.plugin-api.api(apiCheckpasses), the changelog (26.48),plugin-api.mdandPLUGIN_AUTHORING.md.Decisions (David; ADFA-7302's description):
debugger.endpointsreused;build_type(AGP 8 generates noBuildConfigby default);Commits
From the cloud session:
ProjectTemplatePebble;78d659d:
spotlessApplyonly.Review fixes, 16 findings (4 IMPORTANT), all fixed as David chose:
forand cappedrange;errors, and one database's failure kept to it;5ad33e9 merges ADFA-7301 SQLite debugger P2-6: sqlite3 shell tools (suggest_indexes, lint_foreign_keys, dump, export, .dbinfo) #2323 at 1133a58, with no conflicts: the 2026-11-26 review fixes of ADFA-7296: SQLite debugger records row and change events #2311 and ADFA-7301 SQLite debugger P2-6: sqlite3 shell tools (suggest_indexes, lint_foreign_keys, dump, export, .dbinfo) #2323 (ADFA-7131 comment 41632). It adds exactly ADFA-7301 SQLite debugger P2-6: sqlite3 shell tools (suggest_indexes, lint_foreign_keys, dump, export, .dbinfo) #2323's changes since 323d3d3.
2760274 merges ADFA-7301 SQLite debugger P2-6: sqlite3 shell tools (suggest_indexes, lint_foreign_keys, dump, export, .dbinfo) #2323 at c8bf921, with no conflicts: ADFA-7296: SQLite debugger records row and change events #2311's 2d674ec (
EventDecoderrefuses a row count its bytes cannot hold). Its diff is exactly 2d674ec's.For the 2026-11-27 review (ADFA-7131 comment 41657; David approved fixing both):
readBoundedreads in a loop instead ofInputStream.readNBytes(int), which is API 33 (minSdk 28) and not desugared for this package. The dex of a debug APK built before it has that call inProjectSqlFiles, the app's only API-33InputStreamcall; the APK built with it has none. A new test looks forreadNBytesandskipNBytesin the template classes, since lint does not flag them here.f(40)kept the render thread busy after the error).block()gets the same check (read, not tested).c1df230 (test only; a follow-up from the re-check, 41663): the API-33 guard, now
MinSdkCallsTest, reads each class file's method references and refusesreadAllBytes,readNBytes,skipNBytesortransferToon anInputStreamclass, so the olderFiles.readAllBytesandFileChannel.transferTopass. It also coversSqlTemplateServiceImplandProjectTemplatePebble.For the 2026-11-28 independent review (6 findings, 1 IMPORTANT; David approved fixing them and documenting the snapshot limit), each re-checked:
{% set s = "x" %}{% for i in range(1, 40) %}{% set s = s ~ s %}{% endfor %}ran the app out of memory within the time limit, printing nothing.SqlTemplateFunction's Javadoc says what argument types really arrive.spotlessApply.errors, and so does every table failing;joinis checked after each item; the limits in the publicrenderJavadoc and the changelog.From the cloud session's check of those commits (ADFA-7131 comment 41720):
splitreturns one); in the one-table-at-a-time fallback, a lock, corruption or the time limit puts the database inerrorsinstead of one table'serror; the 20,000-row cap counts all tables together there; and the code, the public Javadoc and the changelog say plainly that chained filters, self-nested lists, constant-factor growth,#{}andblock()/parent()can still run the app out of memory (documented, not fixed: David).splitcounts its pieces before building them, sosplit('')on a 4 Mi string fails without building 4 million strings.7f7ab25 and b5791f6: merge ADFA-7301 SQLite debugger P2-6: sqlite3 shell tools (suggest_indexes, lint_foreign_keys, dump, export, .dbinfo) #2323 with ADFA-7296: SQLite debugger records row and change events #2311's 5d8acf6 and dd7ee19. Each merge's change equals the incoming one; 7f7ab25's tree equals
git merge-tree's.236a52f: merges ADFA-7301 SQLite debugger P2-6: sqlite3 shell tools (suggest_indexes, lint_foreign_keys, dump, export, .dbinfo) #2323 at e3033cf, which brings ADFA-7296: SQLite debugger records row and change events #2311's ADFA-7379 (80-byte records with an execution id) and
execution_idon everyget_eventsevent; no conflicts, and each file's changed lines equal the incoming change's.bc03f42: merges ADFA-7301 SQLite debugger P2-6: sqlite3 shell tools (suggest_indexes, lint_foreign_keys, dump, export, .dbinfo) #2323 at 1b2e2d4, which brings ADFA-7296: SQLite debugger records row and change events #2311's ADFA-7379 review fixes (4ffc26d: a trigger step no longer clears its statement's slot; a non-DML statement's changes are not taken from another statement; stricter decoding of cut values; doc corrections, and the UTF-16 row-size cost as an accepted limit) and ADFA-7297 SQLite debugger P2-2: rows, change counts, named parameters and column types #2319's fuller
execution_iddescription; no conflicts; each file's changed lines equal the incoming change.Tests
test.sh0 failures (ASan+UBSan 32,443 checks, TSan 32,436, JNI 375);:subprojects:sqlite-debugger:testDebugUnitTest(176) andspotlessCheckpass.test.sh0 failures (ASan+UBSan 31,878 checks, TSan 31,873, JNI 375);:subprojects:sqlite-debugger:testDebugUnitTest(174) andspotlessCheckpass. The merge touches onlysubprojects/sqlite-debugger.:plugin-manager:testV8DebugUnitTest(331),:plugin-api:testDebugUnitTest(251) andapiCheck,:subprojects:sqlite-debugger:testDebugUnitTest(170) andspotlessCheckpass. Thesplit, fallback-lock and row-cap tests fail with their fixes reverted.:plugin-manager:testV8DebugUnitTest(329),:plugin-api:testDebugUnitTest(251) andapiCheck,:subprojects:sqlite-debugger:testDebugUnitTest(168) andspotlessCheckpass. Revert proofs: without the caps the doubling tests run the test JVM out of memory; the link, per-table, fallback andjointests each fail with their fix reverted. 8c56eb2 is Javadoc only:apiCheck, the plugin-api compile andspotlessCheckpass.test.sh0 failures (ASan+UBSan 21286 checks, TSan 21272, JNI 374);:plugin-manager:testV8DebugUnitTest,:plugin-api:testDebugUnitTest(251),:subprojects:sqlite-debugger:testDebugUnitTest(161) and:templates-impl:testV8DebugUnitTest(14);:plugin-api:apiCheck,spotlessCheckandassembleV8Debugpass.MinSdkCallsTest1,ProjectSqlFilesTest8,SqlTemplateRendererTest22) andspotlessCheckpass. With 2760274'sProjectSqlFiles.kt,MinSdkCallsTestfails with "ProjectSqlFiles.class: java/io/InputStream.readNBytes".:plugin-manager:testV8DebugUnitTest(323),:plugin-api:testDebugUnitTest(251),:plugin-api:apiCheckandassembleV8Debugpass.ProjectSqlFilesTestandspotlessCheckpassed again after a line wrap in the new test and the changelog edit. Revert proofs: with the oldreadBounded, the new test fails with "ProjectSqlFiles.class: readNBytes"; without the visitor, both new render tests find the render thread alive 5 s after the time limit. On the J7 (Android 9, API 28),app_processrunning each APK's ownProjectSqlFiles.readBounded: before the fix,NoSuchMethodErrorforInputStream.readNBytes(I); with it, the file is read. The full plugin path can't run there (AI-Agent-MCP needs Android 13).:subprojects:sqlite-debugger:testDebugUnitTest(165 tests) andspotlessCheckpass.:subprojects:sqlite-debugger:testDebugUnitTest(164 tests) andspotlessCheckpass.spotlessApplychanges nothing.fortag, the render thread is still alive 5 s after the limit;rangecap, the test JVM runs out of memory;Device check (ADFA-7302's description), before the 2026-11-28 review fixes: on the Galaxy Note 20, with Code on the Go built from #2262 and this PR, AI-Agent-MCP 2.2.0 (addons #184) and AI Core 3.7.2 from addons #188 (ADFA-7340), in a Room app with
exportSchemaon:-- notes.db: Room schema matches, one row count per table, and theordersline with:id.Room schema differs or is not exported.read_sql_templatecall. Its count of server calls wasn't measured on the phone, because ajdbtrace froze the test app on ART; the JVM tests cover it.readNBytesfix (39daeac) was checked on Android 9 (ADFA-7302's description).Not done here:
Merging:
libs/refresh.No screens added or changed.
Left as is (David, 2026-11-30): nitpicks from the last re-check, none affecting correctness.
truncatedcan be true when exactly 20,000 rows were read and nothing is missing.SqlLimits.checkhas no test of its own; thesplitfilter's check fails first.splitstill builds up to 1,000,002 pieces, and a split within the limit runs twice (once to count, then Pebble's own).split('', -1)on exactly 1,000,000 characters passes the precheck with 1,000,001 pieces; it's caught only ifsetstores it.🤖 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.