Skip to content

fix(kuna): say why Kuna cannot answer instead of a generic message - #4113

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
fix/kuna-unavailable-says-why
Oct 15, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
fix/kuna-unavailable-says-why

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Several Kuna capability gaps were built as AnalysisCapabilityUnavailableError without a user message. The MCP/CLI projection then shows its generic text for that tag: "This analysis is unavailable for the current target. Choose another analysis or target." The precise Kuna reason stayed in details.reason. That text is wrong for these cases: the target is fine, the requested address is just not code, or not a function node. An agent that follows "choose another analysis or target" abandons a target that works. Refs #1957.

Problem and expected behavior

Real Kuna 1.833, a small arm64 test program (odd, built with cc -O1), main b225765:

procedure_assembly 0x100004000   (printf's import slot)
  message: "This analysis is unavailable for the current target. Choose another analysis or target."
  details.reason: "Kuna's export lists no code at 0x100004000; import slots and data entries have no listing."
procedure_callers 0x100000504    (inside a function, not an entry)
  message: "This analysis is unavailable for the current target. Choose another analysis or target."
  details.reason: "Kuna's graph has no function node at 0x100000504; its relationships are unknown."
analyze_function 0x100004000     same as procedure_assembly

Expected: the message (and the remediation, which the projection derives from it) states the Kuna reason.

Change and scope

  • New kunaUnavailable(operation, reason, options) in src/kuna/KunaUnavailable.ts builds the capability error with the reason as its user message. Every Kuna site that presents its reason as-is now uses it:
    • assembly with no code at an address (KunaProjectReader);
    • an address without a graph node (KunaReferenceQueries);
    • a closed session;
    • an unsupported operation;
    • an unconfigured provider at client creation (KunaProvider);
    • the two installation checks that already passed userMessage: reason by hand.
  • The unsupported-operation reason now lists call relationships and xrefs, which Kuna has answered since c9f9b83.
  • The failed-export error (exportUnavailable) keeps its own composed message.

Not included: changing the generic presentation for other providers. Their AnalysisCapabilityUnavailableError uses are outside this track.

Scope: an ordinary fix within the existing Kuna provider boundary; no maintainer scope decision applies.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the Kuna sites that construct these errors.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: no schema change. message and remediation.action carry the Kuna reason; code, category, retryable and details are unchanged.
  • Provider, bridge, target-format, or platform compatibility: Kuna only.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details: none.
  • Generated metadata, package, or installation impact: none.

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

  • Tests added or updated: kunaCommandFailures.test.ts gets "says why Kuna cannot answer instead of a generic unavailable message". It checks the projected message for assembly at an import slot, callers at a non-entry address and an unsupported operation (search_strings), with code: capability_unavailable and retryable: false.

  • Base reproduction: the test fails on the base revision (git stash of src/kuna).

  • Real Kuna 1.833, same calls as above, after the fix:

    procedure_assembly 0x100004000  message/action: "Kuna's export lists no code at 0x100004000; import slots and data entries have no listing."
    procedure_callers 0x100000504   message/action: "Kuna's graph has no function node at 0x100000504; its relationships are unknown."
    

    Response sizes are about the same (645 → 651 and 634 → 620 bytes).

  • Remaining proof gaps: no Linux run; the closed-session and unconfigured-provider sites are covered by type and source review, not by a dedicated test of their message.

  • 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

Compatibility, safety, and release

  • Breaking changes or migration steps: none; only message text changes.
  • Real Hopper/Ghidra, browser, or OS coverage: real Kuna on macOS arm64 only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: the reasons contain target addresses and REA's own Kuna settings text, already present in details.reason.

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

@kaoru0822-kitauji kaoru0822-kitauji added bug Something isn't working track:kuna Kuna decompiler provider series (#1957) labels Oct 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T13:15:42.687475Z 21fc731 New commits
ℹ️ 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 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no blocking issue was found.

Summary

Kuna now shows its specific reason when it cannot answer, rather than suggesting that callers abandon a working target.

  • Kuna tells callers the reason it cannot answer.

Reviews (2) · Last reviewed commit: "fix(kuna): say why Kuna cannot answer in..." · Reviewed by Greptile

Kuna capability gaps such as "no code at this address" or "no function node
at this address" were built without a user message, so MCP and the CLI
showed only "This analysis is unavailable for the current target. Choose
another analysis or target." and kept the reason in details. One Kuna
helper now presents the reason as the message for every such gap, and the
unsupported-operation reason names call relationships and xrefs, which Kuna
now answers.

Refs #1957

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji
kaoru0822-kitauji force-pushed the fix/kuna-unavailable-says-why branch from 489f8b0 to 21fc731 Compare October 15, 2026 13:12
@kaoru0822-kitauji
kaoru0822-kitauji merged commit f7250fe into main Oct 15, 2026
33 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/kuna-unavailable-says-why branch October 15, 2026 14:37
@morluto morluto added the provider: kuna Analysis provider / engine: kuna label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working provider: kuna Analysis provider / engine: kuna track:kuna Kuna decompiler provider series (#1957)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants