[PR #7196] feat(native): add static library function matcher #7710

Open
opened 2026-11-03 13:39:48 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7196
Author: @amitpadhan525
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: feat/7189-static-library-identification


📝 Commits (6)

  • f6c0fd4 feat(native): add static library function matcher
  • a7e8cc2 fix(native): enforce library matcher budgets
  • cb0ab60 fix(native): bound library signature token parsing
  • 5519bcb fix(native): return library matcher input errors
  • 80f794e test(native): align matcher assertions with testing guide and bound candidate groups
  • c027d4f fix(native): enforce total matches budget to bound match growth

📊 Changes

2 files changed (+992 additions, -0 deletions)

View changed files

➕ src/domain/native/libraryFunctionIdentification.test.ts (+493 -0)
➕ src/domain/native/libraryFunctionIdentification.ts (+499 -0)

📄 Description

Summary

Prototype the Phase 1 domain matcher proposed in #7189 for static identification of known native library functions.

This contribution intentionally stops at the pure domain boundary:

  • Parses caller-supplied signatures containing hexadecimal bytes and ?? wildcards.
  • Matches only at function offset 0.
  • Ranks all matches deterministically by score, pattern length, then signature ID.
  • Preserves ambiguous matches instead of selecting a false winner.
  • Reports function and byte-budget skips as explicit unknowns.
  • Rejects duplicate IDs, malformed patterns, all-wildcard patterns, and oversized signature sets via the domain Result error algebra.

No signature corpus, provider registration, MCP tool, composition wiring, execution, or mutation is included.

Scope

This draft requests maintainer confirmation that the Phase 1 behavior and domain placement are appropriate before any integration work. Matches are pattern inferences, not proof of library provenance or behavioral equivalence.

Validation

  • Focused matcher suite: 23 tests passed.
  • Repeated focused suite: 23/23 independent runs passed.
  • npm run check:fast passed
  • npm run typecheck passed
  • npm exec -- oxfmt --check src/domain/native/libraryFunctionIdentification.ts src/domain/native/libraryFunctionIdentification.test.ts passed
  • npm run verify:architecture-guards passed
  • git diff --check passed

Related to #7189.

Author readiness

Human owner: @amitpadhan525

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

🔄 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/7196 **Author:** [@amitpadhan525](https://github.com/amitpadhan525) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/7189-static-library-identification` --- ### 📝 Commits (6) - [`f6c0fd4`](https://github.com/morluto/rea/commit/f6c0fd4098d94f54322498c9086910953e67b3aa) feat(native): add static library function matcher - [`a7e8cc2`](https://github.com/morluto/rea/commit/a7e8cc27268a6a597643ce684089e8c86cfed906) fix(native): enforce library matcher budgets - [`cb0ab60`](https://github.com/morluto/rea/commit/cb0ab606f51e686ab9b0d5dc58bdf23050f0af85) fix(native): bound library signature token parsing - [`5519bcb`](https://github.com/morluto/rea/commit/5519bcb05d49fd479019b9086af290e2d50aa7f9) fix(native): return library matcher input errors - [`80f794e`](https://github.com/morluto/rea/commit/80f794e097906d79b7e838279f3384db8a88ccad) test(native): align matcher assertions with testing guide and bound candidate groups - [`c027d4f`](https://github.com/morluto/rea/commit/c027d4f2a5829e123736d0368b9a62d3b8819b18) fix(native): enforce total matches budget to bound match growth ### 📊 Changes **2 files changed** (+992 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/native/libraryFunctionIdentification.test.ts` (+493 -0) ➕ `src/domain/native/libraryFunctionIdentification.ts` (+499 -0) </details> ### 📄 Description ## Summary Prototype the Phase 1 domain matcher proposed in #7189 for static identification of known native library functions. This contribution intentionally stops at the pure domain boundary: - Parses caller-supplied signatures containing hexadecimal bytes and `??` wildcards. - Matches only at function offset 0. - Ranks all matches deterministically by score, pattern length, then signature ID. - Preserves ambiguous matches instead of selecting a false winner. - Reports function and byte-budget skips as explicit unknowns. - Rejects duplicate IDs, malformed patterns, all-wildcard patterns, and oversized signature sets via the domain Result error algebra. No signature corpus, provider registration, MCP tool, composition wiring, execution, or mutation is included. ## Scope This draft requests maintainer confirmation that the Phase 1 behavior and domain placement are appropriate before any integration work. Matches are pattern inferences, not proof of library provenance or behavioral equivalence. ## Validation - Focused matcher suite: 23 tests passed. - Repeated focused suite: 23/23 independent runs passed. - `npm run check:fast` passed - `npm run typecheck` passed - `npm exec -- oxfmt --check src/domain/native/libraryFunctionIdentification.ts src/domain/native/libraryFunctionIdentification.test.ts` passed - `npm run verify:architecture-guards` passed - `git diff --check` passed Related to #7189. ## Author readiness Human owner: @amitpadhan525 - [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. --- <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#7710
No description provided.