[PR #6856] fix(comparison): reject blank function names #7426

Open
opened 2026-11-01 21:47:47 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6856
Author: @SC-10749
Created: 10/23/2026
Status: 🔄 Open

Base: main ← Head: codex/fix-empty-function-symbol-name


📝 Commits (9)

  • 4671e6d fix(comparison): ignore blank inventory symbols
  • 3db9423 fix(native): reject whitespace-only reported symbols
  • 346513f fix(native): reject blank inventory symbol matches
  • 4f134ac test(native): use named inventory fixture
  • a5fa6dd test(native): assert blank names never pair by symbol
  • d4234a7 fix(native): preserve blank symbol origin conflicts
  • 14a3737 test(comparison): cover blank names in calls
  • ae0451e test(comparison): avoid masking blank call names
  • 0686373 fix: clean up rebased inventory imports

📊 Changes

4 files changed (+109 additions, -5 deletions)

View changed files

📝 src/domain/functionComparison.test.ts (+30 -0)
📝 src/domain/native/functionInventory.ts (+7 -4)
📝 src/domain/native/nativeSymbol.ts (+1 -1)
📝 tests/acceptance/tools/nativeFunctionMatching.test.ts (+71 -0)

📄 Description

Summary

compare_functions now treats an blank procedure name as unavailable symbol identity. Equal blank names no longer establish symbol correspondence or an unchanged identity claim. Fixes #6824.

Problem and expected behavior

Two schema-valid function dossiers with procedure.name: "" were reported as function_match: { status: "matched", method: "symbol" }, and the identity dimension could be reported unchanged. Empty and whitespace-only names carry no symbol identity; the match should remain ambiguous and the identity and overall result should remain unknown.

Change and scope

Define one shared rule for stable function names and use it in function matching, identity and call dimensions, reference endpoints, and structural candidates. The schema and retained Evidence are unchanged; only comparisons involving blank names stay unresolved. Address-derived name behavior is preserved.

Follow the contribution scope. This is an ordinary fix within the existing comparison boundary; a separate maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Comparison normalization, before match classification and dimension projection.
  • Contribution scope fit and linked maintainer decision: Existing static Evidence comparison; ordinary bug fix, decision not applicable.
  • CLI and MCP/tool-catalog contract: No schema or tool-catalog shape change; compare_functions now reports unknown identity for blank names.
  • Provider, bridge, target-format, or platform compatibility: No provider or platform behavior changes.
  • Evidence, artifact, provenance, or reconstruction contract: Original names and Evidence provenance remain intact; derived identity stays unknown.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): Not applicable; no target selection, execution, or cleanup.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): No generated metadata, package, or installation changes.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: Domain coverage verifies empty callee names leave calls unknown; public MCP coverage verifies blank procedure names yield an ambiguous match, unknown identity, and unknown overall result.
  • Base reproduction or other evidence: The public MCP regression failed on the base revision: it returned matched/symbol and identity: unchanged. That fixture has differing pseudocode, so its base overall result was changed; the issue's equivalent-facet reproduction reports an unchanged overall result.
  • User-visible CLI/MCP output (if applicable): The structured MCP result now reports status: "unknown", function_match.status: "ambiguous", and identity.status: "unknown".
  • Remaining proof gaps: No native Hopper or Ghidra provider was run; native-provider reach and real-world frequency remain unestablished.

For evidence-bearing changes:

  • 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 --yes npm@11.16.0 run test:local -- src/domain/functionComparison.test.ts src/domain/functionReferenceCompatibility.test.ts src/domain/native/functionStructuralCandidate.test.ts — passed; 76 tests.
  • npx --yes npm@11.16.0 run test:focused -- tests/boundary/mcp/functionComparisonMcp.test.ts tests/boundary/mcp/functionComparisonIntegrityMcp.test.ts tests/boundary/mcp/functionComparisonCoverageMcp.test.ts tests/boundary/mcp/functionComparisonStringDecodingMcp.test.ts tests/boundary/mcp/functionComparisonReferenceFactsMcp.test.ts — passed; 39 tests.
  • npx --yes npm@11.16.0 run check:fast — passed (typecheck and lint); the pre-push check passed.
  • npx --yes npm@11.16.0 run docs:check — passed; README consistency tests 9/9.
  • pnpm hotline validate — passed; 1 project.
  • npm run check:pr — not completed on this Windows host. The full Vitest run reported failures in unrelated host-dependent suites and was stopped; WSL has no installed Linux distribution.
  • npm run test:python — failed on this Windows host because Python 3.13 does not provide the POSIX resource module.
  • npm run jscpd — total duplication 3.586% exceeds the 3.5% threshold; the report lists 0 new clones and 0 new duplicated lines.

Compatibility, safety, and release

  • Breaking changes or migration steps: None; the result is more conservative only when a procedure name is blank or whitespace-only.
  • Real Hopper/Ghidra, browser, or OS coverage: No real provider or target was used.
  • Package or release metadata impact: None; no schema or package metadata changes.
  • Security, privacy, process, or containment review: Offline comparison only; no target interaction.

Author readiness

Human owner: @SC-10749

  • 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/6856 **Author:** [@SC-10749](https://github.com/SC-10749) **Created:** 10/23/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/fix-empty-function-symbol-name` --- ### 📝 Commits (9) - [`4671e6d`](https://github.com/morluto/rea/commit/4671e6dcfe83f289cca031e7276356da2cffa1b2) fix(comparison): ignore blank inventory symbols - [`3db9423`](https://github.com/morluto/rea/commit/3db9423035bef4b5bbae81b04462b51dd6e9ab26) fix(native): reject whitespace-only reported symbols - [`346513f`](https://github.com/morluto/rea/commit/346513fae8ea94c3cfafe21208254b07a365c6b6) fix(native): reject blank inventory symbol matches - [`4f134ac`](https://github.com/morluto/rea/commit/4f134acd1af97dadb6dedf50c33ff6fb6e49219f) test(native): use named inventory fixture - [`a5fa6dd`](https://github.com/morluto/rea/commit/a5fa6dd7193a38db1d9997dbd8d4a371ef74f6bb) test(native): assert blank names never pair by symbol - [`d4234a7`](https://github.com/morluto/rea/commit/d4234a7b904f2acf03bed761a3c9a128e178a0cf) fix(native): preserve blank symbol origin conflicts - [`14a3737`](https://github.com/morluto/rea/commit/14a3737f3677f97d960206480de1db4f4fbcbf90) test(comparison): cover blank names in calls - [`ae0451e`](https://github.com/morluto/rea/commit/ae0451eb5bbcf12d097b31f11e8d2f28b1666f8d) test(comparison): avoid masking blank call names - [`0686373`](https://github.com/morluto/rea/commit/0686373e3c45aaaa637bece2534492880338e81d) fix: clean up rebased inventory imports ### 📊 Changes **4 files changed** (+109 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/functionComparison.test.ts` (+30 -0) 📝 `src/domain/native/functionInventory.ts` (+7 -4) 📝 `src/domain/native/nativeSymbol.ts` (+1 -1) 📝 `tests/acceptance/tools/nativeFunctionMatching.test.ts` (+71 -0) </details> ### 📄 Description ## Summary `compare_functions` now treats an blank procedure name as unavailable symbol identity. Equal blank names no longer establish symbol correspondence or an unchanged identity claim. Fixes #6824. ## Problem and expected behavior Two schema-valid function dossiers with `procedure.name: ""` were reported as `function_match: { status: "matched", method: "symbol" }`, and the identity dimension could be reported unchanged. Empty and whitespace-only names carry no symbol identity; the match should remain ambiguous and the identity and overall result should remain unknown. ## Change and scope Define one shared rule for stable function names and use it in function matching, identity and call dimensions, reference endpoints, and structural candidates. The schema and retained Evidence are unchanged; only comparisons involving blank names stay unresolved. Address-derived name behavior is preserved. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). This is an ordinary fix within the existing comparison boundary; a separate maintainer scope decision is not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: Comparison normalization, before match classification and dimension projection. - Contribution scope fit and linked maintainer decision: Existing static Evidence comparison; ordinary bug fix, decision not applicable. - CLI and MCP/tool-catalog contract: No schema or tool-catalog shape change; `compare_functions` now reports unknown identity for blank names. - Provider, bridge, target-format, or platform compatibility: No provider or platform behavior changes. - Evidence, artifact, provenance, or reconstruction contract: Original names and Evidence provenance remain intact; derived identity stays unknown. - Target selection, authority, upstream behavior, and cleanup details (if applicable): Not applicable; no target selection, execution, or cleanup. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): No generated metadata, package, or installation changes. Expected effects: - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: Domain coverage verifies empty callee names leave calls unknown; public MCP coverage verifies blank procedure names yield an ambiguous match, unknown identity, and unknown overall result. - Base reproduction or other evidence: The public MCP regression failed on the base revision: it returned `matched/symbol` and `identity: unchanged`. That fixture has differing pseudocode, so its base overall result was changed; the issue's equivalent-facet reproduction reports an unchanged overall result. - User-visible CLI/MCP output (if applicable): The structured MCP result now reports `status: "unknown"`, `function_match.status: "ambiguous"`, and `identity.status: "unknown"`. - Remaining proof gaps: No native Hopper or Ghidra provider was run; native-provider reach and real-world frequency remain unestablished. For evidence-bearing changes: - [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 --yes npm@11.16.0 run test:local -- src/domain/functionComparison.test.ts src/domain/functionReferenceCompatibility.test.ts src/domain/native/functionStructuralCandidate.test.ts` — passed; 76 tests. - `npx --yes npm@11.16.0 run test:focused -- tests/boundary/mcp/functionComparisonMcp.test.ts tests/boundary/mcp/functionComparisonIntegrityMcp.test.ts tests/boundary/mcp/functionComparisonCoverageMcp.test.ts tests/boundary/mcp/functionComparisonStringDecodingMcp.test.ts tests/boundary/mcp/functionComparisonReferenceFactsMcp.test.ts` — passed; 39 tests. - `npx --yes npm@11.16.0 run check:fast` — passed (typecheck and lint); the pre-push check passed. - `npx --yes npm@11.16.0 run docs:check` — passed; README consistency tests 9/9. - `pnpm hotline validate` — passed; 1 project. - `npm run check:pr` — not completed on this Windows host. The full Vitest run reported failures in unrelated host-dependent suites and was stopped; WSL has no installed Linux distribution. - `npm run test:python` — failed on this Windows host because Python 3.13 does not provide the POSIX `resource` module. - `npm run jscpd` — total duplication 3.586% exceeds the 3.5% threshold; the report lists 0 new clones and 0 new duplicated lines. ## Compatibility, safety, and release - Breaking changes or migration steps: None; the result is more conservative only when a procedure name is blank or whitespace-only. - Real Hopper/Ghidra, browser, or OS coverage: No real provider or target was used. - Package or release metadata impact: None; no schema or package metadata changes. - Security, privacy, process, or containment review: Offline comparison only; no target interaction. ## Author readiness Human owner: @SC-10749 - [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>
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#7426
No description provided.