Commit Graph
2797 Commits
Author SHA1 Message Date
Vincent Koc 474c0537c3 refactor(evidence): share bundle inspection option types (#16509) 2026-12-04 07:32:23 +08:00
Vincent Koc e6caca151f refactor(evidence): share mobile inventory projection setup (#16503) 2026-12-04 07:16:36 +08:00
Vincent Koc 428c279102 test(guidance): share fixture search reader (#16461) 2026-12-03 20:00:04 +00:00
Vincent Koc ee7ef5da47 test(python): share bytecode provider fixtures (#16376) 2026-12-03 14:17:34 +00:00
Vincent Koc 8901add08a test(config): share Goose REA extension edit fixtures (#16373) 2026-12-03 14:13:20 +00:00
Vincent Koc 6c31247aa7 test(config): share successful Vibe serialization fixtures (#16369) 2026-12-03 14:04:09 +00:00
Vincent Koc 16516cd5b3 test(entropy): share zero-filled file fixtures (#16366) 2026-12-03 13:42:20 +00:00
Vincent Koc bec6394874 test(desktop): share fresh bundle destinations (#16363) 2026-12-03 13:33:36 +00:00
gensokyo-dev 823c2df068 test(firmware): check access counts with a schema-valid report
The count-mismatch test added a removed field, so the strict report schema
rejected it before the count check ran. It now changes counts.loads on a
schema-valid report, with the unchanged report as a control.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-03 21:19:29 +08:00
gensokyo-dev 766c45de1d feat(firmware)!: replace the literal-pool and split-immediate MMIO tools with inspect_firmware_mmio
inspect_firmware_literal_pools and inspect_firmware_mmio_synthesis answered
the same question and differed only in the instruction idiom they decode.
One tool, inspect_firmware_mmio, now takes a single architecture vocabulary
across all nine ISAs and dispatches to the literal-pool or split-immediate
decoder.

Both decoders write the same report:
- accesses rows: instruction, address register, access kind and width,
  address and MIPS physical address, region kind, architectural block, and
  CMSIS-SVD peripheral and register facts;
- a source object with the decoder's own facts: pool slot and disassembly,
  or pattern and high instruction;
- decoder facts on the report.

firmwareMmioGroups.ts owns grouping MMIO accesses by SVD peripheral,
architectural block or 4 KiB page. mmioAttributionBasis owns the group
basis. The retained view kind is firmware-mmio, with collections accesses,
peripheral_groups and anomalies, and its summary lists the top 16 groups as
compact rows.

max_references and max_syntheses are removed, since max_representation_bytes
already bounds the rows they counted. The literal-pool pre-allocation
measurement now includes an upper bound for each group, so its refusal
reports the exact required bytes. max_scan_bytes defaults to its 16 MiB
maximum, so one call covers a whole application image. mmio_only, default
true, now also drops literal-pool constants that are not MMIO;
counts.candidate_accesses still counts every decoded access.

BREAKING CHANGE: inspect_firmware_literal_pools and
inspect_firmware_mmio_synthesis (CLI inspect-firmware-literal-pools and
inspect-firmware-mmio-synthesis) and the retained view kinds
firmware-literal-pools and firmware-mmio-synthesis are replaced by
inspect_firmware_mmio (inspect-firmware-mmio) and view kind firmware-mmio.
isa becomes architecture, max_svd_nodes becomes max_svd_xml_nodes, and
max_references and max_syntheses are removed. Neither old tool has been
released.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-03 21:19:29 +08:00
Vincent Koc 9958666968 test(evidence): share health record fixtures (#16342) 2026-12-03 12:34:15 +00:00
Vincent Koc 4caa302c80 test(environment): share recorded probe fixtures (#16331) 2026-12-03 11:51:49 +00:00
Vincent Koc 387ddfebc2 test(environment): share linked create note fixtures (#16324) 2026-12-03 11:28:40 +00:00
Vincent Koc 1b6bc54cea test(javascript): share semantic graph binding lookups (#16321) 2026-12-03 11:15:42 +00:00
Vincent Koc d29a15d6b3 test(initializers): share ARM64 fixture reads (#16318) 2026-12-03 11:00:14 +00:00
0af842ad26 feat(firmware): disassemble RISC-V, MIPS32, PowerPC, and ARM64 split-immediate MMIO accesses (#15413)
* 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>
2026-12-03 17:22:49 +08:00
04d473ca0b feat(firmware): disassemble ARM and Xtensa PC-relative literal-pool MMIO loads (#14447)
* 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>
2026-12-03 17:00:14 +08:00
Vincent Koc 37365a363e refactor(json): reuse reader failure type in public signatures (#16294) 2026-12-03 08:57:59 +00:00
Vincent Koc 4af8651f6d refactor(javascript): share container entry graph identities (#16293) 2026-12-03 08:56:13 +00:00
bf7646b0c7 feat(firmware): classify privileged system-register, CSR, and port-I/O instructions (#14422)
* 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>
2026-12-03 16:36:28 +08:00
Vincent Koc 504064c4b9 refactor(environment): share recorded list selection (#16287) 2026-12-03 08:30:44 +00:00
Vincent Koc bfe2c7cf0c refactor(environment): share recorded-answer fallback (#16284) 2026-12-03 08:17:03 +00:00
Vincent Koc 7cc831fef9 test(ips): share report inspection fixtures (#16281) 2026-12-03 08:00:42 +00:00
Vincent Koc ad6f2130ed refactor(desktop): share checkpoint version traversal (#16272) 2026-12-03 07:30:23 +00:00
Vincent Koc 4f5a01e7b4 test(oci): share image-layout service fixtures (#16270) 2026-12-03 07:25:59 +00:00
Vincent Koc 53afc0b14a refactor(environment): share two-value difference formatting (#16269) 2026-12-03 07:16:39 +00:00
Vincent Koc 100dcabeb6 refactor(javascript): reuse invalid source-map projection (#16265) 2026-12-03 07:02:28 +00:00
Vincent Koc b6ca1310ad refactor(capabilities): reuse public mode fields (#16256) 2026-12-03 06:33:14 +00:00
Vincent Koc 103fbabb6c refactor(javascript): share graph finding source projection (#16243) 2026-12-03 06:02:12 +00:00
Vincent Koc 28dcb8478a test(rust): share binary service fixture setup (#16241) 2026-12-03 05:58:02 +00:00
Vincent Koc 45dc99a88f refactor(config): share Vibe TOML section writing (#16239) 2026-12-03 05:47:47 +00:00
Vincent Koc 18dad5a9e1 refactor(investigation): share retained evidence resolution (#16229) 2026-12-03 05:20:29 +00:00
CyberSprout 6c627682ba feat(artifacts): inspect and extract MCUboot firmware images (#15414)
* feat(firmware): inspect and extract MCUboot images offline

* fix(firmware): align MCUboot digest tags, ParseFailureError locations, and compact summaries
2026-12-03 13:02:15 +08:00
CyberSprout 60d804050c feat(firmware): disassemble ARM A/R, Atmel AVR, and Motorola 68000 vector tables (#15404)
* feat(firmware): disassemble ARM A/R, Atmel AVR, and Motorola 68000 vector tables

* fix(firmware): preserve legacy vector views and tighten AVR/ARM-AR bounds

* fix(firmware): report truncated AVR vector slots and remove unused wrapper

* fix(firmware): enforce ARM A/R LDR pc target rules and slot-based table coverage
2026-12-03 13:02:09 +08:00
c50b1bae9d feat(firmware): propose CPU, endianness, and load-base candidates for firmware blobs (#14419)
* 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>
2026-12-03 13:02:04 +08:00
07de725f17 feat(setup): register Mistral Vibe CLI client (#15278)
* 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>
2026-12-03 12:46:21 +08:00
Vincent Koc 3b8a1057da refactor(setup): share Cline editor registration defaults (#16213) 2026-12-03 04:07:50 +00:00
Vincent Koc 413181e06b refactor(metadata): share Go and Rust artifact selection validation (#16212) 2026-12-03 04:06:06 +00:00
Vincent Koc c98e199c52 refactor(javascript): share static finding source lookup (#16210) 2026-12-03 03:48:26 +00:00
Vincent Koc 523bb18d89 test(ntfs): share empty journal MFT record fixture (#16211) 2026-12-03 03:45:15 +00:00
Vincent Koc 2ed23f31bb test(reconstruction): share semantic request graph fixtures (#16132) 2026-12-02 22:56:57 +00:00
Vincent Koc bbb4a949d1 test(environment): share bundle export inputs (#16115) 2026-12-02 21:57:23 +00:00
Vincent Koc 40dda21d90 refactor(javascript): share artifact graph evidence construction (#16109) 2026-12-02 21:38:15 +00:00
Vincent Koc 48cb8187c8 test(setup): share client descriptor fixtures (#16103) 2026-12-02 21:11:58 +00:00
Vincent Koc f6de954b8b refactor(esp-nvs): share caller evidence finalization (#16101) 2026-12-02 21:02:36 +00:00
Vincent Koc 64fcc7f65f test(reference-source): share file entry fixtures (#16099) 2026-12-02 20:45:03 +00:00
Vincent Koc 620ba57b52 test(deb): share package service fixture setup (#16094) 2026-12-02 20:34:03 +00:00
Vincent Koc 7616dea802 test(go): share binary service fixture setup (#16091) 2026-12-02 20:00:07 +00:00
Vincent Koc e3496a5c95 test(esp-nvs): share empty service report fixtures (#16088) 2026-12-02 19:52:43 +00:00
Vincent Koc 6f7068642e test(wasm): reuse inspect provider fixtures (#16052) 2026-12-02 17:05:32 +00:00