[PR #679] [CLOSED] fix(artifacts): align native DMG mount and detach lifecycle #2160

Closed
opened 2026-10-16 21:15:03 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/679
Author: @rudycelekli
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/rea-dmg-native-lifecycle-20261006


📝 Commits (1)

  • 9569b8c fix(artifacts): align native DMG mount and detach lifecycle

📊 Changes

2 files changed (+62 additions, -5 deletions)

View changed files

📝 src/artifacts/NativeDmgArtifactReader.ts (+17 -4)
📝 tests/boundary/providers/native/nativeDmgArtifactReader.test.ts (+45 -1)

📄 Description

Summary

Make real native DMG attach/read/detach work with the metadata returned by hdiutil:

  • Canonicalize the owned temporary mount root before requesting attachment. On macOS, /var/... and /private/var/... can name the same directory; hdiutil returns its canonical spelling. The old lexical prefix check rejects a legitimate owned mount.
  • Detach an observed whole disk once, rather than subsequently trying each of its now-unavailable partitions. Parent authority is taken only from devices actually returned by hdiutil; child-only metadata is preserved.

Both failures occurred in one public NativeDmgArtifactReader run against an owned hdiutil-created UDZO image. The baseline rejected the legitimate mount and then reported cleanup failures. Afterward the same image attaches, enumerates and closes successfully; hdiutil info -plist reports no attached images left.

Verification

  • Native host commands: hdiutil create, hdiutil convert -format UDZO, then public reader create → entries → close, using the actual system host. Before fails; after passes with a single observed whole-disk detach.
  • npm run test:focused -- tests/boundary/providers/native/nativeDmgArtifactReader.test.ts — 3 tests passed, including canonical-root and multiple whole disks/partitions.
  • npm run check — all five tasks passed.
  • Existing nonzero/child-only failure paths remain tested. This does not claim arbitrary APFS snapshot/nested partition support or unrelated image cleanup.
  • No Hopper or Ghidra verification was performed; no such provider is changed. No public contract/generated metadata changes.

AI assistance was used for implementation and verification. The source and actual native proof were independently reviewed before publication. No user-owned image was used.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/679 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rea-dmg-native-lifecycle-20261006` --- ### 📝 Commits (1) - [`9569b8c`](https://github.com/morluto/rea/commit/9569b8cfb3f24f379656c10dae60347ff54cda19) fix(artifacts): align native DMG mount and detach lifecycle ### 📊 Changes **2 files changed** (+62 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/NativeDmgArtifactReader.ts` (+17 -4) 📝 `tests/boundary/providers/native/nativeDmgArtifactReader.test.ts` (+45 -1) </details> ### 📄 Description ## Summary Make real native DMG attach/read/detach work with the metadata returned by hdiutil: - Canonicalize the owned temporary mount root before requesting attachment. On macOS, `/var/...` and `/private/var/...` can name the same directory; hdiutil returns its canonical spelling. The old lexical prefix check rejects a legitimate owned mount. - Detach an observed whole disk once, rather than subsequently trying each of its now-unavailable partitions. Parent authority is taken only from devices actually returned by hdiutil; child-only metadata is preserved. Both failures occurred in one public NativeDmgArtifactReader run against an owned hdiutil-created UDZO image. The baseline rejected the legitimate mount and then reported cleanup failures. Afterward the same image attaches, enumerates and closes successfully; `hdiutil info -plist` reports no attached images left. ## Verification - Native host commands: `hdiutil create`, `hdiutil convert -format UDZO`, then public reader `create → entries → close`, using the actual system host. Before fails; after passes with a single observed whole-disk detach. - `npm run test:focused -- tests/boundary/providers/native/nativeDmgArtifactReader.test.ts` — 3 tests passed, including canonical-root and multiple whole disks/partitions. - `npm run check` — all five tasks passed. - Existing nonzero/child-only failure paths remain tested. This does not claim arbitrary APFS snapshot/nested partition support or unrelated image cleanup. - No Hopper or Ghidra verification was performed; no such provider is changed. No public contract/generated metadata changes. AI assistance was used for implementation and verification. The source and actual native proof were independently reviewed before publication. No user-owned image was used. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2160
No description provided.