Repository navigation
refactor(plist): report property-list and keyed-archive failures through ParseFailure - #10822
Merged
morluto merged 3 commits intoNov 15, 2026
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
[Medium impact] The reviewed changes appear safe to merge. SummaryMoves plist, keyed-archive, and Kuna document failures onto
No new actionable issues were found. This was a source review; tests were not rerun. Live supersession status could not be checked because GitHub authentication was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Plist and archive readers] --> B[ParseFailureError]
B --> C{Failure kind}
C -->|limit| D[Report a limit or omit the archive]
C -->|malformed| E[Report invalid content]
C -->|unsupported| F[Keep unsupported-content details]
Reviews (4) · Last reviewed commit: "refactor(plist): report plist decode bud..." · Reviewed by Greptile |
22 tasks
…10824) * refactor(kuna): report Kuna document failures through ParseFailure * test(kuna): pin the limit and malformed facts of Kuna document failures
22 tasks
…0842) * refactor(plist): report plist decode budgets through ParseFailure The plist preflight owner throws a ParseFailure limit (plist-decode-bytes) for its byte budget, the shared PlistNestingLimitError for nesting depth, and a malformed failure for a reference cycle, instead of a per-format PropertyListDecodeBudgetFailure whose meaning each caller re-mapped through a fail callback. The fail option, PropertyListDecodeBudgetFailure and interfaceBuilderDecodeBudgetFailure are removed; the parser-format-failure-class baseline reaches zero. * refactor(plist): report keyed-archive allowances as typed limit failures (#10844) keyedArchive.ts and decodeKeyedArchiveBytes throw decodeLimit parse failures (keyed-archive-bytes, -object-table-entries, -values-per-object, -reference-edges) and malformed parse failures instead of plain RangeError/TypeError. KeyedArchiveReader no longer classifies every RangeError as a limit: only a limit parse failure or a host stack/capacity limit is one. The unreachable 128-level scan nesting check is removed; projectPlistValue already refuses the archive first.
morluto
merged commit Nov 15, 2026
9449e97
into
refactor/parse-failure-baselined-classes
1 check passed
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…ugh ParseFailure (#10822) * refactor(plist): report property-list and keyed-archive failures through ParseFailure * refactor(kuna): report Kuna document failures through ParseFailure (#10824) * refactor(kuna): report Kuna document failures through ParseFailure * test(kuna): pin the limit and malformed facts of Kuna document failures * refactor(plist): report plist decode budgets through ParseFailure (#10842) * refactor(plist): report plist decode budgets through ParseFailure The plist preflight owner throws a ParseFailure limit (plist-decode-bytes) for its byte budget, the shared PlistNestingLimitError for nesting depth, and a malformed failure for a reference cycle, instead of a per-format PropertyListDecodeBudgetFailure whose meaning each caller re-mapped through a fail callback. The fail option, PropertyListDecodeBudgetFailure and interfaceBuilderDecodeBudgetFailure are removed; the parser-format-failure-class baseline reaches zero. * refactor(plist): report keyed-archive allowances as typed limit failures (#10844) keyedArchive.ts and decodeKeyedArchiveBytes throw decodeLimit parse failures (keyed-archive-bytes, -object-table-entries, -values-per-object, -reference-edges) and malformed parse failures instead of plain RangeError/TypeError. KeyedArchiveReader no longer classifies every RangeError as a limit: only a limit parse failure or a host stack/capacity limit is one. The unreachable 128-level scan nesting check is removed; projectPlistValue already refuses the archive first.
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…graph failure classes (#10818) * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes * refactor(plist): report property-list and keyed-archive failures through ParseFailure (#10822) * refactor(plist): report property-list and keyed-archive failures through ParseFailure * refactor(kuna): report Kuna document failures through ParseFailure (#10824) * refactor(kuna): report Kuna document failures through ParseFailure * test(kuna): pin the limit and malformed facts of Kuna document failures * refactor(plist): report plist decode budgets through ParseFailure (#10842) * refactor(plist): report plist decode budgets through ParseFailure The plist preflight owner throws a ParseFailure limit (plist-decode-bytes) for its byte budget, the shared PlistNestingLimitError for nesting depth, and a malformed failure for a reference cycle, instead of a per-format PropertyListDecodeBudgetFailure whose meaning each caller re-mapped through a fail callback. The fail option, PropertyListDecodeBudgetFailure and interfaceBuilderDecodeBudgetFailure are removed; the parser-format-failure-class baseline reaches zero. * refactor(plist): report keyed-archive allowances as typed limit failures (#10844) keyedArchive.ts and decodeKeyedArchiveBytes throw decodeLimit parse failures (keyed-archive-bytes, -object-table-entries, -values-per-object, -reference-edges) and malformed parse failures instead of plain RangeError/TypeError. KeyedArchiveReader no longer classifies every RangeError as a limit: only a limit parse failure or a host stack/capacity limit is one. The unreachable 128-level scan nesting check is removed; projectPlistValue already refuses the archive first.
12 tasks
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…10714) * refactor(macho): name load-command codes through the shared LC table * refactor(macho): name version-min and string commands through the shared tables * refactor(parsers): report XML, web artifact and Mach-O failures through ParseFailure (#10760) * refactor(parsers): report XML, web artifact and Mach-O failures through ParseFailure * refactor(xml): type XML parse failures as malformed or unsupported only * refactor(parsers): catch per-format document and source failure classes (#10794) * refactor(parsers): report apktool strings and XML plist source failures through ParseFailure * refactor(apktool): drop the unused ParseFailureError import * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes (#10818) * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes * refactor(plist): report property-list and keyed-archive failures through ParseFailure (#10822) * refactor(plist): report property-list and keyed-archive failures through ParseFailure * refactor(kuna): report Kuna document failures through ParseFailure (#10824) * refactor(kuna): report Kuna document failures through ParseFailure * test(kuna): pin the limit and malformed facts of Kuna document failures * refactor(plist): report plist decode budgets through ParseFailure (#10842) * refactor(plist): report plist decode budgets through ParseFailure The plist preflight owner throws a ParseFailure limit (plist-decode-bytes) for its byte budget, the shared PlistNestingLimitError for nesting depth, and a malformed failure for a reference cycle, instead of a per-format PropertyListDecodeBudgetFailure whose meaning each caller re-mapped through a fail callback. The fail option, PropertyListDecodeBudgetFailure and interfaceBuilderDecodeBudgetFailure are removed; the parser-format-failure-class baseline reaches zero. * refactor(plist): report keyed-archive allowances as typed limit failures (#10844) keyedArchive.ts and decodeKeyedArchiveBytes throw decodeLimit parse failures (keyed-archive-bytes, -object-table-entries, -values-per-object, -reference-edges) and malformed parse failures instead of plain RangeError/TypeError. KeyedArchiveReader no longer classifies every RangeError as a limit: only a limit parse failure or a host stack/capacity limit is one. The unreachable 128-level scan nesting check is removed; projectPlistValue already refuses the archive first. * test(plist): expect the nesting limit as its ParseFailure carrier * refactor(plist): report plist and NIBArchive input faults through ParseFailure and defects through invariantViolation (#10895) * refactor(plist): report plist and NIBArchive input faults through ParseFailure and defects through invariantViolation * fix(plist): report a cut-short NIB header or plist length record as truncated * fix(native): project the selected Mach-O's parse failures through the shared owner nativeMachoSourcePrimary mapped every non-limit ParseFailureError to AnalysisOutputError, so a malformed or truncated selected Mach-O was reported as unreadable tool output and an unsupported one lost its category. It now uses parseFailureAnalysisError like the ELF, Go and other byte-format providers: malformed and truncated bytes are an invalid path, unsupported bytes an unsupported target, and a limit still falls through to its producer's budget.
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…10874) * refactor(macho): name load-command codes through the shared LC table * refactor(macho): name version-min and string commands through the shared tables * refactor(parsers): report XML, web artifact and Mach-O failures through ParseFailure (#10760) * refactor(parsers): report XML, web artifact and Mach-O failures through ParseFailure * refactor(xml): type XML parse failures as malformed or unsupported only * refactor(parsers): catch per-format document and source failure classes (#10794) * refactor(parsers): report apktool strings and XML plist source failures through ParseFailure * refactor(apktool): drop the unused ParseFailureError import * refactor(native): select ELF sections through the keyed owner * test(native): pin returned exports and versions for repeated version sections * refactor(nativeaot): read neither of repeated frozen object regions (#10790) * refactor(nativeaot): read neither of repeated frozen object regions through the keyed owner * refactor(parsers): retire every first-match section lookup (#10793) * fix(nativeaot): report an ambiguous frozen object region as partial (#10812) * refactor(native): select program headers and load commands through the keyed owner (#10827) * refactor(native): select the GOT base and dependency segments through the keyed owner (#10847) * refactor(native): select the GOT base and dependency segments through the keyed owner resolveGotBase selects the SHT_DYNAMIC section and the allocated .got.plt/.got sections with uniqueKeyed, so a repeat leaves the GOT base unknown instead of taking the first match; elfDependencies reads PT_LOAD segments through the same keyed program table as PT_DYNAMIC. A new keyed-first-match guard recognizes a find/findLast or filter-then-[0] whose predicate compares a key field, whatever the table is called; existing matches are baselined. The unwind fixture can declare PT_DYNAMIC headers and repeated .dynamic/.got.plt sections. * test(native): pin the PT_DYNAMIC path and destructured keyed lookups The keyed-first-match guard moves to scripts/verify/keyed-first-match.mjs with focused tests, and now recognizes a destructured key in any position and a destructured filter predicate. The single PT_DYNAMIC unwind test declares .dynamic as SHT_PROGBITS so only the program header supplies DT_PLTGOT, and asserts the resolved ranges. * fix(macho): refuse repeated chained-fixup and dyld-info tables (#10850) parseMachoLayout kept the last LC_DYLD_CHAINED_FIXUPS range and merged the rebase/bind streams of every LC_DYLD_INFO(_ONLY) command. A repeat now refuses the slice as malformed. NativeMachoInspection's chained import-name reader already declined repeated LC_DYLD_CHAINED_FIXUPS; that rule is now covered by a test. * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes (#10818) * refactor(parsers): retire the Mach-O, source-map, NDJSON and managed-graph failure classes * refactor(plist): report property-list and keyed-archive failures through ParseFailure (#10822) * refactor(plist): report property-list and keyed-archive failures through ParseFailure * refactor(kuna): report Kuna document failures through ParseFailure (#10824) * refactor(kuna): report Kuna document failures through ParseFailure * test(kuna): pin the limit and malformed facts of Kuna document failures * refactor(plist): report plist decode budgets through ParseFailure (#10842) * refactor(plist): report plist decode budgets through ParseFailure The plist preflight owner throws a ParseFailure limit (plist-decode-bytes) for its byte budget, the shared PlistNestingLimitError for nesting depth, and a malformed failure for a reference cycle, instead of a per-format PropertyListDecodeBudgetFailure whose meaning each caller re-mapped through a fail callback. The fail option, PropertyListDecodeBudgetFailure and interfaceBuilderDecodeBudgetFailure are removed; the parser-format-failure-class baseline reaches zero. * refactor(plist): report keyed-archive allowances as typed limit failures (#10844) keyedArchive.ts and decodeKeyedArchiveBytes throw decodeLimit parse failures (keyed-archive-bytes, -object-table-entries, -values-per-object, -reference-edges) and malformed parse failures instead of plain RangeError/TypeError. KeyedArchiveReader no longer classifies every RangeError as a limit: only a limit parse failure or a host stack/capacity limit is one. The unreachable 128-level scan nesting check is removed; projectPlistValue already refuses the archive first. * test(plist): expect the nesting limit as its ParseFailure carrier * fix(verify): count a filter index only on the filter's own result * refactor(macho): select slices through one owner with typed refusals * refactor(keyed): select FIT properties and certificate extensions through uniqueKeyed * refactor(keyed): key each FIT node once, pin repeated FIT properties and subjectKeyIdentifiers, and type the unknown Mach-O header as unsupported * refactor(plist): report plist and NIBArchive input faults through ParseFailure and defects through invariantViolation (#10895) * refactor(plist): report plist and NIBArchive input faults through ParseFailure and defects through invariantViolation * fix(plist): report a cut-short NIB header or plist length record as truncated * fix(native): project the selected Mach-O's parse failures through the shared owner nativeMachoSourcePrimary mapped every non-limit ParseFailureError to AnalysisOutputError, so a malformed or truncated selected Mach-O was reported as unreadable tool output and an unsupported one lost its category. It now uses parseFailureAnalysisError like the ELF, Go and other byte-format providers: malformed and truncated bytes are an invalid path, unsupported bytes an unsupported target, and a limit still falls through to its producer's budget.
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
The six property-list and keyed-archive failure classes now extend
ParseFailureErrorwith an explicit kind, and theparser-format-failure-classguard now also matches any*Plist*,*PropertyList*or*Archive*failure class built on a host error. Refs plan W7; stacked on #10818.Problem and expected behavior
XmlPlistTextDecodeErrorwas baselined;XmlPlistDataError,PlistNestingLimitError,OpenStepPropertyListError,KeyedArchiveKindErrorandUnsupportedBinaryPlistUidErrorrestated the same algebra but escaped the guard because their names do not end in Format/Parse/Decode/etc. Two catch sites read "limit" frominstanceof RangeErroronly becausePlistNestingLimitErrorextendedRangeError.Expected: each class says which
ParseFailurekind it is, consumers read that kind, and a new plist/archive class built on a host error fails the guard.Change and scope
Each class keeps its name and its format-specific facts (
reason,code,position,maximumDepth,decimalValue,sourceWidth,declaredEncoding,characterOffset), and now extendsParseFailureError:XmlPlistTextDecodeErrorunsupported(undecoded content) forunsupported-encoding;malformedotherwiseXmlPlistDataErrorunsupportedforsource-location;malformedotherwisePlistNestingLimitErrorlimit(plist-nesting-depth,maximumDepth)OpenStepPropertyListErrormalformedKeyedArchiveKindErrorunsupportedUnsupportedBinaryPlistUidErrorunsupported(undecoded content)KeyedArchiveKindError.kindis renamedfileKind, becausekindis now the shared failure kind. Its one consumer (KeyedArchiveReader) is updated._tagfields are removed (they conflicted withParseFailureError._tag); tests assertnameinstead. No production code read those tags.InterfaceBuilderAnalysis.parseXmlWithinDecodeBudgetnow reads alimitparse failure or a host stack/capacity limit (isHostLimitFailure), not anyRangeError. Itsrange-error-interpretationbaseline entry is removed.KeyedArchiveReaderstill treats aRangeErroras a limit, becausekeyedArchive.tsandKeyedArchiveReader.tsthrow plainRangeErrors for their object-table, edge and size limits; it also reads alimitparse failure, so the nesting limit stays a limit.\w*(?:Plist|PropertyList|Archive)\w*. It finds one more existing class,PropertyListDecodeBudgetFailure, which is baselined at 1.KunaDocumentError(follow-up PR),PropertyListDecodeBudgetFailure, and the plainRangeErrorlimits in the keyed-archive reader.Contribution scope: not applicable (refactor inside existing boundaries).
Contract and boundary impact
src/domain/propertyListXml{Text,Data}.ts,src/domain/apple/plistValue.ts,src/domain/propertyListOpenStep.ts,src/domain/apple/keyedArchive.ts,src/artifacts/apple/PlistScalars.ts); consumersKeyedArchiveReader,InterfaceBuilderAnalysis.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/domain/propertyListXmlText.test.tsasserts the kind for each decode reason;src/domain/propertyListKeys.test.tsasserts the nesting failure'slimitfacts instead ofRangeError; OpenStep, XML data and keyed-archive nesting tests assertnameinstead of_tag.InterfaceBuilderAnalysisno longer classifying an arbitrary non-hostRangeErroras a decode budget (the XML plist parser throws none besides the nesting limit).For evidence-bearing changes:
Validation performed
npm run test:local -- src/domain/propertyListOpenStep.test.ts src/domain/propertyListXmlText.test.ts src/domain/propertyListXmlData.test.ts src/domain/propertyListKeys.test.ts src/artifacts/apple/KeyedArchiveReader.test.ts src/native/parsers/plist.test.ts src/application/AppBundleExecutable.test.ts src/browser/history/SazMetadata.test.ts: 248 passed (after test updates)npm run test:local -- src/domain/propertyListKeys.test.ts src/artifacts/apple/NibArchive.test.ts src/artifacts/apple/AppleAssetCatalogAnalysis.test.ts: 95 passed, 1 skippednpm run test:focused -- tests/boundary/filesystem/interfaceBuilderBundle.test.ts tests/boundary/filesystem/keyedArchiveXmlNesting.test.ts tests/boundary/providers/native/plistSourceFormat.test.ts: 102 passed, 1 skipped (13.4 s elapsed, 852 MB peak RSS)node scripts/verify/architecture-guards.mjs --shrink-baselines: passednpx tsc --noEmit -p .: passedCompatibility, safety, and release
KeyedArchiveKindError.kindis internal and renamedfileKind.Author readiness
Human owner:
Before merge
type(scope): outcome.