[PR #2133] [MERGED] fix(target): recognize binary plists by magic under any extension #5051

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2133
Author: @kaoru0822-kitauji
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @morluto

Base: main ← Head: fix/issue-2129


📝 Commits (2)

  • d5ea18e fix(target): recognize binary plists by magic under any extension
  • 7346e82 Merge remote-tracking branch 'origin/main' into fix/issue-2129

📊 Changes

2 files changed (+14 additions, -0 deletions)

View changed files

📝 src/application/BinaryTargetResolver.ts (+3 -0)
📝 tests/boundary/filesystem/binaryTarget.test.ts (+11 -0)

📄 Description

Summary

Target resolution admitted a property list only when its name ended in .plist. Keyed archives under other names were rejected as unsupported binary format before any plist tool ran. Example: TextStylePreviewCache.archive in iMovie's TextFramework, which file reports as "Apple binary property list". detectArtifactFormat already reads the first 8 bytes; it now classifies bplist00 as plist, as the artifact inventory's classifyArtifactBytes does.

Fixes #2129

Before / after

$ rea inspect-keyed-archive …/TextFramework.framework/Versions/A/Resources/TextStylePreviewCache.archive --format json
before: {"code":"target_unavailable","message":"Cannot open artifact: unsupported binary format.", …}
after:  Evidence with subject.format "plist" and the archive's roots/objects/references

A binary plist converted to x.data now gets the same inspect-plist result as the same bytes named x.plist. Only the bplist00 magic is used. XML plists still need the .plist name, because an XML prefix alone does not identify a plist.

Validation

  • New boundary test classifies a binary plist by its magic under any extension (tests/boundary/filesystem/binaryTarget.test.ts). It fails on main and passes with this change; all 48 tests in the file pass.
  • npm run lint passes.
  • npm test: 9150 passed, 15 failed in 8 files. These are the same 8 files and 15 tests that fail on clean origin/main c22111eca on this host. Most are environmental (no Hopper, Command Line Tools only, hdiutil, inspector target locations). promptCompletion.test.ts is the main regression tracked in #2123.

🤖 Generated with Claude Code


🔄 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/2133 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/issue-2129` --- ### 📝 Commits (2) - [`d5ea18e`](https://github.com/morluto/rea/commit/d5ea18e2dba88151165069aac9dd76abbd697ec9) fix(target): recognize binary plists by magic under any extension - [`7346e82`](https://github.com/morluto/rea/commit/7346e82b2273d1b39a370807fff7a4371310eb9e) Merge remote-tracking branch 'origin/main' into fix/issue-2129 ### 📊 Changes **2 files changed** (+14 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/application/BinaryTargetResolver.ts` (+3 -0) 📝 `tests/boundary/filesystem/binaryTarget.test.ts` (+11 -0) </details> ### 📄 Description ## Summary Target resolution admitted a property list only when its name ended in `.plist`. Keyed archives under other names were rejected as `unsupported binary format` before any plist tool ran. Example: `TextStylePreviewCache.archive` in iMovie's TextFramework, which `file` reports as "Apple binary property list". `detectArtifactFormat` already reads the first 8 bytes; it now classifies `bplist00` as `plist`, as the artifact inventory's `classifyArtifactBytes` does. Fixes #2129 ## Before / after ```text $ rea inspect-keyed-archive …/TextFramework.framework/Versions/A/Resources/TextStylePreviewCache.archive --format json before: {"code":"target_unavailable","message":"Cannot open artifact: unsupported binary format.", …} after: Evidence with subject.format "plist" and the archive's roots/objects/references ``` A binary plist converted to `x.data` now gets the same `inspect-plist` result as the same bytes named `x.plist`. Only the `bplist00` magic is used. XML plists still need the `.plist` name, because an XML prefix alone does not identify a plist. ## Validation - New boundary test `classifies a binary plist by its magic under any extension` (`tests/boundary/filesystem/binaryTarget.test.ts`). It fails on main and passes with this change; all 48 tests in the file pass. - `npm run lint` passes. - `npm test`: 9150 passed, 15 failed in 8 files. These are the same 8 files and 15 tests that fail on clean `origin/main` c22111eca on this host. Most are environmental (no Hopper, Command Line Tools only, `hdiutil`, inspector target locations). `promptCompletion.test.ts` is the main regression tracked in #2123. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:01:05 +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#5051
No description provided.