[PR #4420] [CLOSED] fix(managed): authorize signature kind against its metadata row kind #6230

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

📋 Pull Request Information

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

Base: main ← Head: fix/managed-member-signature-kind


📝 Commits (1)

  • 89be9de fix(managed): authorize signature kind against its metadata row kind

📊 Changes

4 files changed (+155 additions, -22 deletions)

View changed files

📝 scripts/fixtures/managed/pe.mjs (+6 -2)
📝 src/domain/managed/managedArtifact.ts (+1 -0)
📝 src/dotnet/ManagedMemberRows.ts (+54 -20)
➕ src/dotnet/ManagedMemberSignatureKind.test.ts (+94 -0)

📄 Description

Summary

Fixes #3877.

A MethodDef / Field row whose signature blob decodes to the other
kind was reported as a clean decoded signature. The root cause: the row-level
core map kept the correct kind, but the per-member signature field spread
the blob-derived kind from decodeSignature, so:

  • coverage looked complete with no parse issues, and
  • downstream compare-managed-members could match the member as the wrong kind
    (item/match logic keys off signature.kind).

Changes

  • src/dotnet/ManagedMemberRows.ts: both row parsers now authorize the decoded
    signature against the kind their table permits via a shared
    signatureKindGuard. A mismatch is reported as a new invalid-signature-kind
    parse issue, and the member's signature keeps the row-authorized kind with
    parse_status: "malformed" (unknown-kind decodes pass through unchanged).
  • src/domain/managed/managedArtifact.ts: add invalid-signature-kind to the
    managed parse issue code enum.
  • scripts/fixtures/managed/pe.mjs: the PE fixture accepts explicit
    fieldSignature / methodSignature blobs.
  • src/dotnet/ManagedMemberSignatureKind.test.ts (new): regression tests for
    both mismatch directions plus the clean baseline.

Validation

  • npx vitest run src/dotnet/ManagedMemberInspector.test.ts src/dotnet/ManagedMemberSignatureKind.test.ts - 134 passed
  • npx tsc --noEmit -p tsconfig.json - clean
  • oxfmt --check / oxlint on changed files - no new warnings (the pre-existing
    parseFields max-params and managedArtifact.ts max-lines warnings on
    main are untouched)

🔄 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/4420 **Author:** [@KimChow](https://github.com/KimChow) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/managed-member-signature-kind` --- ### 📝 Commits (1) - [`89be9de`](https://github.com/morluto/rea/commit/89be9dec88cc03b58f8e24fc9db90e9f66b01c39) fix(managed): authorize signature kind against its metadata row kind ### 📊 Changes **4 files changed** (+155 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `scripts/fixtures/managed/pe.mjs` (+6 -2) 📝 `src/domain/managed/managedArtifact.ts` (+1 -0) 📝 `src/dotnet/ManagedMemberRows.ts` (+54 -20) ➕ `src/dotnet/ManagedMemberSignatureKind.test.ts` (+94 -0) </details> ### 📄 Description ## Summary Fixes #3877. A `MethodDef` / `Field` row whose signature blob decodes to the **other** kind was reported as a clean decoded signature. The root cause: the row-level `core` map kept the correct kind, but the per-member `signature` field spread the blob-derived `kind` from `decodeSignature`, so: - coverage looked `complete` with **no parse issues**, and - downstream `compare-managed-members` could match the member as the wrong kind (item/match logic keys off `signature.kind`). ## Changes - `src/dotnet/ManagedMemberRows.ts`: both row parsers now authorize the decoded signature against the kind their table permits via a shared `signatureKindGuard`. A mismatch is reported as a new `invalid-signature-kind` parse issue, and the member's signature keeps the **row-authorized** kind with `parse_status: "malformed"` (unknown-kind decodes pass through unchanged). - `src/domain/managed/managedArtifact.ts`: add `invalid-signature-kind` to the managed parse issue code enum. - `scripts/fixtures/managed/pe.mjs`: the PE fixture accepts explicit `fieldSignature` / `methodSignature` blobs. - `src/dotnet/ManagedMemberSignatureKind.test.ts` (new): regression tests for both mismatch directions plus the clean baseline. ## Validation - `npx vitest run src/dotnet/ManagedMemberInspector.test.ts src/dotnet/ManagedMemberSignatureKind.test.ts` - 134 passed - `npx tsc --noEmit -p tsconfig.json` - clean - `oxfmt --check` / `oxlint` on changed files - no new warnings (the pre-existing `parseFields` `max-params` and `managedArtifact.ts` `max-lines` warnings on `main` are untouched) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12:52 +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#6230
No description provided.