Skip to content

fix(managed): project metadata with empty names without a display label - #3853

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
fix/managed-empty-name-label
Oct 15, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
fix/managed-empty-name-label

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3352. inspect-managed-members returns complete, authenticated Evidence for a PE/CLI Module row whose name is the empty string. Passing that exact Evidence to project-managed-application-graph failed with exit 1: invalid_request at observations.0.label. No graph was returned, so the readable type, method and field observations were lost.

Now the projection succeeds. The module node's observation has label: null, and properties.name keeps the source value "".

Problem and expected behavior

managedApplicationGraphNodes.ts copied metadata names directly into graph observation labels. The shared application-graph schema allows label to be a non-empty string or null. The managed inspector schema admits any string (z.string()) for these names. An empty metadata name (heap index 0) is therefore valid inspector Evidence, but it was an invalid graph label, so a display constraint rejected an identity fact.

Change and scope

  • The managed graph node builder, src/domain/managed/managedApplicationGraphNodes.ts, gains metadataLabel(name), which maps "" to null. It is applied to every label derived from a metadata name, all of which the inspector admits as empty:
    • assembly and module names
    • type full name
    • method and field labels (bare names when there is no declaring type)
    • P/Invoke import name
    • native implementation name
  • Each node's properties keeps the source values unchanged.
  • Not included: the artifact node label (basename of the path, never empty) and JavaScript graph labels.

Contract and boundary impact

  • Semantic owner and earliest changed stage: managed application graph node construction (display labels).
  • Contribution scope fit and linked maintainer decision: correctness fix within existing read-only projection; not applicable.
  • CLI and MCP/tool-catalog contract: schemas unchanged. label was already nullable, and a previously rejected input now projects.
  • Provider, bridge, target-format, or platform compatibility: unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: identity values stay in properties; only the display label becomes null.
  • Target selection, authority, upstream behavior, and cleanup details: unchanged.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.

Evidence and regression coverage

  • Tests added: tests/composition/analysis-sessions/managedApplicationGraph.test.ts builds the repository PE fixture and points the Module row's Name at the empty string-heap entry, as the issue does. It inspects the result with the production inspectManagedMembersBytes and projects that Evidence. It asserts the module observation { label: null, properties: { name: "" } } and that the type, method and field nodes are retained.
  • Base reproduction: against the unfixed module, the new test fails (1 failed | 17 passed).
  • User-visible CLI output for the issue's reproduction script, after:
    control projection 0  nodes 5
    inspection {"exit":0,"module_name":"","coverage":{"state":"complete","issues":[]}}
    projection 0  nodes=5
    
    Before: projection 1 {"code":"invalid_request",...,"message":"A nested value failed validation at observations.0.label: Too small: expected string to have >=1 characters"}.
  • Remaining proof gaps: there was no real managed assembly with empty metadata names to test against; the fixture is built with the repository's PE builder and read by the production inspector.

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/cli/jsonInputStatus.test.ts tests/composition/analysis-sessions/managedApplicationGraph.test.ts: 51 passed
  • npm run check:fast, npm run knip: passed
  • The issue's CLI reproduction (built CLI on macOS, Darwin 25.6 arm64): the control and empty-name projections both exit 0 with 5 nodes, at about 0.4 s each, the same as the control before the change.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Labels for non-empty names are unchanged.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

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.

🤖 Generated with Claude Code

The managed application graph copied metadata names into observation
labels. The graph schema requires a non-empty label or null, so Evidence
whose Module name was the string heap's empty entry made
project-managed-application-graph fail with invalid_request at
observations.0.label. The inspector accepts that Evidence as complete,
and no graph was returned.

Labels derived from metadata names (assembly, module, type, member,
P/Invoke import and native implementation) now become null when the name
is empty. The node's properties keep the source value, so display
formatting no longer rejects identity facts.

Fixes #3352

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji kaoru0822-kitauji added the track:bugs Small-bug loop track PRs label Oct 15, 2026
@chatgpt-codex-connector

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 ⚠️ Failed 2026-10-15T05:08:04.563970Z 04981eb 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Managed graph nodes now map empty display labels to null while keeping the original metadata values in their properties.

  • Managed graph projection keeps nodes with empty metadata names.

Reviews (1) · Last reviewed commit: "fix(managed): project metadata with empt..." · Reviewed by Greptile

@kaoru0822-kitauji
kaoru0822-kitauji merged commit cf0a38a into main Oct 15, 2026
33 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/managed-empty-name-label branch October 15, 2026 05:23
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Nov 23, 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 bug Something isn't working track:bugs Small-bug loop track PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Managed graph projection rejects inspector Evidence with an empty module name

2 participants