[GH-ISSUE #5148] [Feature] Let the CLI request inspect_managed_members summary mode and page retained rows #3167

Closed
opened 2026-10-31 00:37:25 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @elricfd on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5148

Before submitting

  • I searched the open and closed issues and pull requests for a related proposal.
  • I understand the contribution scope must be reviewed before integration; open questions are welcome here.
  • This request does not include credentials, private samples, or sensitive target data.

Area

CLI

Current limitation

docs/managed-code-analysis.md ("Member summary and retained member rows") says that inspect_managed_members always returns the assembly-wide member_refs, so even one selected type can return megabytes, and recommends detail:"summary" followed by managed-members pages. The MCP tool has detail; rea inspect-managed-members --help lists only --type.

Observed (Mixed In Key 11 MixedInKey.exe, SHA-256 b014a00e6f6b80ed9313f68ad3da8f42c2de38f9111582e62145cec63c7da843, rea 6.7.0):

  • rea inspect-managed-members <exe> --type MixedInKey.Audio.AudioAnalyser --json: 4.36 MB; --token-count prints 989602. member_refs (6829 rows) is 3.98 MB of it.
  • Adding --filter-output normalized_result.methods gives 45231 tokens, but the full result is still produced first.
  • MCP inspect_managed_members {"path": "...", "type_names": ["MixedInKey.Audio.AudioAnalyser"], "detail": "summary"}: 7188 characters.

Use cases

An agent or analyst driving the CLI (rather than MCP) to inspect one type of a large assembly pays roughly 1M tokens for the default output.

Desired outcome and success criteria

The CLI can request the summary and page retained rows (for example --detail summary and a way to run the managed-members view on the retained Evidence), or the default CLI output avoids assembly-wide member_refs for a selected type. Success: a one-type inspection on this file costs a few thousand tokens by --token-count.

Expected interaction with targets

Read existing files or captured data

Target and scope details (optional)

Read-only metadata inspection, same as today.

Verification available so far

I have a prototype or observed results

Verification details (optional)

Measured as above, on one type; warm/cold runtime not separated (each run about 1 s). Not measured: wall time or memory for large outputs.

Alternatives considered

--filter-output trims what is printed, not what is produced. MCP summary mode works but is not reachable from the CLI. inspect-analysis-view pages retained Evidence, but needs a prior successful parent Evidence JSON, which the CLI does not leave.

Possible direction

Mirror the MCP detail option on the CLI command. Treat as a proposal.

References

Related: docs/managed-code-analysis.md; AGENTS.md "Performance" (agent tokens first).

Originally created by @elricfd on GitHub (Oct 19, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5148 ### Before submitting - [x] I searched the open and closed issues and pull requests for a related proposal. - [x] I understand the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope) must be reviewed before integration; open questions are welcome here. - [x] This request does not include credentials, private samples, or sensitive target data. ### Area CLI ### Current limitation docs/managed-code-analysis.md ("Member summary and retained member rows") says that `inspect_managed_members` always returns the assembly-wide `member_refs`, so even one selected type can return megabytes, and recommends `detail:"summary"` followed by `managed-members` pages. The MCP tool has `detail`; `rea inspect-managed-members --help` lists only `--type`. Observed (Mixed In Key 11 `MixedInKey.exe`, SHA-256 `b014a00e6f6b80ed9313f68ad3da8f42c2de38f9111582e62145cec63c7da843`, rea 6.7.0): - `rea inspect-managed-members <exe> --type MixedInKey.Audio.AudioAnalyser --json`: 4.36 MB; `--token-count` prints 989602. `member_refs` (6829 rows) is 3.98 MB of it. - Adding `--filter-output normalized_result.methods` gives 45231 tokens, but the full result is still produced first. - MCP `inspect_managed_members {"path": "...", "type_names": ["MixedInKey.Audio.AudioAnalyser"], "detail": "summary"}`: 7188 characters. ### Use cases An agent or analyst driving the CLI (rather than MCP) to inspect one type of a large assembly pays roughly 1M tokens for the default output. ### Desired outcome and success criteria The CLI can request the summary and page retained rows (for example `--detail summary` and a way to run the `managed-members` view on the retained Evidence), or the default CLI output avoids assembly-wide `member_refs` for a selected type. Success: a one-type inspection on this file costs a few thousand tokens by `--token-count`. ### Expected interaction with targets Read existing files or captured data ### Target and scope details (optional) Read-only metadata inspection, same as today. ### Verification available so far I have a prototype or observed results ### Verification details (optional) Measured as above, on one type; warm/cold runtime not separated (each run about 1 s). Not measured: wall time or memory for large outputs. ### Alternatives considered `--filter-output` trims what is printed, not what is produced. MCP summary mode works but is not reachable from the CLI. `inspect-analysis-view` pages retained Evidence, but needs a prior successful parent Evidence JSON, which the CLI does not leave. ### Possible direction Mirror the MCP `detail` option on the CLI command. Treat as a proposal. ### References Related: docs/managed-code-analysis.md; AGENTS.md "Performance" (agent tokens first).
Author
Owner

@XinwangTao commented on GitHub (Oct 19, 2026):

The 1M-token cost for inspecting a single type is a strong justification: token-count is the metric that actually matters for agent workflows, and produce-then-filter makes --filter-output nearly useless on large assemblies. Mirroring the MCP detail option on the CLI with durable Evidence paging (as #5167 does) closes the gap cleanly, and keeping assembly-wide member_refs opt-in on the full-detail path preserves the existing contract for consumers who do want it.

One thing worth confirming in the PR: that the paged managed-members view works against the retained Evidence produced by the summary run, without requiring a separate parent Evidence JSON — that was the awkward part of the inspect-analysis-view workaround. If that holds, the CLI finally has a cheap way to drill into one type of a large assembly.

<!-- gh-comment-id:6259644585 --> @XinwangTao commented on GitHub (Oct 19, 2026): The 1M-token cost for inspecting a single type is a strong justification: token-count is the metric that actually matters for agent workflows, and produce-then-filter makes --filter-output nearly useless on large assemblies. Mirroring the MCP detail option on the CLI with durable Evidence paging (as #5167 does) closes the gap cleanly, and keeping assembly-wide member_refs opt-in on the full-detail path preserves the existing contract for consumers who do want it. One thing worth confirming in the PR: that the paged managed-members view works against the retained Evidence produced by the summary run, without requiring a separate parent Evidence JSON — that was the awkward part of the inspect-analysis-view workaround. If that holds, the CLI finally has a cheap way to drill into one type of a large assembly.
Author
Owner

@XinwangTao commented on GitHub (Oct 22, 2026):

Confirmed working as proposed — with #5167 merged, the CLI can now request the summary mode and page retained rows directly, so inspecting a single type no longer pays the assembly-wide member_refs token cost (1M tokens on the Mixed In Key sample). The paged managed-members view operating on the retained Evidence without a separate parent Evidence JSON also removes the awkward part of the inspect-analysis-view workaround. Thanks for landing this.

<!-- gh-comment-id:6330173995 --> @XinwangTao commented on GitHub (Oct 22, 2026): Confirmed working as proposed — with #5167 merged, the CLI can now request the summary mode and page retained rows directly, so inspecting a single type no longer pays the assembly-wide member_refs token cost (1M tokens on the Mixed In Key sample). The paged managed-members view operating on the retained Evidence without a separate parent Evidence JSON also removes the awkward part of the inspect-analysis-view workaround. Thanks for landing this.
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#3167
No description provided.