[PR #4861] [CLOSED] fix(native): retain methods around empty Objective-C selectors #6445

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4861
Author: @Abdooo2235
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: fix/objc-method-entry-recovery


📝 Commits (1)

  • ed2cc8e fix(native): retain methods around empty Objective-C selectors

📊 Changes

3 files changed (+140 additions, -9 deletions)

View changed files

📝 src/native/AppleDispatchMetadata.test.ts (+101 -1)
📝 src/native/AppleObjcDispatchFacets.ts (+15 -3)
📝 tests/boundary/filesystem/appleDispatchMetadataStrings.test.ts (+24 -5)

📄 Description

Summary

Fixes #4534. Skip an empty Objective-C method selector without discarding its class or category, the valid methods on either side, or independent metadata.

Problem and expected behavior

The existing empty-selector guard prevents invalid records from reaching schema validation, but throws out of the entire method list. A valid/empty/valid list consequently loses its owner and the last method. Empty selectors should produce partial coverage while the remaining records stay available.

Change and scope

Record the failure at the method entry and continue the bounded list scan, following the existing protocol-selector recovery pattern. Class methods report through class coverage; category methods report through category coverage. Keep the existing handling of unreadable pointers and unsupported list layouts.

This builds on the validation already present on main; it does not replace that guard or broaden supported metadata formats.

Contract and boundary impact

  • Semantic owner and earliest changed stage: decodeObjcDispatchFacets, while decoding a binary method-list entry.

  • Contribution scope fit and linked maintainer decision: ordinary read-only recovery fix within an existing parser; no new scope decision required.

  • CLI and MCP/tool-catalog contract: existing result schemas and operation arguments are unchanged.

  • Provider, bridge, target-format, or platform compatibility: no additional provider or format support.

  • Evidence, artifact, provenance, or reconstruction contract: retain valid records and their locations/provenance; report the malformed entry's owner, method type, index and address in the affected coverage facet.

  • Target selection, authority, upstream behavior, and cleanup: existing target selection, record budget and resource ownership are preserved.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

Evidence and regression coverage

On base 3ad1032b, all four new class/category and absolute/relative recovery cases failed; the other 52 tests passed. With the fix, all 56 pass. The tests assert retained owner method arrays, implementation records, ivars, protocols and properties, as well as precise diagnostics and unchanged independent coverage.

A file-backed regression also retains a valid method following an empty selector, preserves the input bytes and digest, and reports partial class coverage. Existing UTF-8 identity and resource-cleanup controls continue to pass.

Representative result: the owner's methods remain earlier: and later:; coverage identifies method 1 as having an empty selector instead of losing the owner.

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Windows x64, pinned Node 24.18.0 and npm 11.16.0:

  • npm run test:focused -- src/native/AppleDispatchMetadata.test.ts tests/boundary/filesystem/appleDispatchMetadataStrings.test.ts tests/boundary/providers/native/nativeDispatchMetadataFileCleanup.test.ts — 64 tests passed across three files.
  • npm run check — passed, including typecheck, lint, formatting, knip, module boundaries and architecture guards.
  • npm run docs:check — passed, including generated-document checks and five README conformance tests.
  • git diff --check — passed.
  • GitHub CI on ed2cc8e3 — completed successfully, including all five test shards, source/static checks, package build, Linux package baseline and Real Apple artifact CLI/MCP E2E. All four required checks passed.

Compatibility, safety, and release

No breaking change, migration, dependency or package change. This change reads captured Mach-O bytes only. Local verification used Windows; GitHub's real Apple artifact CLI/MCP E2E lane passed on this revision. No real-world malformed binary was examined; the regression uses synthetic bytes through the production decoder and file-backed inspection boundary. The full repository suite was not run locally.

Author readiness

Human owner: @Abdooo2235

  • 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 within the existing contribution scope.
  • The PR has one focused outcome and links the related issue.
  • Tests cover changed behavior and meaningful failure paths.
  • The final diff was checked for unrelated changes and unsupported claims.
  • Human readiness and required CI/review checks are complete.

🔄 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/4861 **Author:** [@Abdooo2235](https://github.com/Abdooo2235) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/objc-method-entry-recovery` --- ### 📝 Commits (1) - [`ed2cc8e`](https://github.com/morluto/rea/commit/ed2cc8e30814546724a8193aba8aca888dd2b241) fix(native): retain methods around empty Objective-C selectors ### 📊 Changes **3 files changed** (+140 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/native/AppleDispatchMetadata.test.ts` (+101 -1) 📝 `src/native/AppleObjcDispatchFacets.ts` (+15 -3) 📝 `tests/boundary/filesystem/appleDispatchMetadataStrings.test.ts` (+24 -5) </details> ### 📄 Description ## Summary Fixes #4534. Skip an empty Objective-C method selector without discarding its class or category, the valid methods on either side, or independent metadata. ## Problem and expected behavior The existing empty-selector guard prevents invalid records from reaching schema validation, but throws out of the entire method list. A valid/empty/valid list consequently loses its owner and the last method. Empty selectors should produce partial coverage while the remaining records stay available. ## Change and scope Record the failure at the method entry and continue the bounded list scan, following the existing protocol-selector recovery pattern. Class methods report through class coverage; category methods report through category coverage. Keep the existing handling of unreadable pointers and unsupported list layouts. This builds on the validation already present on `main`; it does not replace that guard or broaden supported metadata formats. ## Contract and boundary impact - Semantic owner and earliest changed stage: `decodeObjcDispatchFacets`, while decoding a binary method-list entry. - Contribution scope fit and linked maintainer decision: ordinary read-only recovery fix within an existing parser; no new scope decision required. - CLI and MCP/tool-catalog contract: existing result schemas and operation arguments are unchanged. - Provider, bridge, target-format, or platform compatibility: no additional provider or format support. - Evidence, artifact, provenance, or reconstruction contract: retain valid records and their locations/provenance; report the malformed entry's owner, method type, index and address in the affected coverage facet. - Target selection, authority, upstream behavior, and cleanup: existing target selection, record budget and resource ownership are preserved. - Generated metadata, package, or installation impact: none. - [x] Read existing files or captured data. ## Evidence and regression coverage On base `3ad1032b`, all four new class/category and absolute/relative recovery cases failed; the other 52 tests passed. With the fix, all 56 pass. The tests assert retained owner method arrays, implementation records, ivars, protocols and properties, as well as precise diagnostics and unchanged independent coverage. A file-backed regression also retains a valid method following an empty selector, preserves the input bytes and digest, and reports partial class coverage. Existing UTF-8 identity and resource-cleanup controls continue to pass. Representative result: the owner's methods remain `earlier:` and `later:`; coverage identifies method 1 as having an empty selector instead of losing the owner. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Windows x64, pinned Node 24.18.0 and npm 11.16.0: - `npm run test:focused -- src/native/AppleDispatchMetadata.test.ts tests/boundary/filesystem/appleDispatchMetadataStrings.test.ts tests/boundary/providers/native/nativeDispatchMetadataFileCleanup.test.ts` — 64 tests passed across three files. - `npm run check` — passed, including typecheck, lint, formatting, knip, module boundaries and architecture guards. - `npm run docs:check` — passed, including generated-document checks and five README conformance tests. - `git diff --check` — passed. - [GitHub CI on `ed2cc8e3`](https://github.com/morluto/rea/actions/runs/39058407826) — completed successfully, including all five test shards, source/static checks, package build, Linux package baseline and `Real Apple artifact CLI/MCP E2E`. All four required checks passed. ## Compatibility, safety, and release No breaking change, migration, dependency or package change. This change reads captured Mach-O bytes only. Local verification used Windows; GitHub's real Apple artifact CLI/MCP E2E lane passed on this revision. No real-world malformed binary was examined; the regression uses synthetic bytes through the production decoder and file-backed inspection boundary. The full repository suite was not run locally. ## Author readiness Human owner: @Abdooo2235 - [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 within the existing contribution scope. - [x] The PR has one focused outcome and links the related issue. - [x] Tests cover changed behavior and meaningful failure paths. - [x] The final diff was checked for unrelated changes and unsupported claims. - [x] Human readiness and required CI/review checks are complete. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:14:30 +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#6445
No description provided.