[PR #900] [MERGED] fix(artifacts): read AppKit connectors from flat keyed-archive NIBs #2330

Closed
opened 2026-10-16 21:17:24 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/900
Author: @kaoru0822-kitauji
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @morluto

Base: main ← Head: fix/interface-builder-appkit-connectors


📝 Commits (3)

  • cfb1748 fix(artifacts): read AppKit connectors from flat keyed-archive NIBs
  • 2de79a3 fix(artifacts): read AppKit control connectors from the control to its target
  • d30310c fix(artifacts): key AppKit connector endpoints by their node identity

📊 Changes

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

View changed files

📝 src/domain/interfaceBuilderGraph.test.ts (+107 -0)
📝 src/domain/interfaceBuilderKeyedArchive.ts (+19 -0)

📄 Description

Summary

Flat (keyed-archive) AppKit NIBs store each NSNibOutletConnector and NSNibControlConnector endpoint and its outlet or selector name under NSSource, NSDestination, and NSLabel. The keyed-archive parser in decode_interface_builder read only source/destination/label (and from/to/target/owner). It therefore skipped every AppKit connector, and these documents produced no outlet_to or target_action edges.

The NS-prefixed keys are now read after the existing ones, in Apple's archived order: NSSource is the outlet owner or the sending control, and NSDestination is the outlet value or the action target. Actions therefore run control → action → selector + target, which is what trace_native_ui_action (it follows control → action) and the graph's selector keying (by target) expect. The unprefixed source/destination fields keep their existing pinned behavior. NSNibBindingConnector stays out of connections, as before.

App edges with #899 alone with #899 and this PR
XLD 20250302 (64 flat NIBs) 0 1264 (458 outlets, 348 target-action, 458 contains); 108 of 116 actions start at a control
Transmission 4.1.2 (Sparkle flat NIBs) 2368 2451
KeepingYouAwake (NIBArchive only) 527 527, byte-identical result

This PR is independent of #899 and branches from main. On main itself, though, AppKit flat NIBs with archived colors do not decode at all until #899 lands. The unit test does not depend on #899.

No schema or catalog change.

Verification

  • New cases in src/domain/interfaceBuilderGraph.test.ts: an AppKit outlet connector and control connector archived with NSSource/NSDestination/NSLabel produce an outlet and an action connection with the expected endpoints and labels. A graph-level case checks NSButton → action → objc_selector + target. Both fail on main.

Related, not changed here: the compiled NIBArchive path (projectNibArchive) applies the same inversion to NSNibControlConnector. KeepingYouAwake, Music (MAPreferences.storyboardc), and Transmission archive NSSource = control, but main projects target → action → control (Transmission: 234 actions). The ibtool MacFixture.storyboard test nonetheless asserts control → action and passes on macos-14. I can't run ibtool here to see that fixture's encoding, so I left it alone.

  • Real apps as in the table above.
  • npm run check:changed passes.

No Hopper/Ghidra/IDA verification is needed.

🤖 Generated with Claude Code


🔄 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/900 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/interface-builder-appkit-connectors` --- ### 📝 Commits (3) - [`cfb1748`](https://github.com/morluto/rea/commit/cfb1748f31db862734332ff10e1da589327bb86f) fix(artifacts): read AppKit connectors from flat keyed-archive NIBs - [`2de79a3`](https://github.com/morluto/rea/commit/2de79a34611917995ff99f49f6ca97370968c97c) fix(artifacts): read AppKit control connectors from the control to its target - [`d30310c`](https://github.com/morluto/rea/commit/d30310cfce45a35dbd5afa3f50cc6fa20fabc78c) fix(artifacts): key AppKit connector endpoints by their node identity ### 📊 Changes **2 files changed** (+126 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/interfaceBuilderGraph.test.ts` (+107 -0) 📝 `src/domain/interfaceBuilderKeyedArchive.ts` (+19 -0) </details> ### 📄 Description ## Summary Flat (keyed-archive) AppKit NIBs store each `NSNibOutletConnector` and `NSNibControlConnector` endpoint and its outlet or selector name under `NSSource`, `NSDestination`, and `NSLabel`. The keyed-archive parser in `decode_interface_builder` read only `source`/`destination`/`label` (and `from`/`to`/`target`/`owner`). It therefore skipped every AppKit connector, and these documents produced no `outlet_to` or `target_action` edges. The NS-prefixed keys are now read after the existing ones, in Apple's archived order: `NSSource` is the outlet owner or the sending control, and `NSDestination` is the outlet value or the action target. Actions therefore run `control → action → selector + target`, which is what `trace_native_ui_action` (it follows control → action) and the graph's selector keying (by target) expect. The unprefixed `source`/`destination` fields keep their existing pinned behavior. `NSNibBindingConnector` stays out of connections, as before. | App | edges with #899 alone | with #899 and this PR | | --- | --- | --- | | XLD 20250302 (64 flat NIBs) | 0 | 1264 (458 outlets, 348 target-action, 458 contains); 108 of 116 actions start at a control | | Transmission 4.1.2 (Sparkle flat NIBs) | 2368 | 2451 | | KeepingYouAwake (NIBArchive only) | 527 | 527, byte-identical result | This PR is independent of #899 and branches from `main`. On `main` itself, though, AppKit flat NIBs with archived colors do not decode at all until #899 lands. The unit test does not depend on #899. No schema or catalog change. ## Verification - New cases in `src/domain/interfaceBuilderGraph.test.ts`: an AppKit outlet connector and control connector archived with `NSSource`/`NSDestination`/`NSLabel` produce an `outlet` and an `action` connection with the expected endpoints and labels. A graph-level case checks `NSButton → action → objc_selector + target`. Both fail on `main`. **Related, not changed here:** the compiled NIBArchive path (`projectNibArchive`) applies the same inversion to `NSNibControlConnector`. KeepingYouAwake, Music (`MAPreferences.storyboardc`), and Transmission archive `NSSource` = control, but `main` projects `target → action → control` (Transmission: 234 actions). The ibtool `MacFixture.storyboard` test nonetheless asserts control → action and passes on macos-14. I can't run ibtool here to see that fixture's encoding, so I left it alone. - Real apps as in the table above. - `npm run check:changed` passes. No Hopper/Ghidra/IDA verification is needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:17:24 +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#2330
No description provided.