Repository navigation
fix(native): retain valid Objective-C properties beside a malformed record - #3833
Conversation
…ecord readObjcPropertyList decoded a whole property_list_t in one operation. When a later entry's name pointer was unmapped, the list-level catch discarded the properties already decoded. An empty property name passed decoding and then failed schema validation of the whole result, so inspect-native-dispatch-metadata exited 1 with no metadata. Each property_t entry is now decoded on its own. A failing entry, or an empty name, becomes a property_decode_failed issue at the entry address, and sibling properties are retained. Incomplete-attribute issues also report their entry address. List-header failures still fail only that list. Fixes #3336 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge, with the previous coverage gap addressed and no new actionable issues found. SummaryThe PR keeps valid Objective-C properties when another record cannot be decoded.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Read property list header] --> B[Check record budget]
B --> C[Decode one property]
C --> D{Record valid?}
D -->|Yes| E[Retain property]
D -->|No| F[Record issue at entry address]
E --> B
F --> B
B -->|Finished or budget exhausted| G[Return retained properties and issues]
Reviews (2) · Last reviewed commit: "test(native): cover property record isol..." · Reviewed by Greptile |
Move the synthetic Objective-C property Mach-O into a shared fixture and decode it through decodeAppleDispatchMetadata in a portable test, so Linux and Windows runs also catch a regression that drops valid sibling properties. The macOS CLI cases keep exercising the built command. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Fixes #3336.
inspect-native-dispatch-metadata(MCPinspect_native_dispatch_metadata) lost valid Objective-C metadata when a single property record was malformed:Fixture.properties: []).1,execution_failurewith a schema violation at["objc_classes",0,"properties",0,"name"], and noSiblingclass or validsecondproperty.Now each property record is decoded on its own. The failing record becomes a
property_decode_faileddiagnostic at its entry address, the facet is marked partial, and every valid sibling property and class is retained.Problem and expected behavior
readObjcPropertyListaccumulated a wholeproperty_list_tin one operation, andreadObjcPropertiesOfreturned[]from its list-levelcatch. A failure on entry n therefore discarded entries 0..n-1. An empty name raised nothing during decoding, so it reachedappleDispatchMetadataSchemavalidation of the whole result. That rejected every class, matching the class-level case #2611 already fixed for empty class names.Change and scope
src/native/AppleObjcProperties.ts, decodes eachproperty_tentry inside its owntry. An empty name is rejected there. The function returns{ properties, issues }, where each issue has a code, message and entry address.readObjcPropertiesOfforwards those issues through the existing class and category issue paths.objc_properties_categoriesis thereforepartialwithproperty_decode_failed at <entry>: <owner>: property <index> could not be decoded: <cause>.property_attributes_incompleteissue from fix(native): keep property flags unknown for unfinished quoted types #3825 now uses the same path and reports the entry address instead of the list address.Contract and boundary impact
AppleObjcProperties.ts).AGENTS.mdanddocs/tool-design.md.Expected effects:
Evidence and regression coverage
tests/boundary/cli/nativeDispatchPropertyAttributes.test.tsruns the built CLI on the issue's synthetic arm64 Mach-O (darwin).first, withproperty_decode_failed at 0x100000518.second, with the diagnostic at0x100000508.Tests 2 failed | 4 passed).unmapped.binreturnedFixture[], andempty.binexited 1 with no metadata.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/cli/nativeDispatchPropertyAttributes.test.ts src/native/AppleMachoFixups.test.ts src/native/AppleDispatchMetadata.test.ts tests/boundary/providers/native/nativeProvider.test.ts: 126 passednpm run check:fast,npm run knip,npm run docs:check: passedtryper property entry.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.🤖 Generated with Claude Code