Repository navigation
fix(native): report unidentified text plists as unknown - #4320
Conversation
Require explicit XML identification in file output instead of treating all text as XML. Preserve decoded plist values and source-format provenance when plutil falls back to XML conversion. Add provider-boundary regressions and real macOS CLI controls for OpenStep, data-bearing OpenStep, XML, UTF-16 XML and binary property lists. Fixes morluto#4294
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge, subject to the required CI and macOS checks. SummaryCorrects
The previous finding is fixed. This review used source inspection; it did not run tests or real macOS tools. Checking whether another PR replaces this one was blocked by missing GitHub authentication. Reviews (3) · Last reviewed commit: "fix(native): distinguish OpenStep data f..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d09db2a67
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
`file -b` names XML only when a document declaration is present, so the narrowed `\bXML\b` check reported a declaration-less XML plist as unknown and broke the real-plutil `decodes xml plists that plutil cannot express as JSON` CLI test. When `file` reports only text, read the source head once and label it XML only when its first non-whitespace character (after a UTF-8 BOM) is `<`; OpenStep and other text stay unknown. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
CI/conflict track. Fixed the Root cause: Fix: Test: Validation (macOS, real |
Recognize XML markup instead of treating every leading angle bracket as XML. Keep data-only OpenStep sources unknown, honor explicit JSON identification, and decode BOM-marked UTF-16 prefixes before detecting declarationless XML. Add source-format regressions and macOS CLI cases for data-only sources.
|
@kaoru0822-kitauji Following up on your CI repair: the remaining source-format findings are fixed in 0f1ea4e, while preserving your fix for declarationless XML.
The current-head CI run passed, including all five test shards and the real Apple lane. Its macOS log confirms all 17 native plist CLI tests passed. A fresh local rerun also passed 23 focused tests; the 17 macOS cases are skipped locally on Linux. Both review findings are resolved, and the latest Codex and Greptile reviews cover this head without outstanding findings. The PR description has the current evidence and limitations. Could you take another look at the current head when you have a chance? |
baron
left a comment
There was a problem hiding this comment.
Reviewed 0f1ea4efe20ee95a74de56b8ce87da1fe0433c50 across the source-format owner, plutil conversion/value parser and consumer output. No actionable source finding: explicit identities remain distinct from converted values, generic text only gets bounded markup recognition, UTF-16 BOM handling is at that boundary, and OpenStep data roots remain unknown. The probe closes its handle; provenance/limitations are retained. #4047's numeric-decoding change is conceptually compatible and does not replace this source classifier.
Executed in an isolated head snapshot with pinned Node 24.18.0 and an existing byte-identical-lock dependency tree: exact Vitest selection of tests/boundary/providers/native/plistSourceFormat.test.ts and src/native/parsers/plist.test.ts, 23/23 passed. Six separate real macOS /usr/bin/file + /usr/bin/plutil controls confirmed ASCII OpenStep dictionary/data/empty-data classification and declarationless UTF-8/UTF-16 LE/BE conversion. Those controls are real tool evidence, not a public REA CLI/MCP run. No build/install/full check, compiled CLI/MCP or disassembler/client verification was performed locally.
HOLD, not approval: open/non-draft, MERGEABLE/CLEAN, all 35 listed check runs pass or are legitimate skips, including the real Apple artifact lane. However, there is no current-head PR readiness status/check. The human declaration is filled but does not replace that CI gate; please run the readiness workflow before approval.
Summary
Fixes #4294.
inspect_plist.formatnow describes the selected source: OpenStep text, including a data-only value such as<deadbeef>, reportsunknowninstead ofxml. Explicit XML and binary identities remain supported; an explicit JSON identity now reports the existingjsonvariant.Problem and expected behavior
Generic
file -btext 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 remainsunknown.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
unknown; explicitly identified JSON uses the existingjsonenum.fileandplutilpaths.Expected effects:
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 reportedxml, explicit JSON reportedunknown, and two declarationless UTF-16 XML sources reportedunknown. Eight controls passed. All 14 pass after the fix.The original reproduction also failed three OpenStep cases on base
1bd5c5c. Representative boundary results now retainformat: "unknown"withvalue: {"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.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.mjsandgit diff --check: passed.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 andfatal 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
Before merge