Repository navigation
Conversation
Decode real text and CDATA from the existing XML preflight DOM. Retain number facts at that boundary and remove the duplicate XML number scan so value decoding and integer/real classification agree. Keep original archive identity and ambiguous numeric origins intact. Fixes morluto#4042
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; the previous app-opening issue is fixed and no new blocking issue was found. SummaryPreserves XML real values split across ordinary text and CDATA. Shared XML parsing now supplies number facts to plist consumers.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Original XML] --> B[Shared XML parser]
B --> C[Number facts]
B --> D[Compact real text]
D --> E[Pinned value decoder]
C --> F[Number projection]
E --> F
F --> G[CLI and MCP results]
Reviews (5) · Last reviewed commit: "fix(plist): avoid bigint metadata round ..." · Reviewed by Greptile |
|
Author readiness declaration — human owner: @JFSAS I have reviewed the final diff at I have checked the validation evidence, confirmed that it supports the change, and understand the documented limitations and remaining verification gaps. I declare this PR ready for initial maintainer review. This declaration is posted by my assistant at my explicit request. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e31f5c59e7
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Normalize each parsed real to a bounded exponential literal instead of escaping its original character data for the second XML parse. Keep signed zero and numeric provenance while dropping replaced spans. Cover expansion at the real decoder boundary and retain numeric round trips and neighboring source content.
Merge main at a40ee74 and retain its prototype-key omission counts. Keep the shared number-facts contract and align the two new OpenStep assertions with it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a33f082970
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Retain upstream binary integer decoding, overlap validation, and budgets. Route keyed archive and Interface Builder XML consumers through the shared DOM-owned number facts without restoring the old scanner. Extend the existing Interface Builder CLI case to preserve exact integer attributes alongside mixed-text and pure-CDATA real values.
Retain exact decimal metadata as normalized source text rather than converting it to BigInt and back. Use Number only for the existing rounded-value association, preserving signed and zero-padded integers. This removes costly arbitrary-precision work from shared XML consumers, including app opening with unrelated large Info.plist integers.
There was a problem hiding this comment.
Source review at 43be57a7d37305d6837195eff9ecb8dfd62d0a63: the structural direction is sound: the format-aware preflight DOM owns real character data and numeric facts; keyed-archive, Interface Builder and XML fallback consume those facts. The raw archive scanner/entity helper is removed, source bytes remain untouched, and uncertain integer/real associations remain conservative. The native JSON path's retained scanner is still live and consumes canonical plutil conversion output, so I am not repeating the previously resolved dead-code finding. The decimal collector also removes the added BigInt round trip rather than bypassing it in one consumer. No new actionable source finding identified.
Overlap: #4530 fixes the helper this PR deletes; do not restore that obsolete interpretation merely to retain its helper-only regression. #4320 owns source-format classification, not numeric decoding, and is conceptually compatible.
HOLD, not approval: GitHub currently reports CONFLICTING/DIRTY against main. All 34 current-head listed checks pass or are legitimate skips, but no PR readiness status/check is present (the human declarations themselves are filled). Reconcile the current-base conflicts/overlap and obtain applicable CI/readiness for the resulting head. Follow-up with the coordinated byte-identical-lock dependency tree and pinned Node 24.18.0: exact Vitest source selection of src/domain/propertyListKeys.test.ts, src/native/parsers/plist.test.ts and src/artifacts/apple/PlistNumberLiterals.test.ts, 73/73 passed. No build/typecheck/install was run in this lane. Existing reported CLI/stdio MCP and capacity measurements were inspected, not rerun; no new real-provider/client/performance claim.
|
Thank you for the real/CDATA work and the shared-parser follow-up. The original #4042 defect was addressed on main in 7aa4b98, but the current PR also changes numeric fact ownership across plist consumers and app-bundle integer handling. I am keeping it open for review of that broader remaining work. If you would like to continue, could you identify the concrete cases still differing from current main and focus the diff and regressions around them? I did not run the plist workflows in this pass. |
Summary
Fixes #4042. Keyed-archive inspection now retains
1.25from both<real>1<![CDATA[.25]]></real>and<real><![CDATA[1.25]]></real>through CLI and MCP. Previously these became1or an unknown non-finite real, while plain XML and native binary conversions were correct.Change and scope
Reuse the existing XML preflight DOM to own real character data and numeric facts. Normalize each parsed real to a round-trippable exponential literal (at most 24 ASCII characters), removing its original character-data spans before the pinned value decoder. This eliminates CDATA entity expansion while retaining signed zero, literal-entity meaning and neighboring source line endings. XML consumers use those parsed number facts; remove the superseded raw XML number scanner and its entity decoder. The collector is shared with the upstream binary-number interpretation. It retains exact decimal text by normalizing its sign and leading zeroes, and uses
Numberonly for the rounded-value association. This removes the unnecessaryBigIntparse/format round trip from every consumer, including app Info.plist resolution.Integer/real collisions remain ambiguous. Original archive bytes/digests, object identities, references, selection and limits remain intact. No adapter-specific value repair, dependency upgrade or new tool is introduced. The native JSON path continues to use its existing canonical plutil conversion.
Related #3426 and #3475 change this same XML boundary for keys and hexadecimal integers. This PR addresses real character data and does not incorporate their separate behavior changes.
The upstream OpenStep omission-count fix from #4105 is retained alongside the shared
numberLiteralsresult. The merge also preserves #4324's 128-bit binary integer decoding, overlap validation and decode budgets. Both keyed-archive and Interface Builder consumers receive XML number facts from the shared DOM parser; the new upstream Interface Builder caller does not restore the superseded XML scanner. Its existing CLI regression now checks exact integer attributes alongside mixed-text and pure-CDATA reals.Contract and boundary impact
parseXmlPropertyList; consumers receive numeric facts alongside decoded values.Expected effect:
Evidence and validation
Validated head
43be57a7d37305d6837195eff9ecb8dfd62d0a63on main4838f444939677107902549c59b73439e14d3ae9; original base337d2e33c5aae40f20c64584c341a3593420b8e0; macOS arm64, Node 24.18.0 / npm 11.16.0.plutilcontrols independently returned1.25, and the original four-case replay passed all eight CLI/MCP checks with unchanged source bytes and matching Evidence digests. Current-head CLI/stdio MCP acceptance tests again pass XML and binary controls.npm run check: passed typecheck, lint, formatting, knip, metadata, resolved module boundaries and architecture guards.npm run docs:check: passed, including five consistency tests.npm run verify:test-discovery: all 1,442 test files discovered exactly once.git diff --check: passed.a33f08297, a public CLI/stdio MCP OpenStep smoke retained the neighboring value, reported one omitted__proto__entry, and preserved source bytes and digest. Current-head parser tests continue to cover that behavior.Numeric metadata resource regression
The app-opening review finding is valid and addressed in
43be57a7d. Adding numeric facts to the shared XML parser exposed unrelated Info.plist integers to an unnecessary arbitrary-precision parse/format round trip. Decimal metadata needs canonical source text and a rounded numeric key; it does not need a BigInt representation. The fix removes that representation in the shared collector, preserving all callers and avoiding a caller-specific bypass or arbitrary digit cutoff.resolveAppBundleExecutablewith a 5,000,000-digit unrelated integer. A scoped conversion guard fails on the previous head and passes after the fix; it does not depend on a timing threshold.Whole-workflow observations compare
25acccc40with this fix using a 5,000,120-byte Info.plist. CLI runsanalyze; stdio MCP performs initialize/open/shutdown. Both intentionally stop at the same unknown-provider diagnostic after resolving the app, so no disassembler starts. Output and original source bytes match in every run.Versions alternate; separate Node compile caches are cold on first use and warm afterward. OS disk caches were not forced cold. CPU is
wait4user/system including waited children. Process-family RSS is sampled every 10 ms pluspsoverhead and may miss brief peaks. CLI wall time varied substantially on the shared host, and RSS did not uniformly decrease. Output remains 2,489 bytes for CLI and 2,462 for MCP. Agent-token use was not measured. This removes the added arbitrary-precision work; file reading and DOM parsing still scale with input, and no new total Info.plist size or resident-memory cap is claimed.Earlier CDATA resource and performance evidence
The resource and performance measurements below were executed at
44da0cf8f, before the upstream merges. The current merge preserves the XML real normalization implementation and retains upstream binary-width handling. These timings and near-limit capacity probes were not rerun at the current head.The P1 review finding was reproduced on
e31f5c59e: a 262,472-byte archive reached the second real XML parser as 1,311,036 bytes. The new production-boundary regression invokes both real parsers and fails on that expansion. After this change, the second parser receives 319 bytes for the same archive. The entity-escaping path has been removed.A 66,060,616-byte (63 MiB payload) self-authored archive also completed through the public CLI and real stdio MCP, each with a 512 MiB JavaScript heap setting and 30-second deadline. Both returned the expected value and original digest, with source bytes unchanged. The corresponding owner probe's second parse was still 319 bytes. The old near-limit case was not executed. A seeded 2,007-value round-trip check matched the previous plain-text decoder, including negative zero, subnormals, extreme finite values and non-finite values.
The following whole-workflow measurements compare
e31f5c59ewith this fix on a 1,048,904-byte archive containing entity-like CDATA. This is well-formed XML admitted by the pinned decoder; it does not establish that Apple accepts the numeric suffix. Each run is a complete fresh CLI invocation or stdio MCP connection plus open/inspect/close. Separate Node compile caches were cold for the first run and warm for four subsequent alternating runs; OS disk caches were not forced cold.CPU uses
wait4user/system accounting for the process and waited children. Family RSS is sampled every 10 ms pluspsoverhead, so brief peaks may be missed. Normalized results match exactly; complete stdout remains 2,352 bytes for CLI and 2,351 for MCP. No real-agent run or agent-token measurement was performed. These samples do not establish a universal speedup or total resident-memory cap. The initial DOM/input cost remains subject to the existing acquisition and depth boundaries; no entity-expansion cleanup remains.Compatibility and limitations
No migration or public schema change. Binary and OpenStep decoding retain their existing routes. Malformed nested numeric content remains explicitly incomplete. Tests use self-authored artifacts; frequency in real applications, Linux/Windows behavior and the full CI suite have not been established locally. No real disassembler coverage is claimed. Prepared with AI assistance.
Author readiness
Human owner: @JFSAS