Skip to content

feat(analysis)!: default function MCP output to retained summaries - #5660

Merged
gensokyo-dev merged 39 commits into
morluto:mainfrom
CryptoJones:perf/ghidra-analyze-function-pseudocode-default
Oct 24, 2026
Merged

gensokyo-dev merged 39 commits into
morluto:mainfrom
CryptoJones:perf/ghidra-analyze-function-pseudocode-default

Conversation

@CryptoJones

@CryptoJones CryptoJones commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Refs #5032.

MCP analyze_function always returned the full native dossier, so large reference/value-flow results could consume the response budget before the requested code was useful. It now defaults to detail: "summary": function identity, availability, facet counts, limitations and a retained parent Evidence ID. inspect_analysis_view pages that parent; detail: "complete" preserves the previous inline dossier. This default is a breaking MCP change. Delivery detail stays outside provider inputs and parent Evidence identity.

CLI rea function still defaults to complete output. Explicit summary delivery requires --evidence_output /absolute/path/dossier.json, writes an exclusive complete Evidence bundle and returns the summary. The saved bundle can be paged through an evidence-file source and selected evidence_id after the provider closes. For example, select the returned parent ID with a native pseudocode view (offset: 0, limit: 4096). Summary delivery requires retention and an artifact-bound parent.

The existing summary/view pipeline owns projection and provenance. Function addresses and relationship coverage survive; omitted or unavailable counts remain null. Bundle import and file projection share authentication rather than parallel parsers. Ambiguous-bundle guidance keeps complete IDs within a 2 KiB encoded preview, with explicit omissions. Canonical hashing avoids copying large emitted strings while preserving its byte stream.

Measured equivalent real Linux Ghidra MCP task (small-function pseudocode plus large-function availability/counts/20 assembly rows, then warm repeats and a matched complete-small read): selected facts match exactly, target digests stay unchanged and cleanup completes.

Whole benchmark Before After
Estimated SDK exchange tokens 44,217,047 1,033,322
Elapsed seconds 237.715 128.600
Waited family CPU seconds 211.656 123.083
Sampled family RSS MiB 3951.7 2827.8
Catalog/tool exchanges 8 12

The 97.66% token reduction includes all catalog/argument/SDK-result projections and extra page calls. These are tokenx estimates, not model usage; client rendering and prompts are unmeasured. Whole timings include counting and evidence writes; measured MCP phases total 217.33 → 127.54 s. One pair, baseline first, shared host, unflushed OS caches: no universal speed claim. The warm small task is about 6.7 ms slower despite a smaller answer. An earlier 240-second baseline timeout is retained separately and excluded from completed comparisons.

Validation:

  • Full npm run check, 139 focused contract/CLI/progress/snapshot/path tests, 15 actual SDK/schema checks and docs:check passed after integrating main a062529b. Initial stale generated-catalog and CLI harness-envelope failures are recorded in the report.
  • Real CLI default-complete output verified. Summary delivery writes a 29,141,012-byte bundle; independent CLI processes authenticate and page its first/final 20 assembly rows with Ghidra unavailable. Each fresh file-page command scans/authenticates the complete file (17.218 / 18.175 s), so sublinear disk access is not claimed.
  • CI run 40042416832 failed on independently established main baselines; all 12 failed/cancelled logs and 1,015 assertion markers were audited. Cancelled coverage remains unverified.
  • Real-provider scope is Linux Ghidra 12.1.4 / JDK 21. Hopper/IDA/Kuna, macOS and Windows were not newly runtime-verified. Existing complete-dossier verifiers explicitly request complete delivery.

Verification report pins source/artifact/harness identities, cold/warm phases, limits and incomplete controls.

Scope: existing read-only native analysis and caller-selected Evidence file output; no new provider, target execution/injection, executable mutation, attached-GUI authority or installation behavior.

Author readiness

Human owner: @CryptoJones

  • 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

https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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 ⚠️ Failed 2026-10-24T00:05:20.276222Z
We couldn’t complete this review. Comment @codex review to try again.
c6cbd2d 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 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge; no new actionable issue was found, and the previous verification failure is fixed.

Summary

analyze_function now defaults to a retained summary over MCP. The CLI keeps complete delivery by default and can save a complete bundle while returning a summary.

  • MCP function analysis returns a compact summary by default.
  • CLI function analysis can save a dossier bundle for summary delivery.
  • Evidence validation accounts for serialized copies and walks wide JSON incrementally.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["MCP analyze_function"] --> B["Separate detail from provider input"]
  B --> C["Produce complete dossier Evidence"]
  C --> D{"detail"}
  D -->|complete| E["Return complete Evidence"]
  D -->|summary| F["Retain complete Evidence"]
  F --> G["Return summary with parent_evidence_id"]
  G --> H["inspect_analysis_view"]
  H --> I["Page retained dossier facets"]
  J["CLI function --detail summary"] --> K["Save complete Evidence bundle"]
  K --> L["Read bundle as evidence-file"]
  L --> H
Loading

Reviews (5) · Last reviewed commit: "test(evidence): pin validator member ord..." · Reviewed by Greptile

Comment thread src/contracts/enhancedInputs.ts Resolved
Comment thread src/cli/coreBinaryCommands.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50c019d224

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/contracts/enhancedInputs.ts Resolved
Keeps BinarySession from marking every Ghidra operation unavailable after one procedure's decompile reaches the limit, and names the MCP tool-call deadline in the remediation.
CryptoJones added a commit to CryptoJones/rea that referenced this pull request Oct 20, 2026
…puts

Address the five automated review findings on morluto#5660.

P1: `detail` lived in the shared enhancedInputSchemas.analyze_function, so
inspect_native_api composed `{procedure, detail: "summary"}` and the strict
Ghidra analyze_function schema rejected it. Delivery detail is now owned by
the analyze_function MCP tool contract; the handler separates it before any
provider call, and executeFunctionAnalysisEvidence parses the provider input
only. The MCP regression test validates provider input exactly as the
production Ghidra client does and exercises inspect_native_api.

P2: the analyze_function summary Evidence now carries the parent's
relationship_coverage like native facet views, so partial or unknown
caller/callee discovery is not reported as complete.

P2: the summary reports the dossier's declared facet_availability, nulls the
counts of facets the provider declared unavailable, and lists each reason in
unknowns, so Kuna's empty references, comments and basic blocks are not
mistaken for observed absence.

P2: inspect-analysis-view evidence-file sources accept the Evidence bundle
that --evidence_output writes, selecting a record with source.evidence_id
when the bundle holds several; the CLI test reads the saved bundle back
through that route.

Tests that assert the complete dossier over public analyze_function now pass
detail complete, and the oversized-dossier test asserts the summary view it
previously expected to be unsupported.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: edbfea04b3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@CryptoJones
CryptoJones force-pushed the perf/ghidra-analyze-function-pseudocode-default branch from 17171dc to 2234564 Compare October 21, 2026 01:07
CryptoJones added a commit to CryptoJones/rea that referenced this pull request Oct 21, 2026
…puts

Address the five automated review findings on morluto#5660.

P1: `detail` lived in the shared enhancedInputSchemas.analyze_function, so
inspect_native_api composed `{procedure, detail: "summary"}` and the strict
Ghidra analyze_function schema rejected it. Delivery detail is now owned by
the analyze_function MCP tool contract; the handler separates it before any
provider call, and executeFunctionAnalysisEvidence parses the provider input
only. The MCP regression test validates provider input exactly as the
production Ghidra client does and exercises inspect_native_api.

P2: the analyze_function summary Evidence now carries the parent's
relationship_coverage like native facet views, so partial or unknown
caller/callee discovery is not reported as complete.

P2: the summary reports the dossier's declared facet_availability, nulls the
counts of facets the provider declared unavailable, and lists each reason in
unknowns, so Kuna's empty references, comments and basic blocks are not
mistaken for observed absence.

P2: inspect-analysis-view evidence-file sources accept the Evidence bundle
that --evidence_output writes, selecting a record with source.evidence_id
when the bundle holds several; the CLI test reads the saved bundle back
through that route.

Tests that assert the complete dossier over public analyze_function now pass
detail complete, and the oversized-dossier test asserts the summary view it
previously expected to be unsupported.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
Comment thread src/contracts/analysisDetail.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2234564c8f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/cli.md Resolved
…d sessions

Adds REA_GHIDRA_DECOMPILE_TIMEOUT_SECONDS to the derived Codex/Kimi tool deadline and forwards it through setup. Marks a remote failure that settles after caller cancellation so the timeout projection no longer promises session reuse.
@CassieFox23

CassieFox23 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

I tested this on Linux at head 2234564. The results are in my review.

🤖 Written with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

@CassieFox23 CassieFox23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR: The new summary default breaks the real-provider check scripts. They call analyze_function over MCP. This PR changes none of them. All 148 tests in the changed files pass on Node 22, 24 and 26. I could not reproduce the Codex memory concern about evidence bundles.

Tested head 2234564 (main was 335c042 when I checked; none of main's 8 newer commits touch a file in this PR).

Check Node 22 Node 24 Node 26
10 changed or added test files, test:focused 148 passed 148 passed 148 passed
Greptile P1 replay (check scripts on the new default) reproduced reproduced reproduced
Codex P1 replay (bundle parse memory) not run not reproduced not run

Greptile P1: reproduced

I called analyze_function with no detail through the PR's own in-memory MCP test setup (a fake provider, not real Ghidra). Then I ran the checks the scripts run.

  • The Evidence operation is inspect_analysis_view. native-value-e2e.mjs line 216 asserts analyze_function, so that check fails.
  • The normalized_result has no top-level procedure. Line 201 of verify-real-hopper.mjs calls requireFunctionDossier, and it throws "expected object, received undefined".
  • With detail: "complete", both checks pass.

The PR changes no file under scripts/. Its validation list does not name verify:hopper or verify:ghidra. MCP callers I found: verify-real-hopper.mjs, real-hopper-semantic.mjs, native-value-e2e.mjs and ghidra-reference-snapshot-e2e.mjs. The scripts that use rea function are not hit, because the CLI default stays complete. 26 script files mention analyze_function with callTool or functionCall. I did not read all of them, so the full count is unknown.

Codex P1: not reproduced

This is a bounded probe plus code reading, not a proof. The code does more work on a bundle than on one record. It schema-parses the whole bundle. It parses each record again, and it compares two full JSON.stringify results. I wrote the same payload as a valid bundle and as a single record, and capped the heap with --max-old-space-size (Node 24 only).

  • Small-object payloads (150k and 250k rows, 512 MB heap): both ran fine, up to a guard estimate of 230 MB.
  • One long two-byte string (12M to 63M characters, 256 MB heap): both ran fine at all nine sizes.
  • At 64.5M characters, the single record aborted once with out of memory. On rerun, both it and the bundle were refused by the headroom guard. At 66M characters both aborted the same way. That looks like a read-time limit shared by both paths. I did not check which step died.

I found no size where the bundle died and the single record survived.

Also open (read in the code, not run)

  • nativeFunctionView.ts lines 186-190: the five value_flow_* counts use ?? 0, so an unavailable value flow reads as zero.
  • Lines 16-25 of docs/mcp-contracts.md still say analyze_function Evidence goes straight into compare_functions. The new default has a different operation, and compare_functions rejects it.

Not run

  • npm run verify:hopper and npm run verify:ghidra. Hopper was not found on PATH, and no changed test needed Ghidra.
  • The heap probe on Node 22 and 26, other payload shapes and a real exported bundle.
  • check:fast, docs:check, the full suite, and the PR's own real-target measurements.

Thanks, CryptoJones, for the clear write-up and for adding tests with the change.

Commands
git -C ~/code/rea-mirror/rea.git archive 2234564c8 | tar -x -C /tmp/b6-c/5660/src
npm ci && npm run prepare && npm run build:cached && npm run test:prepare   # Node 24, all exit 0
npm run test:focused -- src/application/analysisView/AnalysisViewService.test.ts \
  src/application/analysisView/evidenceFileSource.test.ts \
  src/domain/analysisView/analysisView.test.ts \
  tests/boundary/cli/analyzeFunctionDetail.test.ts \
  tests/boundary/mcp/analysisViewMcp.test.ts \
  tests/boundary/mcp/analyzeFunctionDetail.test.ts \
  tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts \
  tests/boundary/mcp/ghidraEvidenceMcp.test.ts \
  tests/boundary/mcp/inlineEvidenceCompositionMcp.test.ts \
  tests/boundary/mcp/investigationAnalysisMcp.test.ts
# exit 0 on Node 22.23.1, 24.18.0, 26.11.1; 10 files, 148 tests each
node --max-old-space-size=256 run.mjs payload.json   # run.mjs only calls readEvidenceFileSource(path)

The Greptile probe was one throwaway test file in the extracted tree, run with test:focused on all three Node versions (exit 0 each, output identical). The heap probe ran under systemd-run --user --scope -p MemoryMax=8G.

Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.11
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 22.23.1, 24.18.0, 26.11.1
  • Head / main: 2234564 / 335c042 (merge base ccc7da3)
  • Other: other test jobs may have shared the box; I did not check. Timings are not benchmarks.

🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

CryptoJones and others added 11 commits October 21, 2026 12:00
analyze_function was the one analysis tool never wired into REA's
detail: summary|complete convention, so it always returned the complete
native dossier inline (0.2-10 MB, dominated by value-flow and
references). Agents on tool-result-capped harnesses never reached the
pseudocode.

Add `detail` to analyze_function, defaulting to summary: return a
compact dossier (procedure identity, pseudocode size, facet counts,
value-flow availability) and retain the complete dossier Evidence in
the session. Page pseudocode, references, assembly and value-flow
through normalized_result.parent_evidence_id with inspect_analysis_view,
which already projects every native facet. detail: complete returns the
full dossier inline as before. Delivery detail never reaches the
provider or Evidence identity.

BREAKING CHANGE: analyze_function now defaults to the compact summary
view instead of the complete dossier inline. Pass detail: "complete"
for the previous behavior.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
Wire `rea function` into the shared CLI detail-delivery convention
(--detail, --evidence_output) so the CLI and MCP adapters offer the same
summary | complete choice for analyze_function. Summary delivery writes
the complete dossier Evidence to a bundle and returns the compact
summary view; it fails before analysis when --evidence_output is
missing, so no provider work is wasted. The CLI default stays complete
because a one-shot command has no in-process Evidence retention.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
…eview

FlatlineRoundtable cross-model review (6 lanes) converged on the summary
projection's availability semantics being underspecified. Document that
facet_availability is authoritative over raw pseudocode length, that
code_units are UTF-16 (the unit inspect_analysis_view pages by), and that
value_flow.truncated is meaningful only when value-flow is available.
Parenthesize the nullish-coalescing/comparison for clarity. No behavior
change; declined claims (value-flow "truncated collapse", unresolved_calls
dead code) were schema-impossible or already correct.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
Close the roundtable's top convergent finding: the summary path had only
domain-projection coverage, not the server/CLI wiring where the breaking
behavior lives.

MCP server (registerEnhancedTools): the default delivers a retained
summary whose complete parent is recorded for paging; delivery detail is
stripped before the provider request; detail: complete returns the full
dossier inline; a registration without retention rejects a summary
request before any provider work.

CLI (rea function): the default returns the complete dossier; --detail
summary without --evidence_output fails before analysis; with the bundle
sink it returns the compact summary and writes the complete Evidence
bundle.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
…puts

Address the five automated review findings on morluto#5660.

P1: `detail` lived in the shared enhancedInputSchemas.analyze_function, so
inspect_native_api composed `{procedure, detail: "summary"}` and the strict
Ghidra analyze_function schema rejected it. Delivery detail is now owned by
the analyze_function MCP tool contract; the handler separates it before any
provider call, and executeFunctionAnalysisEvidence parses the provider input
only. The MCP regression test validates provider input exactly as the
production Ghidra client does and exercises inspect_native_api.

P2: the analyze_function summary Evidence now carries the parent's
relationship_coverage like native facet views, so partial or unknown
caller/callee discovery is not reported as complete.

P2: the summary reports the dossier's declared facet_availability, nulls the
counts of facets the provider declared unavailable, and lists each reason in
unknowns, so Kuna's empty references, comments and basic blocks are not
mistaken for observed absence.

P2: inspect-analysis-view evidence-file sources accept the Evidence bundle
that --evidence_output writes, selecting a record with source.evidence_id
when the bundle holds several; the CLI test reads the saved bundle back
through that route.

Tests that assert the complete dossier over public analyze_function now pass
detail complete, and the oversized-dossier test asserts the summary view it
previously expected to be unsupported.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
The analyze_function summary coerced an omitted unresolved_calls record to
a count of 0 while the native facet view reports the same dossier as "not
recorded", and it carried no counts at all for the pageable
swift_string_literals facets. Count optional records as null when the
dossier omits them, name them in unknowns, and add nullable counts for both
Swift literal facets. The summary Evidence envelope also dropped the
function address: createAnalysisViewEvidence now derives one function-view
predicate for both the address location and relationship coverage.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
…ider checks

The real-provider check scripts call analyze_function over MCP and then
consume the complete dossier: requireFunctionDossier, functionDossierSchema,
.procedure/.pseudocode reads, operation assertions, compare_functions inputs
and the oversized-dossier rejection path. The summary default broke them.
Every such call site now passes detail: "complete". Provider-direct callers
are unchanged because detail is an MCP contract field; the admission-error
sites stay unchanged because provider failures return before the summary
branch.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
summarizeDossier coerced the five value_flow_* counts to zero when
native_value_flow was null (IDA, Kuna) or declared unavailable (Ghidra),
so the summary reported empty collections while value_flow.available said
otherwise. The counts are now null unless value flow is available, with the
reason already named in unknowns.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
…lized size

The evidence-file headroom reserved two parsed copies, calibrated for one
record, and charged strings at two bytes per character. Bundle
authentication additionally holds the schema-parsed bundle, the re-parsed
records and two JSON.stringify results, which expand control characters and
lone surrogates sixfold: a bundle whose raw_result is a million NUL
characters estimated at 2 MB parsed but needed 12 MB of serialized text.

The budget now has a parsed term and a serialized term per file shape, owned
by EvidenceAuthenticationHeadroom and shared by the analysis-view reader and
the bundle importer, which had no guard. Two transient peaks the budget did
not name are removed at their producers: the canonical digest hashes a large
leaf directly instead of concatenating it into its buffer, and the JSON
validator walks containers by cursor so a wide array no longer queues one
entry per member.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
… in docs and prompts

The MCP guide, the version-comparison and crash-triage prompt contracts,
the authored skill and the Kuna, IDA and function-matching docs still told
agents to pass analyze_function replies straight to compare_functions or
build_call_path. Under the summary default those consumers reject the reply.
They now name the retained-evidence reference for compare_functions, the
observations fields of match_native_functions, and detail: "complete" for
build_call_path, which accepts only inline dossiers.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
…ation yielding

Independent review of the cursor validator found the interrupted-validation
fixture relied on the old last-first walk: its over-deep head was reached
before the first cooperative yield. The padding now precedes the deep
element so the walk yields first, which is the invariant the test guards.
A new case pins first-defect-in-member-order reporting, skipped
non-enumerable keys no longer count toward the yield cadence, and the
import-headroom test loads the reader through a fresh module graph so it
holds under the services project's shared workers.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AoJZDPcrgmMsCqLG4LfiFb
@gensokyo-dev gensokyo-dev changed the title feat(ghidra)!: default analyze_function to a retained summary feat(analysis)!: default function MCP output to retained summaries Oct 23, 2026
@gensokyo-dev

Copy link
Copy Markdown
Collaborator

CI attribution for published head c6cbd2d985d09118b8bd8ee76131ff744649ea2a:

CI run 40042416832 completed with 13 successful jobs, 5 failures, 7 cancellations and 16 skips. I inspected the raw logs of all 12 failed/cancelled jobs, including the portable aggregation and required-check failure. All 1,015 visible assertion markers match retained main/exact-base controls; no unclassified assertion remains. Cancelled shards do not establish unexecuted coverage.

The newly observed case, ghidraEndpointLifetime.test.ts > preserves endpoint IO failure during cancellation and failed close, fails identically on the actual CI main parent 6b3eee1c: the assertion expects the original EIO object but receives its ArtifactReaderFailure cleanup wrapper. The focused baseline control runs both close outcomes (1 pass / 1 fail); the feature checkout runs all 14 endpoint cases successfully. The actual CI merge 49d336b3 and that main parent have identical Ghidra/artifact producer and endpoint-test files. An earlier baseline whole-file control also lacked its compiled FIFO artifact; that separate harness failure is retained and excluded from the focused attribution.

The remaining controls were recorded during #5662: shared source/built error-algebra assertions, exact-base JavaScript cases, Windows native cases, and the intermittent Kuna startup case. The Kuna control proves independent main failure, without claiming identical cancellation diagnostics.

The full feature static gate, selected public CLI/MCP/SDK checks and real Linux Ghidra/CLI evidence described in the PR body passed. Per the maintainer's authorization, established baseline CI failures may be bypassed; this is not a claim that the whole suite passed or that cancelled checks executed.

@gensokyo-dev

Copy link
Copy Markdown
Collaborator

Final integration verification: the conflict-free candidate on main 76500f12b54e07b1ea700a403b2593890d63b42a passed full npm run check and all 139 selected Evidence-bundle, native-view, CLI/MCP summary/complete, progress, snapshot cleanup and local-path tests. Candidate tree: cba1406b84d9dcd4ea6e8ad5eaa8dd52367abbd5. This supplements the published-head real Ghidra/CLI report; it does not replace the baseline CI limitations documented above.

@gensokyo-dev
gensokyo-dev merged commit 1a48a82 into morluto:main Oct 24, 2026
36 of 48 checks passed
@gensokyo-dev

Copy link
Copy Markdown
Collaborator

Correction to the earlier CI attribution: matching the failing test name was insufficient for the module-isolation check. Although main already had an SDK cancellation mock in a shared project, #5660 added another offender, src/application/EvidenceBundleFiles.test.ts. That is our test-placement omission.

The follow-up in #6206 moves both module-mock tests into the existing isolated tests/process-global/ project and preserves all assertions. The cancellation fixture also holds its selected producer boundary until an ordered ping acknowledges cancellation, checks that this barrier participated, and releases it during failed cleanup. All 18 focused headroom/cancellation/progress/project-policy checks pass; bypassing that fixture barrier makes both cancellation cases fail. An initial preloaded-consumer run passed and is not presented as causal proof.

The revised native view guidance also left a stale introductory-text assertion in the oversized discovery test. Its metadata filters, schema checks and retained paging now execute successfully; all 22 MCP view cases pass after removing that unrelated prose precheck. These corrections change test ownership and verification, while preserving the merged runtime summary behavior. The #6206 verification report records the controls and limitations.

@morluto morluto mentioned this pull request Oct 25, 2026
3 tasks done
import { toolRegistrationOptions } from "./toolRegistrationOptions.js";
import { executeFunctionAnalysisEvidence } from "../application/FunctionAnalysisEvidence.js";
import type { WithAdmittedAnalysis } from "./analysisAdmission.js";
import type { EvidenceLookup } from "../application/EvidenceInputResolver.js";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**sha256

Suggested change
import type { EvidenceLookup } from "../application/EvidenceInputResolver.js";
import type { EvidenceLookup } from "../application/EvidenceInputResolver.js";

**

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two weeks late ;)

@Nawab995 Nawab995 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withdrw all

@morluto morluto added area: mcp MCP server, transport, and tool registration enhancement New feature or request labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants