[PR #5674] [MERGED] fix(managed): treat extension-only module scopes as unknown identity #7029

Closed
opened 2026-11-01 21:44:49 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5674
Author: @umi008
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @morluto

Base: main ← Head: fix/5467-empty-module-identity


📝 Commits (1)

  • 2b3961a fix(managed): treat extension-only module scopes as unknown identity

📊 Changes

2 files changed (+27 additions, -5 deletions)

View changed files

📝 src/domain/managed/managedNativeVerificationMatch.ts (+11 -5)
📝 tests/conformance/providers/managed/managedNativeVerification.test.ts (+16 -0)

📄 Description

Summary

Fixes #5467. A P/Invoke scope such as .dll normalizes to an empty module identity. Shared-library aliasing (lib.dylib → lib → ``) also produced an empty identity, so .dll was reported verified/exact-export-name against lib.dylib/lib.so, and contradicted/module-mismatch against foo.dll.

Problem and expected behavior

docs/managed-code-analysis.md requires unresolved correspondence when either side lacks a usable module identity, and a mismatch only when both identities exist and differ. The declared side checked only raw text emptiness, not the normalized identity.

Change and scope

In src/domain/managed/managedNativeVerificationMatch.ts:

  • declaredModuleIdentity returns the normalized declared identity, or null when normalization leaves no name. Both moduleCompatible and scopeKnown use it, so an extension-only scope is unknown identity.
  • nativeModuleIdentities no longer yields an empty identity (from lib.dylib/lib.so alias stripping).

Whitespace-only and null scopes keep their existing handling. Contribution scope: not applicable (fix within existing boundaries).

Contract and boundary impact

  • Semantic owner and earliest changed stage: managed/native verification match (domain)

  • Contribution scope fit and linked maintainer decision: not applicable

  • CLI and MCP/tool-catalog contract: no schema change; verify-managed-native-boundaries / verify_managed_native_boundaries now return unresolved/module-identity-unknown for extension-only scopes as documented

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

  • Evidence, artifact, provenance, or reconstruction contract: corrects verification status for this input class; candidates retained

  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable

  • Generated metadata, package, or installation impact: none

  • Read existing files or captured data.

Evidence and regression coverage

  • Tests added or updated: tests/conformance/providers/managed/managedNativeVerification.test.ts — scope .dll against lib.dylib, lib.so, foo.dll stays unresolved/module-identity-unknown with its candidate.
  • Base reproduction: the new assertion failed on the base with status: "verified", basis: "exact-export-name"; it passes with the change. The issue's CLI script, run against the built change, now prints unresolved/module-identity-unknown for all three modules (before: verified, verified, contradicted).
  • Remaining proof gaps: no real managed assemblies or native providers.

Validation performed

  • npm run test:local -- tests/conformance/providers/managed/managedNativeVerification.test.ts — 13 passed
  • node scripts/run-exact-tests.mjs on src/contracts/tupleSchemaParity.test.ts, src/contracts/workflowInputContracts.test.ts, tests/boundary/mcp/managedNativeVerificationAdapters.test.ts, tests/boundary/mcp/managedWorkflowUnknownIdentityMcp.test.ts, tests/boundary/mcp/outputSchemaSemanticConstraints.test.ts, and the conformance test — 6 files, 49 passed
  • npm run check:fast — passed

Compatibility, safety, and release

  • Breaking changes or migration steps: none
  • Real Hopper/Ghidra, browser, or OS coverage: Windows 11 local only, synthetic Evidence
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: none

Author readiness

Human owner: @umi008

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

🤖 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/5674 **Author:** [@umi008](https://github.com/umi008) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/5467-empty-module-identity` --- ### 📝 Commits (1) - [`2b3961a`](https://github.com/morluto/rea/commit/2b3961a292c506703bbce9fec0dc5941da70646c) fix(managed): treat extension-only module scopes as unknown identity ### 📊 Changes **2 files changed** (+27 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/managed/managedNativeVerificationMatch.ts` (+11 -5) 📝 `tests/conformance/providers/managed/managedNativeVerification.test.ts` (+16 -0) </details> ### 📄 Description ## Summary Fixes #5467. A P/Invoke scope such as `.dll` normalizes to an empty module identity. Shared-library aliasing (`lib.dylib` → `lib` → ``) also produced an empty identity, so `.dll` was reported `verified/exact-export-name` against `lib.dylib`/`lib.so`, and `contradicted/module-mismatch` against `foo.dll`. ## Problem and expected behavior `docs/managed-code-analysis.md` requires unresolved correspondence when either side lacks a usable module identity, and a mismatch only when both identities exist and differ. The declared side checked only raw text emptiness, not the normalized identity. ## Change and scope In `src/domain/managed/managedNativeVerificationMatch.ts`: - `declaredModuleIdentity` returns the normalized declared identity, or `null` when normalization leaves no name. Both `moduleCompatible` and `scopeKnown` use it, so an extension-only scope is unknown identity. - `nativeModuleIdentities` no longer yields an empty identity (from `lib.dylib`/`lib.so` alias stripping). Whitespace-only and `null` scopes keep their existing handling. Contribution scope: not applicable (fix within existing boundaries). ## Contract and boundary impact - Semantic owner and earliest changed stage: managed/native verification match (domain) - Contribution scope fit and linked maintainer decision: not applicable - CLI and MCP/tool-catalog contract: no schema change; `verify-managed-native-boundaries` / `verify_managed_native_boundaries` now return `unresolved/module-identity-unknown` for extension-only scopes as documented - Provider, bridge, target-format, or platform compatibility: none - Evidence, artifact, provenance, or reconstruction contract: corrects verification status for this input class; candidates retained - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable - Generated metadata, package, or installation impact: none - [x] Read existing files or captured data. ## Evidence and regression coverage - Tests added or updated: `tests/conformance/providers/managed/managedNativeVerification.test.ts` — scope `.dll` against `lib.dylib`, `lib.so`, `foo.dll` stays `unresolved/module-identity-unknown` with its candidate. - Base reproduction: the new assertion failed on the base with `status: "verified"`, `basis: "exact-export-name"`; it passes with the change. The issue's CLI script, run against the built change, now prints `unresolved/module-identity-unknown` for all three modules (before: verified, verified, contradicted). - Remaining proof gaps: no real managed assemblies or native providers. ## Validation performed - `npm run test:local -- tests/conformance/providers/managed/managedNativeVerification.test.ts` — 13 passed - `node scripts/run-exact-tests.mjs` on `src/contracts/tupleSchemaParity.test.ts`, `src/contracts/workflowInputContracts.test.ts`, `tests/boundary/mcp/managedNativeVerificationAdapters.test.ts`, `tests/boundary/mcp/managedWorkflowUnknownIdentityMcp.test.ts`, `tests/boundary/mcp/outputSchemaSemanticConstraints.test.ts`, and the conformance test — 6 files, 49 passed - `npm run check:fast` — passed ## Compatibility, safety, and release - Breaking changes or migration steps: none - Real Hopper/Ghidra, browser, or OS coverage: Windows 11 local only, synthetic Evidence - Package or release metadata impact: none - Security, privacy, process, or containment review: none ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: @umi008 - [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 <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [ ] 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. 🤖 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-11-01 21:44:49 +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#7029
No description provided.