Whole-binary inventories returned complete Evidence unless the caller
asked for a summary. On Debian 12 zstd, a stripped 1.2 MB ELF, the complete
MCP results were 8.2 MB for list_names, 3.6 MB for trace_feature on
"error", 1.0 MB for a regex string search and 504 KB for list_procedures.
Claude Code moves results above about 25,000 tokens out of context.
list_names, list_procedures, list_strings, search_procedures,
search_strings, trace_feature and batch_decompile now declare a size-aware
detail. When the caller omits it, Evidence up to 32 KiB of UTF-8 JSON is
returned inline; larger Evidence is retained and its summary returned. A
server that retains nothing still returns the complete Evidence. Explicit
complete and summary are unchanged. Both delivery handlers share one
decision, measured with the bounded JSON size helper, and a contract opts
in by declaring the size-aware detail schema.
BREAKING CHANGE: for these seven tools, an omitted detail on a result
above 32 KiB now returns the retained summary instead of complete Evidence.
Pass detail: "complete" to keep the previous shape.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(limits): make the IL2CPP pointer index adjustable and name ELF note budgets in details.limit
inspect_il2cpp_metadata accepts max_native_index_bytes (default 1 GiB,
needs binary_path) for the estimated ELF virtual pointer index. The index
refusal now carries its own limit name (virtual-pointer-index-bytes) and a
details.limit naming the parameter, its effective value, default and range,
instead of a fixed ceiling with no override. The binary file allowance and
the loader's fixed capacities are unchanged.
inspect_elf_notes and inspect_elf_debug_link refusals for max_file_bytes,
the decoded section-name budget and max_entries now set details.limit. One
domain-owned bounds object per operation feeds both the schema and the limit.
Two guards keep new in-code refusal limits owned:
- scripts/verify/fixed-ceilings.mjs (run by npm run lint) requires every
fixedAllowanceOptions, fixedProducerInputAllowance,
artifactFixedLimitFailure or inline fixedAllowance declaration to be
listed in fixed-ceiling-registry.json with its class (format, protocol,
representation, derived, forwarding, or pending with an issue) and reason,
and fails on stale entries.
- The untyped-budget-refusal architecture guard counts refusals whose only
recovery is an authored remediationAction, with a shrink-only baseline.
Fixes#14175
Part of #14234
BREAKING CHANGE: an inspect_il2cpp_metadata refusal at the ELF pointer index
reports reported_limits.boundary "virtual-pointer-index-bytes" and
details.limit for max_native_index_bytes, and no longer carries a
details.refusal fixed_ceiling.
* fix(limits): track IL2CPP's remaining fixed allowances with the native readers
* fix(limits): run the authored-only refusal count from lint, where TypeScript is installed
The architecture guards run before npm ci in CI and must stay
dependency-free, so the AST-based count moves into fixed-ceilings.mjs with
its own shrink-only baseline and --shrink-baselines.
* fix(limits): register producer and native wrapper ceilings by the allowance they name
fixedProducerInputAllowance names its allowance in its second argument, and
fixedNativeAllowance forwards its first, so the guard now reads each helper's
allowance argument and checks the callers of both.
* fix(limits): delete the authored-only baseline when its last count is removed
reconcileBaselineFile returns delete once no count remains, but the
verifier ignored it and the next run read the file unconditionally, so
--shrink-baselines could not finish. An absent baseline now reads as empty
and shrinking removes the file.
* fix(limits): record the advertised IL2CPP input schema with max_native_index_bytes
* fix(gpu)!: dispatch AMDGPU note metadata on the declared ELF ABI
inspect_gpu_code_objects read every AMDGPU ELF note under the HSA schema,
so a well-formed PAL-ABI code object was reported malformed ("no valid
kernel array") while the same object without metadata was unsupported.
The AMD ELF metadata owner now reads EI_OSABI once and selects the note
schema from it. HSA (64) keeps the existing kernel path. PAL (65) decodes
amdpal.pipelines into a new amd_pal_metadata object field during kernel
analysis: the version, and per pipeline its name, type, API, API shader
stages with their hardware mapping, and each hardware stage's entry point,
entry point symbol, SGPR/VGPR/AGPR counts, wavefront size, LDS and scratch
sizes. PAL register maps use unsigned integer keys, which the MessagePack
reader now admits for that schema only. Mesa3D (66) and unrecognized ABIs
are unsupported with their e_flags target and unexamined notes. Corrupt PAL
MessagePack or container shapes remain malformed.
BREAKING CHANGE: amd_target_metadata gains required os_abi and abi fields,
GPU objects gain a nullable amd_pal_metadata field, and PAL-ABI objects
report complete, partial or unsupported instead of malformed.
Fixes#14154
* chore(gpu): regenerate the inspect_gpu_code_objects advertised schema summary
The objects view fields selector derives from the GPU object schema, so the new amd_pal_metadata field changes the advertised input compact schema.
* fix(gpu): bound AMDGPU note expansion per code object and refuse binary maps
The decoded-value allowance is now shared across all of a code object's notes, so PAL pipeline facts expanded during discovery stay bounded. MessagePack binary values are no longer accepted as maps for PAL pipelines, stages or HSA kernel and argument rows.
* feat(javascript): add semantic_analysis structure-only mode to analyze_javascript_application
On large Electron apps the default analysis runs full semantic analysis per file (364 s measured in #14100) although first questions are application-graph facts. semantic_analysis: structure-only returns static and application-graph facts without semantic IR, graph content or traces: the worker purpose protocol gains structure-only (full static checkpoint, semantic phase skipped, no semantic result budget consumed), adoption records the mode once as a limitation, and Evidence parameters record the selection. Default complete behavior is unchanged.
Closes#14116. Verified: javascriptArtifactReconstruction, electronApplicationAnalysis and javascriptApplicationService suites (75 tests incl. new structure-only e2e), worker server/schema tests, check:fast, docs:check, advertised schema summary regenerated.
* test(javascript): assert semantic relations in the structure-only test
* fix(javascript): record structure-only semantic coverage as incomplete and retain refusal facts
Structure-only files now record a semantic unavailable reason so graph coverage cannot claim complete examination (comparisons will not report skipped bindings as removed), member-mutation refusal checkpoints cross for structure-only as they do for complete analysis, and the e2e control asserts real semantic content under the default.
* docs(javascript): document semantic_analysis and expose --semantic-analysis
The owning reconstruction guide now describes the complete default, what structure-only returns and skips, and how to follow up with complete analysis of selected sources. The CLI projection declares the field so --semantic-analysis <complete|structure-only> is accepted with the contract enum.
* fix(javascript): record structure-only application coverage as partial
Structure-only omits source-module and export-binding nodes. The
application graph now reports partial coverage with a null omission
count, so a comparison of an unchanged application treats those
bindings as unknown rather than removed.
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* chore(deps): update MCP TypeScript SDK to 2.4.0
Bump @modelcontextprotocol/server and @modelcontextprotocol/client (and core transitively) from 2.3.1 to 2.4.0, the current v2 release; the legacy @modelcontextprotocol/sdk package line (1.x) is not used. Regenerate package metadata. Notable upstream changes checked against REA usage: no x-mcp-header annotations are used, output schema ids are urn: URIs accepted by the new Ajv fast-uri, and REA does not unwrap structuredContent.result. The 2025-11-25 structuredContent wrapping change for meta-id output schemas is client-visible and noted for release notes.
Verified: check:fast, DeferredEvidenceMcpServer + toolOutputReferences suites (53 tests), deferredRuntime + serverLifecycleMcp boundary suites (41 tests), and a stdio initialize/tools/list probe on all profiles after a clean build.
* fix(contracts): keep compact output unions when the SDK stamps an object root
MCP SDK 2.4.0 treats a $ref union of objects as an object and stamps
type:object before tools/list. Compact reduction then dropped that union
and advertised an empty property bag. Reduce each alternative's root
shape instead, and advertise widened oneOf branches as anyOf so
overlapping branches still accept canonical results. guided_workflows
already declared that object root and had the same empty advertisement.
Refresh the advertised catalog summaries for guided_workflows,
read_guidance_section, and search_guidance.
* chore(licenses): refresh the MCP SDK 2.4.0 dependency inventory
Regenerate licenses/npm-dependencies.txt with the license inventory
script. Update the three runtime notice identities from the lockfile
after checking each 2.4.0 archive integrity and LICENSE text; those
license bodies are unchanged. The notice fingerprint matches the
generator.
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
* perf(contracts): prune only over-depth schema branches instead of reducing whole schemas
A schema whose inlined form exceeded the depth-10 advertised limit fell back to reduceToShallowProperties for the entire tool, erasing enums and nested validation on all root properties. pruneSchemaBeyondDepth now replaces only sub-schemas past the prune depth with type-preserving placeholders (every replacement widens acceptance, so canonical server-side validation is unchanged), and both input and output compaction keep the pruned form as inline when it fits bytes, depth and dialect checks. Two compactInputSchema tests that pinned depth-forces-reduction now pin the pruned-inline contract with the same Ajv/dialect safety assertions.
Refs #13302. Verified: compactInputSchema, compactOutputSchema, toolSchemaMetadata, advertisedInputExamples (59 tests), check:fast, docs:check.
* docs(contracts): refresh advertised schema summary for pruned-inline compaction
Pruned-inline schemas retain patterns (digest, Evidence id and text patterns) that whole-schema reduction dropped on 13 tools; regenerate the committed catalog summary with npm run verify:advertised-schemas -- --update-summary and re-verify clean.
* fix(contracts): make deep-schema pruning widening-safe
Walk schema positions instead of raw JSON, preserve declared integer types, keep branches that fit, return no pruned schema under not/oneOf where widening can reject valid values, and recheck output byte budgets. Add regression coverage for closed objects, unsafe combinators, fitting enums, and nullable integers; refresh advertised summaries.
* fix(contracts): keep untyped deep schemas unconstrained when pruned
Inferring object from properties or array from items narrows an untyped schema, which accepts every JSON value; the placeholder is now always unconstrained when no type is declared. Add an Ajv regression accepting null and nested values through a pruned untyped branch.
* test(contracts): assert pruned untyped schemas at depth 8
The regression accepted values that never reached the replaced node, so
it stayed green for an object placeholder and did not distinguish
branch pruning from whole-schema reduction. Assert the empty schema at
depth 8 and accept null there.
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* refactor(application): move AnalysisViewRetention to a light module and defer view loading in services
AnalysisViewRetention and requireAnalysisViewRetention moved from AnalysisViewService (which pulls the 1.3 MB analysis-view result graph) into AnalysisViewRetention.ts, which depends only on error and Evidence port types. All type-only consumers now import the light module. ApkSignature, Il2cpp and Reverse services load AnalysisViewService dynamically only on the detail=summary branch, and executeArtifactInspection checks retention readiness through the light module and loads the view service only after a successful inspection. No behavior or wire change.
Refs #13275, #13940. Verified: check:fast (typecheck, lint, architecture guards), 93 source tests (AnalysisViewService, Il2cpp, ApkSignature, Reverse), cliStartupImports 10/10 on pinned Node 24.22.1, knip clean. Remaining static importers (ArtifactComparisonEvidence, environment build/state, Frida sync inspectStatus, server bindings) still block a full chunk split and stay in #13275.
* fix(application): recheck cancellation after lazy view imports and guard static view links
An abort arriving while the dynamic AnalysisViewService import was pending still recorded and returned a successful summary. ArtifactInspectionExecution, ApkSignature, Il2cpp and Reverse now recheck the signal after the import (retaining the complete Evidence as the cancelled partial observation) before projecting. Add a counted architecture guard so static AnalysisViewService imports in application services cannot return silently; the baseline records only the known synchronous helpers and Frida path tracked in #14112.
* refactor(config): return Result for ConfigurationError in IdaConfiguration and KiloClientLocation
* fix(config): return Kilo file-probe failures through Result
kiloGlobalLocation returned inline-configuration failures as Result but kept
throwing the shared probe's ConfigurationError, and kiloLayeredLocation no
longer caught it: an unreadable Kilo folder rejected resolveSupportedClients
for every client instead of staying a Kilo row failure. Convert probe
failures at the same Result boundary and register the counted catch.
Validation: a new boundary test (regular file at Kilo's config root) fails
without the fix and passes with it; kiloClientLocation, clientLifecycle,
mcpAddClientLifecycle and registration catalog suites pass; check:fast
passes.
* fix(ida): preserve the size rejection when descriptor close fails
The 64 KiB rejection became a completed outcome holding a rejected Result,
so the cleanup-failure handler replaced it with generic close guidance.
Read the rejection from the completed outcome when composing the cleanup
error, covering both the admission and growth size checks. Restore the
close spy leaked by the existing denial test, which the new cases exposed.
Validation: a new it.each denies close after each size check, asserts the
64 KiB message plus retained-cleanup release, and fails without the fix;
the IdaConfiguration suite and check:fast pass.
extract_uefi_firmware rows gained a required ffs_file, so extraction Evidence saved before that field failed to parse in retained views. The field is now optional when reading: the extractor still always records it, and an unrecorded owner matches no owner filter. UEFI view filters also capped each list at 64 values without a format, protocol or resource reason; overlapping filters cannot be split into separate requests without miscounting, so the cap is removed. MCP input-element admission still bounds every request.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
A whole-image extraction of a 4 MiB OVMF image lists 560 files in about 553 KB of structured content, which exceeds client result limits. MCP extract_uefi_firmware now retains the complete manifest and returns its summary unless the caller passes detail complete. Targeted extractions fit in the summary's file preview. An optional view returns the first uefi-extraction page in the same call; later pages use inspect_analysis_view. The one-shot CLI command still returns complete Evidence.
BREAKING CHANGE: MCP callers that need every published file inline must pass detail: "complete" to extract_uefi_firmware.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
A complete map of a 4 MiB OVMF image is about 514 KB of structured content, which exceeds client result limits. MCP inspect_uefi_firmware now retains the complete map and returns its summary unless the caller passes detail complete. An optional view returns the first uefi-firmware page in the same call; later pages use inspect_analysis_view. The one-shot CLI command still returns complete Evidence.
BREAKING CHANGE: MCP callers that need every volume, file and section inline must pass detail: "complete" to inspect_uefi_firmware.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(frida): add optional limit and offset paging to list_frida_processes
Closes#13853
* fix(frida): stabilize paged process discovery
* docs(frida): scope paging claims to shipped discovery
* feat(android): add optional limit and offset paging to search_android_classes
Closes#13845
* fix(android): honor larger class search pages
* fix(android): size JADX reads to the requested page
* test(android): separate class paging from Evidence retention
* refactor(artifacts): extract releaseExposureFailures from ReleaseExposureReader
* fix(artifacts): preserve release audit operation in errors
* style: format files with oxfmt
The bridge-owned catalog omitted method_name and reference_target from
get_class_summary and reference_target from get_xrefs_to_method, even
though the bridge reads both on its external-prototype path and REA
sends both for reference queries. Neither side validates against the
schema today, but the verified catalog contradicted the traffic it
describes, and any schema-validating client would reject REA's own
reference queries.
The REA call sites also stopped sending limit, resolve_line and
smali_fallback, which the bridge never reads.
Validation: check:fast, and the Android MCP boundary plus JadxAnalysis
tests (92 tests). The bridge source itself was not compiled here; the
local engine JAR is absent, so verify:android against the real 0.8.0
JAR remains the authoritative catalog check.
The catalog check compared property names and required fields only, so
advertising `overload_index` as a string would still have passed even
though the bridge rejects it. Each expected property now carries its type.
The transport piped the bridge's stderr and never read it, so a failing
startup or catalog reply surfaced as "Connection closed" with the Java
error hidden. Retain a bounded tail and append it to the failure.
Validation: bridge-catalog against the real 0.8.0 JAR passes; a wrong
expected type fails with "get_method_body.overload_index must stay
string", and a missing engine JAR now reports the javac diagnostics
instead of only the closed connection.
Listing the bridge tools closed the connection. The bridge copied each
property from the pinned engine's schema, and that schema has no
`overload_index` for `get_xrefs_to_method`, so the advertised map carried
a null that kotlinx serialization cannot write. Only `tools/list` was
affected: REA calls tools by name, which is why the real lanes never saw
it, and the same defect reproduces against the 0.7.1 engine.
The bridge now declares the properties and required fields it accepts, so
an engine bump can neither advertise a null nor drop the overload
selector REA relies on. The real Android lane lists the live catalog to
keep the shape under test. One tool list serves both the consumed set and
the reimplementation loop, unknown names fail fast instead of inheriting
a method-shaped schema, and the identity moves to 12 because main's JNI
split-qualification change already owns 11.
Validation: build:cached, check:fast, docs:check, test:focused over the
Android boundary files, and verify:android against the real 0.8.0 JAR and
ApiDemos 6.0.18. The new catalog step passes; the lane still stops at the
pre-existing `missing java` recovery expectation, which this change does
not touch.
OpenPGP packet headers read their one-, two- and four-byte lengths with
raw Buffer reads after the header-width checks. Read them through an
openpgp BinaryReader. This was the last counted raw numeric read, so the
raw-buffer-read baseline is removed and the guard now refuses any new
copy outright. The CI change-scope test names another baseline file as
its static-only path.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
BMPString and UniversalString decoding read code units with raw Buffer
reads after their length-multiple checks. Read them through the
pe-certificate-table BinaryReader instead.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The fixed-string custom-attribute prolog and the embedded resource length
were raw Buffer reads after their length and directory checks. Read them
with the managed BinaryReader formats the other metadata readers use.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The Objective-C method and Swift relative-pointer decoders read 32-bit
displacements straight from the image bytes, beside the checked u32 and
pointer readers. The shared dispatch readers now provide i32 through the
image BinaryReader and both facets use it, so they no longer take the raw
image bytes.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The build-version platform and tool count were read through a local
DataView after the command-size check. Read them with machoWordReader,
as the other load-command decoders do, and drop the now-unused viewOf.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
readGnuPropertyWords decoded property type, size and feature words with
endian-selected raw Buffer reads. Every read already sits behind the
record length checks, so the shared reader returns the same values.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The image and publisher cleanup retry built its composite and bound the
parts by hand; providerCleanupErrorFromFailures builds the same composite.
It names close_binary, the ProviderCleanupError default that the parts
and the previous composite used.
Refs #11859
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
ArtifactAnalysisResources built its multi-failure cleanup composite and
bound the parts by hand; providerCleanupErrorFromFailures builds the same
composite with the existing per-part diagnostics.
Refs #11859
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>