[PR #3835] feat(managed)!: expose file-backed field initialization data #5938

Open
opened 2026-10-31 01:10:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3835
Author: @rancy777
Created: 10/15/2026
Status: 🔄 Open

Base: main ← Head: codex/managed-windows


📝 Commits (1)

  • 1a7500a feat(managed)!: expose file-backed field initialization data

📊 Changes

10 files changed (+762 additions, -11 deletions)

View changed files

📝 docs/managed-code-analysis.md (+35 -0)
📝 src/domain/managed/managedArtifact.ts (+24 -0)
📝 src/domain/managed/managedMemberComparisonCoverage.ts (+1 -0)
➕ src/dotnet/ManagedFieldInitialData.test.ts (+272 -0)
➕ src/dotnet/ManagedFieldInitialData.ts (+238 -0)
📝 src/dotnet/ManagedMemberInspector.ts (+7 -0)
📝 src/dotnet/ManagedMemberInspectorCore.ts (+29 -0)
📝 src/dotnet/ManagedMemberRows.ts (+26 -1)
📝 src/dotnet/ManagedPe.fixture.ts (+64 -10)
📝 tests/boundary/mcp/managedMemberSummaryMcp.test.ts (+66 -0)

📄 Description

Summary

Given a .NET initializer that references a FieldRVA-backed field, member inspection now returns the declared RVA, verified file offset and, for supported statically sized storage, the exact initial bytes and digest. Refs #3829.

The reader owns FieldRVA/ClassLayout facts and reuses the existing PE mapping, type-reference, member-list and representation-budget owners. It reads fixed-width primitive storage and nongeneric local fieldless value types with a nonzero ClassLayout size. Unsupported layouts retain their declarations and explicit unavailability. Duplicate declarations, contradictory flags and invalid mappings preserve diagnostic coverage; hexadecimal expansion is admitted before allocation.

CLI, MCP complete output and retained field pages carry the same result. No target constructors or assemblies are executed. No dependency, provider, tool or target-execution authority was added. Managed member comparison explicitly says that it does not compare initializer bytes.

Breaking contract change

Every member field now requires nullable initial_data. Null records observed absence of FieldRVA data; old member Evidence lacking the field is rejected. No compatibility fallback or migration is provided.

Validation

  • 483 tests pass in 25 selected managed parser/provider/MCP files, including malformed declarations, unsupported sizes, exact storage bounds, pre-allocation budget enforcement and retained pages after the source file is removed.
  • npm run check:fast, npm run check, npm run verify:test-discovery and npm run docs:check pass.
  • Post-commit review: 145 tests pass across eight files covering FieldRVA parsing, retained MCP field pages, member comparison, reconstruction and managed application graphs. This overlaps the earlier 483-test selection; the totals are not additive.
  • npm run verify:managed passes 11 portable scenarios. Optional ILSpy and operator-manifest lanes were not configured.
  • Windows 11 x64, Node 24.18.0/npm 11.16.0: a source-owned .NET 9 library returns the expected 32 bytes at RVA 10240/file offset 2560. CLI and actual stdio MCP results match PEReader's offset, bytes and SHA-256. Retained field pages match the complete result, and subsequent ping passes. Source bytes remain unchanged.
  • All four previously tested Windows system assemblies still report complete coverage, with 1,701 / 2,093 / 8,293 / 9,859 methods.

Validation source: commit 1a7500a3de, clean worktree, Windows x64, Node 24.18.0/npm 11.16.0. All ten source-file hashes match the validated implementation after commit hooks. The post-commit focused run satisfied build prerequisites from the repository cache, then real CLI/stdio MCP verification again matched the independent PEReader result; complete/summary/retained-field flows and subsequent ping passed, and target bytes remained unchanged.

Development base: 4692bb3330. Latest fetched upstream/main at follow-up review: cf0a38ad97 (14 upstream-only commits). Tests cover the PR head, not a prospective merge with those commits. Full CI, other host platforms, ILSpy, CPU/process-family memory and model-token costs remain unverified. GitHub exposed no CI results at the review snapshot. This PR contains only source, tests and documentation; no DLLs or generated build artifacts.

Author readiness

Human owner: @rancy777

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

The human owner has completed the initial readiness declarations. No maintainer scope decision or merge approval is claimed.


🔄 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/3835 **Author:** [@rancy777](https://github.com/rancy777) **Created:** 10/15/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/managed-windows` --- ### 📝 Commits (1) - [`1a7500a`](https://github.com/morluto/rea/commit/1a7500a3de9b164b54feda70044c8fe690cc40e4) feat(managed)!: expose file-backed field initialization data ### 📊 Changes **10 files changed** (+762 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `docs/managed-code-analysis.md` (+35 -0) 📝 `src/domain/managed/managedArtifact.ts` (+24 -0) 📝 `src/domain/managed/managedMemberComparisonCoverage.ts` (+1 -0) ➕ `src/dotnet/ManagedFieldInitialData.test.ts` (+272 -0) ➕ `src/dotnet/ManagedFieldInitialData.ts` (+238 -0) 📝 `src/dotnet/ManagedMemberInspector.ts` (+7 -0) 📝 `src/dotnet/ManagedMemberInspectorCore.ts` (+29 -0) 📝 `src/dotnet/ManagedMemberRows.ts` (+26 -1) 📝 `src/dotnet/ManagedPe.fixture.ts` (+64 -10) 📝 `tests/boundary/mcp/managedMemberSummaryMcp.test.ts` (+66 -0) </details> ### 📄 Description ## Summary Given a .NET initializer that references a FieldRVA-backed field, member inspection now returns the declared RVA, verified file offset and, for supported statically sized storage, the exact initial bytes and digest. Refs #3829. The reader owns FieldRVA/ClassLayout facts and reuses the existing PE mapping, type-reference, member-list and representation-budget owners. It reads fixed-width primitive storage and nongeneric local fieldless value types with a nonzero ClassLayout size. Unsupported layouts retain their declarations and explicit unavailability. Duplicate declarations, contradictory flags and invalid mappings preserve diagnostic coverage; hexadecimal expansion is admitted before allocation. CLI, MCP complete output and retained field pages carry the same result. No target constructors or assemblies are executed. No dependency, provider, tool or target-execution authority was added. Managed member comparison explicitly says that it does not compare initializer bytes. ## Breaking contract change Every member field now requires nullable initial_data. Null records observed absence of FieldRVA data; old member Evidence lacking the field is rejected. No compatibility fallback or migration is provided. ## Validation - 483 tests pass in 25 selected managed parser/provider/MCP files, including malformed declarations, unsupported sizes, exact storage bounds, pre-allocation budget enforcement and retained pages after the source file is removed. - npm run check:fast, npm run check, npm run verify:test-discovery and npm run docs:check pass. - Post-commit review: 145 tests pass across eight files covering FieldRVA parsing, retained MCP field pages, member comparison, reconstruction and managed application graphs. This overlaps the earlier 483-test selection; the totals are not additive. - npm run verify:managed passes 11 portable scenarios. Optional ILSpy and operator-manifest lanes were not configured. - Windows 11 x64, Node 24.18.0/npm 11.16.0: a source-owned .NET 9 library returns the expected 32 bytes at RVA 10240/file offset 2560. CLI and actual stdio MCP results match PEReader's offset, bytes and SHA-256. Retained field pages match the complete result, and subsequent ping passes. Source bytes remain unchanged. - All four previously tested Windows system assemblies still report complete coverage, with 1,701 / 2,093 / 8,293 / 9,859 methods. Validation source: commit 1a7500a3de9b164b54feda70044c8fe690cc40e4, clean worktree, Windows x64, Node 24.18.0/npm 11.16.0. All ten source-file hashes match the validated implementation after commit hooks. The post-commit focused run satisfied build prerequisites from the repository cache, then real CLI/stdio MCP verification again matched the independent PEReader result; complete/summary/retained-field flows and subsequent ping passed, and target bytes remained unchanged. Development base: 4692bb33300c7cb77b095b6cc0c33da861c1b860. Latest fetched upstream/main at follow-up review: cf0a38ad9774ee9acff3164052688f7a58a1c72c (14 upstream-only commits). Tests cover the PR head, not a prospective merge with those commits. Full CI, other host platforms, ILSpy, CPU/process-family memory and model-token costs remain unverified. GitHub exposed no CI results at the review snapshot. This PR contains only source, tests and documentation; no DLLs or generated build artifacts. ## Author readiness Human owner: @rancy777 - [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. The human owner has completed the initial readiness declarations. No maintainer scope decision or merge approval is claimed. --- <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#5938
No description provided.