[PR #2109] [MERGED] fix(artifacts): preserve NIB key and class name identity #5035

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2109
Author: @1052326311
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/nib-string-identity


📝 Commits (2)

  • 55ef71f fix(artifacts): preserve NIB key and class name identity
  • 989eb2e fix(artifacts): reconcile NIB identity regressions with main

📊 Changes

2 files changed (+59 additions, -0 deletions)

View changed files

📝 src/artifacts/apple/NibArchive.test.ts (+16 -0)
📝 tests/boundary/filesystem/interfaceBuilderBundle.test.ts (+43 -0)

📄 Description

Summary

Preserve leading U+FEFF in NIBArchive keys and class names. A dictionary containing count: 1 and U+FEFFcount: 2 currently becomes just count: 2: the UTF-8 decoder removes a real name character and silently aliases the keys.

No existing issue covers this. Open #2098 concerns file magic, not NIB string decoding; its diff does not touch this owner.

Problem and expected behavior

NIBArchive names are length-prefixed UTF-8 fields, not independent text streams with BOM framing. Preserve their exact decoded identity. The same problem changes class names and is visible in decode-interface-builder Evidence.

Change and scope

Set ignoreBOM: true at the shared NIB UTF-8 decoding boundary. Keep fatal UTF-8 validation, trailing class-name NUL handling, resource budgets and reference handling unchanged. No downstream recovery or alternate representation is introduced.

Contract and boundary impact

  • Semantic owner and earliest changed stage: NibArchive.decodeUtf8, before keyed object construction.
  • CLI and MCP/tool-catalog contract: unchanged schema; existing analysis returns both distinct fields and the correct class name.
  • Provider, bridge, target-format, or platform compatibility: inert NIBArchive parsing; no native engine change.
  • Evidence, artifact, provenance, or reconstruction contract: preserve source key/class identity; no artifact-byte modification.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Tests added: focused key/class identity and malformed UTF-8 control; compiled public CLI test using real NIB bytes inside an app bundle, checking final nibValues and class identity.

  • Base reproduction: both new regressions fail against main c22111eca2. The CLI returns only the overwritten count before the fix.

  • User-visible output: nibValues now retains count: 1 and the distinct U+FEFF-prefixed key with value 2; the prefixed class name also survives.

  • Remaining proof gaps: fixtures use the existing source-owned format builder, not an Apple compiler-generated specimen. No new native ibtool or live UI execution claim.

  • 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

Node 24.18.0 / npm 11.16.0, macOS arm64:

  • Baseline focused run: two new regression failures, plus an existing Xcode-compiled test failure because ibtool is unavailable.
  • Baseline isolated compiled CLI regression: failed on the expected lost key.
  • npm run build:cached - passed.
  • npx vitest run src/artifacts/apple/NibArchive.test.ts src/artifacts/apple/KeyedArchiveReader.test.ts tests/boundary/filesystem/interfaceBuilderBundle.test.ts -t '^(?!.*Xcode-compiled)' - 57 passed, one existing ibtool-dependent test excluded. xcrun --find ibtool confirms the tool is unavailable here.
  • npm run check - six tasks and architecture guards passed.
  • git diff --check - passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; correct previously lossy name decoding.
  • Real Hopper/Ghidra, browser, or OS coverage: compiled CLI on macOS; no other OS, UI runtime or Apple compiler verification.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new authority; invalid UTF-8 still rejects.

Review checklist

  • Concrete problem and focused conventional title.
  • Reason for no issue stated above; adjacent PR checked.
  • Tests cover observable behavior and malformed input.
  • No schema/generated metadata changes needed.
  • Public CLI result verified.
  • Final diff inspected for secrets, generated files and unrelated changes.

Hosted CI checkpoint

The changed-feature Apple artifact CLI/MCP E2E lane passed. Three failing jobs match the exact base c22111eca2c4bc84a084f12711f405b3e7422a40:

The aggregate CI/coverage failure follows these failures. These are verified existing baseline failures, not passing checks; no unrelated prompt-completion code is changed in this PR.


🔄 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/2109 **Author:** [@1052326311](https://github.com/1052326311) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/nib-string-identity` --- ### 📝 Commits (2) - [`55ef71f`](https://github.com/morluto/rea/commit/55ef71f819db3bb8821789a170c24f42f101ba53) fix(artifacts): preserve NIB key and class name identity - [`989eb2e`](https://github.com/morluto/rea/commit/989eb2e9ee63831eca41639aaac7f11d1f2b4082) fix(artifacts): reconcile NIB identity regressions with main ### 📊 Changes **2 files changed** (+59 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/apple/NibArchive.test.ts` (+16 -0) 📝 `tests/boundary/filesystem/interfaceBuilderBundle.test.ts` (+43 -0) </details> ### 📄 Description ## Summary Preserve leading U+FEFF in NIBArchive keys and class names. A dictionary containing `count: 1` and `U+FEFFcount: 2` currently becomes just `count: 2`: the UTF-8 decoder removes a real name character and silently aliases the keys. No existing issue covers this. Open #2098 concerns file magic, not NIB string decoding; its diff does not touch this owner. ## Problem and expected behavior NIBArchive names are length-prefixed UTF-8 fields, not independent text streams with BOM framing. Preserve their exact decoded identity. The same problem changes class names and is visible in `decode-interface-builder` Evidence. ## Change and scope Set `ignoreBOM: true` at the shared NIB UTF-8 decoding boundary. Keep fatal UTF-8 validation, trailing class-name NUL handling, resource budgets and reference handling unchanged. No downstream recovery or alternate representation is introduced. ## Contract and boundary impact - Semantic owner and earliest changed stage: `NibArchive.decodeUtf8`, before keyed object construction. - CLI and MCP/tool-catalog contract: unchanged schema; existing analysis returns both distinct fields and the correct class name. - Provider, bridge, target-format, or platform compatibility: inert NIBArchive parsing; no native engine change. - Evidence, artifact, provenance, or reconstruction contract: preserve source key/class identity; no artifact-byte modification. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: none. ## Evidence and regression coverage - Tests added: focused key/class identity and malformed UTF-8 control; compiled public CLI test using real NIB bytes inside an app bundle, checking final `nibValues` and class identity. - Base reproduction: both new regressions fail against main c22111eca2c4bc84a084f12711f405b3e7422a40. The CLI returns only the overwritten count before the fix. - User-visible output: `nibValues` now retains `count: 1` and the distinct U+FEFF-prefixed key with value 2; the prefixed class name also survives. - Remaining proof gaps: fixtures use the existing source-owned format builder, not an Apple compiler-generated specimen. No new native ibtool or live UI execution claim. - [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 Node 24.18.0 / npm 11.16.0, macOS arm64: - Baseline focused run: two new regression failures, plus an existing Xcode-compiled test failure because ibtool is unavailable. - Baseline isolated compiled CLI regression: failed on the expected lost key. - `npm run build:cached` - passed. - `npx vitest run src/artifacts/apple/NibArchive.test.ts src/artifacts/apple/KeyedArchiveReader.test.ts tests/boundary/filesystem/interfaceBuilderBundle.test.ts -t '^(?!.*Xcode-compiled)'` - 57 passed, one existing ibtool-dependent test excluded. `xcrun --find ibtool` confirms the tool is unavailable here. - `npm run check` - six tasks and architecture guards passed. - `git diff --check` - passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none; correct previously lossy name decoding. - Real Hopper/Ghidra, browser, or OS coverage: compiled CLI on macOS; no other OS, UI runtime or Apple compiler verification. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no new authority; invalid UTF-8 still rejects. ## Review checklist - [x] Concrete problem and focused conventional title. - [x] Reason for no issue stated above; adjacent PR checked. - [x] Tests cover observable behavior and malformed input. - [x] No schema/generated metadata changes needed. - [x] Public CLI result verified. - [x] Final diff inspected for secrets, generated files and unrelated changes. ## Hosted CI checkpoint The changed-feature Apple artifact CLI/MCP E2E lane passed. Three failing jobs match the exact base `c22111eca2c4bc84a084f12711f405b3e7422a40`: - [Test shard 1](https://github.com/morluto/rea/actions/runs/38225266771/job/114731433888): `promptCompletion.test.ts` expects `['App', 'AppTests']` but receives `[]`; [base main has the identical assertion failure](https://github.com/morluto/rea/actions/runs/38224038323/job/114727940506). - [Darwin arm64 package](https://github.com/morluto/rea/actions/runs/38225266771/job/114731529598) and [Darwin x64 package](https://github.com/morluto/rea/actions/runs/38225266771/job/114731529599): `packaged MCP prompt completion lifecycle failed`; identical failures in [base arm64](https://github.com/morluto/rea/actions/runs/38224038323/job/114728030045) and [base x64](https://github.com/morluto/rea/actions/runs/38224038323/job/114728029923). The aggregate CI/coverage failure follows these failures. These are verified existing baseline failures, not passing checks; no unrelated prompt-completion code is changed in this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:59:31 +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#5035
No description provided.