fix: bind identity and coverage to the producing rule (#1513)
* fix: bind identity and coverage to the producing rule Logical paths, container families, examined bytes, path-segment conventions, destination collisions, file-id leases, Mach-O CPU selection, and firmware cleanup now follow the observation that owns each rule. * fix: fail unmatched Mach-O slices and keep firmware roots independent A fat target whose architecture lipo did not list now stops before slice tools run. Chained fixups still count unread LC_DYLD_INFO rebase bytes, and a firmware cleanup failure no longer blocks the next workspace. * test: cover path identity and runtime families at the projection boundary NFC joins and segment conventions are now asserted by the path resolver, the Apple projection, and a real APK inventory instead of helper unit tests. * test: expect unread dyld rebase bytes in the Apple dispatch fixture The legacy LC_DYLD_INFO fixture keeps a rebase range this reader does not decode, so the public CLI and MCP check now requires that partial coverage beside the bind opcodes. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
@@ -16,6 +16,27 @@ describe("native Mach-O slice selection", () => {
|
||||
expect(parseMachoLayout(Buffer.from(fat), "arm64").segments).toEqual([]);
|
||||
});
|
||||
|
||||
it("selects only the admitted CPU type and rejects a 32-bit slice", () => {
|
||||
const sixtyFour = fatImage([
|
||||
{ cpu: CPU.x86_64, bytes: machoImage({ cpu: CPU.x86_64 }) },
|
||||
]);
|
||||
expect(() => parseMachoLayout(Buffer.from(sixtyFour), "x86")).toThrow(
|
||||
/Requested FAT architecture is absent/u,
|
||||
);
|
||||
expect(() => parseMachoLayout(Buffer.from(sixtyFour), "arm")).toThrow(
|
||||
/Requested FAT architecture is absent/u,
|
||||
);
|
||||
const thirtyTwo = fatImage([
|
||||
{
|
||||
cpu: CPU.i386,
|
||||
bytes: machoImage({ cpu: CPU.i386, wide: false }),
|
||||
},
|
||||
]);
|
||||
expect(() => parseMachoLayout(Buffer.from(thirtyTwo), "x86")).toThrow(
|
||||
/Unsupported 32-bit Mach-O metadata for requested CPU type x86/u,
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects FAT subtype disagreement and unaligned slice offsets", () => {
|
||||
const original = fatImage([{ cpu: CPU.arm64, bytes: machoImage({}) }]);
|
||||
const mismatched = original.slice();
|
||||
|
||||
Reference in New Issue
Block a user