Skip to content

fix(mcp): return complete inline Evidence records - #585

Merged
N0zoM1z0 merged 3 commits into
mainfrom
fix/mcp-inline-evidence
Oct 5, 2026
Merged

N0zoM1z0 merged 3 commits into
mainfrom
fix/mcp-inline-evidence

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #551.

  • Return the complete canonical Evidence record inline, including normalized_result, in both MCP text and structured content.
  • Use the canonical envelope schema for inline Evidence so producer outputs satisfy existing Evidence consumer contracts.
  • Preserve the convenience result and evidence_id fields. Regenerate catalog metadata and document direct tool composition.
  • Add fail-before regression coverage for canonical round trips, missing fields, null/falsy/array results, direct function comparison, and session bundle equality.
  • Extend installed-package artifact verification and real Ghidra CLI/MCP verification to consume returned Evidence directly.
  • Package setup support was corrected independently in upstream fix(package): separate agent and Hopper setup support #584 during validation; the final PR uses that upstream implementation and contains no duplicate setup change.

MCP example

const analyzed = await client.callTool({
  name: "analyze_function",
  arguments: { procedure: "fixture_main" },
});
const source = analyzed.structuredContent.evidence;
// source.normalized_result equals analyzed.structuredContent.result.
const compared = await client.callTool({
  name: "compare_functions",
  arguments: { left: source, right: source },
});

inspect_artifact Evidence can likewise be passed directly to compare_artifacts. The returned records match the corresponding session bundle records.

Verification

  • npm run check:pr: 350 files passed; 1,978 tests passed, 1 existing skip. Full run uses process-local single CPU affinity to keep existing startup tests within their unchanged deadlines.
  • npm run check:ci: all 7 tasks passed.
  • npm run docs:generate, generated-document checks, and commit formatting/lint hooks passed.
  • node scripts/verify-real-ghidra.mjs: real Linux x64 Ghidra 12.1.4/JDK 21 host-format verification passed, including actual CLI/stdio MCP direct Evidence handoff. Existing switch oracle still recovers 40 cases and the default, with no switch residual unknowns.
  • Fresh final tarball, independently installed without lifecycle scripts: real Ghidra CLI/MCP trace parity and direct analyze_function Evidence → compare_functions → exact bundle-record equality passed; input unchanged. Trace: 165 nodes, 296 edges, 7 decompilations; 1 existing alias unknown retained.
  • env -u GHIDRA_INSTALL_DIR TMPDIR=/tmp node scripts/verify-package.mjs after the verified build: passed complete installed CLI/MCP, artifact handoff, 4-client setup/idempotence/backup/recovery/symlink checks, and exact-version update/read-only maintenance. Full 116-tool catalog available in ~2.9 seconds.
  • Final tarball: 696 entries, 945,584 bytes; required runtime/bridge entrypoints present, private/binary fixture inputs excluded. Critical shipped modules match the checked build.
  • Additional private local acceptance: 3 owned samples passed direct canonical Evidence parsing/comparison and input/cleanup checks. Their Ghidra/Evidence module bytes match the final artifact; no private inputs, identifiers, captures, or test code are included here.

Fail-before regression run: 8 failures out of 10 tests; after the fix: 10/10 passed. An initial full-run timeout in an unchanged 15-second runtime test was isolated and re-run, followed by clean full-suite runs. No deadlines or assertions were loosened.

After main added #538, resolved all four generated-file conflicts by regeneration. Incremental validation: 37/37 focused Evidence + semantic-scope tests, all four catalog/skill/product/ledger checks, and commit hooks passed. Earlier complete gate/package/Ghidra evidence above is retained; final exact-head GitHub CI is checked before merge. After upstream #584, adopted its setup support helper and removed the duplicated verifier fix; 26/26 targeted setup-support + Evidence tests passed. Final PR delta is 12 files.

Coverage

Real provider claims are limited to Linux x64 Ghidra 12.1.4 with JDK 21. The package smoke lane uses its existing controlled Hopper seam; no real Hopper, macOS, or Windows host verification is claimed. Public fixtures are generated from generic repository source.

Preserve normalized_result in MCP Evidence and use the canonical envelope
for advertised output contracts. Verify direct function and artifact
comparison against inline records and retained session bundles.

Closes #551

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
@N0zoM1z0
N0zoM1z0 merged commit ea9c3da into main Oct 5, 2026
19 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/mcp-inline-evidence branch October 5, 2026 16:10
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
Return complete canonical Evidence records inline, including normalized_result, and preserve direct comparison and retained bundle identity.

Verified full deterministic gate, real Linux Ghidra CLI/MCP and independently installed artifact, generic package acceptance, private local samples, and targeted updates after syncing main.

Closes morluto#551

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
@morluto morluto added bug Something isn't working area: mcp MCP server, transport, and tool registration labels Oct 14, 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 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline Evidence omits normalized_result, so tool output cannot be fed to the comparison tools

2 participants