[PR #3504] [CLOSED] fix(apple): classify launchd plists by owning directory #5787

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/3504
Author: @bnkaiteam
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/launchd-owning-directory


📝 Commits (1)

  • 1194429 fix(apple): classify launchd plists by owning directory

📊 Changes

2 files changed (+65 additions, -23 deletions)

View changed files

📝 src/domain/apple/appleApplication.ts (+14 -23)
📝 tests/boundary/filesystem/appleApplication.test.ts (+51 -0)

📄 Description

Summary

Fixes #3353. A plist in Contents/Library/LaunchAgents/ is currently reported as a daemon if any unrelated ancestor is named LaunchDaemons. Classify it from the directory that actually establishes its launchd role.

Problem and expected behavior

For LaunchDaemons/Sample.app/Contents/Library/LaunchAgents/task.plist, the expected domain is agent. Selection already recognizes the correct path tail, but a second interpretation searches the entire path and changes the result to daemon.

Change and scope

Determine membership and domain together with launchdDomain, using the existing anatomy tail matcher. Remove the separate ancestry search. Retain file, application-root, AppleDouble, extension and case-folding rules.

Contract and boundary impact

  • Semantic owner: Apple inventory projection in src/domain/apple/appleApplication.ts.
  • Scope decision: not applicable; a correction within existing static analysis.
  • CLI/MCP and tool catalog: same inputs and schema; corrected components.launchd_plists[].domain.
  • Evidence/provenance: exact paths, artifact identities and inventory coverage remain intact; the projection digest follows 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 the issue's public inspect-artifact → project-apple-application-graph workflow with synthetic ZIP inputs on the base (f75b1a4) and this patch:

Input Base Patched
LaunchDaemons/Sample.app/Contents/Library/LaunchAgents/task.plist daemon agent
Resources/Sample.app/Contents/Library/LaunchAgents/task.plist agent agent
Resources/Sample.app/Contents/Library/LaunchDaemons/task.plist daemon daemon

All retained the exact path and complete inventory coverage. The new real-ZIP boundary regression fails on the base (7 existing cases pass), and covers unrelated ancestors, nested applications, case-folded anatomy, an actual daemon and exclusion of non-direct children.

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 — 28 passed.
  • npm run check — passed (typecheck, lint, formatting, Knip, metadata and architecture guards).
  • Test discovery verifier — all 1,273 files discovered exactly once.
  • Public CLI reproduction and controls above — passed.

Full deterministic CI and real macOS/Hopper/Ghidra runs were not run locally; this change analyzes synthetic archived paths and does not use those 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/3504 **Author:** [@bnkaiteam](https://github.com/bnkaiteam) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/launchd-owning-directory` --- ### 📝 Commits (1) - [`1194429`](https://github.com/morluto/rea/commit/1194429517acb6cd46d7cc051d7b5ff431a9aeed) fix(apple): classify launchd plists by owning directory ### 📊 Changes **2 files changed** (+65 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/apple/appleApplication.ts` (+14 -23) 📝 `tests/boundary/filesystem/appleApplication.test.ts` (+51 -0) </details> ### 📄 Description ## Summary Fixes #3353. A plist in `Contents/Library/LaunchAgents/` is currently reported as a daemon if any unrelated ancestor is named `LaunchDaemons`. Classify it from the directory that actually establishes its launchd role. ## Problem and expected behavior For `LaunchDaemons/Sample.app/Contents/Library/LaunchAgents/task.plist`, the expected domain is `agent`. Selection already recognizes the correct path tail, but a second interpretation searches the entire path and changes the result to `daemon`. ## Change and scope Determine membership and domain together with `launchdDomain`, using the existing anatomy tail matcher. Remove the separate ancestry search. Retain file, application-root, AppleDouble, extension and case-folding rules. ## Contract and boundary impact - Semantic owner: Apple inventory projection in `src/domain/apple/appleApplication.ts`. - Scope decision: not applicable; a correction within existing static analysis. - CLI/MCP and tool catalog: same inputs and schema; corrected `components.launchd_plists[].domain`. - Evidence/provenance: exact paths, artifact identities and inventory coverage remain intact; the projection digest follows 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 the issue's public `inspect-artifact` → `project-apple-application-graph` workflow with synthetic ZIP inputs on the base (`f75b1a4`) and this patch: | Input | Base | Patched | | --- | --- | --- | | `LaunchDaemons/Sample.app/Contents/Library/LaunchAgents/task.plist` | `daemon` | `agent` | | `Resources/Sample.app/Contents/Library/LaunchAgents/task.plist` | `agent` | `agent` | | `Resources/Sample.app/Contents/Library/LaunchDaemons/task.plist` | `daemon` | `daemon` | All retained the exact path and complete inventory coverage. The new real-ZIP boundary regression fails on the base (7 existing cases pass), and covers unrelated ancestors, nested applications, case-folded anatomy, an actual daemon and exclusion of non-direct children. ## 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` — 28 passed. - `npm run check` — passed (typecheck, lint, formatting, Knip, metadata and architecture guards). - Test discovery verifier — all 1,273 files discovered exactly once. - Public CLI reproduction and controls above — passed. Full deterministic CI and real macOS/Hopper/Ghidra runs were not run locally; this change analyzes synthetic archived paths and does not use those 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#5787
No description provided.