refactor(domain): remove provider-specific target and snapshot state
Move Hopper loader derivation and compatibility projection into the Hopper adapter so BinaryTarget carries only provider-neutral identity and format metadata. Introduce bounded canonical analysis-profile commitments, exact provider/profile snapshot v2 bindings, legacy snapshot rejection guidance, and backward-compatible profiled Evidence v2 records. Partition cache and replay behavior by target, concrete provider build, and profile while preserving custom Hopper loader overrides. Propagate profiles consistently through CLI, MCP, composed workflows, and session lifecycle; preserve the 78-tool contract and legacy loaderArgs response projection. Add migration documentation, generated API updates, property regressions, package verification, and real Hopper coverage.
This commit is contained in:
@@ -39,23 +39,16 @@ describe("executable header parsing", () => {
|
||||
const bytes = fat([0x01000007, 0x0100000c]);
|
||||
const arm = parseExecutableHeader(bytes, "arm64");
|
||||
const intel = parseExecutableHeader(bytes, "x64");
|
||||
expect(arm.ok && arm.value.loaderArgs).toContain("--aarch64");
|
||||
expect(intel.ok && intel.value.loaderArgs).toContain("--intel-64");
|
||||
expect(arm.ok && arm.value).toMatchObject({
|
||||
architecture: "arm64",
|
||||
availableArchitectures: ["x86_64", "arm64"],
|
||||
});
|
||||
expect(intel.ok && intel.value).toMatchObject({
|
||||
architecture: "x86_64",
|
||||
availableArchitectures: ["x86_64", "arm64"],
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
[thinMach(0xfeedfacf, 0x0100000c), ["-l", "Mach-O", "--aarch64"]],
|
||||
[thinMach(0xcefaedfe, 0x01000007), ["-l", "Mach-O", "--intel-64"]],
|
||||
[elf(2, 2, 183), ["-l", "ELF", "--aarch64"]],
|
||||
[pe(0x8664), ["-l", "WinPE", "--intel-64"]],
|
||||
] as const)(
|
||||
"emits a complete non-interactive Hopper selection",
|
||||
(bytes, args) => {
|
||||
const result = parseExecutableHeader(bytes, "arm64");
|
||||
expect(result.ok && result.value.loaderArgs).toEqual(args);
|
||||
},
|
||||
);
|
||||
|
||||
it("rejects FAT files without a host-compatible slice", () => {
|
||||
expect(parseExecutableHeader(fat([0x01000007]), "arm64")).toMatchObject({
|
||||
ok: false,
|
||||
@@ -84,12 +77,10 @@ describe("binary target I/O", () => {
|
||||
expect(archive.ok && archive.value).toMatchObject({
|
||||
kind: "archive",
|
||||
format: "apk",
|
||||
loaderArgs: [],
|
||||
});
|
||||
expect(javascript.ok && javascript.value).toMatchObject({
|
||||
kind: "artifact",
|
||||
format: "javascript",
|
||||
loaderArgs: [],
|
||||
});
|
||||
});
|
||||
|
||||
@@ -190,8 +181,7 @@ describe("binary target I/O", () => {
|
||||
);
|
||||
expect(result.ok && result.value).toMatchObject({
|
||||
kind: "database",
|
||||
format: "hopper",
|
||||
loaderArgs: [],
|
||||
format: "analysis-database",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user