Merge the literal-pool and split-immediate guides into one firmware MMIO
guide covering both instruction tables, the shared access rows and groups,
attribution basis, budgets and the firmware-mmio view. Update the
documentation index, firmware overview and skill reference.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(firmware): disassemble RISC-V, MIPS32, PowerPC, and ARM64 split-immediate MMIO accesses
* fix(firmware): tighten SVD interval inheritance and split-immediate register tracking
* fix(firmware): bound inherited SVD block expansion and decode exact destination GPRs
* fix(firmware): clear Rs across acquire-ordered ARM64 CAS and CASP variants
* chore(mcp): sync advertised schema summary and budget projection with main
* fix(firmware): bound CMSIS-SVD numeric widths before BigInt and index expansion
* fix(firmware): keep rejected SVD addressBlocks distinct from omitted spans
* fix(firmware): bound MMIO representation growth and preserve SVD ambiguity
* perf(firmware): memoize SVD address lookups and pre-rank peripheral names
* fix(firmware): scan a whole application image by default for MMIO syntheses
On the 1.36 MB IROM segment of the MicroPython 1.24.1 ESP32-C3 image, a
default call scanned 256 KiB and kept 512 of 713 matching accesses. The
omitted rows were not in the retained Evidence, so the agent had to repeat
the call with larger controls or page by scan_offset. Defaults now scan
4 MiB and keep up to 32,768 syntheses within a 16 MiB representation
allowance, matching the literal-pool tool. Retained summary delivery still
sizes what reaches the agent. The image completes in about 1 s with 4,073
syntheses.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* refactor(firmware): use MMIO synthesis maximums as their defaults directly
The default scan, synthesis and representation constants only repeated
their maximums, which Knip reports as duplicate exports. The budgets and
the parser fallback now name the maximums.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(firmware): bound SVD match cache weight, exclude RISC-V flash, and report scan-limit stops
---------
Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(firmware): disassemble ARM and Xtensa PC-relative literal-pool MMIO loads
Disassemble PC-relative literal-pool load instructions (`arm-thumb` 16-bit
LDR and 32-bit Thumb-2 LDR.W, `arm-a32` LDR, and `xtensa` L32R) from local
firmware images at an explicit `base_address` without target execution:
- Byte-granular `PoolByteBitset` suppresses forward and backward pool byte
ranges even at `4k + 2` unaligned file offsets (`base_address` ending in 2).
- Two-pass Xtensa pool discovery preserves `L32R` alignment after leading or
interleaved 4-byte literal pools and preserves valid `21 36 01` encodings.
- Indexed `O(log M)` CMSIS-SVD disjoint `<addressBlock>`/`<register>` matching
with cycle-safe multi-hop `derivedFrom` resolution, `mapped_image` bounds
precedence, exact ARMv7-M/v8-M SCS sub-blocks, and `arm-a32` SoC neutrality.
- Cooperative `setImmediate` event-loop yields with `AbortSignal` cancellation,
complete retained Evidence with `detail: "summary"` and `inspect_analysis_view`
(`firmware-literal-pools`), `max_svd_nodes` parameter budget, and
field-specific `invalid_request` validation.
* fix(firmware): bound SVD and candidate memory, preserve overshadowed loads, and report required_value
* fix(firmware): resolve SVD derivedFrom chains iteratively and restore lifecycle test title
* fix(firmware): bound Xtensa trace and SVD representation memory, make Evidence cooperative, and preserve unaligned literal loads
* fix(firmware): retain completed literal-pool scans on late cancellation and avoid repeated SVD string hashing
* fix(firmware): walk SVD register clusters, sweep dense overlaps linearly, and preserve XML depth recovery
* fix(firmware): enforce profile-wide cooperative SVD cluster expansion budget and sync schema
* fix(firmware): pre-parse SVD cluster templates, inherit defaults, and keep Xtensa framing
* fix(firmware): share inherited SVD template chains and count compact arrays as single intervals
* fix(firmware): replace SVD override chain links with persistent O(log K) treap
* fix(firmware): default max_references to the representation-bounded maximum
The IROM segment of the MicroPython 1.24.1 ESP32 image resolves 35,179
literal-pool loads. A default call scanned it and then refused at 16,384
references, so the agent had to repeat the whole scan with a larger
max_references. The count is checked after scanning, and
max_representation_bytes already bounds the Evidence these rows build. The
default is now the maximum; the same image completes in 1.4 s with a 12 MB
complete result.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* refactor(firmware): use the max_references maximum as its default directly
Knip reported DEFAULT_LITERAL_POOL_MAX_REFERENCES as a duplicate export of
MAX_LITERAL_POOL_REFERENCES. The budget now names the maximum as its
default, and the provider test reads the default from the budget.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(firmware): preserve inherited SVD register widths and addressBlock spans
---------
Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(firmware): classify privileged system-register, CSR, and port-I/O instructions
Add `inspect_procedure_hardware_instructions` (`rea inspect-procedure-hardware-instructions`)
to extract and classify architectural non-MMIO hardware instructions from
`read_function_instructions` across `arm`, `arm64`, `riscv`, `xtensa`, `mips`,
`x86`, and `x86_64`.
- Parse provider `<nativeAddress>: <assembly>` lines through the shared native
address grammar (`OBSERVED_NATIVE_ADDRESS_PATTERN` / `nativeAddressInputSchema`)
without stripping 2-hex-letter mnemonics (`dc`) or discarding address spaces
(`rom:0x1000`, `overlay%3Aspace:0x1000`).
- Normalize conditional A32/T32 system, coprocessor, barrier, wait, and trap
mnemonics (`mrcne`, `mcrgt`, `mrsne`, `msreq`, `cpsie.w`, `wfene`, `wfine`,
`sevne`, `svcne`) while preserving original disassembled mnemonics, and cover
AArch64 `dc`/`ic`/`at`/`tlbi` maintenance operations.
- Parse complete 8-bit immediate x86 port tokens (`0x00..0xff` across `0x`,
Intel `h`, `$`/`#`, and decimal syntax), keep register-selected `DX` ports as
`unresolved_register`, and separate symbolic or unparsed port tokens as
`unresolved_operand`.
- Classify zero-source RISC-V CSR set/clear pseudo-instructions (`csrsi csr, 0`,
`csrci csr, 0`, `csrs csr, zero`, `csrc csr, x0`) as `read` consistently with
their canonical `csrrs`/`csrrc`/`csrrsi`/`csrrci` encodings.
Refs #7955
* chore(firmware): refresh the hardware-instruction advertised schema summary
The shared Evidence output schema on main now advertises its string
patterns, so the summary recorded on the older base was stale.
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>
* feat(firmware): propose CPU, endianness, and load-base candidates for firmware blobs
* fix(firmware): preserve MCP caller inputs, x32 decoder width, and bounded ELF tallies
* fix(firmware): leave M-profile variant and PPC width unresolved and report observed file size
* chore(firmware): remove unused exported types flagged by knip
* fix(firmware): recognize x86_64 leave;ret functions, keep uImage ppc width unknown, and preserve MIPS ELF flags
* fix(firmware): preserve MIPS/ARM decoder uncertainty and partial scan stages
* fix(firmware): preserve MIPS16 and microMIPS ELF ASE mode declarations
* fix(firmware): admit Cortex-M vector tables with filled reserved slots
The Raspberry Pi Pico SDK fills reserved vector slots with its default
handler. The detector required them to be zero, so it missed the vector
table and load base of the MicroPython 1.24.1 RP2040 image and offered only
an instruction-census guess. Reserved slots may now hold a Thumb handler in
the Reset region; any other value still rejects the table.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(firmware): identify ESP-IDF images from their header chip_id
The detectors found no candidate for the MicroPython 1.24.1 ESP32 image.
They have no Xtensa signature, and the chip is named in the image header.
A new esp-image-header detector recognizes the ESP-IDF header at offset 0
or a ROM bootloader offset, and takes the ISA from the existing ESP-IDF chip
table. The chip_id field now has one reader shared with the ESP image
parser. ESP32 images report Xtensa and ESP32-C3 images RISC-V.
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>
* feat(build): add non-turbo source-build path for freebsd
* test(build): keep direct-build coverage runnable without turbo and reap build children
* test(build): use processTest fixture and long-running tag for build tests
---------
Co-authored-by: Ysopwnable <161784452+N0zoM1z0@users.noreply.github.com>
* feat(setup): register Mistral Vibe CLI client
* fix(setup): preserve inline Vibe entry order and reject non-boolean enable_mcp on read
* fix(setup): report duplicate Vibe registrations in doctor and preserve separated subtables
* docs(setup): record the Mistral Vibe 3.2.0 registration check
Mistral Vibe 3.2.0 on Linux loaded the setup registration through its
configuration schema and discovered REA's tools over stdio. After its own
`vibe mcp add` rewrote the file, setup made no change and uninstall removed
only the REA entry.
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>
A plugin install has no `rea setup` registration to carry a WABT
tool directory, so the only way to enable inspect_wasm_artifact was a
client-wide environment variable, even though #3016 persisted the other
host-stable tool paths.
Add REA_WABT_BIN_DIRECTORY to PERSISTED_SETTINGS and the environment
schema as an absolute path, so `rea config --set`,
`rea config --get --json` and startup precedence (env > config > auto)
behave like REA_ILSPY_CMD_PATH and HOPPER_LAUNCHER_PATH. The value is
merged into the effective environment before the WASM provider reads it,
so no provider change is needed. Setup still leaves saved values in the
file rather than copying them into a client registration.
A package file's Depends can name a virtual package, such as Chrome's
libasound2 on Ubuntu 24.04, which apt refuses to install by name. The
capture now records, for each dependency the host has no package of, the
installed packages that provide it, read from dpkg-query. The export
installs those providers instead and says so in its limitations. When
dpkg-query cannot say, the capture records why and the export keeps the
declared name.
Fixes#15682
Co-authored-by: Anurag Singh <211784907+Anurag-5ingh@users.noreply.github.com>
The universal Mach-O reader reported complete coverage whenever lipo and
the FAT table agreed, without comparing the slice ranges with the file.
Bytes appended after the last slice, or placed before a slice beyond the
padding its alignment needs, were never exposed and nothing said so.
readMachoImage now reports where the FAT table ends, including Apple's
hidden ARM64 row. fatUnaccountedBytes measures the bytes outside the
table, every slice and each slice's alignment padding, following lipo's
placement of every slice at the first offset its alignment allows. Any
such bytes keep coverage unknown with a limitation that counts them and
names the first offset. Without a FAT parse only the fixed header is
known, which measures leading bytes conservatively.
The FAT fixture no longer pads its last slice, matching lipo output; the
two tests that needed bytes past the last slice now add them explicitly.
Fixes#15534
* test(clients): verify native OpenCode integration against OpenCode V2
The OpenCode client lane targeted OpenCode V1 (opencode-ai@1.18.35) and
could not pass against OpenCode V2. The V2 skill tool names its argument
`id`, so the lane's `{ name: ... }` call was rejected with "id: Missing
key" and the personal skill never loaded.
Bring the lane to OpenCode V2:
- Call the skill tool with `id` under V2 and keep `name` for V1.
- Register REA in the native `mcp.servers` table and read additional skill
sources from the `skills` array; grant tool access with a `permissions`
ruleset. The V1 dialect remains selectable with
`REA_VERIFY_OPENCODE_DIALECT=v1`.
- OpenCode V2 groups MCP tools behind its Code Mode tool by default, so the
lane sets the documented `codemode: false` server option to observe the
forwarded catalog as direct function tools. REA's refresh preserves that
client-owned option, which the lane now covers.
- Start a private server under V2. The shared background service keeps the
environment it started with and would read the caller's own configuration
instead of the lane's isolated one.
- Isolate the home for both platforms. The lane set only USERPROFILE, so a
POSIX run resolved the caller's real home for the shared skill directory.
- Take the expected catalog from the runtime under test, so
`REA_VERIFY_RUNTIME_ROOT` can point at an installed package whose catalog
differs from this checkout.
- Record the dialect, plugin-isolation mechanism and tool surface in the
receipt. OpenCode V2 dropped OPENCODE_PURE, so the V1 isolation claim no
longer described what ran.
The lane no longer refuses Windows, so the OpenCode integration can be
verified on a native Windows host.
* fix(clients): isolate OpenCode verifier config and coverage claims
Clear inherited OPENCODE_CONFIG and OPENCODE_CONFIG_CONTENT so the lab
cannot load the caller's configuration layers. Record V2 as verified
only on native Windows and leave POSIX V2 explicitly unverified.
* fix(clients): pin OpenCode verifier to a full REA catalog
Clear inherited REA_MCP_TOOL_FAMILIES and set REA_MCP_TOOL_CATALOG_PROFILE=full so setup and the MCP child always advertise the complete catalog the fixture asserts.
* fix(ci): pin Native MCP OpenCode checks to @opencode/cli@2.2.7
The verifier defaults to the OpenCode V2 dialect, but the Native MCP
registration workflow still installed opencode-ai@1.19.6 without selecting
v1. Point the matrix at the published V2 CLI that supports the V2 config
and --standalone.
* fix(clients): harden OpenCode V2 verifier modes and launch seeds
Keep Code Mode enabled for scoped-chat and assert the paginated catalog
search, clear inherited REA MCP capacity/schema settings that can reject
fixture calls, and accept Aube-managed shim launchers alongside the
raw Node/script/mcp shape.
* fix(clients): only require Code Mode catalog search for OpenCode V2
* fix(clients): clear OpenCode verifier ambient budget and Windows env aliases
Unset inherited REA_AGENT_RESULT_BUDGET_BYTES so the fixture keeps complete
Evidence, and delete cleared OpenCode/REA launch seeds case-insensitively
before spawn so mixed-case Windows aliases cannot survive.
* fix(clients): require Windows packaged OpenCode runtime and isolate V2 ancestors
Document that Windows call verification needs REA_VERIFY_RUNTIME_ROOT with a
matching packaged runtime, and refuse OpenCode V2 lab runs when an ancestor
project configuration file would join the private server.
* fix(clients): qualify POSIX OpenCode V2 coverage and dialect Windows hint
Limit checked-in POSIX V2 claims to scoped-chat catalog search and point
Windows preflight recovery at the selected OpenCode package major.
* fix(clients): match OpenCode runtime contracts and clear registration seeds
Reject a REA_VERIFY_RUNTIME_ROOT whose package version or tool catalog
differs from this checkout, and clear every selected registration setting
from SetupRegistrationEnvironment instead of a hand-maintained MCP list.
* fix(verification): bind OpenCode fixtures to selected runtime
* fix(verification): refuse discovered OpenCode plugin sources
* test(verification): reject plugins before starting OpenCode
* test(ci): exercise packaged OpenCode on Windows
* fix(verification): type the selected-runtime fixture reader
* chore(ci): use pinned npm for Windows client proof
* docs(verification): distinguish Windows runner isolation
* test(verification): keep compiled fixtures in the built test lane
* test(verification): type catalog fixtures without generated output
* fix(ci): classify automated OpenCode verification
* ci(test-selection): run every portable test when error classification changes
Boundary and acceptance tests pin the code, category and retry class a
refusal reports, but reach src/domain/analysisError* only through the
built CLI or MCP server, so PR selection never picked them. A
classification change (#15588) passed CI and left stale pins that
failed later on unrelated PRs. Treat a change to that owner as
untraceable so the plan falls back to the complete fast suite.
The rule lives in test selection rather than SHARED_BOUNDARY, because
that list also limits lane planning to a single naming lane and would
drop the four lanes that name these files.
* style(ci): format test selection
The Maven reader decoded every file as strict UTF-8, so an ISO-8859-1 POM
such as Maven's own pom-encoding fixture, or a BOM-marked UTF-16 POM,
failed as "not valid UTF-8". Decode with the shared XML text decoder and
admit ISO-8859-1. A POM that declares an encoding REA does not decode is
now refused as unsupported and names that declaration.
Fixes#15664
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Every DDS surface holds at least one texel, so a file that ends at its
payload offset is truncated even when the format's exact size is not
derived, such as planar video formats.
Fixes#15674
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The DXGI table listed only RGBA32, RGBA16 and RGBA8/BGRA8 formats, so a
DX10 texture in R8_UINT, R16_FLOAT, R32_FLOAT, RG8 and other single- or
two-channel formats had no expected payload size and passed the extent
check even with no pixel data. List every format with a fixed number of
bytes per texel.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
DEB_MAINTAINER_SCRIPTS listed "triggers" alongside preinst/postinst/
prerm/postrm/config, so inspect-deb-package reported a maintainer script
for packages whose control archive ships a triggers file. Debian defines
triggers as a list of directives dpkg reads (deb-triggers(5)); it is not
an executable maintainer script. Packages like libxv1 therefore showed
one bogus entry named "triggers" with an interpreter line that does not
exist.
Drop "triggers" from the script list and stop treating it as one. Update
the fixture to ship a realistic control-archive triggers file (mode 0644,
activate-noawait directive) so the regression exercises the real shape,
and correct the parser test's script list and summary count. The docs
note that triggers is a directive list, not a maintainer script.
* fix(pe)!: deliver inspect_pe_imports and inspect_pe_resources within the agent result budget
Neither tool had a detail input or a summary view, so their complete
Evidence was always delivered inline: about 200-480 KB of CLI JSON for
stock kernel32.dll, shell32.dll and explorer.exe, and over 1 MB over MCP.
Both now follow the inspect_deb_package pattern. With detail omitted,
complete Evidence is returned when it fits the agent result budget, and
otherwise the retained summary with delivery facts; detail complete always
returns everything, and inspect_analysis_view evidence-json pages the
retained record. The CLI gains --detail and --evidence_output.
The imports summary carries image identity, imphash, coverage with DLL
and function counts, issue/limitation counts and one name/function_count/
delay_load row per DLL, bounded to 16 KiB of rows with an omitted count.
The resources summary carries image identity, the resource directory,
coverage, directory/resource/icon-group counts and resource counts by type
and by language, each bounded to 8 KiB of rows with an omitted count.
The byte-bounded leading-prefix rule extract_artifact's summary used is
now byteBoundedList, shared by the three summaries.
BREAKING CHANGE: inspect_pe_imports and inspect_pe_resources output is now
complete Evidence or, when detail is omitted and the Evidence exceeds the
agent result budget, the inspect_analysis_view summary with delivery facts.
Callers that need the complete record inline pass detail "complete"
(CLI --detail complete); otherwise follow delivery.next.
Fixes#15619
* test(pe): cover byte-bounded lists and named resource identities in summaries
* fix(cli): withhold an over-budget summary answer and print its paging facts
The CLI printed {summary, evidence_bundle, delivery} for over-budget Evidence without measuring it, so a summary larger than a smaller configured agent result budget was printed whole. Like MCP since #15591, the CLI now measures that answer and, when it is over the budget, prints the bundle receipt and the delivery facts marked withheld, whose next call pages the saved Evidence.
* test(adb): link stub executables to one launched dispatcher
macOS checks every newly written executable on its first launch, one file
at a time for the whole host (about 150 ms each; 50 fresh stubs launched
together took 9 s). The ADB tests wrote a fresh fake adb (and Node.js tool
shims) per test, so under parallel load the first launch waited behind
every other test's stubs inside the provider's 10 s adb version probe
deadline or the test's own deadline.
writeShellStub hard-links each stub to one dispatcher the test process has
already launched; the dispatcher sources the stub's script with the stub's
own $0 and arguments. AdbProvider.test.ts drops from 38 s to 12 s alone.
* test(adb): remove the stub dispatcher at worker teardown
Forked Vitest workers skip process exit hooks, so the dispatcher
directory leaked. The test runner now removes it through the worker
cleanup it already uses for the process ownership host.
* fix(native)!: bound read_bytes to 1 MiB per call
read_bytes accepted any length up to Number.MAX_SAFE_INTEGER, both in the
public contract and in the Ghidra bridge request, so one call could ask a
provider to allocate and hex-encode an unbounded range before any
delivery budget applied. Admit at most 1,048,576 bytes per call: about
2 MiB of hex, inside the 10 MiB maximum agent result budget and the MCP
SDK's default 10 MiB stdio message buffer. The contract and the Ghidra
request share one MAX_READ_BYTES_LENGTH, the schema describes the bound
and how to read a longer range, and the refusal comes from input
admission before the provider runs.
Refs #8560
BREAKING CHANGE: read_bytes refuses length above 1048576 with
invalid_request on length. Read longer ranges as consecutive calls that
start at the previous address plus returned_bytes.
* fix(native): derive the read_bytes ceiling from the maximum agent result budget
The 1 MiB ceiling was a chosen number. Each byte returns as at least two
hex characters and no result can exceed MAXIMUM_AGENT_RESULT_BUDGET_BYTES,
so a read longer than half that maximum could never be delivered at any
budget. Derive MAX_READ_BYTES_LENGTH from it (5,242,880 bytes), so it
follows that ceiling instead of a separate constant.
* fix(native): size the read_bytes ceiling to a complete MCP response
MCP sends bytes_hex in both structuredContent and the text block, so a
read of N bytes needs about 4N bytes of response. The ceiling was half the
maximum agent budget, so a full read at it could not fit the default 10
MiB MCP response and failed after the provider finished. Derive it from
MINIMUM_RESPONSE_BYTES, which every server delivers, less a 64 KiB
Evidence envelope reserve, divided by four (2,605,056 bytes). The boundary
test now delivers a complete read at the ceiling.
The compact input schema drops field descriptions, so the consecutive-call
advice now lives in the tool description and the length refusal message,
from one READ_BYTES_CONTINUATION.
* refactor(limits): own the minimum MCP response size in the domain limits
nativeByteRead derives the read_bytes ceiling from the minimum MCP
response, but imported it from config, which the pure-layer boundary
forbids. Define MINIMUM_RESPONSE_BYTES with the other delivery limits in
src/domain/analysisResourceLimits.ts; the config parser, the byte-read
ceiling, the numeric-limit verifier and tests read it there.
* test(ghidra): verify read_bytes at its admitted ceiling
The real-Ghidra verifier still requested read_bytes with
Number.MAX_SAFE_INTEGER and with a length past the new ceiling, so it
stopped on input refusal.
- The boundary probe reads MAX_READ_BYTES_LENGTH, which runs past the
probe's mapped bytes, so it still checks an explicit incomplete read,
and refuses a length one over the ceiling.
- The large-result probe reads MAX_READ_BYTES_LENGTH through MCP and the
CLI and checks it is delivered complete with the fixture's bytes. The
annotation and dossier probes keep covering oversized delivery with a
retained reference.
* test(ghidra): compare the served annotation description with its owner
The real-Ghidra boundary verifier compared annotate_native_function's
served description with the bare contract text. Since the open-target
prerequisite is appended by describeToolPrerequisite, the check failed
before reaching the read_bytes probes. Compare with the description that
owner produces from the contract and its availability.
* test(ghidra): run verifier probes under the shared command owner
The read_bytes and large-result verifier helpers launched the CLI, ps and
the compiler through promisify(execFile), outside the verifier's command
owner, so a failure or timeout could leave their children running. Pass
the native-value verifier's commands owner through verifyGhidraBoundaries,
verifyStartupCancellation and verifyGhidraLargeResults and run every
command with commands.exec. Expected-refusal checks read the owner's
VerifierCommandExitError output (snapshot.stdout.text).
* fix(delivery): refuse within the budget when even the summary is over it
When complete Evidence was over the agent result budget, MCP retained it
and delivered its summary without measuring the summary. A deb package
with many ar members, for example, produced a summary larger than the
budget it was meant to fit.
Measure the summary before retaining it. When it is still over the
budget, return a resource_constraint error that carries the same
delivery facts in details.reported_limits.agent_budget: the complete
size, the budget, the retained complete Evidence ID and the
inspect_analysis_view call that pages it within the budget. Errors are
already delivered within the budget.
The CLI path, which builds its summary separately, is unchanged.
* fix(delivery): measure the delivered answer and describe the refusal
- Measure the {summary, delivery} answer MCP sends, not the summary
alone, when deciding whether the summary fits the budget.
- The refusal's delivery note says neither the result nor its summary
was delivered, instead of reusing the summary-delivered note.
- Offer repeating the call with detail complete only for idempotent
tools; a call with effects is told not to repeat its completed call.
- Build all three delivery refusals in this file through one
responseRefusal helper, and lower the resource-constraint constructor
baseline it no longer needs.
* Merge origin/main into fix/over-budget-summary-refusal
Also lower the untyped-budget-refusal baseline for ToolResultDelivery.ts,
which now builds its refusals through one helper.
* Merge origin/main into fix/over-budget-summary-refusal
With #15638, the page delivery.next names fits the effective budget.
The deb regression now asserts the followed page is within 4,096 bytes,
and the minimum-budget paging test accepts the refusal this branch
returns when the summary answer is over the budget too, following the
same next call.
* test(firmware): select a budget the vector-table summary answer fits
The test selected the 4,096-byte minimum budget to make the complete
vector-table report over budget. At that budget the summary answer with
its delivery facts is over the budget too, so this branch now refuses
with paging facts instead. Select 12,000 bytes: above the summary
answer and below the about 18 KB complete report, so the test still
exercises summary delivery.
* feat(evtx): page event records with offset and report page facts
inspect_evtx_archive stopped walking at max_records, so records past the first 20,000 (the newest events of a default-size Application log) could not be listed. The walk now covers every record. max_records stays a 20,000-record page bound, which limits retained Evidence. A new zero-based offset selects the first record listed. The result reports page { offset, limit, returned, total, next_offset }, and the record-limit-reached diagnostic names offset=next_offset. Coverage now describes parse loss only, so a page that leaves records out by selection is no longer partial, and chunk ending facts and endpoint checks cover records past the page.
Fixes#15612
* feat(evtx)!: qualify the file-tail offset for small and wrapped logs
The suggested tail offset is now the larger of 0 and page.total minus max_records, so a log smaller than one page gets a valid offset. File order is oldest first only in a log that has not wrapped; the guide and descriptions now say how chunks[] locates the newest records in a wrapped log.
BREAKING CHANGE: inspect_evtx_archive results now require page. Evidence saved before this change has no page, and inspect_analysis_view refuses to summarise it. Re-run inspect_evtx_archive on the log to produce current Evidence.
* fix(views): size evidence-json pages to the effective agent result budget
An over-budget delivery names inspect_analysis_view evidence-json at offset
0 as its next call. With limit omitted, a page held at most 24,576 bytes of
escaped text, sized for the 32 KiB default budget with a fixed 8 KiB
allowance for its view Evidence. Below about 32 KiB (the minimum is 4,096),
following next returned another answer over the budget.
The view service now pages an omitted limit as the largest page whose
view Evidence, measured as delivered, fits the effective budget (the
runtime override, then REA_AGENT_RESULT_BUDGET_BYTES, then the default).
A page over the budget shrinks by its measured excess and is projected
again. The MCP binding, application-execution views and the CLI pass the
launch seed they captured. A default page also never spans more code
units than the largest explicit limit, so large budgets keep fitting the
stdio frame. The fixed envelope constant and default page size are gone.
* perf(views): reuse the last window while shrinking an uncached evidence-json page
* fix(errors)!: report wrong-format, missing-file and missing-Evidence refusals by their cause
- inspect_labview_artifact refuses a file with no LabVIEW RSRC data as an
unrecognized target (code unsupported_target, failure_kind unrecognized),
as its format siblings do, instead of invalid_request. A PE whose
resource tree could not be fully read is a malformed PE target.
- inspect_gpu_code_objects, inspect_model_artifact and Apktool reported a
missing or non-regular selected file through their own copy of the
selected-file refusal (BinaryTargetError, target_unavailable). They now
use the shared projectSelectedArtifactFileFailure owner
(invalid_request, conforming, with its own next step), and the copy is
removed. The shared owner keeps the verified-symlink recovery the copy
carried.
- A retained Evidence reference the session does not hold is
invalid_request / invalid_input instead of evidence_integrity_mismatch.
Altered or unauthenticated Evidence stays evidence_integrity_mismatch.
BREAKING CHANGE: error codes change for three refusals. A non-LabVIEW
file given to inspect_labview_artifact is unsupported_target (was
invalid_request). A missing or non-regular selected file for
inspect_gpu_code_objects, inspect_model_artifact or Apktool operations is
invalid_request (was target_unavailable). A missing retained Evidence
reference (details.reason "missing") is invalid_request with category
invalid_input (was evidence_integrity_mismatch / integrity_mismatch).
Callers that branch on these codes should match the new values;
details.reason, retry_class and the remediation are unchanged in meaning.
* test(model): expect the shared selected-file refusal for a missing model path
The process-global host read failure test still expected
target_unavailable for path errors on a model file. Those are now the
shared selected-file input refusal.
* fix(resources): name a rejected symlink in the shared selected-file refusal
The GPU and model readers' copy of the selected-file refusal said the
path was a symbolic link; the shared owner reported only ELOOP, so
rejectedSymlinkRecovery failed once they moved to it. Use the rejected
symlink's own message, and keep the errno message for every other
selected-path refusal.
* docs(errors): describe missing references and closure members as the caller's selection
The comment above RESOURCE_SNAPSHOT_NOT_APPLICABLE still said a missing
Evidence reference stays an integrity failure. Missing references,
including retained sources and closure members, are invalid_request; only
altered or unauthenticated Evidence stays an integrity failure.
* fix(artifacts)!: report reader admission limits as resource_constraint
An artifact read refused by a reader limit (artifact_limits.*) or a
release-fixed allowance was code partial, which the error contract
reserves for a result cut short by a delivery or decode limit. The
read was refused at admission, so it is now resource_constraint, like
every other admission limit. The retry class is unchanged: change_first
when the limit can be raised, never when it cannot. A limit without
admission facts, such as a parser budget, stays partial.
The reader's own recovery, which names the parameter, its supported
range and the next step, and the reader_limit fact are unchanged.
Refs #15323
BREAKING CHANGE: artifact refusals with details.reason "limit" and a
details.reader_limit or fixed allowance report code and category
resource_constraint instead of partial. Match resource_constraint, or
read details.reason and details.reader_limit, which are unchanged.
* fix(errors): catalogue each artifact admission limit with the retry it returns
The catalogue listed one row for reader limits and fixed allowances with
change_first, though a fixed allowance and a reader limit already at its
maximum return never, and the release-fixed row still said partial.
List the raisable reader limit, the reader limit at its maximum and the
release-fixed allowance as separate rows, and test each row against the
error it projects.
The package, process, directory, feature and service listings reported a
caller-selected page only as a limitation sentence, and marked the result
coverage partial whenever the page omitted rows. A requested page is the
caller's selection, not lost coverage, and the next offset had to be
read out of prose.
pageListingItems now returns a page record, which each listing reports as
page: { offset, limit, returned, total, next_offset }, the shape
inspect_elf_unwind_ranges already serves. coverage reports parse loss
only, and the paging limitation sentence is removed.
Refs #15324
BREAKING CHANGE: list_adb_packages, list_adb_processes,
list_adb_directory, list_adb_features and list_adb_services no longer set
coverage partial or add a paging limitation when a page omits rows. Read
page.next_offset (null when none remain) and page.total instead.
* fix(desktop): recognize unpacked resources/app Electron applications
Electron loads an application from resources/app.asar, resources/app or
resources/default_app.asar. The desktop path convention recognized only the
ASAR names, so VS Code and GitHub Desktop, which ship an unpacked
resources/app folder, got no Electron candidate and only .NET probes for the
managed helpers they bundle.
The convention owner now reports the Electron application layout and its
depth for both forms. inspect_desktop_application emits an
electron-app-directory-convention fact for resources/app/package.json, adds it
to the Electron candidate and offers analyze_javascript_application on the
folder. Electron application probes are now application priority, so bundled
managed or native helpers no longer lead next_probes. Release exposure reads
the layout folder from the same convention, so an unpacked build names its
fuse host like an ASAR build.
* fix(desktop): derive Electron probes before bundled managed helpers
A bundled managed helper with its own .runtimeconfig.json, such as Git
Credential Manager in GitHub Desktop, is application priority too. Its probe
was derived first, so the stable priority sort still put it ahead of the
Electron application. Derive the Electron candidate and probes first.
lib.exe records the absolute object path it was given, such as
C:\build\Release\decode.obj, as the member name. The ar reader passed
that name to the shared path validator, which rejects absolute names,
so every such member was dropped and a static library built this way
looked empty with unknown coverage.
An absolute member name names a build-host location, not archive
structure. The reader now lists it under its last component, as
`llvm-ar x` writes it, keeps the recorded name in source_path, and adds
one reader-level limitation counting such members. Coverage stays
complete. A last component that is itself unsafe (empty, `.`, `..`)
is still refused and counted as before.
The absolute-name rule now has one owner in ArtifactPaths:
absoluteArtifactPathBasename classifies drive-absolute and POSIX-rooted
names, and normalizeArtifactPath uses it for its refusal.
Fixes#15618
Logs exported with wevtutil epl keep all-zero 64 KiB slots after the chunks the file header declares. The inventory diagnosed each as invalid-chunk, added chunk-count-mismatch and reported partial coverage although every record was read. Following libevtx and omerbenamram/evtx, an all-zero slot past the declared count is now unused space. A nonzero slot there, and a zero slot inside the declared count, are still diagnosed.
Fixes#15611
* fix(deb)!: deliver inspect_deb_package within the agent result budget
inspect_deb_package registered a retained summary view but declared no
detail selector and no summary delivery, so a large .deb inventory was
always inlined whole (about 790 KB for 5000 files).
The tool now takes detail like inspect_nuget_nupkg: omitted detail returns
complete Evidence within delivery.agent_result_budget_bytes and the retained
summary otherwise, and the CLI gains --detail and --evidence_output.
BREAKING CHANGE: inspect_deb_package with detail omitted now returns its
retained summary when complete Evidence exceeds the agent result budget in
a session that can page it. Pass detail "complete" (CLI --detail complete)
for complete inline delivery.
Refs #15326
* test(deb): read the retained parent without reopening the package
* fix(errors)!: make retry_class the only retry field of a target failure
A target failure reported two retry fields: its own `retry` hint
(`none | backoff | after_change`) and the `retry_class` every error
carries. They mapped one to one, so readers had to reconcile both.
`retry_class` is now the single owner: the target-failure table declares
it directly, the projection no longer emits `retry`, the error schema no
longer accepts it, and the CLI recovery rewrite reads `retry_class`.
BREAKING CHANGE: target failures no longer include `retry`, and the
error schema rejects it. Read `retry_class` instead: `backoff` is
`same_call`, `after_change` is `change_first` and `none` is `never`.
* test(errors): readers reject the removed target-failure retry field
* fix(session): never overwrite the open target with a snapshot or bundle
* test(session): cover a hard-linked target and own the test directory cleanup
* fix(mcp): serve refinement-only input rules agents need before the first call
- UEFI paths use the shared absolute-path schema, so the served schema
carries the absolute-path pattern instead of a refinement.
- Blank-text checks (guided workflow ids, prompt arguments, guidance
queries, residual-unknown text) are a served `\S` pattern, not a trim
refinement.
- Input groups name the selector values that open them, for example
`operation=architectures` for inspect_with_objdump.
- inspect_native_data_type states its one-of rule in the tool description,
from the same constant the refusal uses.
- The served-schema parity sweep credits a cross-field rule when the
description states the refusal or the selecting input group, with
controls, and drops the fixed refinement gaps.
Refs #15311
* fix(mcp): serve endpoint and literal rules on reduced schemas; state wider patterns
- A reduced schema over budget drops name-derived fallback descriptions
before its scalar rules, so analyze_web_bundle keeps its bounds.
- Reduced root properties that are unions of literals serve their values
as one enum (detail, format).
- CDP and Inspector endpoint schemas declare the explicit-port envelope
that explicitEndpointAuthority reads, as their pattern.
- A pattern the portable grammar can only serve wider (`\S`, the adb
serial) is also stated exactly in guidance.
- The parity sweep drops the endpoint and literal gaps; the generated
property accepts the host-independent absolute-path envelope.
Refs #15311