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 <[email protected]> Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
24 lines
647 B
TypeScript
24 lines
647 B
TypeScript
/** Bound frozen input, retained JSON and worker allocation before parsing untrusted files. */
|
|
export const SQLITE_DATABASE_LIMITS = {
|
|
concurrentInspections: 2,
|
|
inputBytes: 256 * 1024 * 1024,
|
|
outputBytes: 16 * 1024 * 1024,
|
|
timeoutMs: 30_000,
|
|
diagnosticBytes: 1024 * 1024,
|
|
} as const;
|
|
/** Internal rejection retains the failed boundary without returning partial success. */
|
|
export class SqliteInspectionFailure extends Error {
|
|
constructor(
|
|
readonly reason:
|
|
| "format"
|
|
| "selection"
|
|
| "unsupported"
|
|
| "unavailable"
|
|
| "output-limit"
|
|
| "memory",
|
|
message: string,
|
|
) {
|
|
super(message);
|
|
}
|
|
}
|