* fix(comparisons)!: preserve unknowns across partial observations Share absence and digest semantics, keep unobserved managed bodies unknown, and match unique managed type/name/signatures before structural fallback. BREAKING CHANGE: Managed comparison metadata adds exact-signature matching and its count, and name_matching now reports exact-signature-fallback. * fix(javascript): preserve projected result binding semantics Share syntax-aware property reads and assigned-result resolution. Retain destructuring paths and downgrade downstream whole-result relationships instead of resolving nested or wrapped calls as aliases. * fix(native)!: admit complete parser values and preserve typed failures Decode Mach headers by named columns, validate complete slice keys and lipo alignment, and preserve codesign runtime flags and tagged parser errors. Rename the Ghidra test dossier fixture and connect fake-backed suites to real verification lanes. BREAKING CHANGE: Native load-command results no longer contain the unused, always-null file_offset field. * fix(process): preserve host identity and actionable boundary failures Thread selected platform and environment through process and Doctor seams, stamp observed producer identity in Evidence, and retain PTY, filesystem, lease and lazy-provider failure causes. Drain cancelled lazy loads and omit exited descendants from verified lineage. * fix(browser): preserve cleanup and document-transition evidence Make V8 and Playwright teardown cancellation-aware, expose primary failures alongside incomplete cleanup, share frame-tree and navigation rules, and clear stale WebMCP registrations without pruning unrelated child frames. * fix(adapters): align managed targets and typed CLI outcomes Inspect managed PE/CLI targets independently of native provider selection, reuse successful managed selections, and keep evidence bound to the actual inspected target. Classify canonical CLI error envelopes and exhaustive setup/update/uninstall outcomes, audit registered CLI coverage, and assert platform-specific runtime results. * docs: refresh boundary contracts and shipped roadmap behavior
89 lines
3.0 KiB
TypeScript
89 lines
3.0 KiB
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { NativeMacOSProvider } from "../../../../src/native/NativeMacOSProvider.js";
|
|
import { parseOtoolLoadCommands } from "../../../../src/native/parsers/otool.js";
|
|
import {
|
|
NativeFixtureRunner,
|
|
nativeFixture,
|
|
nativeMachoTarget,
|
|
} from "../../../fixtures/nativeCommands.js";
|
|
|
|
it("collects the actual Mach header alongside the native load commands", async () => {
|
|
// The provider always invokes `otool -h -l`, which the runner resolves
|
|
// via the "otool:-h" key; no bare `otool` override is needed.
|
|
const runner = new NativeFixtureRunner({
|
|
"otool:-h": await nativeFixture(
|
|
"native-macho-header/otool-header-load.txt",
|
|
),
|
|
});
|
|
const client = new NativeMacOSProvider(runner, "darwin").createClient(
|
|
nativeMachoTarget("/owned/fixture"),
|
|
);
|
|
const result = await client.execute("inspect_macho", {});
|
|
expect(result.ok).toBe(true);
|
|
if (!result.ok) return;
|
|
expect(result.value.result).toMatchObject({
|
|
file_type: "2",
|
|
flags: ["0x00200085"],
|
|
segments: {
|
|
items: expect.arrayContaining([
|
|
expect.objectContaining({ name: "__TEXT" }),
|
|
]),
|
|
},
|
|
});
|
|
});
|
|
|
|
it("does not reinterpret segment and section flags as Mach header flags", async () => {
|
|
const load = parseOtoolLoadCommands(
|
|
await nativeFixture("native-macho-header/otool-header-load.txt"),
|
|
);
|
|
expect(load.flags).toEqual(["0x00200085"]);
|
|
expect(load.commands.some((command) => command.fields.flags === 0)).toBe(
|
|
true,
|
|
);
|
|
});
|
|
|
|
it("keeps multi-word field names such as time stamp intact", async () => {
|
|
const load = parseOtoolLoadCommands(await nativeFixture("otool-load.txt"));
|
|
const stamped = load.commands.filter(
|
|
(command) => "time stamp" in command.fields,
|
|
);
|
|
expect(stamped.length).toBeGreaterThan(0);
|
|
expect(load.commands.some((command) => "time" in command.fields)).toBe(false);
|
|
expect(stamped[0]?.fields["time stamp"]).toMatch(/^2 Thu Jan/);
|
|
});
|
|
|
|
it("decodes Mach header fields by their column names", () => {
|
|
const reordered = parseOtoolLoadCommands(
|
|
[
|
|
"Mach header",
|
|
" flags filetype magic cputype",
|
|
" NOUNDEFS 2 0xfeedfacf 16777228",
|
|
"Load command 0",
|
|
" cmd LC_UUID",
|
|
" uuid 01234567-89ab-cdef-0123-456789abcdef",
|
|
].join("\n"),
|
|
);
|
|
expect(reordered.fileType).toBe("2");
|
|
expect(reordered.flags).toEqual(["NOUNDEFS"]);
|
|
const reorderedMultiwordFlags = parseOtoolLoadCommands(
|
|
[
|
|
"Mach header",
|
|
" filetype magic flags ncmds sizeofcmds",
|
|
" 2 0xfeedfacf NOUNDEFS DYLDLINK 4 512",
|
|
].join("\n"),
|
|
);
|
|
expect(reorderedMultiwordFlags.fileType).toBe("2");
|
|
expect(reorderedMultiwordFlags.flags).toEqual(["DYLDLINK", "NOUNDEFS"]);
|
|
const missing = parseOtoolLoadCommands(
|
|
"Mach header\n magic cputype flags\n 0xfeedfacf 1 NOUNDEFS\n",
|
|
);
|
|
expect(missing.fileType).toBeNull();
|
|
expect(missing.flags).toEqual(["NOUNDEFS"]);
|
|
const incomplete = parseOtoolLoadCommands(
|
|
"Mach header\n filetype magic flags ncmds sizeofcmds\n 2 0xfeedfacf NOUNDEFS\n",
|
|
);
|
|
expect(incomplete.fileType).toBeNull();
|
|
expect(incomplete.flags).toEqual([]);
|
|
});
|