mirror of
https://github.com/morluto/rea.git
synced 2026-11-07 15:26:25 +00:00
* test: strengthen and prune audited test coverage * test: require delivered DeepSeek skill instructions * test: keep schema fixture types private * test: verify Gemini receives skill instructions * test: bind Qwen skill evidence to its tool result * test: report NativeAOT verifier checks precisely * fix: verify Ghidra cleanup paths reliably * fix: verify Command Code skill activation * test: tighten cleanup and fixture checks * test: verify packet capture evidence is recorded * fix: report HTTP3 capture provenance accurately * test: preserve resource coverage through MCP * test: prune repeated assertions and retain cancellation identity * fix: validate client verifier fixture paths * test: skip Copilot verifier cases on Windows * test: keep verifier setup target relative
86 lines
2.7 KiB
TypeScript
86 lines
2.7 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import type { ElectronFuseReport } from "../../domain/electron/electronFuses.js";
|
|
import { AnalysisOutputError } from "../../domain/analysisErrorCore.js";
|
|
import { parseEvidence } from "../../domain/evidence.js";
|
|
import { ok } from "../../domain/result.js";
|
|
import { ElectronFuseService } from "./ElectronFuseService.js";
|
|
|
|
const identity = { id: "fuse-fixture", name: "Fixture", version: "1" };
|
|
const report: ElectronFuseReport = {
|
|
artifact: {
|
|
selected_path: "/artifacts/app",
|
|
resolved_path: "/artifacts/app",
|
|
sha256: "a".repeat(64),
|
|
bytes: 0,
|
|
format: "elf",
|
|
},
|
|
slices: [
|
|
{
|
|
index: 0,
|
|
file_offset: 0,
|
|
size: 0,
|
|
architecture: null,
|
|
sentinel_count: 0,
|
|
sentinels: [],
|
|
},
|
|
],
|
|
runtime_implications: [],
|
|
limitations: ["source-owned fixture"],
|
|
};
|
|
|
|
it("retains completed fuse Evidence when the provider completes after abort", async () => {
|
|
const controller = new AbortController();
|
|
const reason = { requested: "stop after fuse inspection" };
|
|
const result = await new ElectronFuseService({
|
|
identity,
|
|
close: async () => {},
|
|
inspect: async () => {
|
|
controller.abort(reason);
|
|
return ok(report);
|
|
},
|
|
}).inspect(
|
|
{ path: report.artifact.selected_path },
|
|
{ signal: controller.signal },
|
|
);
|
|
expect(result.ok).toBe(false);
|
|
if (!result.ok) {
|
|
expect(result.error._tag).toBe("AnalysisCancelledError");
|
|
expect(result.error.cause).toBe(reason);
|
|
expect(parseEvidence(result.error.partialObservation)).toMatchObject({
|
|
operation: "inspect_electron_fuses",
|
|
provider: identity,
|
|
subject: {
|
|
local_path: report.artifact.resolved_path,
|
|
digest: { sha256: report.artifact.sha256 },
|
|
format: report.artifact.format,
|
|
},
|
|
parameters: { path: report.artifact.selected_path },
|
|
confidence: "observed",
|
|
limitations: expect.arrayContaining(report.limitations),
|
|
locations: [{ kind: "artifact-path", path: report.artifact.selected_path }],
|
|
normalized_result: report,
|
|
});
|
|
}
|
|
});
|
|
|
|
it("preserves malformed fuse output ahead of late cancellation", async () => {
|
|
const malformed = {
|
|
...report,
|
|
artifact: { ...report.artifact, selected_path: "/artifacts/other" },
|
|
};
|
|
const controller = new AbortController();
|
|
const invalid = await new ElectronFuseService({
|
|
identity,
|
|
close: async () => {},
|
|
inspect: async () => {
|
|
controller.abort();
|
|
return ok(malformed);
|
|
},
|
|
}).inspect(
|
|
{ path: report.artifact.selected_path },
|
|
{ signal: controller.signal },
|
|
);
|
|
expect(invalid.ok).toBe(false);
|
|
if (!invalid.ok) expect(invalid.error).toBeInstanceOf(AnalysisOutputError);
|
|
});
|