[PR #3505] [CLOSED] fix(apple): require directory evidence for bundle anatomy #5788

Closed
opened 2026-10-31 01:09:26 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3505
Author: @bnkaiteam
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/apple-anatomy-directory-identity


📝 Commits (1)

  • ca04c79 fix(apple): require directory evidence for bundle anatomy

📊 Changes

2 files changed (+109 additions, -8 deletions)

View changed files

📝 src/domain/apple/appleApplication.test.ts (+85 -0)
📝 src/domain/apple/appleBundleAnatomy.ts (+24 -8)

📄 Description

Summary

Fixes #3359. A regular resource named Contents currently makes a shallow iOS application report macOS layout and lose its valid Info.plist path. Require directory evidence before selecting structural bundle anatomy.

Problem and expected behavior

An IPA containing only Payload/Mobile.app/Info.plist and a regular file Payload/Mobile.app/Contents must remain shallow/iOS. The current child-name lookup admits files and symlinks as directory conventions. Versions has the same issue; an exact-name file can also hide a differently cased real directory.

Change and scope

Select from the existing tree.directories index before applying anatomy-name preference. Reuse that directory selection for Contents, Versions, Resources, MacOS and _CodeSignature, so layout and its consumers share the same interpretation. Preserve explicit empty directories and implicit ancestors from archive entries; do not resolve symlinks.

Contract and boundary impact

  • Semantic owner: src/domain/apple/appleBundleAnatomy.ts, after inventory identity is established.
  • Scope decision: not applicable; correction within existing static analysis.
  • CLI/MCP and tool catalog: unchanged inputs and schema; corrected layout/platform and retained metadata, executable and signing paths.
  • Evidence/provenance: exact paths, identities and coverage remain intact; projection digests follow the corrected result.
  • Providers, target authority, cleanup, generated metadata, package and installation: unchanged. No target execution or new capability.

Expected effects:

  • Read existing files or captured data.

Evidence and regression coverage

Executed public inspect-artifact → project-apple-application-graph calls with synthetic IPA inputs on base f75b1a4 and this patch:

Input Base Patched
Shallow Info.plist + regular Contents file macos-deep, macos, null Info.plist shallow, ios, Payload/Mobile.app/Info.plist
Real Contents/Info.plist hierarchy macos-deep, macos, deep Info.plist unchanged

Both preserve complete inventory coverage. Nine regression cases cover file/symlink lookalikes, explicit empty directories, exact-name files hiding case-folded directories and nested structural lookups. The pre-fix regression run observed six failures; the final suite passes. Existing versioned-framework and Versions/Current uncertainty tests remain covered.

Validation performed

Windows x64, Node 24.18.0 and npm 11.16.0:

  • npm run test:focused -- src/domain/apple/appleApplication.test.ts tests/boundary/filesystem/appleApplication.test.ts — 36 passed.
  • npm run check — passed (typecheck, lint, formatting, Knip, metadata and architecture guards).
  • npm run verify:test-discovery — all 1,273 files discovered exactly once.
  • Public CLI reproduction and real-directory control above — passed.

Full deterministic CI and real macOS/Hopper/Ghidra runs were not run locally; synthetic archives require none of these providers. No performance improvement is claimed.

Compatibility, safety, and release

No API/dependency changes or migration. Read-only inventory projection; no added network, process, mutation or protection-recovery behavior.

Author readiness

Human owner: @bnkaiteam

Prepared with AI-agent assistance. Kept in draft pending the human owner's final review and readiness declaration.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 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/3505 **Author:** [@bnkaiteam](https://github.com/bnkaiteam) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/apple-anatomy-directory-identity` --- ### 📝 Commits (1) - [`ca04c79`](https://github.com/morluto/rea/commit/ca04c797855966c7eef1f700349fbef2e6165210) fix(apple): require directory evidence for bundle anatomy ### 📊 Changes **2 files changed** (+109 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/apple/appleApplication.test.ts` (+85 -0) 📝 `src/domain/apple/appleBundleAnatomy.ts` (+24 -8) </details> ### 📄 Description ## Summary Fixes #3359. A regular resource named `Contents` currently makes a shallow iOS application report macOS layout and lose its valid Info.plist path. Require directory evidence before selecting structural bundle anatomy. ## Problem and expected behavior An IPA containing only `Payload/Mobile.app/Info.plist` and a regular file `Payload/Mobile.app/Contents` must remain shallow/iOS. The current child-name lookup admits files and symlinks as directory conventions. `Versions` has the same issue; an exact-name file can also hide a differently cased real directory. ## Change and scope Select from the existing `tree.directories` index before applying anatomy-name preference. Reuse that directory selection for `Contents`, `Versions`, `Resources`, `MacOS` and `_CodeSignature`, so layout and its consumers share the same interpretation. Preserve explicit empty directories and implicit ancestors from archive entries; do not resolve symlinks. ## Contract and boundary impact - Semantic owner: `src/domain/apple/appleBundleAnatomy.ts`, after inventory identity is established. - Scope decision: not applicable; correction within existing static analysis. - CLI/MCP and tool catalog: unchanged inputs and schema; corrected layout/platform and retained metadata, executable and signing paths. - Evidence/provenance: exact paths, identities and coverage remain intact; projection digests follow the corrected result. - Providers, target authority, cleanup, generated metadata, package and installation: unchanged. No target execution or new capability. Expected effects: - [x] Read existing files or captured data. ## Evidence and regression coverage Executed public `inspect-artifact` → `project-apple-application-graph` calls with synthetic IPA inputs on base `f75b1a4` and this patch: | Input | Base | Patched | | --- | --- | --- | | Shallow Info.plist + regular `Contents` file | `macos-deep`, `macos`, null Info.plist | `shallow`, `ios`, `Payload/Mobile.app/Info.plist` | | Real `Contents/Info.plist` hierarchy | `macos-deep`, `macos`, deep Info.plist | unchanged | Both preserve complete inventory coverage. Nine regression cases cover file/symlink lookalikes, explicit empty directories, exact-name files hiding case-folded directories and nested structural lookups. The pre-fix regression run observed six failures; the final suite passes. Existing versioned-framework and `Versions/Current` uncertainty tests remain covered. ## Validation performed Windows x64, Node 24.18.0 and npm 11.16.0: - `npm run test:focused -- src/domain/apple/appleApplication.test.ts tests/boundary/filesystem/appleApplication.test.ts` — 36 passed. - `npm run check` — passed (typecheck, lint, formatting, Knip, metadata and architecture guards). - `npm run verify:test-discovery` — all 1,273 files discovered exactly once. - Public CLI reproduction and real-directory control above — passed. Full deterministic CI and real macOS/Hopper/Ghidra runs were not run locally; synthetic archives require none of these providers. No performance improvement is claimed. ## Compatibility, safety, and release No API/dependency changes or migration. Read-only inventory projection; no added network, process, mutation or protection-recovery behavior. ## Author readiness Human owner: @bnkaiteam Prepared with AI-agent assistance. Kept in draft pending the human owner's final review and readiness declaration. - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:09:26 +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#5788
No description provided.