[PR #3814] [MERGED] fix(managed): preserve observed method header differences #5917

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3814
Author: @xiajiahang
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: fix/managed-method-header-comparison


📝 Commits (1)

  • c32790a fix(managed): preserve observed method header differences

📊 Changes

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

View changed files

📝 docs/managed-code-analysis.md (+6 -3)
📝 src/domain/managed/managedMemberComparisonItems.ts (+18 -2)
📝 tests/boundary/providers/managed/managedMemberComparisonFromMetadata.test.ts (+41 -0)
📝 tests/boundary/providers/managed/managedMemberComparisonPartialBodies.test.ts (+40 -0)

📄 Description

Summary

Fixes #3348. Managed member comparisons now retain observed init_locals and max_stack differences in the existing metadata dimension, even when the signature and CIL hashes match.

Problem and expected behavior

Two methods with identical signatures and CIL could be reported unchanged despite differing initialization flags or maximum-stack values. Equal CIL hashes exclude method headers and cannot establish equality of those independently observed facts.

Change and scope

Compare known header values in the shared method comparison owner before incomplete-CIL handling. Keep missing values unknown through body coverage. Matching keys and CIL hashes retain their existing boundaries. Update the owning guide and boundary regressions. This does not compare local-signature tokens as stable identities or infer runtime effects.

Contract and boundary impact

  • Semantic owner and earliest changed stage: managedMemberComparisonItems.ts, after member matching and before comparison status derivation.
  • Contribution scope fit and linked maintainer decision: routine static-analysis correctness fix; advance scope decision not applicable.
  • CLI and MCP/tool-catalog contract: shared comparison behavior; no schema, input, dimension-enum or catalog changes.
  • Provider, bridge, target-format, or platform compatibility: built-in PE/CLI analysis; no external-provider protocol changes.
  • Evidence, artifact, provenance, or reconstruction contract: preserve observed differences and unknown header values; source Evidence and links retained.
  • Target selection, authority, upstream behavior, and cleanup: existing selected artifacts; no new authority, target execution, processes or cleanup behavior.
  • Generated metadata, package, or installation impact: no authored metadata, package or installer changes; generated outputs uncommitted.

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

  • Byte-built PE/CLI regressions change only initialization or maximum stack, retain both equal CIL hashes, and require changed with metadata and exact CIL/signature matching. Self-comparison remains unchanged.
  • Admitted inspection-data cases preserve null headers as unknown and known differences beside incomplete CIL.
  • On base 4692bb333, the two byte-fixture regressions failed with unchanged and empty dimensions (63 peers passed); three header coverage regressions also failed (one peer passed).
  • Final focused run: all 96 tests in three files passed. Six built public CLI calls (three inspections and three comparisons) exited 0: initialization and stack variants report changed / ["metadata"], self-comparison reports unchanged / []; CIL hashes remain equal.
  • Remaining proof gaps: synthetic byte fixtures; no external disassembler, .NET execution, Windows or Linux runtime validation. No performance measurements; comparison adds two fixed-field checks per paired method without new artifact reads or output dimensions.

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

  • npm run test:focused -- tests/boundary/providers/managed/managedMemberComparison.test.ts tests/boundary/providers/managed/managedMemberComparisonFromMetadata.test.ts tests/boundary/providers/managed/managedMemberComparisonPartialBodies.test.ts — 96 tests passed in three files.
  • python3 ../verify-3348.py — built CLI: three inspections and three comparisons passed, retaining equal hashes and exact matching.
  • npm run check — exit 0, six Turbo tasks successful; architecture guards passed across 1405 sources. Lint reported 0 errors and 1430 repository-wide warnings.
  • git diff --check — passed.
  • npm run docs:check — exit 0, six Turbo tasks successful and five README consistency tests passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: no schema migration; corrected false unchanged classifications can now be changed or unknown.
  • Real Hopper/Ghidra, browser, or OS coverage: no external provider required; built CLI verified on macOS arm64, Node 24.18.0 with synthetic PE/CLI byte fixtures.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: static comparison of selected artifacts; no target execution, networking or new authority.

Author readiness

Human owner: @xiajiahang

  • 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/3814 **Author:** [@xiajiahang](https://github.com/xiajiahang) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/managed-method-header-comparison` --- ### 📝 Commits (1) - [`c32790a`](https://github.com/morluto/rea/commit/c32790a0970c67c29b06f15ef0e56acaac1f768f) fix(managed): preserve observed method header differences ### 📊 Changes **4 files changed** (+105 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `docs/managed-code-analysis.md` (+6 -3) 📝 `src/domain/managed/managedMemberComparisonItems.ts` (+18 -2) 📝 `tests/boundary/providers/managed/managedMemberComparisonFromMetadata.test.ts` (+41 -0) 📝 `tests/boundary/providers/managed/managedMemberComparisonPartialBodies.test.ts` (+40 -0) </details> ### 📄 Description ## Summary Fixes #3348. Managed member comparisons now retain observed `init_locals` and `max_stack` differences in the existing `metadata` dimension, even when the signature and CIL hashes match. ## Problem and expected behavior Two methods with identical signatures and CIL could be reported unchanged despite differing initialization flags or maximum-stack values. Equal CIL hashes exclude method headers and cannot establish equality of those independently observed facts. ## Change and scope Compare known header values in the shared method comparison owner before incomplete-CIL handling. Keep missing values unknown through body coverage. Matching keys and CIL hashes retain their existing boundaries. Update the owning guide and boundary regressions. This does not compare local-signature tokens as stable identities or infer runtime effects. ## Contract and boundary impact - Semantic owner and earliest changed stage: `managedMemberComparisonItems.ts`, after member matching and before comparison status derivation. - Contribution scope fit and linked maintainer decision: routine static-analysis correctness fix; advance scope decision not applicable. - CLI and MCP/tool-catalog contract: shared comparison behavior; no schema, input, dimension-enum or catalog changes. - Provider, bridge, target-format, or platform compatibility: built-in PE/CLI analysis; no external-provider protocol changes. - Evidence, artifact, provenance, or reconstruction contract: preserve observed differences and unknown header values; source Evidence and links retained. - Target selection, authority, upstream behavior, and cleanup: existing selected artifacts; no new authority, target execution, processes or cleanup behavior. - Generated metadata, package, or installation impact: no authored metadata, package or installer changes; generated outputs uncommitted. Expected effects: - [x] 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 - Byte-built PE/CLI regressions change only initialization or maximum stack, retain both equal CIL hashes, and require `changed` with `metadata` and exact CIL/signature matching. Self-comparison remains unchanged. - Admitted inspection-data cases preserve null headers as unknown and known differences beside incomplete CIL. - On base 4692bb333, the two byte-fixture regressions failed with `unchanged` and empty dimensions (63 peers passed); three header coverage regressions also failed (one peer passed). - Final focused run: all 96 tests in three files passed. Six built public CLI calls (three inspections and three comparisons) exited 0: initialization and stack variants report `changed` / `["metadata"]`, self-comparison reports `unchanged` / `[]`; CIL hashes remain equal. - Remaining proof gaps: synthetic byte fixtures; no external disassembler, .NET execution, Windows or Linux runtime validation. No performance measurements; comparison adds two fixed-field checks per paired method without new artifact reads or output dimensions. 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 - `npm run test:focused -- tests/boundary/providers/managed/managedMemberComparison.test.ts tests/boundary/providers/managed/managedMemberComparisonFromMetadata.test.ts tests/boundary/providers/managed/managedMemberComparisonPartialBodies.test.ts` — 96 tests passed in three files. - `python3 ../verify-3348.py` — built CLI: three inspections and three comparisons passed, retaining equal hashes and exact matching. - `npm run check` — exit 0, six Turbo tasks successful; architecture guards passed across 1405 sources. Lint reported 0 errors and 1430 repository-wide warnings. - `git diff --check` — passed. - `npm run docs:check` — exit 0, six Turbo tasks successful and five README consistency tests passed. ## Compatibility, safety, and release - Breaking changes or migration steps: no schema migration; corrected false unchanged classifications can now be changed or unknown. - Real Hopper/Ghidra, browser, or OS coverage: no external provider required; built CLI verified on macOS arm64, Node 24.18.0 with synthetic PE/CLI byte fixtures. - Package or release metadata impact: none. - Security, privacy, process, or containment review: static comparison of selected artifacts; no target execution, networking or new authority. ## Author readiness Human owner: @xiajiahang - [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 - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:10:26 +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#5917
No description provided.