Repository navigation
fix(native): keep property flags unknown for unfinished quoted types - #3825
Conversation
An Objective-C property attribute string whose quoted class name never closes, such as T@"NSString, was treated as complete. The missing N and R were then read as the Objective-C defaults, so the property was reported atomic and read-write, and objc_properties_categories coverage stayed complete. The documented semantics require null flags for incomplete attribute metadata. The attribute splitter now reports whether every quote closed. An incomplete string leaves atomicity and any unestablished read-only value null, while explicit N or R tokens remain established and the raw type is preserved. Each affected property adds a property_attributes_incomplete issue, which marks the facet partial. Fixes #3345 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; no actionable defects were found. SummaryThe PR keeps property flags unknown when a quoted Objective-C type never closes.
No actionable defects or security issues were found. Tests were inspected but not run. Whether another PR supersedes this one could not be checked because GitHub authentication was unavailable. Reviews (1) · Last reviewed commit: "fix(native): keep property flags unknown..." · Reviewed by Greptile |
Summary
Fixes #3345.
inspect-native-dispatch-metadata(MCPinspect_native_dispatch_metadata) reportedatomicity: "atomic"andis_readonly: falsefor an Objective-C property whose type attribute has an unfinished quoted class name (T@"NSString).objc_properties_categoriescoverage stayedcomplete. The documented semantics (docs/native-investigation.md) say incomplete attribute metadata leavesatomicityand any unestablished read-only value null.Now such a property reports
atomicity: nullandis_readonly: null, unless an explicitRtoken establishes read-only. The raw type and attribute pairs are kept, and the facet becomespartialwith aproperty_attributes_incompletereason.Problem and expected behavior
splitAttributestoggles a quote state while splitting on commas but never reported an unbalanced quote.parsePropertyAttributesthen treated any nonemptyTtoken as a complete type and inferred theatomic/read-write defaults from the absence ofN/R. With an unfinished quote, any laterNorRwould sit inside the unfinished type (T@"NSString,N,Ryields one token), so their absence establishes nothing.Change and scope
src/native/AppleObjcProperties.ts, changes as follows.splitAttributesreturns{ tokens, complete }, anddecodePropertyAttributesestablishes the defaults only for a complete typed string. ExplicitN/Rtokens remain established, as doG/Saccessors and the rawtype_encoding.readObjcPropertyListreturns the names of incomplete properties.readObjcPropertiesOfrecords oneproperty_attributes_incompleteissue per property through the existing class and category issue paths, which already markobjc_properties_categoriespartial with the reason.parsePropertyAttributeskeeps its signature.Contract and boundary impact
AppleObjcProperties.ts).Expected effects:
Evidence and regression coverage
tests/boundary/cli/nativeDispatchPropertyAttributes.test.tsruns the built CLI on the issue's synthetic arm64 Mach-O (darwin) for four cases. The completeTq,Ncontrol and the complete defaultT@"NSString",Ckeep their flags. An unfinishedT@"NSStringgives null flags, andR,T@"NSStringkeepsis_readonly: true. The facet is partial with the reason only for the unfinished cases.src/native/AppleMachoFixups.test.tschecks thatN,Rswallowed by an unfinished quote are not flags, whileN/Rbefore the type still are.AppleObjcProperties.ts, all three unfinished-quote cases fail (Tests 3 failed | 39 passed).incomplete-attributes.bin, after:atomicity=atomic readonly=false,facet=complete reason=null.For evidence-bearing changes:
Validation performed
npm run test:focused -- src/native/AppleMachoFixups.test.ts tests/boundary/cli/nativeDispatchPropertyAttributes.test.ts tests/boundary/providers/native/nativeProvider.test.ts: 88 passednpm run check:fast,npm run knip,npm run docs:check: passedvalid.binstays nonatomic and read-write with the facet complete;incomplete-attributes.binmatches the expected behavior above.inspect-native-dispatch-metadataon Transmission, KeepingYouAwake, BetterDisplay, Raycast and XLD decoded 768 real properties: 0 got null atomicity and 0property_attributes_incompleteissues. Where a facet was partial, it was already partial for other reasons. Run times were 0.5–0.7 s per app; the fix only keeps a boolean the splitter already computed.Compatibility, safety, and release
atomicity/is_readonly.Author readiness
Human owner:
Before merge
type(scope): outcome.🤖 Generated with Claude Code