Repository navigation
fix(plist): decode formatted XML dictionary keys - #1843
Merged
Merged
Conversation
2 tasks done
Owner
|
@greptileai review |
Contributor
|
morluto
marked this pull request as ready for review
October 13, 2026 11:48
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. |
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow up the XML dictionary-key handling accepted in #885 and #894. Valid key formatting currently makes an otherwise readable Foundation archive fail entirely instead of retaining ordinary values and reporting the existing
__proto__omission.No separate issue was opened: this PR includes an executed reproducer of the existing contract regression. Open and closed plist/XML contributions were checked for overlap.
Problem and expected behavior
On main
0b4ce83618bb800627264ae6221e2e35140417b5, each of these legal XML representations bypasses the regular-expression substitution:<key >__proto__</key >><key>__proto__<!-- trailing comment --></key><key><![CDATA[__proto__]]><!-- trailing comment --></key>The compiled
inspect-keyed-archiveCLI exits 1 withartifact_operation_failed, reasonformat, and the plist decoder's prototype-key rejection. The same failure reaches the real SDK MCP workflow. The exact-tag control succeeds. Python's standard plist reader independently accepts the inert reproducer files with equivalent dictionaries.Expected: use the same key interpretation as the pinned plist decoder, retain unrelated evidence and report the omission count already required by #885/#894.
Change and scope
Replace the key-matching regex with the existing pinned xmldom parser's element identity and source locations. Reserve the placeholder against decoded first-child key values, then insert a CDATA placeholder before each rejected first child. The plist decoder remains responsible for value interpretation.
Source edits operate on the producer's line-normalized XML, without serializing the DOM. This keeps character references such as
,…and
intact rather than turning their decoded values into normalized newlines. Source locations are reached with one forward scan, without allocating an offset for every newline. Existing OpenStep autodetection is preserved.This does not expand plist syntax, change the decoder's first-child key semantics, change binary-plist handling, or introduce a new omission policy.
Contract and boundary impact
Evidence and regression coverage
Four newly covered key forms fail against pristine production source; existing controls pass.
Both new compiled CLI and SDK MCP tests fail against pristine source, then pass with the fix. Their inert fixture asserts the original byte digest, root identity, nested ordinary values, character-reference preservation, placeholder collision handling and two reported omissions.
Domain regressions cover source positions across literal newline forms, OpenStep compatibility, first-child semantics and newline-dense input.
Independent review exercised 500 deterministic differential cases, 16 malformed-input comparisons, typed values, entities, comments/processing instructions, Unicode offsets and actual OpenStep app-bundle resolution.
Representative final result: object 1 retains
kept: "a\rb\u0085c\u2028d", the ordinary__rea_prototype_key__field andnested: { value: 7 }; limitations report2 dictionary entries keyed __proto__ were omitted because REA results cannot represent that key.Observed, derived, and inferred claims remain distinguishable.
Artifact identity and source provenance remain preserved.
Omitted or unavailable information remains visible.
Validation performed
Linux, pinned Node 24.18.0 and npm 11.16.0:
npm ci— passed.npm run test:focused -- src/domain/propertyListKeys.test.ts src/artifacts/apple/KeyedArchiveReader.test.ts tests/boundary/cli/keyedArchivePrototypeKeyCli.test.ts tests/boundary/mcp/keyedArchivePrototypeKeyMcp.test.ts tests/boundary/filesystem/binaryTarget.test.ts tests/boundary/filesystem/interfaceBuilderBundle.test.ts tests/boundary/providers/native/keyedArchiveEncoding.test.ts tests/boundary/providers/native/nativeProvider.test.ts— 138 passed, 25 platform-dependent skips across eight files.npm run check— passed; 753 existing lint warnings, no errors.npm run docs:check— passed.npm run verify:test-discovery— all 838 files discovered exactly once; this is discovery, not full-suite execution.git diff --cached --check— passed.npm run test:fast— 4,457 passed, 3 skipped, 11 failed across two Hopper lease/cleanup files. All 11 failures reproduce with pristine production source in this cloud environment: Unix-domain socket binding is denied withlisten EPERM, with two cleanup cases failing downstream. This is not a full-suite pass; no socket restriction was bypassed.Remote CI status
At publication, CI run 38145874828 for head
4dad5b36f153e48a624bbf5239b9637f85fd0feereportsaction_required: maintainer approval is needed before execution. The run has zero jobs and the commit has zero check runs. This draft is not claiming remote CI passed.Compatibility, safety, and release
Review checklist
AI-assisted implementation and independent review; all validation claims above refer to executed checks.