From 62634e4c0177bde8a08decc356da98fbe25d2000 Mon Sep 17 00:00:00 2001 From: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Date: Wed, 7 Oct 2026 10:28:03 +0000 Subject: [PATCH] fix(artifacts): keep the post-snapshot detach check out of provenance The inventory snapshot captures reader provenance before close() runs, so a `hdiutil info -plist` entry recorded during cleanup never reached CLI or MCP results. Detach entries already share that timing. Record neither instead of implying the query is observable. Co-Authored-By: Claude Opus 5.5 --- src/artifacts/NativeDmgArtifactReader.ts | 7 +++++-- .../providers/native/nativeDmgArtifactReader.test.ts | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/artifacts/NativeDmgArtifactReader.ts b/src/artifacts/NativeDmgArtifactReader.ts index b6dc543c0..b5c6ee73a 100644 --- a/src/artifacts/NativeDmgArtifactReader.ts +++ b/src/artifacts/NativeDmgArtifactReader.ts @@ -141,14 +141,17 @@ export class NativeDmgArtifactReader implements ArtifactReader { ); } - /** Report whether hdiutil still lists a device; unknown state counts as attached. */ + /** + * Report whether hdiutil still lists a device; unknown state counts as + * attached. Like detach, this cleanup query runs after the inventory + * snapshot has captured provenance, so it is not recorded there. + */ async #isAttached(device: string): Promise { try { const info = await runChecked(this.host, ["info", "-plist"], undefined, { timeoutMs: DETACH_TIMEOUT_MS, }); const parsed = infoOutputSchema.parse(parse(info.stdout)); - this.#provenance.push(command(["info", "-plist"], ["read"])); return parsed.images.some((image) => image["system-entities"].some( (entity) => entity["dev-entry"] === device, diff --git a/tests/boundary/providers/native/nativeDmgArtifactReader.test.ts b/tests/boundary/providers/native/nativeDmgArtifactReader.test.ts index e5fcd9f70..b04633b96 100644 --- a/tests/boundary/providers/native/nativeDmgArtifactReader.test.ts +++ b/tests/boundary/providers/native/nativeDmgArtifactReader.test.ts @@ -201,7 +201,6 @@ describe("APFS disk image detach", () => { "verify", "attach", "detach", - "info", ]); });