Files
reverse-engineering-anything/src/contracts/sessionLifecycleInputs.test.ts
T
Matt Van Hornandmorluto 7c207c7951 feat(native): admit raw binaries with caller-supplied architecture and entry (#1868)
* feat(native): admit raw binaries with caller-supplied architecture and entry

* fix(native): honor raw-binary preparation and entry identity

* fix(ghidra): stream raw snapshot attestation with cancellation

* fix(native): preserve and validate raw lifecycle entries

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-12 00:06:29 +08:00

51 lines
1.4 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { openBinaryInputSchema } from "./sessionLifecycleInputs.js";
describe("open_binary raw-binary input contract", () => {
it("accepts header detection without architecture", () => {
expect(
openBinaryInputSchema.safeParse({ path: "/tmp/fixture.bin" }).success,
).toBe(true);
expect(
openBinaryInputSchema.safeParse({
path: "/tmp/legacy.com",
format: "dos-com",
}).success,
).toBe(true);
});
it("accepts raw-binary with architecture and entry", () => {
expect(
openBinaryInputSchema.safeParse({
path: "/tmp/ecu.bin",
format: "raw-binary",
architecture: "arm",
entry_point: "0x8000000",
}).success,
).toBe(true);
});
it("rejects raw-binary without architecture or entry", () => {
const parsed = openBinaryInputSchema.safeParse({
path: "/tmp/ecu.bin",
format: "raw-binary",
});
expect(parsed.success).toBe(false);
expect(
openBinaryInputSchema.safeParse({
path: "/tmp/ecu.bin",
format: "raw-binary",
architecture: "arm",
}).success,
).toBe(false);
});
it("rejects architecture without format=raw-binary", () => {
expect(
openBinaryInputSchema.safeParse({
path: "/tmp/ecu.bin",
architecture: "arm",
entry_point: "0x8000000",
}).success,
).toBe(false);
});
});