Skip to content

fix(apple): join recognized keys from NIBArchive field maps - #2248

Merged
morluto merged 4 commits into
morluto:mainfrom
XiaoBinGan:fix/apple-asset-catalog-nib-values
Oct 12, 2026
Merged

morluto merged 4 commits into
morluto:mainfrom
XiaoBinGan:fix/apple-asset-catalog-nib-values

Conversation

@XiaoBinGan

@XiaoBinGan XiaoBinGan commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2176.

Behavior

Restore catalog rows for recognized scalar image/asset keys decoded from NIBArchive resource nodes. Normalize those fields once in the Interface Builder producer, sharing the recognized-key contract with the catalog consumer. Preserve the original nibValues, authored field values, archive path/SHA-256 and node identity; account for the extra serialized strings in the decoder budget.

The consumer reads the canonical attributes and parsed resource classification. It does not reinterpret nested archive objects or match image-named fields on controls/views. A recognized key produces unmatched, matched or ambiguous rows for zero, one or multiple catalog renditions, with the original source provenance.

Contributor preservation

Keep XiaoBinGan's earlier PR and commit as canonical. Folded thangldw's #2256 producer-boundary implementation and public CLI/MCP coverage with coauthor credit. Reviewed Bappaditya-kuilya's #2249 independent alternative and fixture coverage; its nested-field consumer representation is superseded by this single producer normalization.

Validation and scope

49 focused tests passed across the catalog workflow, public CLI/MCP resource-key joins and Interface Builder filesystem decoding. npm run check and npm run docs:check passed. Spec review caught and fixed overbroad joins from non-resource nodes; a rooted NSButton NIBArchive now proves the negative case.

The production archive parser, graph, CLI and MCP paths are exercised. Catalog records are injected/supplied fixtures: this does not establish native assetutil, a real Assets.car, native UINib applicability, or Windows/Linux behavior. Earlier contributor evidence reported 124 focused passes and a public CLI unmatched-row reproduction; its native hierarchy suite was unavailable on that contributor's CommandLineTools-only setup. Those historical results are not represented as new native-provider verification.

inspect-asset-catalog returned no resource-key matches for a decoded
NIBArchive resource whose recognized image key is present in the archive. The
NIBArchive projection groups an object's decoded fields under the node's
nibValues attribute beside the class, label and ID it derives from the same
archive, while the AppKit keyed-archive parser flattens the same fields onto
the node. The catalog join read only the top level, so a recognized NSImageName
on a decoded resource produced no row, and the empty-catalog limitation still
claimed resource keys were reported as unmatched.

Read an archive object's fields from both shapes, and give the namespace one
owner by exporting NIB_VALUES_ATTRIBUTE from the projection that writes it.
The recognized-field set stays in the catalog analysis, which owns that
contract.

Verified with 5 focused catalog tests, check:fast and verify:test-discovery on
macOS arm64, and through the public CLI against the reported NIBArchive
fixture. The keyed-archive control keeps its existing row, and a NIBArchive
with only an unrecognized title still produces none. The ibtool-dependent
native hierarchy lane requires full Xcode and was unavailable here.
@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.

@morluto

morluto commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Kept this earlier PR and original commit as canonical. Folded @thangldw's #2256 producer-boundary normalization and CLI/MCP coverage with coauthor credit, and reviewed @Bappaditya-kuilya's #2249 independent alternative. The final consumer uses canonical fields and parsed resource kinds rather than separately interpreting nested maps.

Spec review caught a further issue: image-named fields on controls/views must not create resource joins. That is fixed with a resource-kind guard and a rooted NSButton NIBArchive regression. All 49 focused catalog/public CLI/MCP/filesystem tests, full source checks and docs checks passed. These catalog records are fixture-supplied, not native assetutil validation. #2249 and #2256 can now close as consolidated here.

@morluto
morluto merged commit fd985db into morluto:main Oct 12, 2026
30 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
3 tasks done
@morluto morluto added the bug Something isn't working label Oct 14, 2026
XiaoBinGan pushed a commit to XiaoBinGan/rea that referenced this pull request Nov 2, 2026
Fold the complementary implementation from morluto#2256 into the earlier morluto#2248 proposal, retaining the original contribution history.

Co-authored-by: Thang Luu <[email protected]>
@morluto morluto added the area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior label Nov 26, 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.

fix(apple): asset catalog inspection omits recognized NIBArchive resource keys

2 participants