Skip to content

fix(artifacts): preserve NIB field and class identities - #2106

Merged
morluto merged 1 commit into
morluto:mainfrom
1NormalGuy:fix/nib-field-identities
Oct 13, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
1NormalGuy:fix/nib-field-identities

Conversation

@1NormalGuy

@1NormalGuy 1NormalGuy commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Preserve literal NIBArchive field and class names in Interface Builder evidence. Two data-loss defects were reproduced against upstream 0d5033ad1; no related issue was found.

Problem and expected behavior

A serialized __proto__ field was assigned through an ordinary object's inherited setter, so it disappeared from the result. Separately, the UTF-8 decoder stripped an initial U+FEFF from length-prefixed keys and class names. Distinct keys enabled and \uFEFFenabled consequently collapsed, with the second value overwriting the first.

For the regression fixture, both public adapters previously returned nibValues: { constructor: 7, enabled: false }. They now retain __proto__: { objectID: "1" }, constructor: 7, enabled: true, and \uFEFFenabled: false, as well as the exact \uFEFFCustomView class name and a numeric __proto__ field on the second object.

Change and scope

Create own data properties at the NIB field-decoding boundary and disable BOM consumption for the format's length-prefixed UTF-8 names. Malformed UTF-8 remains rejected. The graph projection already uses Object.fromEntries, and the shared JSON-value boundary preserves literal keys, so no downstream repair is needed.

Contract and boundary impact

  • Semantic owner and earliest changed stage: NIBArchive field/name decoding.
  • CLI and MCP/tool-catalog contract: unchanged schemas; corrected decode-interface-builder / decode_interface_builder evidence.
  • Provider, bridge, target-format, or platform compatibility: static NIBArchive reader; no external provider changes.
  • Evidence, artifact, provenance, or reconstruction contract: preserve field/class identities, both distinct values, original archive digest and bytes.
  • Process execution, authorization, cleanup, or containment impact: none; fixture target is not executed.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Added a compiled CLI plus real stdio MCP acceptance workflow using a generated NIBArchive byte fixture. It covers object-valued and numeric __proto__, distinct BOM-prefixed keys, class identity, adapter parity and source integrity.

  • The new workflow failed on the unmodified base with the missing and overwritten fields shown above, then passed after the fix.

  • Native Xcode production of these unusual names was not verified; the new regression uses the existing format fixture encoder, not a simulated provider.

  • 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

Using Node 24.18.0 and npm 11.16.0 on macOS:

  • npm run test:focused -- tests/acceptance/applications/nibFieldIdentity.test.ts src/artifacts/apple/NibArchive.test.ts src/artifacts/apple/NibViewHierarchy.test.ts tests/boundary/mcp/promptCompletion.test.ts — 23 passed on the rebased branch, including CLI, stdio MCP and cold/warm prompt completion.
  • npm run test:local -- src/artifacts/apple/NibArchive.test.ts src/artifacts/apple/NibViewHierarchy.test.ts — 16 passed.
  • Expanded focused run including tests/boundary/filesystem/interfaceBuilderBundle.test.ts — 56 passed, 2 failed because this host lacks Xcode ibtool and its Swift compiler rejects a trailing comma in the existing keyed-archive-hierarchy.swift fixture. These host/toolchain gaps remain unverified; the new acceptance test passed in that run.
  • npm run verify:test-discovery — all 916 files discovered exactly once.
  • npm run check — passed, including typecheck, lint (0 errors), formatting, module boundaries and architecture guards.
  • npm run verify:package — passed on macOS arm64, including packaged MCP prompt completion and lifecycle. Local loopback addresses were excluded from this host's HTTP proxy.
  • git diff --check — passed.
  • Rebased onto upstream e4d3e1399; the prior CI failures in prompt completion and macOS packaged smoke were corrected upstream by 621cee192 and fe4b94a66.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS filesystem, compiled CLI and stdio MCP; external engines are not involved. Xcode coverage is limited as described above.
  • Package or release metadata impact: none.
  • Security/privacy review: archive keys become own data properties instead of invoking prototype setters; no target execution or global prototype mutation.

Review checklist

  • Concrete, reproduced problem and focused Conventional Commit title.
  • No related issue; regression discovered during source review.
  • Observable behavior covered through public workflows.
  • Contracts and generated metadata unchanged.
  • Representative before/after evidence included.
  • Final diff checked for secrets, unrelated cleanup and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

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 ✅ Completed 2026-10-12T15:00:27.965013Z 1a1667b New commits
ℹ️ 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.

@1NormalGuy
1NormalGuy force-pushed the fix/nib-field-identities branch from 3bd53e6 to 1a1667b Compare October 12, 2026 14:56
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Preserves literal NIBArchive field and class names.

  • NIBArchive decoding keeps literal field and class names intact.

Review was source-only; tests were not run. Superseded status could not be checked because GitHub access was unauthenticated.

Reviews (1) · Last reviewed commit: "fix(artifacts): preserve NIB field and c..." · Reviewed by Greptile

@morluto
morluto merged commit f8e9579 into morluto:main Oct 13, 2026
1 check passed
@morluto morluto mentioned this pull request Oct 13, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: evidence Evidence, artifacts, and reconstruction labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants