[PR #4547] [CLOSED] fix(native): report symbols named without an address as unlocated #6299

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4547
Author: @Iyanuoluwa007
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: fix/objc-empty-method-selector


📝 Commits (1)

  • 8c270ca fix(native): report symbols named without an address as unlocated

📊 Changes

2 files changed (+37 additions, -7 deletions)

View changed files

📝 src/domain/native/objcSwiftMetadata.test.ts (+27 -0)
📝 src/domain/native/objcSwiftMetadata.ts (+10 -7)

📄 Description

Summary

Fixes #4542. A provider name-inventory entry with an empty address no longer makes inspectNativeDispatchMetadata throw. An empty address is treated as an unknown location (null): Swift symbols keep their mangled names with address: null, and symbolized Objective-C methods report implementation_address: null instead of "".

Problem and expected behavior

NativeDispatchMetadataInspection accepts list_names entries through addressedValue, whose address is z.string(), so an empty address is admitted from a provider. inspectNativeDispatchMetadata copied it verbatim into swift_symbols[].address, which is z.string().min(1), and the final objcSwiftMetadataSchema.parse rejected the whole result (too_small at swift_symbols[0].address). Objective-C methods did not crash but carried "" as an implementation address and evidence location, which is not an address.

Change and scope

src/domain/native/objcSwiftMetadata.ts:

  • Normalize entry.address === "" to null once per entry, and use it for the method's implementation_address, location.address, evidence location, and the Swift symbol's address.
  • swiftSymbolSchema.address becomes z.string().min(1).nullable(), matching nativeMetadataLocationSchema.address and implementation_address, which are already nullable. Non-empty addresses are unchanged.

This PR originally also carried fixes for #4534 and #4555. Those are now fixed on main (a70c42e03, f31b231a9, 060587b45), so the branch was rebuilt on current main with only the #4542 change, which main does not cover: the regression test below still fails on main at 060587b45.

Contract and boundary impact

  • Semantic owner and earliest changed stage: provider name-inventory projection in inspectNativeDispatchMetadata.

  • Contribution scope fit and linked maintainer decision: not applicable (ordinary fix within existing boundary).

  • CLI and MCP/tool-catalog contract: swift_symbols[].address in inspect_native_dispatch_metadata output may now be null. This widens an output field; previously the same input threw. npm run metadata:check passes with no generated-metadata change.

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: an unlocated symbol is reported as unlocated (null) rather than with an empty-string address.

  • Target selection, authority, upstream behavior, and cleanup details: not applicable.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

Evidence and regression coverage

  • Tests added or updated: src/domain/native/objcSwiftMetadata.test.ts "reports symbols named without an address as unlocated": an empty-address Swift symbol, an empty-address Objective-C method symbol, and an addressed Swift symbol control.

  • Base reproduction: with the source change stashed, the new test fails with ZodError (executed). With the change, it passes.

  • Remaining proof gaps: no real provider was observed returning an empty list_names address; the reachability claim comes from the addressedValue schema.

  • 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

  • npx vitest run src/domain/native/objcSwiftMetadata.test.ts with the fix stashed: the new test fails with ZodError.
  • Rebased on main 060587b45: npx vitest run src/domain/native src/native: 25 files, 398 tests passed. Earlier on the original base: npx vitest run src/domain/native src/native src/application/native src/contracts: 41 files, 556 tests passed.
  • npx vitest run on tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts and tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts: passed. tests/boundary/providers/native/nativeProvider.test.ts has 12 failures on this Windows host, identical with and without this change (pre-existing, native command-capture tests).
  • npm run metadata:check: passed. npx tsc --noEmit: exit 0. Pre-push npm run check:fast: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; an output field gains null for input that previously failed.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; Windows x64, Node 22.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no target interaction beyond existing inventory reads.

Author readiness

Human owner:

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/4547 **Author:** [@Iyanuoluwa007](https://github.com/Iyanuoluwa007) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/objc-empty-method-selector` --- ### 📝 Commits (1) - [`8c270ca`](https://github.com/morluto/rea/commit/8c270ca626ecd44dd386e3413c0686789448bf22) fix(native): report symbols named without an address as unlocated ### 📊 Changes **2 files changed** (+37 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/native/objcSwiftMetadata.test.ts` (+27 -0) 📝 `src/domain/native/objcSwiftMetadata.ts` (+10 -7) </details> ### 📄 Description ## Summary Fixes #4542. A provider name-inventory entry with an empty address no longer makes `inspectNativeDispatchMetadata` throw. An empty address is treated as an unknown location (`null`): Swift symbols keep their mangled names with `address: null`, and symbolized Objective-C methods report `implementation_address: null` instead of `""`. ## Problem and expected behavior `NativeDispatchMetadataInspection` accepts `list_names` entries through `addressedValue`, whose `address` is `z.string()`, so an empty address is admitted from a provider. `inspectNativeDispatchMetadata` copied it verbatim into `swift_symbols[].address`, which is `z.string().min(1)`, and the final `objcSwiftMetadataSchema.parse` rejected the whole result (`too_small` at `swift_symbols[0].address`). Objective-C methods did not crash but carried `""` as an implementation address and evidence location, which is not an address. ## Change and scope `src/domain/native/objcSwiftMetadata.ts`: - Normalize `entry.address === ""` to `null` once per entry, and use it for the method's `implementation_address`, `location.address`, evidence location, and the Swift symbol's `address`. - `swiftSymbolSchema.address` becomes `z.string().min(1).nullable()`, matching `nativeMetadataLocationSchema.address` and `implementation_address`, which are already nullable. Non-empty addresses are unchanged. This PR originally also carried fixes for #4534 and #4555. Those are now fixed on main (a70c42e03, f31b231a9, 060587b45), so the branch was rebuilt on current main with only the #4542 change, which main does not cover: the regression test below still fails on main at 060587b45. ## Contract and boundary impact - Semantic owner and earliest changed stage: provider name-inventory projection in `inspectNativeDispatchMetadata`. - Contribution scope fit and linked maintainer decision: not applicable (ordinary fix within existing boundary). - CLI and MCP/tool-catalog contract: `swift_symbols[].address` in `inspect_native_dispatch_metadata` output may now be `null`. This widens an output field; previously the same input threw. `npm run metadata:check` passes with no generated-metadata change. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: an unlocated symbol is reported as unlocated (`null`) rather than with an empty-string address. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata, package, or installation impact: none. - [x] Read existing files or captured data. ## Evidence and regression coverage - Tests added or updated: `src/domain/native/objcSwiftMetadata.test.ts` "reports symbols named without an address as unlocated": an empty-address Swift symbol, an empty-address Objective-C method symbol, and an addressed Swift symbol control. - Base reproduction: with the source change stashed, the new test fails with `ZodError` (executed). With the change, it passes. - Remaining proof gaps: no real provider was observed returning an empty `list_names` address; the reachability claim comes from the `addressedValue` schema. - [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 - `npx vitest run src/domain/native/objcSwiftMetadata.test.ts` with the fix stashed: the new test fails with `ZodError`. - Rebased on main 060587b45: `npx vitest run src/domain/native src/native`: 25 files, 398 tests passed. Earlier on the original base: `npx vitest run src/domain/native src/native src/application/native src/contracts`: 41 files, 556 tests passed. - `npx vitest run` on `tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts` and `tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts`: passed. `tests/boundary/providers/native/nativeProvider.test.ts` has 12 failures on this Windows host, identical with and without this change (pre-existing, native command-capture tests). - `npm run metadata:check`: passed. `npx tsc --noEmit`: exit 0. Pre-push `npm run check:fast`: passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none; an output field gains `null` for input that previously failed. - Real Hopper/Ghidra, browser, or OS coverage: not applicable; Windows x64, Node 22. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no target interaction beyond existing inventory reads. ## Author readiness Human owner: <!-- @GitHub-handle --> - [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. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:13:23 +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#6299
No description provided.