[PR #4730] [MERGED] fix(native): preserve leading U+FEFF in Apple metadata names #6378

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4730
Author: @ShuaixinHuang
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @morluto

Base: main ← Head: codex/fix-apple-metadata-utf8-identity


📝 Commits (4)

  • 784f31e fix(native): preserve leading U+FEFF in Apple metadata names
  • 7f0cfad test(native): run property metadata regressions on macOS
  • 8c0021b chore: merge upstream Apple resource ownership
  • 7200ffa chore: merge upstream and repair keyed archive test formatting

📊 Changes

6 files changed (+147 additions, -2 deletions)

View changed files

📝 .github/workflows/ci.yml (+1 -0)
📝 scripts/ci/scopes.mjs (+1 -0)
📝 src/native/AppleDispatchMetadata.ts (+2 -1)
📝 tests/boundary/cli/keyedArchivePrototypeKeyCli.test.ts (+4 -1)
📝 tests/boundary/cli/nativeDispatchPropertyAttributes.test.ts (+29 -0)
➕ tests/boundary/filesystem/appleDispatchMetadataStrings.test.ts (+110 -0)

📄 Description

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.

🔄 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/4730 **Author:** [@ShuaixinHuang](https://github.com/ShuaixinHuang) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/fix-apple-metadata-utf8-identity` --- ### 📝 Commits (4) - [`784f31e`](https://github.com/morluto/rea/commit/784f31e3aa3b5d4624148efb97c46e8c5e944be1) fix(native): preserve leading U+FEFF in Apple metadata names - [`7f0cfad`](https://github.com/morluto/rea/commit/7f0cfad585c2ae26b75233b78ca121fe5b33950e) test(native): run property metadata regressions on macOS - [`8c0021b`](https://github.com/morluto/rea/commit/8c0021b023863b5a9c4e6f8fd72dca27bb3c6962) chore: merge upstream Apple resource ownership - [`7200ffa`](https://github.com/morluto/rea/commit/7200ffad6b17b5231a17cfa9e8da1d4ceb682573) chore: merge upstream and repair keyed archive test formatting ### 📊 Changes **6 files changed** (+147 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+1 -0) 📝 `scripts/ci/scopes.mjs` (+1 -0) 📝 `src/native/AppleDispatchMetadata.ts` (+2 -1) 📝 `tests/boundary/cli/keyedArchivePrototypeKeyCli.test.ts` (+4 -1) 📝 `tests/boundary/cli/nativeDispatchPropertyAttributes.test.ts` (+29 -0) ➕ `tests/boundary/filesystem/appleDispatchMetadataStrings.test.ts` (+110 -0) </details> ### 📄 Description ## 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](https://github.com/ShuaixinHuang/rea/actions/runs/39033320450/job/117398090180) 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](https://github.com/morluto/rea/actions/runs/39033271695/job/117400184985) passed. Its [real macOS Apple lane](https://github.com/morluto/rea/actions/runs/39033271695/job/117398327837) 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 - [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. --- <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:00 +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#6378
No description provided.