[PR #3062] [CLOSED] feat(managed): add retained member summaries and pages #5586

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3062
Author: @jcamargos
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: codex/managed-member-views


📝 Commits (2)

  • 2d32777 feat(managed): add retained member summaries and pages
  • b8ea6d3 Merge remote-tracking branch 'origin/main' into sweep/3062

📄 Description

Summary

Add opt-in retained summaries and original-row pages for managed member inspections. A selected or unmatched type query can answer identity, counts and coverage without immediately returning the assembly-wide MemberRef inventory. Addresses #3010.

Problem and expected behavior

inspect_managed_members currently returns complete Evidence even for a question such as whether ICSharpCode.ILSpy.App exists and how many methods were observed. MemberRefs correctly remain assembly-wide. detail: "summary" now retains that complete parent and returns a linked summary; omitted/complete detail preserves the existing complete result. Both MCP compatibility representations remain present.

Change and scope

  • Extend the existing authenticated Evidence projection and retention owners. No additional parser, provider, runtime execution or authority.
  • Preserve selection/unmatched names, SHA-256, module/MVID, metadata, limitations, member coverage and independent user-string coverage. Report collection counts and method-body status counts.
  • Page types, exported_types, fields, methods, member_refs, call_edges, field_accesses and user_strings without changing original rows/order/tokens/signatures/body facts. Historical unexamined collections remain null, distinct from empty arrays. Page exhaustion does not claim complete source coverage.
  • Document portable CLI views through a JSON request file. One-shot inspect-managed-members continues returning complete Evidence; persistent first-call retained summary delivery is MCP-only.

Contract and boundary impact

  • Semantic owner: domain/analysisView/managedMemberView.ts; adapters use the existing application projection.
  • Contribution scope: existing static inspection delivery. A maintainer decision for execution/injection/mutation/protection recovery is not applicable.
  • CLI/MCP/catalog: additive member detail and managed-members view kind; exact output schemas validated after SDK conversion.
  • Provider/platform: existing PE/CLI parser unchanged; no new dependency or bridge.
  • Evidence/provenance: complete parent retained, authenticated inline and retained views, bundle export/import supported; views do not reopen the target.
  • Selection/authority/cleanup: caller inputs preserved; summary without retention fails before target access; existing session ownership unchanged.
  • Generated metadata/package: authored contracts updated; ignored generated catalogs validated, no generated artifacts or package changes committed.

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

Seven new boundary cases cover matched/unmatched selection, complete defaults, remembered paths, schema validation, reconstruction of all eight collections after source deletion, immutable parents, portable/bundle-import views, identity mismatch rejection, historical malformed/null results, independent partial user strings, unavailable retention and delivery capacity with smaller-page recovery. Existing artifact-summary and managed MCP tests remain passing.

Real Windows / Node 24.18.0 verification used the static parser against ILSpy.dll from the official ILSpy v11.1 x64 release: 1,893,376 bytes; SHA-256 97915c6945b182a1a3fee10397ba457990ed0f96b676361159d4468de8e44c4b; MVID 2f9bfa04-4f09-4bce-a714-afd5030ea167. This differs from the DLL in the issue. The DLL was never loaded/executed and its digest remained unchanged.

Both ICSharpCode.ILSpy.App and No.Such.Managed.Type completed through public MCP and the compiled CLI. The matched report has 1 type, 4 fields, 16 methods, 5,822 MemberRefs, 1,594 call edges, 219 field accesses and 92 strings. Member coverage is complete while strings remain partial with their two original terminal-flag issues. The unmatched report preserves the exact unmatched name and all 5,822 MemberRefs. Every paged collection reconstructed exactly. Six compiled CLI invocations verified complete reports, portable summaries and method pages against MCP facts.

Representative MCP calls:

{"name":"inspect_managed_members","arguments":{"path":"/absolute/path/ILSpy.dll","type_names":["ICSharpCode.ILSpy.App"],"detail":"summary"}}
{"name":"inspect_analysis_view","arguments":{"source":{"kind":"retained-evidence","evidence_id":"<normalized_result.parent_evidence_id>"},"view":{"kind":"managed-members","collection":"methods","offset":0,"limit":8}}}

Observed delivery measurements, including SDK text and structured output:

Selection / detail Response bytes Estimated response tokens First API call ms Repeated API calls ms CPU ms, first/repeats Process maxRSS KiB, first/final
matched / complete 7,142,971 2,066,560 11,049 1,227 / 834 12,766 / 1,374 / 1,173 655,148 / 693,824
matched / summary 15,969 4,077 12,346 1,187 / 1,242 13,031 / 1,203 / 1,281 655,616 / 1,001,472
unmatched / complete 5,758,393 1,684,417 26,404 3,944 / 3,644 19,000 / 2,171 / 1,812 646,804 / 683,072
unmatched / summary 15,073 3,811 21,760 2,884 / 3,241 19,266 / 2,140 / 1,735 652,152 / 979,212

Token estimates use tiktoken 0.9.0 / cl100k_base on serialized SDK payloads, not actual model usage. The same current full catalogue costs an estimated 776,177 tokens; requests cost 54 matched / 53 unmatched. Catalogue + one request + response estimates are 2,842,791 versus 780,308 matched, and 2,460,647 versus 780,041 unmatched. The bounded existence/counts/coverage/identity question needs one inspection call and no retries; retrieving every original row is a separate workflow.

Each first call ran in a fresh Node process; repeats reused it. OS caches were not flushed. API timing excludes catalogue retrieval/oracle comparison. Summary runs reconstructed all collections between the first and repeated calls; cumulative maxRSS therefore includes those extra pages, retained records and oracle/harness overhead. These are current complete-versus-summary delivery measurements, not a clean baseline/revision or whole-agent benchmark. Whole-agent tokens/timing and an independently instrumented process-family peak remain unmeasured. No general latency, CPU or memory improvement is claimed; parsing and retention still occur.

  • 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 check — passed all six tasks and architecture guards; 0 errors, existing repository warnings remain.
  • node node_modules/vitest/vitest.mjs run tests/boundary/mcp/managedMemberSummaryMcp.test.ts tests/boundary/mcp/managedArtifactSummaryMcp.test.ts tests/boundary/mcp/managedMcp.test.ts tests/boundary/cli/managedMemberViewCli.test.ts src/application/analysisView/AnalysisViewService.test.ts --maxWorkers=1 --no-file-parallelism — 28 service/MCP cases passed; the new three-process CLI case initially exceeded its 30-second test deadline.
  • After setting only that test's deadline to 60 seconds, node node_modules/vitest/vitest.mjs run tests/boundary/cli/managedMemberViewCli.test.ts --maxWorkers=1 --no-file-parallelism — passed in 20.5 seconds. All 29 relevant cases passed across the suite and targeted rerun; product deadlines unchanged. Scoped lint/format passed afterward.
  • npm run docs:check — passed, including 5 README consistency tests.
  • npm run verify:test-discovery — all 1,185 test files discovered exactly once.
  • Real ILSpy public MCP reconstruction plus six compiled CLI invocations described above — passed.
  • git diff --check — passed.

Compatibility, safety, and release

  • No breaking changes, migrations, dependencies or release metadata changes. Rollback is reverting the additive change.
  • Real static Windows PE/CLI workflow verified. Hopper/Ghidra/IDA are outside this change and were not exercised; other operating systems were not exercised locally.
  • Reviewed identity, malformed/partial input, source deletion, capacity, unavailable retention, ordering and immutable projection. Existing retention/delivery limits remain authoritative; no extra process or network authority.
  • Full repository test suite and whole-agent performance were not run. Targeted tests and real workflows provide the evidence above.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved; no new execution capability.
  • One focused outcome with a Conventional Commit title.
  • Related issue linked.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs/contracts updated and generated metadata validated.
  • Representative public CLI/MCP behavior recorded.
  • Final diff checked 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/3062 **Author:** [@jcamargos](https://github.com/jcamargos) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/managed-member-views` --- ### 📝 Commits (2) - [`2d32777`](https://github.com/morluto/rea/commit/2d327776318765e87fa9bac086d06e1c0238f375) feat(managed): add retained member summaries and pages - [`b8ea6d3`](https://github.com/morluto/rea/commit/b8ea6d38cb94e73d145c943e6eb38e365bb40559) Merge remote-tracking branch 'origin/main' into sweep/3062 ### 📄 Description ## Summary Add opt-in retained summaries and original-row pages for managed member inspections. A selected or unmatched type query can answer identity, counts and coverage without immediately returning the assembly-wide MemberRef inventory. Addresses #3010. ## Problem and expected behavior `inspect_managed_members` currently returns complete Evidence even for a question such as whether `ICSharpCode.ILSpy.App` exists and how many methods were observed. MemberRefs correctly remain assembly-wide. `detail: "summary"` now retains that complete parent and returns a linked summary; omitted/`complete` detail preserves the existing complete result. Both MCP compatibility representations remain present. ## Change and scope - Extend the existing authenticated Evidence projection and retention owners. No additional parser, provider, runtime execution or authority. - Preserve selection/unmatched names, SHA-256, module/MVID, metadata, limitations, member coverage and independent user-string coverage. Report collection counts and method-body status counts. - Page `types`, `exported_types`, `fields`, `methods`, `member_refs`, `call_edges`, `field_accesses` and `user_strings` without changing original rows/order/tokens/signatures/body facts. Historical unexamined collections remain null, distinct from empty arrays. Page exhaustion does not claim complete source coverage. - Document portable CLI views through a JSON request file. One-shot `inspect-managed-members` continues returning complete Evidence; persistent first-call retained summary delivery is MCP-only. ## Contract and boundary impact - Semantic owner: `domain/analysisView/managedMemberView.ts`; adapters use the existing application projection. - Contribution scope: existing static inspection delivery. A maintainer decision for execution/injection/mutation/protection recovery is not applicable. - CLI/MCP/catalog: additive member `detail` and `managed-members` view kind; exact output schemas validated after SDK conversion. - Provider/platform: existing PE/CLI parser unchanged; no new dependency or bridge. - Evidence/provenance: complete parent retained, authenticated inline and retained views, bundle export/import supported; views do not reopen the target. - Selection/authority/cleanup: caller inputs preserved; summary without retention fails before target access; existing session ownership unchanged. - Generated metadata/package: authored contracts updated; ignored generated catalogs validated, no generated artifacts or package changes committed. 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 Seven new boundary cases cover matched/unmatched selection, complete defaults, remembered paths, schema validation, reconstruction of all eight collections after source deletion, immutable parents, portable/bundle-import views, identity mismatch rejection, historical malformed/null results, independent partial user strings, unavailable retention and delivery capacity with smaller-page recovery. Existing artifact-summary and managed MCP tests remain passing. Real Windows / Node 24.18.0 verification used the static parser against `ILSpy.dll` from the official [ILSpy v11.1 x64 release](https://github.com/icsharpcode/ILSpy/releases/download/v11.1/ILSpy_windows_11.1.0.9782-x64.zip): 1,893,376 bytes; SHA-256 `97915c6945b182a1a3fee10397ba457990ed0f96b676361159d4468de8e44c4b`; MVID `2f9bfa04-4f09-4bce-a714-afd5030ea167`. This differs from the DLL in the issue. The DLL was never loaded/executed and its digest remained unchanged. Both `ICSharpCode.ILSpy.App` and `No.Such.Managed.Type` completed through public MCP and the compiled CLI. The matched report has 1 type, 4 fields, 16 methods, 5,822 MemberRefs, 1,594 call edges, 219 field accesses and 92 strings. Member coverage is complete while strings remain partial with their two original terminal-flag issues. The unmatched report preserves the exact unmatched name and all 5,822 MemberRefs. Every paged collection reconstructed exactly. Six compiled CLI invocations verified complete reports, portable summaries and method pages against MCP facts. Representative MCP calls: ```json {"name":"inspect_managed_members","arguments":{"path":"/absolute/path/ILSpy.dll","type_names":["ICSharpCode.ILSpy.App"],"detail":"summary"}} {"name":"inspect_analysis_view","arguments":{"source":{"kind":"retained-evidence","evidence_id":"<normalized_result.parent_evidence_id>"},"view":{"kind":"managed-members","collection":"methods","offset":0,"limit":8}}} ``` Observed delivery measurements, including SDK text and structured output: | Selection / detail | Response bytes | Estimated response tokens | First API call ms | Repeated API calls ms | CPU ms, first/repeats | Process maxRSS KiB, first/final | | --- | ---: | ---: | ---: | --- | --- | --- | | matched / complete | 7,142,971 | 2,066,560 | 11,049 | 1,227 / 834 | 12,766 / 1,374 / 1,173 | 655,148 / 693,824 | | matched / summary | 15,969 | 4,077 | 12,346 | 1,187 / 1,242 | 13,031 / 1,203 / 1,281 | 655,616 / 1,001,472 | | unmatched / complete | 5,758,393 | 1,684,417 | 26,404 | 3,944 / 3,644 | 19,000 / 2,171 / 1,812 | 646,804 / 683,072 | | unmatched / summary | 15,073 | 3,811 | 21,760 | 2,884 / 3,241 | 19,266 / 2,140 / 1,735 | 652,152 / 979,212 | Token estimates use tiktoken 0.9.0 / cl100k_base on serialized SDK payloads, not actual model usage. The same current full catalogue costs an estimated 776,177 tokens; requests cost 54 matched / 53 unmatched. Catalogue + one request + response estimates are 2,842,791 versus 780,308 matched, and 2,460,647 versus 780,041 unmatched. The bounded existence/counts/coverage/identity question needs one inspection call and no retries; retrieving every original row is a separate workflow. Each first call ran in a fresh Node process; repeats reused it. OS caches were not flushed. API timing excludes catalogue retrieval/oracle comparison. Summary runs reconstructed all collections between the first and repeated calls; cumulative maxRSS therefore includes those extra pages, retained records and oracle/harness overhead. These are current complete-versus-summary delivery measurements, not a clean baseline/revision or whole-agent benchmark. Whole-agent tokens/timing and an independently instrumented process-family peak remain unmeasured. No general latency, CPU or memory improvement is claimed; parsing and retention still occur. - [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 check` — passed all six tasks and architecture guards; 0 errors, existing repository warnings remain. - `node node_modules/vitest/vitest.mjs run tests/boundary/mcp/managedMemberSummaryMcp.test.ts tests/boundary/mcp/managedArtifactSummaryMcp.test.ts tests/boundary/mcp/managedMcp.test.ts tests/boundary/cli/managedMemberViewCli.test.ts src/application/analysisView/AnalysisViewService.test.ts --maxWorkers=1 --no-file-parallelism` — 28 service/MCP cases passed; the new three-process CLI case initially exceeded its 30-second test deadline. - After setting only that test's deadline to 60 seconds, `node node_modules/vitest/vitest.mjs run tests/boundary/cli/managedMemberViewCli.test.ts --maxWorkers=1 --no-file-parallelism` — passed in 20.5 seconds. All 29 relevant cases passed across the suite and targeted rerun; product deadlines unchanged. Scoped lint/format passed afterward. - `npm run docs:check` — passed, including 5 README consistency tests. - `npm run verify:test-discovery` — all 1,185 test files discovered exactly once. - Real ILSpy public MCP reconstruction plus six compiled CLI invocations described above — passed. - `git diff --check` — passed. ## Compatibility, safety, and release - No breaking changes, migrations, dependencies or release metadata changes. Rollback is reverting the additive change. - Real static Windows PE/CLI workflow verified. Hopper/Ghidra/IDA are outside this change and were not exercised; other operating systems were not exercised locally. - Reviewed identity, malformed/partial input, source deletion, capacity, unavailable retention, ordering and immutable projection. Existing retention/delivery limits remain authoritative; no extra process or network authority. - Full repository test suite and whole-agent performance were not run. Targeted tests and real workflows provide the evidence above. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved; no new execution capability. - [x] One focused outcome with a Conventional Commit title. - [x] Related issue linked. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs/contracts updated and generated metadata validated. - [x] Representative public CLI/MCP behavior recorded. - [x] Final diff checked 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:07:47 +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#5586
No description provided.