Skip to content

feat(managed): filter and project retained member views - #7968

Merged
gensokyo-dev merged 2 commits into
mainfrom
feat/7282-managed-member-views
Oct 29, 2026
Merged

gensokyo-dev merged 2 commits into
mainfrom
feat/7282-managed-member-views

Conversation

@gensokyo-dev

Copy link
Copy Markdown
Collaborator

Summary

Fixes #7282. inspect_analysis_view can filter retained managed members by exact names/declaring types and project columns. CLI and MCP share this domain implementation; callers can retrieve signatures without the method bodies and IL anchors.

Problem and expected behavior

Previously, finding members in a large retained assembly required paging unrelated full rows or inspecting types again. For example:

{"source":{"kind":"retained-evidence","evidence_id":"<parent>"},"view":{"kind":"managed-members","collection":"methods","names":["ParseNumber","ParseReadNumber"],"declaring_types":["Newtonsoft.Json.JsonTextReader"],"fields":["name","declaring_type","signature"]}}

This returns matching rows in source order, with tokens, defining tokens, metadata offsets, original source_index, module/MVID and source coverage. Body facts remain accessible by explicitly selecting body or reading the complete parent Evidence.

Change and scope

Collection-specific contracts and a single shared selector own filtering/projection. Exact filters intersect before paging; empty lists match nothing. Only returned rows are projected. Fields-only pages visit only their requested slice; filtered pages count matches in one pass without materializing the matched inventory. Existing immutable-parent validation/cache is reused; no new index or cache.

Supported filter meanings are documented explicitly, including MemberRef parent types and call/field-access targets. Display strings are not reparsed. Schema definitions have one owner, separate from projection. Existing validation scenarios retain their assertions through smaller verification helpers.

Existing offline Evidence-query authority; a separate maintainer scope decision is not applicable. No provider, execution, installation or dependency change.

Contract and boundary impact

  • Owner: managedMemberViewSchemas and managedMemberView; existing CLI/MCP dispatch uses the same implementation.
  • Contract: additive exact selectors and collection-specific column enums. Omitting selectors/fields preserves original full rows. Historical unrecorded collections remain unknown and unavailable.
  • Evidence: filtered/projected rows retain source indices and mandatory identity fields. source_count describes producer-returned rows; unresolved_filter_rows preserves candidates with unknown requested facts. Known-match pagination never establishes absence among unknown/unexamined rows. Parent Evidence stays unchanged.
  • Compatibility: optional module context admits older saved views; omitted projected default columns are not recreated. Existing source admission, cancellation and cleanup owners remain in use.
  • Metadata: authored guide/skill and tool descriptions updated; ignored generated outputs remain 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.

Evidence and regression coverage

  • New regressions fail on unmodified main: 4 failed / 3 passed; the implemented cases pass. Coverage includes exact/intersecting/empty selectors, filtering before offsets, unknown candidates under complete/partial coverage, projection/default omission, relationship endpoint facts and legacy IL offsets.
  • Public compiled CLI and actual MCP SDK scenarios page every original collection, then project all eight collections after deleting the target. Exact selections preserve source identity and the original durable bundle. SDK-converted input/output schemas are validated against their dialect.
  • Public Newtonsoft.Json 13.0.3 (712,464 bytes; 4,208 methods) and Unsafe 6.0.0 (18,024 bytes; 45 methods). Independent dnfile 0.18.0 / pefile 2024.8.26 checks MVID, tokens, metadata offsets and raw-signature hashes. Full-body readback also matches independently mapped CIL hashes.
  • A fresh MCP session reading the CLI's saved Evidence produces the same view Evidence ID and result. Target and bundle hashes remain unchanged.

Validation performed

  • Three focused feature files: 25 tests passed after the owner refactor; subsequent endpoint regression file: 8 passed. Full/compact stdio MCP correctness probes also passed, with identical required facts and common parent IDs across workflows.
  • npm run check:fast: typecheck, lint and module-boundary validation passed. npm run docs:check: six tasks plus nine README checks passed. Formatting and diff checks passed.

Completed-task measurements

Pinned main 4671947c9 → feature 056348be2: 24 alternating fresh MCP tasks, three repetitions per corpus/workflow. Each discovers schemas, inspects/retains the complete assembly once, answers two successive questions and closes. Both profiles are compact, with application/managed/session families; all RPC frames, catalogs and text/structured replies are counted.

Workflow Estimated whole-wire tokens, small / large Large elapsed Large CPU Sampled family RSS
Existing full retained paging 93,323 / 10,533,131 11.51–11.81 s 14.93–15.16 s 795–797 MiB
Existing type-selected reinspection, deduplicated 94,311 / 658,449 8.21–8.85 s 11.32–12.04 s 645–656 MiB
Existing type inventory → method ranges 93,879 / 815,736 7.61–7.97 s 10.39–10.91 s 637–643 MiB
Exact filters + columns 49,854 / 54,873 7.23–7.72 s 9.90–10.51 s 603–610 MiB

Catalog cost is included: 36,697 → 36,786 estimated tokens. The new large task uses 4 tool calls versus 9/15/68; the small task uses 4 versus 3/4/4. Small elapsed ranges overlap (about 3.1–3.4 s). For the two large retained queries, the fastest previous composition took 371–416 ms versus 46 ms; whole-task startup/inspection still dominates, and best-case total timings overlap.

Tokenx counts are transport estimates, not model billing/rendered context. OS files and default CLI code caches were warm; sessions were fresh and each summary warmed its immutable parent. Cold OS/code-cache-disabled costs were not measured. Linux 10ms process-family RSS includes client/server/sampler; CPU uses wait4 plus sampler CPU. Observation/NDJSON costs are included. Heaps were capped at 2 GiB and family guard at 1.5 GiB/150 s; no stop occurred in the 24 paired tasks. No local tests/builds ran concurrently.

Full schemas were verified separately. One old large full-profile paging probe hit the 1.5 GiB family guard and was stopped; no survivors or target changes remained. It is an incomplete baseline, excluded from comparisons. Completed full-profile new workflows peaked at approximately 988/1,096 MiB. Fixtures, raw traces and benchmark scripts remain outside Git.

Compatibility, safety, and release

No intended breaking change or migration. Runtime verification: Linux x64, Node 24.22.1. Windows/macOS execution and the issue's private assembly remain unverified. Assemblies were parsed statically, never loaded or executed. No package/release metadata change.

Author readiness

Human owner:

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T01:30:11.669728Z c126364 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The reviewed changes appear safe to merge; no actionable defects were found.

Summary

Adds exact member filters and collection-specific column choices to retained views shared by CLI and MCP.

  • Retained member views can filter rows and choose columns.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI[CLI request] --> Shared[Shared analysis-view service]
  MCP[MCP request] --> Shared
  Parent[Authenticated parent Evidence] --> Shared
  Shared --> Filter[Match recorded names and types]
  Filter --> Page[Page known matches]
  Page --> Project[Keep requested columns and identity]
  Project --> Result[View Evidence with source coverage]
  Filter --> Unknown[Count unresolved candidates]
  Unknown --> Result
Loading

Reviews (1) · Last reviewed commit: "test(managed): guard relationship endpoi..." · Reviewed by Greptile

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

CI baseline audit for c126364:

  • Static checks fails only on formatting in docs/native-investigation.md and tests/boundary/providers/native/nativeProvider.test.ts. Both blobs are identical between the tested main 419a21130 and CI merge 112808b54. An isolated checkout of that main revision, using the same locked oxfmt 0.72.0, reproduces both failures.
  • Source tests reports one failure, NativeMacOSProviderInput.test.ts / unreadable lipo output for inspect_macho (21,581 passed / 16 skipped). The same isolated main reproduces that exact failure (1 failed / 4 passed); this PR changes no native-provider code.
  • On the exact CI merge tree 112808b54, typecheck/lint/module boundaries pass and all 26 relevant domain/public CLI/MCP tests pass. The feature branch's real-corpus and performance evidence remains in the PR body. These unrelated baseline problems have not been mixed into the feature diff.

The remaining CI shards are still running/queued; any feature-related finding will be addressed before merging.

@gensokyo-dev
gensokyo-dev merged commit cf9f010 into main Oct 29, 2026
35 of 40 checks passed
@gensokyo-dev
gensokyo-dev deleted the feat/7282-managed-member-views branch October 29, 2026 02:39
@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

Merged as cf9f010 after all eight portable test shards passed. The aggregate report contains 38,069 passing tests and only the previously audited native-provider baseline failure; formatting failures likewise reproduce on the tested main. The owner-authorized bypass was used for those unrelated failures. No human-review declaration was filled on behalf of the owner.

@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
@morluto morluto added enhancement New feature or request area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] managed-members: filter rows by declaring type or name and project columns

2 participants