[PR #4549] [MERGED] fix(objc): isolate empty protocol selectors and category class names #6301

Closed
opened 2026-10-31 01:13:25 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4549
Author: @Iyanuoluwa007
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @morluto

Base: main ← Head: fix/objc-empty-protocol-selector


📝 Commits (3)

  • 5827ee5 fix(objc): isolate empty Objective-C protocol method selectors
  • a295100 fix(objc): treat empty local category class names as unresolved
  • 93424b9 fix(objc): resolve protocol recovery merge conflicts

📊 Changes

2 files changed (+78 additions, -9 deletions)

View changed files

📝 src/native/AppleDispatchMetadata.test.ts (+51 -0)
📝 src/native/AppleObjcProtocols.ts (+27 -9)

📄 Description

Summary

Fixes #4540. Related: #4541 (already fixed on main).

An empty Objective-C protocol method selector now skips only that method. The protocol retains its valid required/optional methods and adopted declarations, records decode.status: partial with reason protocol_method_selector_empty, and reports the skipped entry's address and method kind through the existing coverage failures.

Change and merge resolution

Merged main at 8267edc0e in 93424b9f4. Main already rejects malformed names at decode boundaries, but its protocol-selector check discards the whole parent protocol. Retain this PR's method-level recovery and update main's adopted-protocol regressions to assert that the partial parent survives.

Main also fixes #4541 at the shared local-class identity reader, which validates names before class, superclass and category consumers use them. Retain that producing boundary and its category regression; remove this PR's redundant downstream category check and duplicate test. Relative to current main, only AppleObjcProtocols.ts and AppleDispatchMetadata.test.ts change.

Contract and boundary impact

  • Static metadata reads only; no target execution or mutation, CLI/MCP schema, provider, package or installation changes.
  • Valid protocol methods remain available alongside explicit partial decode status and coverage diagnostics. Empty selector values never reach the final schema.
  • Existing malformed-name, category, adopted-protocol and class recovery coverage remains in place.

Validation performed

Executed for the merge resolution on macOS with Node 24.18.0:

  • npm run test:local -- src/native/AppleDispatchMetadata.test.ts src/native/AppleMachoFixups.test.ts src/native/AppleMachoSelection.test.ts src/native/AppleSwiftVtables.test.ts: passed, 129 tests across four files.
  • npm run check:fast: passed (typecheck and lint).
  • git diff origin/main...HEAD --check: passed.
  • Pre-commit formatting/lint passed.

Coverage includes a mixed empty/valid required-method list and empty required/optional selectors with independent adopted declarations. Tests use synthetic in-memory Mach-O fixtures. No real malformed application or provider workflow was verified for this resolution. The author's earlier Windows reproduction and 279-test run apply to the pre-merge revision.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4549 **Author:** [@Iyanuoluwa007](https://github.com/Iyanuoluwa007) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/objc-empty-protocol-selector` --- ### 📝 Commits (3) - [`5827ee5`](https://github.com/morluto/rea/commit/5827ee5d52ea7af0e2cf968e746941cf29ddd304) fix(objc): isolate empty Objective-C protocol method selectors - [`a295100`](https://github.com/morluto/rea/commit/a2951000caa0e5f6aa446ebdc8c76d8346c5468c) fix(objc): treat empty local category class names as unresolved - [`93424b9`](https://github.com/morluto/rea/commit/93424b9f406898c1c3b1dc2d535e5f8041aae728) fix(objc): resolve protocol recovery merge conflicts ### 📊 Changes **2 files changed** (+78 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/native/AppleDispatchMetadata.test.ts` (+51 -0) 📝 `src/native/AppleObjcProtocols.ts` (+27 -9) </details> ### 📄 Description ## Summary Fixes #4540. Related: #4541 (already fixed on main). An empty Objective-C protocol method selector now skips only that method. The protocol retains its valid required/optional methods and adopted declarations, records `decode.status: partial` with reason `protocol_method_selector_empty`, and reports the skipped entry's address and method kind through the existing coverage failures. ## Change and merge resolution Merged main at `8267edc0e` in `93424b9f4`. Main already rejects malformed names at decode boundaries, but its protocol-selector check discards the whole parent protocol. Retain this PR's method-level recovery and update main's adopted-protocol regressions to assert that the partial parent survives. Main also fixes #4541 at the shared local-class identity reader, which validates names before class, superclass and category consumers use them. Retain that producing boundary and its category regression; remove this PR's redundant downstream category check and duplicate test. Relative to current main, only `AppleObjcProtocols.ts` and `AppleDispatchMetadata.test.ts` change. ## Contract and boundary impact - Static metadata reads only; no target execution or mutation, CLI/MCP schema, provider, package or installation changes. - Valid protocol methods remain available alongside explicit partial decode status and coverage diagnostics. Empty selector values never reach the final schema. - Existing malformed-name, category, adopted-protocol and class recovery coverage remains in place. ## Validation performed Executed for the merge resolution on macOS with Node 24.18.0: - `npm run test:local -- src/native/AppleDispatchMetadata.test.ts src/native/AppleMachoFixups.test.ts src/native/AppleMachoSelection.test.ts src/native/AppleSwiftVtables.test.ts`: passed, 129 tests across four files. - `npm run check:fast`: passed (typecheck and lint). - `git diff origin/main...HEAD --check`: passed. - Pre-commit formatting/lint passed. Coverage includes a mixed empty/valid required-method list and empty required/optional selectors with independent adopted declarations. Tests use synthetic in-memory Mach-O fixtures. No real malformed application or provider workflow was verified for this resolution. The author's earlier Windows reproduction and 279-test run apply to the pre-merge revision. ## Author readiness Human owner: <!-- @GitHub-handle --> - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:13:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6301
No description provided.