[PR #4320] [MERGED] fix(native): report unidentified text plists as unknown #6169

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4320
Author: @Y0UW1SH
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @morluto

Base: main ← Head: fix/4294-plist-source-format


📝 Commits (3)

  • 3d09db2 fix(native): report unidentified text plists as unknown
  • a26197c fix(native): keep XML plists without a declaration labeled xml
  • 0f1ea4e fix(native): distinguish OpenStep data from XML source markup

📊 Changes

4 files changed (+318 additions, -5 deletions)

View changed files

📝 docs/native-investigation.md (+7 -0)
📝 src/native/NativeMacOSProvider.ts (+59 -5)
📝 tests/boundary/cli/nativePlistCli.test.ts (+97 -0)
➕ tests/boundary/providers/native/plistSourceFormat.test.ts (+155 -0)

📄 Description

Summary

Fixes #4294. inspect_plist.format now describes the selected source: OpenStep text, including a data-only value such as <deadbeef>, reports unknown instead of xml. Explicit XML and binary identities remain supported; an explicit JSON identity now reports the existing json variant.

Problem and expected behavior

Generic file -b text descriptions do not establish XML. Neither does plutil's XML conversion. The follow-up prefix probe also mistook OpenStep data delimiters for XML markup and missed BOM-marked UTF-16 XML without a declaration.

Change and scope

Keep source classification in NativeMacOSProvider.plistSourceFormat. Honor explicit identities, then inspect up to 4 KiB of generic text for XML markup using UTF-8 or a UTF-16 byte-order mark. A lone opening angle bracket or an unrecognized prefix remains unknown.

Add 14 provider-boundary cases and seven macOS CLI source-format cases. Preserve decoded values, selected paths, command provenance and conversion limitations. Update the owning documentation and split existing CLI test groups to meet the lint limit.

Contract and boundary impact

  • Semantic owner: native provider source-format classification.
  • Contribution scope: ordinary correction within existing static inspection; maintainer scope decision not applicable.
  • CLI/MCP schemas and arguments: unchanged. Incorrect XML labels become unknown; explicitly identified JSON uses the existing json enum.
  • Platform/provider: existing native macOS file and plutil paths.
  • Evidence: source identity remains separate from converted values; provenance and limitations are retained.
  • Authority/cleanup: selected-file reads and existing inspection subprocesses; the bounded probe closes its file handle.
  • Generated metadata, dependencies, packaging and installation: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.

The subprocesses are the existing inspection tools; the target application is not launched.

Evidence and regression coverage

On a26197c, six provider-boundary regressions failed for the expected format mismatch: three OpenStep data roots reported xml, explicit JSON reported unknown, and two declarationless UTF-16 XML sources reported unknown. Eight controls passed. All 14 pass after the fix.

The original reproduction also failed three OpenStep cases on base 1bd5c5c. Representative boundary results now retain format: "unknown" with value: {"Name":"Example","Items":["a","b"]}, or the data-only value {"$plist_type":"data","base64":"3q2+7w=="}. These provider assertions replay native command results; they are not a real macOS execution claim.

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Linux x64, Node 24.18.0/npm 11.16.0, locked dependencies:

  • npm run test:focused -- tests/boundary/providers/native/plistSourceFormat.test.ts src/native/parsers/plist.test.ts tests/boundary/cli/nativePlistCli.test.ts: build succeeded; 23 passed, 17 macOS-only CLI tests skipped. Repeated successfully after the final test typing correction.
  • npm run check: all six tasks and architecture guards passed; 0 lint errors and 1,521 existing warnings. The first run caught a test-table typing error, which was corrected before the passing run.
  • npm run verify:test-discovery: all 1,399 test files discovered exactly once.
  • node scripts/check-doc-facts.mjs and git diff --check: passed.
  • Independent review of the complete PR and follow-up diff: no actionable findings.

Current-head CI run 38874377490 passed at 0f1ea4e: static checks, source tests, all five portable test shards, package verification, documentation generation and the real Apple artifact CLI/MCP lane. The macOS job log confirms all 17 native plist CLI tests passed, including both data-only OpenStep regressions; its complete focused selection recorded 239 passed and 4 skipped.

A further review reran the local focused selection (23 passed, 17 macOS-only tests skipped locally) and exercised 14 additional standalone production-boundary probes against the compiled head: explicit JSON without the text word, generic JSON, quoted XML literals, OpenStep comments, oversized data roots, both UTF-16 data byte orders, XML processing instructions/doctype/scalar roots, UTF-8 BOM/whitespace, exhausted prefixes and unidentified non-text descriptions. All passed. These additional probes replay command results through the production runner seam; they do not claim real macOS tool execution. No code change was needed.

Coverage limits: real macOS execution is unavailable locally. The broader native-provider suite was previously blocked before its 46 tests by this host's process-ownership preparation. A fresh, independent Node child-process probe still makes ps -axo ... fail with exit 1 and fatal library error, lookup self. This is not reported as a passing broader suite. The focused plist boundary tests do run here.

Compatibility, safety, and release

No breaking schema, migration, dependency or release-metadata changes. The source probe is bounded and leaves an unrecognized prefix unknown. No target execution, injection or mutation is added. Real macOS plist coverage passed in the existing Apple CI lane; Hopper/Ghidra/IDA verification does not apply.

Author readiness

Human owner: @Y0UW1SH

  • 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.

Before merge

  • Concrete bug, linked issue, focused outcome and conventional title.
  • Existing inspection scope and authority retained.
  • Regression coverage and owning documentation updated.
  • Diff checked for unrelated changes, credentials, generated outputs and unsupported claims.
  • Required CI and real macOS checks pass on the latest head.
  • Human author readiness completed.

🔄 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/4320 **Author:** [@Y0UW1SH](https://github.com/Y0UW1SH) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/4294-plist-source-format` --- ### 📝 Commits (3) - [`3d09db2`](https://github.com/morluto/rea/commit/3d09db2a67015c6063e5bf37481c4923addf6112) fix(native): report unidentified text plists as unknown - [`a26197c`](https://github.com/morluto/rea/commit/a26197cd6cd7e7f3a701f47a421454e05505353a) fix(native): keep XML plists without a declaration labeled xml - [`0f1ea4e`](https://github.com/morluto/rea/commit/0f1ea4efe20ee95a74de56b8ce87da1fe0433c50) fix(native): distinguish OpenStep data from XML source markup ### 📊 Changes **4 files changed** (+318 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `docs/native-investigation.md` (+7 -0) 📝 `src/native/NativeMacOSProvider.ts` (+59 -5) 📝 `tests/boundary/cli/nativePlistCli.test.ts` (+97 -0) ➕ `tests/boundary/providers/native/plistSourceFormat.test.ts` (+155 -0) </details> ### 📄 Description ## Summary Fixes #4294. `inspect_plist.format` now describes the selected source: OpenStep text, including a data-only value such as `<deadbeef>`, reports `unknown` instead of `xml`. Explicit XML and binary identities remain supported; an explicit JSON identity now reports the existing `json` variant. ## Problem and expected behavior Generic `file -b` text descriptions do not establish XML. Neither does plutil's XML conversion. The follow-up prefix probe also mistook OpenStep data delimiters for XML markup and missed BOM-marked UTF-16 XML without a declaration. ## Change and scope Keep source classification in `NativeMacOSProvider.plistSourceFormat`. Honor explicit identities, then inspect up to 4 KiB of generic text for XML markup using UTF-8 or a UTF-16 byte-order mark. A lone opening angle bracket or an unrecognized prefix remains `unknown`. Add 14 provider-boundary cases and seven macOS CLI source-format cases. Preserve decoded values, selected paths, command provenance and conversion limitations. Update the owning documentation and split existing CLI test groups to meet the lint limit. ## Contract and boundary impact - Semantic owner: native provider source-format classification. - Contribution scope: ordinary correction within existing static inspection; maintainer scope decision not applicable. - CLI/MCP schemas and arguments: unchanged. Incorrect XML labels become `unknown`; explicitly identified JSON uses the existing `json` enum. - Platform/provider: existing native macOS `file` and `plutil` paths. - Evidence: source identity remains separate from converted values; provenance and limitations are retained. - Authority/cleanup: selected-file reads and existing inspection subprocesses; the bounded probe closes its file handle. - Generated metadata, dependencies, packaging and installation: none. Expected effects: - [x] Read existing files or captured data. - [x] Launch or attach to a process. The subprocesses are the existing inspection tools; the target application is not launched. ## Evidence and regression coverage On `a26197c`, six provider-boundary regressions failed for the expected format mismatch: three OpenStep data roots reported `xml`, explicit JSON reported `unknown`, and two declarationless UTF-16 XML sources reported `unknown`. Eight controls passed. All 14 pass after the fix. The original reproduction also failed three OpenStep cases on base `1bd5c5c`. Representative boundary results now retain `format: "unknown"` with `value: {"Name":"Example","Items":["a","b"]}`, or the data-only value `{"$plist_type":"data","base64":"3q2+7w=="}`. These provider assertions replay native command results; they are not a real macOS execution claim. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Linux x64, Node 24.18.0/npm 11.16.0, locked dependencies: - `npm run test:focused -- tests/boundary/providers/native/plistSourceFormat.test.ts src/native/parsers/plist.test.ts tests/boundary/cli/nativePlistCli.test.ts`: build succeeded; **23 passed, 17 macOS-only CLI tests skipped**. Repeated successfully after the final test typing correction. - `npm run check`: all six tasks and architecture guards passed; 0 lint errors and 1,521 existing warnings. The first run caught a test-table typing error, which was corrected before the passing run. - `npm run verify:test-discovery`: all 1,399 test files discovered exactly once. - `node scripts/check-doc-facts.mjs` and `git diff --check`: passed. - Independent review of the complete PR and follow-up diff: no actionable findings. Current-head [CI run 38874377490](https://github.com/morluto/rea/actions/runs/38874377490) passed at `0f1ea4e`: static checks, source tests, all five portable test shards, package verification, documentation generation and the real Apple artifact CLI/MCP lane. The [macOS job log](https://github.com/morluto/rea/actions/runs/38874377490/job/116886386031) confirms all **17 native plist CLI tests passed**, including both data-only OpenStep regressions; its complete focused selection recorded 239 passed and 4 skipped. A further review reran the local focused selection (23 passed, 17 macOS-only tests skipped locally) and exercised **14 additional standalone production-boundary probes** against the compiled head: explicit JSON without the text word, generic JSON, quoted XML literals, OpenStep comments, oversized data roots, both UTF-16 data byte orders, XML processing instructions/doctype/scalar roots, UTF-8 BOM/whitespace, exhausted prefixes and unidentified non-text descriptions. All passed. These additional probes replay command results through the production runner seam; they do not claim real macOS tool execution. No code change was needed. Coverage limits: real macOS execution is unavailable locally. The broader native-provider suite was previously blocked before its 46 tests by this host's process-ownership preparation. A fresh, independent Node child-process probe still makes `ps -axo ...` fail with exit 1 and `fatal library error, lookup self`. This is not reported as a passing broader suite. The focused plist boundary tests do run here. ## Compatibility, safety, and release No breaking schema, migration, dependency or release-metadata changes. The source probe is bounded and leaves an unrecognized prefix unknown. No target execution, injection or mutation is added. Real macOS plist coverage passed in the existing Apple CI lane; Hopper/Ghidra/IDA verification does not apply. ## Author readiness Human owner: @Y0UW1SH - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] Concrete bug, linked issue, focused outcome and conventional title. - [x] Existing inspection scope and authority retained. - [x] Regression coverage and owning documentation updated. - [x] Diff checked for unrelated changes, credentials, generated outputs and unsupported claims. - [x] Required CI and real macOS checks pass on the latest head. - [x] Human author readiness completed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12:23 +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#6169
No description provided.