Skip to content

fix(native): preserve leading U+FEFF in Apple metadata names - #4730

Merged
morluto merged 4 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-apple-metadata-utf8-identity
Oct 17, 2026
Merged

morluto merged 4 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-apple-metadata-utf8-identity

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem and outcome

The Apple metadata C-string decoder removed an initial U+FEFF, changing class, selector and property identities. A U+FEFF-only class was incorrectly rejected as empty. Preserve every code point with ignoreBOM: true on the existing shared fatal UTF-8 reader; invalid UTF-8 and genuinely empty names retain their partial-result handling.

This fixes the producing boundary used by Objective-C facets and Swift metadata/vtables, without downstream name repair or a schema change.

Validation

Head 7200ffad6b17b5231a17cfa9e8da1d4ceb682573, normally merged upstream 78cf6100; pinned Node 24.18.0/npm 11.16.0.

  • Original file-backed producer baseline reproduced 2 failures / 3 passes before the fix. File admission, digest, names/addresses/provenance, unchanged source bytes and malformed-UTF-8/NUL-only controls are retained.
  • Resource-ownership integration at 8c0021b0: 62/62 passed across file-backed metadata, Apple metadata, Swift vtables and upstream descriptor-cleanup regression files. The tests use the required caller-owned scope, including awaited cleanup.
  • Exact-source real macOS verification of the final 7200ffad head passed 10 property CLI + 5 file-backed cases, zero skips, and all 10 compiler/link-mode Objective-C/Swift CLI/MCP fixtures.
  • Final integration: npm run check 6/6 plus module-boundary/architecture guards passed; the two compiled keyed-archive CLI/MCP integration cases passed 2/2; git diff --check passed. Only the upstream test's call(...) formatting was additionally corrected to unblock CI; no assertions were changed.

The 10 property CLI cases are now selected by the macOS Apple CI job and own their CI scope. Current-head CI required passed. Its real macOS Apple lane passed 254 tests / 4 platform skips, including all 10 property CLI cases; the independent exact-source 15/15, zero-skip run above is also complete. Previous failed static runs are not presented as passing; their API-arity and upstream formatting causes have been repaired.

Fixtures include source-owned Mach-O bytes and real host-compiled Objective-C/Swift binaries. Compilation and static inspection do not execute the compiled targets (target_executed: false). Prepared with AI assistance.

Author readiness

Human owner: @ShuaixinHuang

  • 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.

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review October 17, 2026 10:22
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T10:22:31.567026Z 784f31e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking defects were found.

Summary

Preserves leading U+FEFF in Apple metadata names at the shared C-string reader.

  • Apple metadata names keep their leading U+FEFF character.
  • The keyed-archive test lays out its MCP call across lines.

Reviews (4) · Last reviewed commit: "chore: merge upstream and repair keyed a..." · Reviewed by Greptile

@morluto
morluto merged commit 68c3c5b into morluto:main Oct 17, 2026
41 checks passed
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

I appreciate this fix, @ShuaixinHuang. Preserving a leading U+FEFF in Apple metadata names protects the actual class, selector, and property identity at the decoder boundary, including names made only of that character.

@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants