Repository navigation
feat(sqlite): inspect offline snapshots with selective evidence - #2271
Merged
Merged
Conversation
Import the SQLite inspection proposed in #1356 and integrate its CLI, MCP, Evidence, cleanup, and runtime compatibility boundaries with current main. Co-authored-by: Y0UW1SH <29498139+Y0UW1SH@users.noreply.github.com>
Use compact schema inventory and selected-table details by default, with explicit complete schema and exact ordered column selection. Sample 20 rows by default while keeping larger caller-selected limits and lossless cells. Reuse grouped capability projection and session admission. Preserve completed observations through late cancellation and cleanup failures, recording their Evidence before delivery. Bound provider concurrency to two inspections and report occupied capacity as a retryable typed resource constraint. Verified real SQLite CLI/MCP workflows, Chinook and Firefox snapshots, malformed inputs, WAL, encoding, cancellation, cleanup retry and resource limits. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Re-read inactive rollback journal headers after copying the database/WAL, before final file-set identity checks. A previously inactive journal that becomes active is changed evidence even when its metadata cannot distinguish the write. Keep descriptor cleanup ownership and refuse recovery. Count bounded JSON parts through the shared serializer so escaping is accounted for without allocating an oversized document to measure it. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Retain main's static EVM descriptor and shared binary-layout/crash cleanup instances alongside the SQLite service registered and closed by this server. Validated check, docs, test discovery and 35 SQLite/MCP/EVM/crash integration cases.
Download the build-owned rea-test-runtime artifact at the repository root, reusing its compiled runtime and prepared test metadata across Node versions. Add a producer/consumer contract regression for the artifact name and layout. Document that execution wording denies application/caller SQL execution while a trusted inspector worker is launched. Reuse the invariant cell-byte length parser rather than constructing it for every sampled row. Validated 121 focused CI, effects, native inspection and public workflow cases plus the artifact contract; check, docs and test discovery pass. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
3 tasks done
11 tasks done
11 of 19 tasks
This was referenced Oct 12, 2026
34 tasks done
2 tasks done
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.
REA currently cannot inspect application SQLite storage through its public CLI/MCP. This adds
inspect_sqlite_database/inspect-sqlite-databasefor explicit offline database/WAL snapshots, developed from @Y0UW1SH's implementation in #1356. This PR supersedes that proposal and includes its contributor credit.columns/ repeated--columnavoids evaluating unrelated cells;schema_scope: databaseexplicitly requests complete stored schema.Validation on Linux, with two CPU cores and an 8 GiB process-family guard:
npm run check,npm run docs:check, andnpm run verify:test-discoverypassed on the updated main base.Representative context measurements (MCP response text, same frozen inputs):
The completed Chinook discovery + twenty full-row task, counting one complete SQLite tool definition plus both request JSON payloads and response text, estimates 17,687 → 10,300
o200k_basetokens (about 42% less). Other model tokenizers, catalog/prompt conversion, agent reasoning and billed model usage are unmeasured. Both workflows use two calls without retries and retain identical requested rows.Isolated final 24-call MCP probe: 10.76 s wall time, 12.72 s process-family CPU time, peak 843.22 MiB RSS. Three repetitions per input; the 64 MB projected sample took 0.67–0.93 s. Each call starts a fresh worker; the MCP server stays warm and filesystem caches were not cleared. Earlier baseline CPU time was not measured. Each call checks source bytes; persistent MCP amortizes server startup rather than reusing potentially stale database contents.
Latest main lifecycle integration passed 35 affected SQLite/MCP/EVM/crash cases. The first CI run exposed two PR integration mistakes: an obsolete runtime artifact name and a missing trusted-worker wording-audit entry. Both are fixed, with a producer/consumer artifact-name-and-layout regression; 121 focused cases and the full local gates passed.
Node 26 and non-Linux behavior are not claimed from local verification; the new compatibility matrix and existing CI provide additional coverage. Native SQLite allocations remain distinct from the 256 MiB worker JavaScript heap; no overall native heap or OS sandbox claim is made.