refactor(native)!: report kernel build config coverage as partial or unknown instead of incomplete (#11486)

inspect_kernel_build_config coverage.status was `incomplete` for a config cut by the
searched bytes or a budget-stopped search (known gaps), for a malformed framed
config, and for a payload that was never searched (examined_bytes 0). Coverage
now uses the shared status: `partial` for the known gaps, `unknown` when a
config's existence or contents cannot be determined; `unsupported` is
unchanged. config.status keeps its own values, and the service's consistency
check pairs each config state with its coverage.

BREAKING CHANGE: inspect_kernel_build_config `coverage.status` reports `partial`
(config_gzip_truncated, config_search_exhausted) or `unknown` (malformed config,
payload not searched) instead of `incomplete`.
This commit is contained in:
morluto authored and GitHub committed 2026-11-16 05:01:36 +08:00
1 parent 0a9e736aea
commit acb10754c1
9 files changed
+71 -23

No files matched your search

+9 -8
View File
@@ -204,7 +204,7 @@ it("reports a framed member whose text fails the grammar as malformed, not absen
option_count: 0,
entries: [],
});
expect(report.coverage.status).toBe("incomplete");
expect(report.coverage.status).toBe("unknown");
expect(
report.limitations.some((line) => line.includes("not a .config")),
).toBe(true);
@@ -219,7 +219,7 @@ it("reports a framed member with a bad CRC-32 as malformed, not absent", async (
sha256: null,
option_count: 0,
});
expect(report.coverage.status).toBe("incomplete");
expect(report.coverage.status).toBe("unknown");
expect(report.limitations.some((line) => line.includes("CRC-32"))).toBe(true);
});
@@ -274,7 +274,7 @@ it("reports a framed member that does not decode as malformed, not absent", asyn
gzip: { space: "file", offset: 8, bytes: body.length },
end_marker: { space: "file", offset: bytes.length - 8, bytes: 8 },
});
expect(report.coverage.status).toBe("incomplete");
expect(report.coverage.status).toBe("unknown");
expect(
(await parse(Buffer.concat([bytes, embeddedKernelConfig()]))).config
.status,
@@ -296,7 +296,7 @@ it("reports a truncated IKCFG member as incomplete, not absent", async () => {
status: "incomplete",
reason: "config_gzip_truncated",
});
expect(report.coverage.status).toBe("incomplete");
expect(report.coverage.status).toBe("partial");
});
it("inflates a bzImage gzip payload and reports payload-relative offsets", async () => {
@@ -332,15 +332,16 @@ it("names an xz bzImage payload as unsupported without searching it", async () =
});
});
it("keeps truncated and unusable bzImage payloads incomplete", async () => {
it("keeps coverage unknown for truncated and unusable bzImage payloads", async () => {
const truncated = await parse(bzImageTruncatedGzipFixture());
expect(truncated.payload.status).toBe("truncated");
expect(truncated.config.reason).toBe("payload_truncated");
expect(truncated.coverage.status).toBe("incomplete");
expect(truncated.coverage.status).toBe("unknown");
const old = await parse(bzImageFixture(gzipSync("x"), { version: 0x0206 }));
expect(old.payload.status).toBe("unavailable");
expect(old.config.reason).toBe("setup_header_payload_unavailable");
expect(old.coverage).toMatchObject({ status: "unknown", examined_bytes: 0 });
const short = bzImageFixture(gzipSync("x"));
short.writeUInt32LE(0xffff, 0x24c);
@@ -414,7 +415,7 @@ it("stops inflating decoy candidates after the candidate cap and reports incompl
reason: "config_search_exhausted",
marker: null,
});
expect(report.coverage.status).toBe("incomplete");
expect(report.coverage.status).toBe("partial");
expect(
report.limitations.some((line) => line.includes("16 IKCFG_ST gzip")),
).toBe(true);
@@ -737,7 +738,7 @@ it("retains incomplete coverage for a partial config end marker", async () => {
reason: "config_gzip_truncated",
entries: [],
});
expect(report.coverage.status).toBe("incomplete");
expect(report.coverage.status).toBe("partial");
});
it("ignores marker bytes inside a gzip member", async () => {