* feat(delivery)!: bound default results by an agent result budget
Omitted detail now returns complete Evidence only when it fits the new
delivery.agent_result_budget_bytes runtime setting (default 49152 compact
JSON bytes, about 12k tokens at an estimated 4 bytes per token). Larger
results are retained and delivered as the producer's summary with a
limitation naming the budget and the recovery call; nothing is refused or
truncated. inspect_analysis_view gains an evidence-json view that pages the
exact JSON text of retained Evidence. The CLI applies the same budget and
publishes the complete bundle with --evidence_output.
inspect_managed_members type_names now also narrows member_refs and
exported_types, and inspect-byte-entropy gains CLI evidence delivery.
BREAKING CHANGE: An omitted detail no longer always returns complete
Evidence inline on MCP or the CLI for tools with a detail selector
(including inspect_managed_members, inspect_managed_artifact,
inspect_byte_entropy, inspect_artifact, analyze_javascript_application,
list_procedures, list_strings and the other operations listed in
src/domain/agentBudgetOperations.ts). Over the budget they return the
retained summary; pass detail complete (--detail complete) for complete
inline delivery. inspect_managed_members type_names narrows member_refs
and exported_types.
Fixes#14172Fixes#14180
Part of #14187
Part of #14156
* test(schemas): record advertised summaries for budgeted detail
* fix(delivery): keep budgeted summaries canonical and carry delivery facts beside them
Review fixes for the agent result budget:
- Deliver the producer's own summary record, identical to detail summary,
so its identity holds in summary consumers such as compare_artifacts.
The budget, sizes, retention and the exact paging call travel as
delivery facts: a second MCP text block and _meta, or a delivery field
in CLI output.
- Capture the caller's detail for application-validated tools too, so
inspect_binary_layout and similar tools are budgeted.
- Keep recovery facts when a budgeted summary itself exceeds the frame.
- Size an omitted evidence-json limit by escaped UTF-8 bytes and never
split a surrogate pair, even in a one-unit page.
- Add the REA_AGENT_RESULT_BUDGET_BYTES launch seed; the shared test
environment raises it for semantic tests, and budget tests clear it.
- Align tool descriptions and verifiers that read complete Evidence.
* fix(delivery): retain the budgeted summary like an explicit summary
* fix(delivery): read the budget seed from the captured environment and count delivery facts in the frame
- The agent result budget seed is read from the environment the server or
CLI invocation captured: ToolResultDelivery takes it at construction,
and a CLI invocation binds it in its publication context. The ambient
process environment is no longer read.
- The frame check reserves the bytes of the delivery block and _meta that
are added after encoding, so a budgeted response cannot exceed the frame.
- Conformance workflows that resend complete Evidence raise the budget
through the shared inline-Evidence environment, as do the artifact and
binary layout verifiers.
* fix(delivery)!: request complete Evidence explicitly and never spill CLI overflow
- Shared test and verifier environments no longer raise the agent result
budget. Every test and verifier workflow that reads complete Evidence
from a budgeted tool now requests it with detail complete or --detail
complete, including the real-provider verifiers outside PR CI (Ghidra,
Hopper, IDA, Kuna and client verifiers). Default delivery is exercised
as shipped.
- Budgeting applies only to tools with a detail selector, so every
budgeted call has a complete opt-out.
- CLI overflow without --evidence_output writes nothing; its delivery
facts carry exact rerun argv for --detail complete and
--evidence_output, omitted when the command declares sensitive values.
* test(delivery): prove captured budget seeds with valid in-range values
* test: state complete-detail requests once and fix codemod regressions
- Add tests/support/completeDetail.ts with COMPLETE_DETAIL and
completeArguments so tests that read complete Evidence request it in one
place, keeping functions within max-lines-per-function without raising
the limit.
- Restore provider-client tests (GhidraClient, Hopper health): their
callTool("name", ...) calls are bridge requests, not MCP tools, and take
no detail.
- Update the game-scale type inventory test for member_refs narrowing.
* test: request complete Evidence in shared JavaScript analysis helpers and remaining CLI workflows
* test: request complete Evidence by default in the shared test transports
The shared MCP client helpers (createTestMcp, connectLocalToolsMcp and
the CLI fixture's shared MCP session) and the CLI runners (the cli
fixture and the shared CLI session) now apply one named default,
completeEvidenceByDefault. A budgeted tool called with neither detail nor
view gets detail complete; the CLI does the same with --detail complete,
chosen by the command's tool contract. A budgeted operation that resolves
to no contract fails loudly at load. Tests whose subject is delivery opt
out with delivery "budgeted". This is a test-harness choice; production
delivery is unchanged and the budget tests prove the default path.
Per-call complete-detail edits are reverted in the 204 test files whose
transports all apply the default. Explicit requests remain where a test
drives its own SDK client, server, CLI instance or process, and where
the detail choice is the test's subject.
* test: resolve CLI complete-detail defaults from the CLI registry
The Real Apple and browser verifiers read complete Evidence through
artifactCliEvidence, which ran the compiled CLI without a detail choice
and got the budgeted {summary, delivery} output. The helper now requests
complete Evidence for commands that take --detail, read from the compiled
CLI's own registry (scripts/lib/complete-evidence-cli.mjs).
The test harness default had a sibling bug: it treated every cli-flagged
budgeted contract as taking --detail, but only Evidence-delivery commands
do (inspect-binary-layout does not). It now reads the source CLI registry
too, and covers every command the CLI budgets.
* test(verifiers): request complete Evidence at each verifier's SDK client and CLI argv
The real-browser failure was the same missing normalized_result as the
Apple one: browser-capture-metadata-budget-e2e reads analyze-web-bundle
through artifactCliEvidence, fixed in the previous commit.
The shared verifier module, scripts/lib/complete-evidence.mjs, now owns
both transports:
- completeEvidenceClient wraps each verifier's SDK Client once, so every
callTool to a budgeted tool with neither detail nor view requests
complete Evidence, whatever local call helper a verifier uses (86
clients, including the Ghidra, Hopper, IDA and Kuna verifiers'
argument-less list_procedures and inspect_native_load_image calls).
- completeEvidenceCliArguments covers the remaining verifier CLI argv
that chose no detail, such as function, decompile, analyze and the
Android and Apple commands.
Commands and tools that are not budgeted are sent as written.
* test(delivery): await async completeEvidenceCliArguments helper in boundary test
* test(delivery): request complete detail in Electron CLI artifact format test
* docs(delivery): document delivery.rerun as add-only argument arrays
* test(schemas): record advertised summaries for the unified delivery budget
Tool descriptions now name the agent result budget, and the evidence-json default page is derived from the 32 KiB default, which changes the advertised input digests of the 28 affected tools. Recorded from the Build package job's output.
* test(delivery): pin the budget boundary and keep failures unbudgeted
Main's retainedSummaryDelivery tests pinned the size decision at exactly
32,768 and 32,769 UTF-8 JSON bytes. Unifying that decision into
budgetedSummaryBytes deleted them, and their port never landed, so the
byte measurement went unchecked.
Restore them against budgetedSummaryBytes at the configured budget and
one byte over, for the default and a runtime budget, with ASCII, escaped
and multibyte text, plus each condition of the decision. Off-by-one
mutants (< for <=, a cap one byte short) fail six cases; measuring UTF-16
code units instead of UTF-8 bytes fails the multibyte cases.
An MCP case pins that a target failure from a budgeted tool under the
minimum budget is identical with detail omitted and complete, with no
delivery facts.
* test(verifiers): route literal CLI argv for budgeted commands through complete Evidence
real-browser failed with "Scenario CLI did not report external disconnect
ownership": runScenarioCli ran capture-browser-scenario without --detail,
so an over-budget capture came back as its summary, which has no
browser.cleanup. The earlier sweep counted these files as covered
because their MCP clients were wrapped, but their CLI argv was not.
Route the shared runScenarioCli helper (five callers), the local cli
helpers in the module, source-map and script-export verifiers, and
every other literal argv for a budgeted CLI command without --detail or
--view (EVM interface, binary layout, packet capture, devicetree, DOM
destinations, Ghidra relocation symbols, WABT cleanup, Termux browser)
through completeEvidenceCliArguments. A sweep of scripts/ for budgeted
command literals with --json and no detail selection now finds none.
* fix(verifiers): leave clients without callTool unwrapped
The native verifier cleanup test drives native-value-e2e with a connection double whose Client has only connect and close. completeEvidenceClient bound client.callTool unconditionally, so wrapping threw a TypeError before connect ran. That TypeError replaced the primary connection failure the test asserts is preserved, and all four fault cases failed in Test shard 5 and Portable tests. A client without callTool has no tool call to complete, so the helper now returns it unchanged. Locally all five fault modes of the fixture now exit 0.
* fix(delivery): keep the catalog recorder on shipped helpers and expect view-implied summary
The verifier sweep wrapped record-mcp-catalog.mjs in completeEvidenceClient,
which lives in an unshipped helper. deferredRuntime copies only the
package's shipped files plus the recorder, so the recorder failed to load
(ERR_MODULE_NOT_FOUND) and its cleanup recorder never wrote. The recorder
only lists tools and prompts, so the wrapper had no effect; it is removed.
This branch makes a view with no --detail select summary delivery, as MCP
does for a view. Three CLI cases still expected the old view refusal; with
a view alone the missing input is now the summary bundle, so they expect
evidence_output, and a view with --detail complete still refuses the view.
* fix(delivery): request complete Evidence where callers need the whole result
Budgeted delivery made four callers receive a summary they cannot use:
- The GitHub Actions example uploads the analysis as a CI artifact, so it
now asks for --detail complete; over budget it had saved a summary.
- javascriptIntegrityPolicyCli spawns the CLI itself, outside the test
harness default, and reads normalized_result; it now applies the same
completeEvidenceCliArguments default.
- nativeObservationViewsMcp builds its own client to prove complete
observations overflow into a paging continuation; it now applies the
harness default so each call asks for complete Evidence.
- The CLI parity goldens are re-recorded for the --detail and
--evidence_output options the budgeted commands now advertise.
* fix(tests): give processes tests spawn the largest agent result budget
About 90 tests spawn scripts/rea.mjs or a server directly, outside the
harness default that asks for complete Evidence, and read analysis facts
from the result. Over the default budget they received a summary instead;
javascriptChildHandleOwnership failed this way.
The Vitest environment now seeds REA_AGENT_RESULT_BUDGET_BYTES with the
largest accepted value, so a spawned CLI or server delivers complete
Evidence, as the in-process default does. Delivery tests keep their own
budget: agentResultBudgetMcp builds its server without the seed, so its
default-budget cases still exercise the shipped default.
* fix(tests): give budgeted harness tests the shipped agent result budget
The test environment seeds the largest agent result budget so spawned
processes deliver complete Evidence. In-memory servers built by
createApplicationMcpHarness (and connectGhidraMcp, which uses it) inherit
process.env too, so a test that chose testDelivery "budgeted" kept the
seed: the 600-row list_procedures case and the omitted-detail web page
views returned complete Evidence instead of a summary.
testDeliveryEnvironment now owns that choice: a budgeted test's server
environment drops the seed and uses the shipped default. The application
harness applies it to every server it builds.
* fix(tests): expect view-implied summary delivery in the Playwright trace refusal
A view with no --detail now selects summary delivery, so its refusal
names the missing evidence_output bundle; --detail complete still refuses
the view. The trace test still expected a view refusal in both cases.
* feat(artifacts)!: inspect and compare directories by a content-addressed root digest
inspect_artifact takes an optional path and inspects it without the open
session target; a directory is inventoried in place. compare_artifacts
accepts {kind:"path",path} on either side. open_binary is unchanged and
still refuses ordinary directories with directory_requires_file.
The inventory owner computes a versioned tree digest (rea-directory-tree
v1) from the walk it already performs: SHA-256 over length-prefixed
records of each member's NFC path, kind and content digest, sorted by
path bytes. Symlink targets are recorded and not followed; FIFOs,
sockets and devices are recorded by kind. A walk that a limit or an
unreadable member stops reports root_digest partial with no digest.
BREAKING CHANGE: subject.identity gains a directory kind
{kind:"directory",algorithm:"rea-directory-tree",version:1,sha256}. A
directory inventory's subject and root sha256 are its tree digest, and a
partial walk's subject is {kind:"unknown",reason:"not-observed"}.
inspect_artifact no longer requires an open target. Directory symlink
occurrences record link_target and compare by it.
* fix(artifacts): hash exact directory names and keep failed inspection cleanup retryable
- The tree digest encodes each member's exact stored name bytes instead
of an NFC path, so names that differ only in normalization stay two
members and swapping their contents changes the identity.
- A directory inspection whose readers cannot be released retains its
scope in the caller's lifetime (the MCP session, the CLI session or
the comparison's resource scope), so a later close retries it. The
one-shot session of a path-selected file is retained the same way.
- compare_artifacts keeps a completed left inventory as an argument
observation when the right side fails.
- A summary of a partial directory inventory, whose subject is unknown,
resolves to its exact parent and compares with unknown coverage.
- The directory identity reference is in the site navigation, and the
CLI boundary test passes the comparison command its environment.
* fix(evidence): treat complete directory identities as artifact subjects in claims and digest filters
verify_reconstruction required a file subject for every structural
source, so a structural-artifact claim over two complete directory
inventories stayed unknown even when compare_artifacts confirmed a
difference. Artifact claims now accept a file or directory identity;
function claims remain file-only.
get_evidence_bundle's target_sha256 filter compared only file subjects,
so a directory's returned tree digest matched no records. It now
matches the digest of a file or directory subject.
* fix(artifacts): resolve a selected directory against the caller's cwd
A relative directory selection such as "." reached the directory route
unresolved, so the subject's local_path was the relative spelling.
The directory route now uses the caller path owner, as target admission
does for files, and records the absolute path.
The CLI acceptance test that pinned "inspect-artifact ." to
directory_requires_file now expects the inventoried empty directory,
and the macOS bundle verifier asserts the .app directory's tree-digest
identity instead of a file format.
* fix(artifacts): address PR #14270 review findings on partial roots, CLI evidence delivery, cleanup retry, and tool effects
* fix(artifacts): collect linked source closure for comparison exports
* fix(artifacts): require matching root digest schemes before comparing root hashes
* fix(artifacts): compare stored directory filenames across normalization forms
* feat(pe): inspect x64 exception-directory function ranges
Add inspect_pe_unwind_ranges, a provider-free reader of the PE32+
exception directory (.pdata). It reports each RUNTIME_FUNCTION's begin,
end and unwind RVAs, whether the entry starts a function or is a chained
fragment (UNW_FLAG_CHAININFO or an indirect unwind RVA), the chain's
parent and primary entry, and empty, unsorted, overlapping, unmapped or
unresolvable entries as explicit issues. Counts cover every entry while
kind, offset and limit select the page.
It reads headers through the shared PE image owner without changing its
admission. Failures use the existing PE failure projection.
Refs #14181
* chore(pe): record the unwind-ranges advertised schema and cursor skill
* fix(pe): index chain parents, map the whole exception directory and keep high RVAs unsigned
An unsorted table looked up every chain parent with a linear scan, and
chain resolution did not yield, so a crafted table could stall the
server. Parents are now found through one begin-RVA order and the pass
yields to cancellation. The file-backed check covers every declared
directory byte, including trailing bytes, and clearing the indirect bit
keeps RVAs at or above 0x80000000 unsigned.
* fix(pe): bound unwind reads and report unreadable codes, mismatched parents and unsorted overlaps
Unwind data is visited in ascending RVA order, so the windowed reader
moves forward and reads each region about once whatever the table order.
A primary entry whose declared code array leaves the file-backed bytes
is unknown (unwind_codes_unmapped), and its header facts are kept. A
chain parent must match the whole RUNTIME_FUNCTION; an entry with the
same begin but another end or unwind RVA is chain_parent_mismatch.
Order and overlap are checked separately. The guide moves under
docs/guides/native, and its route is unchanged.
* fix(pe): index whole RUNTIME_FUNCTION records for chain parents
Entries sharing a begin RVA were scanned for every parent lookup. The
table is now ordered once by (begin, end, unwind), and a parent is a
binary search for the exact record, with a second search for a begin
mismatch.
* test(pe): register the unwind-ranges provider lifecycle coverage
The provider lifecycle registry needs one entry per provider id. Add
rea-pe-unwind-ranges with its public CLI/MCP workflow and a typed
resource and cancellation failure test.
* test(cli): record inspect-pe-unwind-ranges in the completion goldens
* fix(pe): keep a verified unwind report through cleanup failure and check the directory before its allowance
A report completed before final close failed was replaced by the file
hash. The provider now records the verified report and the shared PE
failure projection retains it, as the ELF readers do. The entry
allowance now applies only after the directory is shown file-backed, so
an oversized count that leaves the file is a malformed target.
* chore(pe): register the exception-directory entry allowance as a pending fixed ceiling
* fix(native)!: resolve name and import selectors through one owner
find_xrefs_to_name matched names exactly against list_names, while
procedure_callers and procedure_references used each provider's own
procedure lookup. One import selector therefore resolved differently per
tool, and each tool failed on a different provider. Hopper also refused
every target outside a procedure, so it could not answer incoming
references to an import.
- NativeSymbolSelection owns name resolution for find_xrefs_to_name, xrefs
and the incoming procedure tools: exact name, then a provider-reported
external import by imported or library-qualified name, then the
provider's procedure lookup. CLI and MCP both run through it.
- When a provider refuses a name for xrefs, procedure_callers or incoming
procedure_references, REA resolves it once and asks again by address.
- The Ghidra and Hopper bridges answer an explicit address outside every
procedure (an import slot, imported name or data label) with its recorded
references and their containing procedures.
- XrefsAddressResolution is removed.
BREAKING CHANGE: procedure_references.procedure may now identify an address
outside every procedure, with classification null and an unavailable body.
find_xrefs_to_name adds resolved_name and candidates, and resolves bare
import names on Ghidra.
Fixes#14160Fixes#14184
* fix(native): order selector candidates by code point
The domain ordering rule forbids localeCompare.
* fix(native): retry only names outside every procedure and keep retry facts
- Answer a refused name by address only when the provider observes that
address outside every procedure. An interior label stays refused instead
of selecting its containing procedure.
- Return a retry's own failure unless it is another lookup miss.
- Retain Hopper's native address-target reply as raw Evidence, with its
target identity and caller completeness.
* fix(native): retry at exact procedure entries and return containment failures
- An import resolved to a procedure's exact entry, such as Ghidra's external
function for kernel32.dll::VirtualAlloc, is answered by that address;
only an address strictly inside a procedure keeps the refusal.
- A containment lookup that fails for any reason other than the provider
lacking it is returned with its facts instead of the name refusal.
* test(ida): answer unknown names as Not found in the verifier fixture
The verifier's fake IDA resolved every lookup_funcs query to main. With
xrefs names now resolved by the shared selector owner, an unknown name
such as not-an-address reaches the provider's procedure lookup, which the
fake answered with main, so xrefs succeeded instead of the expected
invalid_request. Real IDA answers an unknown name with "Not found"; the
fixture now does too, and the verifier's contract is unchanged.
* fix(native): keep provider ambiguity and declare the procedure-lookup fallback
- The Ghidra bridge sends every matching entry of an ambiguous procedure
selector as structured candidates. The projection carries them as the
typed ambiguous-selector refusal, and the shared owner no longer treats
an ambiguous lookup as a missing name, so find_xrefs_to_name returns the
ambiguity with its candidates.
- find_xrefs_to_name requires list_names or procedure_address, plus xrefs,
so providers without a name inventory, such as IDA and Kuna, report it as
available with the effects of the calls it makes.
* fix(native): answer a provider-ambiguous name by its unique exact name
Ghidra's procedure lookup matches leaf names, so a global work and ns::work
make work ambiguous, while the shared owner resolves the exact name work.
When the provider reports an ambiguity, the shared owner now retries only by
a unique exact-name match and otherwise keeps the provider's ambiguity and
candidates.
* fix(native): resolve incoming procedure names through the shared owner first
procedure_callers and incoming procedure_references asked the provider by
name first, so Ghidra's leaf-name lookup could answer "work" with ns::work
while find_xrefs_to_name selected the exact label work. These tools now
resolve the name with the shared owner first and ask the provider by its
address when that address is outside every procedure or a procedure's exact
entry. A name the owner cannot resolve, or one inside a procedure, still goes
to the provider's procedure lookup, which owns alias and thunk spellings.
xrefs keeps provider-first resolution.
* fix(native): retain snapshot replay for resolved symbol selectors
* feat(browser)!: size inspect_web_page delivery and page captures by section
inspect_web_page returned the complete capture inline with no detail
choice. A local page with 2,000 list rows, 200 buttons and three bundled
libraries produced a 4.6 MB MCP result, mostly 6,423 DOM nodes and 10,614
accessibility nodes.
inspect_web_page now declares the size-aware detail. Omitted, a capture
up to 32 KiB is inline and a larger one is retained behind a summary of
its small sections and counts. A new web-page view pages dom (node_names),
accessibility (roles), console (types), network (methods), scripts and
resources. The shared Evidence handler applies the same size decision as
the other size-aware tools and keeps detail out of the capture parameters.
BREAKING CHANGE: an MCP inspect_web_page call that omits detail on a
capture above 32 KiB now returns the retained summary. Pass
detail: "complete" for the previous shape, for example before
compare_web_captures.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(cli): deliver inspect-web-page summaries through the Evidence bundle
The contract's size-aware detail also generated a --detail option for
rea inspect-web-page, but the command ignored it and always printed the
complete capture. The command now uses the shared CLI Evidence delivery,
as analyze-web-bundle does: omitted or complete detail prints the
capture, and --detail summary requires --evidence_output and prints the
summary with the bundle receipt.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(browser): bound web-page summaries and keep capture context on pages
Review found three gaps in the new web-page view:
- pages dropped the capture's completeness and the section's context, so
an empty accessibility page looked like an exhausted one;
- script rows carried their complete captured source, so one large
bundle could not be paged;
- the summary copied every frame and worker.
Every page now carries the capture's completeness and its section's own
context beside the page coverage. Script rows keep source metadata
without text, and a script-source collection pages one script's text by
UTF-16 offset. The summary counts frames and workers, which page through
their own collections.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* test(browser): request complete captures in the real-browser verifiers
The metadata-budget, URL userinfo, DOM destination and script export
verifiers read the complete inspect_web_page capture through MCP. With
size-aware delivery, an omitted detail above 32 KiB returns the summary,
and the metadata-budget verifier failed reading scripts.items from it.
These calls now request detail complete; their CLI calls already return
the complete capture.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
---------
Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The description said detail summary retains the complete Evidence, but
the request schema required a view with it, so {detail: "summary"} was
refused at view, and the binding only projected when a view was present.
analyze_javascript_application, which shares the route delivery, already
accepted a summary without a view.
The summary delivery now makes the view optional, and the binding projects
the retained analysis's summary view when none is named. A summary with a
view is unchanged.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
An omitted size-aware detail summarized large Evidence whenever the
server could retain it. A session scoped without the application family,
for example REA_MCP_TOOL_FAMILIES=direct,enhanced, retains Evidence but
does not advertise inspect_analysis_view, so that summary could not be
paged.
The size decision now also requires the session to advertise the view
tool, in both delivery handlers, and returns complete Evidence otherwise.
An explicit summary is unchanged. Unit tests pin the 32 KiB bound at
exactly 32,768 and 32,769 UTF-8 JSON bytes with escaped and multibyte
text, and each condition of the decision; an MCP test covers the scoped
session.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
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>
* perf(mcp): serve compact output schemas from the build-recorded catalog
The compact output profile forced the eager runtime: full server composition plus runtime schema compaction measured at ~700 ms init + ~421 ms first tools/list, vs ~125 ms deferred for the default profile. The catalog recorder now also records bounded compact output advertisements per tool at build time; the deferred server serves them verbatim (new recorded presentation kind, canonical validation unchanged on calls), main admits the compact profile to the deferred path, and catalogs recorded before this field fall back to eager. Measured after: compact init 118 ms + list 7 ms at the same ~672 KB payload.
Refs #13275. Verified: DeferredEvidenceMcpServer tests (17), check:fast, build:cached, and a stdio probe comparing default/compact/hot-cold initialize and tools/list timings and bytes.
* fix(mcp): align compact deferred listings with the recorded catalog
Deferred compact startup used the off-profile catalog digests, so the first
tool call rejected the runtime. Select the digest for the configured output
profile.
Recorded output presentation skipped compaction for every listed schema.
Track which tools have a build-recorded advertisement and compact live
registrations, including discover_tools.
The recorder stored a contract projection. Legacy clients receive that
projection after the SDK stamps or wraps a non-object root and REA compacts
the listing. Record that listed schema.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* docs(mcp): describe recorded compact startup
Compact stdio startup serves the recorded catalog, including compact output
when that catalog has compact schemas. A compact profile whose catalog has
none falls back to eager composition. Initial-target, HTTP, family-scoped
hot/cold, and source runs without recorded artifacts stay eager.
Co-authored-by: morluto <morluto@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.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.
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>
* refactor(server): replace server.close and onclose monkey-patching with lifecycle hooks
* fix(mcp): keep deferred runtime cleanup out of protocol close
* test(mcp): verify materialized runtime hooks close once
* fix(cli): defer artifact AnalysisView loading until requested
* 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
* perf(cli/server/dotnet): single-pass --token-count JSON, indexed CLI command lookup, single status parse, and direct loops
* fix(cli): admit JSON token counting before retaining output
* perf(application/server): bucket ReleaseExposure layouts, use Set in environmentStateStore, and avoid owned-payload deep-clones
* perf: skip preferred release reads when evidence is settled
Move the audited engine release and its submodule gitlink from v0.7.1 to
v0.8.0 (commit 2b2a560e, sha256 4b9a01c2...). Upstream only changed
source-window paging and metadata-only field reads, so the six tools REA
consumes and the bridge identity stay unchanged.
Hand-copied version numbers now derive from JADX_RELEASE: the fixture
download name, the metadata-bridge workflow path and the fake MCP
server's reported engine version. The composition fallback availability
text no longer names a release, because the Android boundary owns the
versioned remediation.
Validation: build:cached, check:fast, docs:check, test:focused over the
16 Android test files (296 tests), and verify:android against the real
0.8.0 JAR and ApiDemos 6.0.18.
* feat(evidence): paginate retained evidence discovery summaries
Let callers page summary metadata in canonical Evidence ID order without loading record payloads into the response. Keep filter and link totals global to all matches and preserve the unpaged response for existing clients.
* test(evidence): use the supported compact schema profile
* docs(evidence): explain the summary pagination request default
* test: align verification fixtures with current public contracts
Keep the production changes from upstream and update the verification consumers that still asserted their retired contracts:
- assert unknown workflow identity structurally and retain the bounded provider caveats;
- observe the process capture's partial-error delivery while preserving live cleanup ownership assertions;
- use the package's declared imports in the isolated release controller;
- refresh the replay card digest after the Evidence subject identity migration;
- use the supported compact Kimi profile while testing case-insensitive environment keys;
- assert each public interface's own capture issue path.
These are shared test and verifier compatibility repairs. The evidence summary pagination and config-printer feature changes remain separate.
* test: observe the session close result in Kuna retry coverage
* test: follow the persisted DOL snapshot target identity
* test: align CLI and progress fixtures with shared owners
Reuse the core registrar for decompile-all instead of registering it twice
after upstream #11680. Assert the outer MCP start/completion notifications
separately from provider cleanup progress introduced by #11637, retaining
cleanup, rate, timeout, cancellation, and evidence assertions.
* docs: link CLI paging guidance to its canonical contract