fix(parsers): preserve format evidence and caller input identity

Retain bounded FAT and offset-tagged PE observations through archive hashing,
classification, and content nodes. Preserve PyInstaller member paths according
to the observed carrier dialect and share APK v1 signing-name semantics.

Read SQLite's implicit sqlite_schema table without inventing a stored schema
declaration. Distinguish unsupported ELF numbering and decoded-name admission
from malformed data and fixed scan allowances. Preserve Sigrok basenames and
classify matching explicit input-format refusals at their owning boundary.

Validation: 554 distinct tests passed, 3 skipped across serial focused runs;
build, typecheck/lint, docs, formatting, and discovery (2141 files) passed.
Sigrok command-boundary simulators do not establish real-tool decoding.
Small repeated public PyInstaller CLI runs had equivalent inventory facts;
warm median elapsed 0.5431s before / 0.5426s after, with no speed claim.

Fixes #6733
Fixes #6741
Fixes #6722
Fixes #6732
Fixes #6736
Fixes #6734
Fixes #6764
Fixes #6766
Refs #6739
This commit is contained in:
morluto committed 2026-10-23 22:54:28 +08:00
1 parent a718037033
commit bd4f5e9c19
47 files changed
+1523 -209

No files matched your search

@@ -122,6 +122,90 @@ it("retains the actual default without inventing an explicit caller selection",
expect(result.value.parameters).not.toHaveProperty("worker_timeout_ms");
});
it("accepts sqlite_schema rows without requiring a fabricated declaration", async () => {
const report = {
...fixture(),
schema: {
...fixture().schema,
scope: "selected_table",
tables: [],
},
rows: {
table: "sqlite_schema",
columns: ["name", "type"],
values: [
[
{
type: "text",
value: "records",
bytes_hex: "7265636f726473",
encoding: "UTF-8",
},
{
type: "text",
value: "table",
bytes_hex: "7461626c65",
encoding: "UTF-8",
},
],
],
row_limit: 20,
returned_rows: 1,
truncated: false,
order: "unspecified",
},
};
const service = new SqliteDatabaseService({
inspect: async () => ok(execution(report)),
});
const result = await service.inspect({
path: "/selected.db",
table: "sqlite_schema",
columns: ["name", "type"],
schema_scope: "selected_table",
});
expect(result.ok).toBe(true);
const foreign = {
...report,
schema: {
...report.schema,
tables: [
{
name: "records",
root_page: 2,
kind: "table",
without_rowid: false,
strict: false,
column_count: 0,
columns_completeness: "complete",
columns: [],
},
],
},
};
const foreignService = new SqliteDatabaseService({
inspect: async () => ok(execution(foreign)),
});
expect(
await foreignService.inspect({
path: "/selected.db",
table: "sqlite_schema",
columns: ["name", "type"],
schema_scope: "selected_table",
}),
).toMatchObject({ ok: false, error: { _tag: "AnalysisOutputError" } });
expect(
await service.inspect({
path: "/selected.db",
table: "missing",
columns: ["name", "type"],
schema_scope: "selected_table",
}),
).toMatchObject({ ok: false, error: { _tag: "AnalysisOutputError" } });
});
it("parses historical report omissions as unknown without supplying a default", () => {
const { worker_timeout_ms: _default, ...historical } = fixture();
const parsed = sqliteDatabaseSchema.parse(historical);