Repository navigation
feat(kuna): allow independent decompile retries - #8793
Conversation
[Medium impact] The PR appears safe to merge, with one non-blocking issue in how fresh retries report unavailable sibling tools.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Fresh independent decompiles stay uncached, and one-shot pseudocode can still replay. Failed-export limitations keep both the fresh-run fact and main's export-state checks.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
A failed export still reports that per-function records are not exposed, and an explicit fresh decompile remains a separate single-function run.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
(cherry picked from commit ac30fbd)
# Conflicts: # src/application/binary/AnalysisSnapshotCache.ts
| return ok({ | ||
| result: standalone.value, | ||
| source: { kind: "single-function" }, | ||
| locations, | ||
| limitations: [ | ||
| "This is a fresh independent single-function decompile; it does not use the project export's whole-program prototypes.", | ||
| ...classification, | ||
| ], |
There was a problem hiding this comment.
If a regular pseudocode call returns while the export is running and that export later fails, a successful independent_fresh retry skips #settledExportUnavailable and returns no siblingUnavailability. binary_session keeps advertising procedure_assembly and analyze_function as available, although both will fail until the target is reopened. This costs users another failed call.
Share the failed-export facts between regular and independent single-function answers without sharing their cached text.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/kuna/KunaSessionClient.ts
Line: 869-876
Comment:
**Failed tools stay listed**
If a regular pseudocode call returns while the export is running and that export later fails, a successful `independent_fresh` retry skips `#settledExportUnavailable` and returns no `siblingUnavailability`. `binary_session` keeps advertising `procedure_assembly` and `analyze_function` as available, although both will fail until the target is reopened. This costs users another failed call.
Share the failed-export facts between regular and independent single-function answers without sharing their cached text.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
A completed Kuna project export can retain a failed function even when a new standalone decompile succeeds. This adds an explicit independent attempt while retaining the original observation. Related: #8167.
Problem and expected behavior
Repeating
procedure_pseudo_codeagainst the same partial project returns its null body again. When the provider declares support,analysis: "independent_fresh"requests a new attempt; the CLI equivalent isrea decompile <path> <procedure> --analysis independent_fresh. The result may use different analysis context and may still fail.Change and scope
Kuna owns the independent single-function run, its bounded admission, and cleanup. The application refuses the selection when a provider has not declared it and prevents both in-session and pre-open snapshot replay. A cold request does not start a project export. Timeout recovery names the configured deadline without promising that an export exists, and CLI/MCP share the same selection schema. The failed project block gives the next step; its structured failure reason is kept independently of limitation ordering. Identical results may share a content-addressed Evidence ID; this does not provide a separate run receipt or automatically link attempts.
Contract and boundary impact
independent_decompilecapability; unsupported providers refuse it. Grouped capability facts remain associated with the operation.Expected effects:
Evidence and regression coverage
functionsanddecompile, with nodecompile-project. Real Ghidra 12.1.4 refused the undeclared selection. The target was not executed or changed.To try an independent decompile, call procedure_pseudo_code with analysis: independent_fresh, or use rea decompile --analysis independent_fresh.Current-main integration
Merged main through
2e2f981c. Retained both the independent decompile selector and the current pseudocode detail/retained-view contract; retained both sets of snapshot regressions. Node 24.22.1 focused snapshot and single-function suites passed 48 tests (2 skipped), the simulated-provider compact/full MCP boundary passed 4 tests, and the Kuna provider boundary passed 39 tests.build:cachedpassed (3 tasks, 1 cached),check:fastpassed uncached, and changed-file formatting passed. Fullformat:checkpassed after integrating the upstream formatting fix #9280. No real Kuna or Ghidra run was performed on this merged head; earlier real-provider evidence is historical.Validation performed
After merging main
106ba173, preserved fresh independent-decompile cache bypass alongside the new source-evidence options contract. Node 24check:fastandformat:checkpassed; four snapshot, Kuna provider and MCP suites passed 124 tests with 2 skipped. Real Kuna was not rerun after the merge.Focused snapshot, Kuna MCP, batch, and provider boundary tests — passed; 2 snapshot tests skipped on this host. The two imported-snapshot variants passed after the full focused run.
npm run check:ci:fast— passed.npm run docs:check— passed.Real CLI and compact/full MCP controls described above — passed on macOS arm64.
Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.