feat(native): add inspection primitives, dispatch traces and approved UI observation (#500)
* fix(hopper): normalize string-backed addresses and update verification * feat(native): add inspection primitives, dispatch traces and approved UI observation * test: prioritize real artifact E2E and captured golden regressions * fix(process): queue observed output before reactive rendering actions * test: prune redundant cases and strengthen boundary assertions * fix(cli): route native value tracing through shared workflows * test: replace synthetic success with real workflows and captured data * fix(catalog): separate portable metadata from native host availability
This commit is contained in:
@@ -12,12 +12,10 @@ import {
|
||||
describe("native DMG artifact reader", () => {
|
||||
it("uses plist attachment metadata and detaches returned devices", async () => {
|
||||
const calls: string[][] = [];
|
||||
const commandOptions: unknown[] = [];
|
||||
const host: NativeDmgHost = {
|
||||
async run(arguments_, _signal, options) {
|
||||
async run(arguments_) {
|
||||
const args = [...arguments_];
|
||||
calls.push(args);
|
||||
commandOptions.push(options);
|
||||
if (args[0] !== "attach") return { stdout: "", exitCode: 0 };
|
||||
const mountRoot = args[args.indexOf("-mountroot") + 1];
|
||||
if (mountRoot === undefined) throw new Error("missing mount root");
|
||||
@@ -43,15 +41,13 @@ describe("native DMG artifact reader", () => {
|
||||
for await (const entry of reader.entries()) entries.push(entry.path);
|
||||
expect(entries).toContain("image.dmg/Fixture/hello.txt");
|
||||
const provenance = reader.provenance();
|
||||
if (provenance[0] !== undefined)
|
||||
Reflect.set(provenance[0], "tool", "forged");
|
||||
const first = provenance[0];
|
||||
if (first === undefined) throw new Error("expected attachment provenance");
|
||||
Reflect.set(first, "tool", "forged");
|
||||
expect(reader.provenance()[0]?.tool).toBe("/usr/bin/hdiutil");
|
||||
await reader.close();
|
||||
expect(calls).toContainEqual(["verify", "/tmp/image.dmg"]);
|
||||
expect(calls).toContainEqual(["detach", "/dev/disk-fixture"]);
|
||||
expect(commandOptions[0]).toBeUndefined();
|
||||
expect(commandOptions[1]).toBeUndefined();
|
||||
expect(commandOptions[2]).toEqual({ timeoutMs: 120_000 });
|
||||
});
|
||||
|
||||
it("rejects non-zero results and surfaces detach failure during attach cleanup", async () => {
|
||||
|
||||
Reference in New Issue
Block a user