feat(sqlite): inspect offline snapshots with selective evidence (#2271)

Add offline SQLite database/WAL inspection through the shared CLI/MCP.

Use compact inventory, selected-table schema, exact ordered columns and
bounded row samples while preserving source identity and lossless values.
Retain completed Evidence through late cancellation and private-root cleanup
failures, bound concurrent inspections, and recheck journal validity after
acquisition. Reuse prepared CI runtime artifacts across supported Node lines.

Co-authored-by: Y0UW1SH <29498139+Y0UW1SH@users.noreply.github.com>
Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
This commit is contained in:
Ysopwnable
2026-10-12 18:33:23 +00:00
committed by GitHub
co-authored by Y0UW1SH
parent 916ac97bf9
commit aeee5074d1
59 changed files with 5757 additions and 24 deletions
+15
View File
@@ -7,6 +7,9 @@ import { registerPeResourcesTool } from "./registerPeResourcesTool.js";
import type { EvmInterfaceService } from "../application/evm/EvmInterfaceService.js";
import { evmInterfaceModule } from "../composition/evm.js";
import { registerEvmTools } from "./registerEvmTools.js";
import type { SqliteDatabaseService } from "../application/sqlite/SqliteDatabaseService.js";
import { createSqliteDatabaseService } from "../composition/sqlite.js";
import { registerSqliteTools } from "./registerSqliteTools.js";
import { registerRecordedCrashTools } from "./registerRecordedCrashTools.js";
import { createRecordedCrashService } from "../composition/binaryDiagnostics.js";
import { createGoBinaryService } from "../composition/go.js";
@@ -118,6 +121,7 @@ export interface CreateServerOptions {
readonly delivery?: ToolResultDelivery;
readonly wasmArtifact?: WasmArtifactService;
readonly evmInterface?: EvmInterfaceService;
readonly sqliteDatabase?: SqliteDatabaseService;
readonly logger?: Logger;
readonly binaryLayout?: BinaryLayoutService;
readonly goBinary?: GoBinaryService;
@@ -243,6 +247,8 @@ export const createServer = (
const delivery = selectToolResultDelivery(environment, options.delivery);
const evmInterface =
options.evmInterface ?? evmInterfaceModule.create(environment);
const sqliteDatabase =
options.sqliteDatabase ?? createSqliteDatabaseService(environment);
const binaryLayout =
options.binaryLayout ?? createBinaryLayoutService(environment);
const recordedCrash =
@@ -262,6 +268,7 @@ export const createServer = (
environment,
delivery,
evmInterface,
sqliteDatabase,
binaryLayout,
recordedCrash,
webSourceLocation,
@@ -302,6 +309,7 @@ export const createServer = (
adbDevice.close(),
flutter.close(),
evmInterface.close(),
sqliteDatabase.close(),
binaryLayout.close(),
recordedCrash.close(),
webSourceLocation.close(),
@@ -520,6 +528,13 @@ const registerConfiguredAnalysisTools = (
recordEvidence,
withAdmittedAnalysis,
);
registerSqliteTools(
server,
options.sqliteDatabase ?? createSqliteDatabaseService(environment),
toolLogger,
recordEvidence,
withAdmittedAnalysis,
);
registerRecordedCrashTools(
server,
options.recordedCrash ?? createRecordedCrashService(environment),