Commit Graph
2834 Commits
Author SHA1 Message Date
Vincent Koc 2009922533 refactor(filesystem): share Error-only missing-path checks (#16870) 2026-12-05 08:13:21 +08:00
Vincent Koc 0af8817643 refactor(filesystem): share reported missing-file checks (#16865) 2026-12-05 07:25:22 +08:00
Cassie_FoxandClaude Opus 5.5 7b1d1749e6 perf(analysis-view): reuse the owner's sealed JavaScript result without a graph walk (#16864)
* perf(analysis-view): reuse the owner's sealed JavaScript result without a graph walk

Since #13315 the JavaScript parent goes through createAnalysisViewResultReader.
On a record's first read, its fast path returns a new wrapper around the same
owned graphs, so the reader walks both whole trees in
canBorrowParsedJsonSnapshot to prove it can keep the source. Since #14252 every
over-budget delivery reads its summary that way, so each big JavaScript result
blocks the server for that walk: 331 to 429 ms per 1,200-function call in
--cpu-prof runs on 0ad967258 (#1065).

The parser now remembers the fast-path results it returns. Once
createOwnedJavaScriptApplicationEvidenceCooperatively has sealed one in place
and bound it to its Evidence, it admits that exact object to the parser's
validated set, so a later parse returns it and the reader's borrow check ends
at its identity test. A sealed copy, an imported result, or one not yet
sealed is never admitted and keeps today's checks.

🤖 Generated with Claude Code (Opus 5.5) 🦊

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* perf(analysis-view): re-check the sealed owned result before admitting it

Admission trusted the result as the parser returned it, so a change between
that return and sealing would have gone unseen. Before admitting, the sealed
result now passes the fast path's checks again: the metadata schema with the
owned graphs by identity, an exact match between the sealed and re-parsed
wrapper outside the graphs, and the cross-graph bindings. The bindings run in
bounded steps through completeJavaScriptAnalysisSteps, without the request
signal, so a cancel still gets its Evidence as before.

🤖 Generated with Claude Code (Opus 5.5) 🦊

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 18:12:58 -05:00
Vincent Koc bfecf4e00d refactor(setup): reuse client registration file probes (#16855) 2026-12-05 06:42:36 +08:00
ShuaixinHuangandShuaixinHuang ee76d1a05a fix(browser): compare saved captures without a CDP provider (#16756)
* fix(browser): compare saved captures without a CDP provider

* fix(browser): align offline comparison callers and discovery

* test(browser): assert offline comparisons in catalog presentation

---------

Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-12-04 15:29:52 -05:00
Vincent Koc 7e4e503796 test(graph): share destructuring edge lookups (#16831) 2026-12-05 04:03:30 +08:00
Eliran Zachandmorluto 33b2763423 feat(artifacts): inspect PlayStation PS-X EXE headers (#16251)
* feat(artifacts): inspect PlayStation PS-X EXE headers

A file starting with the PS-X EXE magic is inventoried as psx-exe. Root
metadata reports the initial PC and GP, the text, data and BSS ranges,
the stack base and offset with the initial SP, the region marker and
its licensed region, and whether the file length agrees with 0x800 plus
the declared text size. header.bin and text.bin are stored ranges;
text.bin carries its load address and holds only the bytes present.

A file shorter or longer than the declared text, or a text size that is
not a whole number of 2048-byte sectors, leaves coverage unknown with
the offset involved. A file that ends inside the header is refused as
truncated with the offset where it ends. Nothing is executed.

* fix(artifacts): read PS-X EXE fields through BinaryReader and match regions exactly

A region marker such as constructor matched an inherited property of the
region table, so the metadata held a function and inventory failed when
it was cloned. Regions now come from a Map. Header words are read
through BinaryReader instead of a local decoder. The fixture writes
literal offsets with distinct non-zero values, including data and a
stack offset, and the guide says inventory reads the members to hash
them.

* fix(artifacts): validate PS-X file sizes and name the omitted text member

* test(artifacts): extract PS-X EXE members in the reader test

* style(artifacts): format the PS-X reader test

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-04 17:31:34 +00:00
Vincent Koc 8c92c75dac refactor(evidence): simplify function comparison IDs (#16800) 2026-12-05 01:15:46 +08:00
Eliran Zachandmorluto 73582aa342 feat(native): identify Nim, Zig, GHC, OCaml and D toolchains (#16252)
* feat(native): identify Nim, Zig, GHC, OCaml and D toolchains

Add identify_native_toolchain, a static, read-only reader that reports
whether a local ELF, PE or thin or universal Mach-O image was built by
Nim, Zig, Haskell (GHC), OCaml or D, including stripped images without
a DWARF producer.

The reader searches a bounded part of the selected image for a fixed
table of runtime symbol names, runtime messages, mangled names, source
paths and producer strings, and returns each observed marker with its
file offset, section or segment, matched text and occurrence count.
Data sections are searched before bytes outside sections and before
instruction sections, so a bounded scan reaches strings first;
coverage reports the bytes examined.

The verdict is derived from the listed markers only: a language needs
two distinct markers, one strong. Conflicting, too few or no markers
give unknown, and a version is reported only when a marker states it.

* perf(native): order toolchain scan ranges in linear time

Intersect instruction sections with the bytes outside data sections in one pass, so an image with tens of thousands of sections does not take quadratic time before the scan starts.

* fix(native): bound stated toolchain versions and describe scan order

Track distinct versions per marker in a Set and list at most eight,
counting the rest in versions_omitted, so an image with many version
strings costs constant time per match and a bounded result. A candidate
reports a version only when exactly one was stated.

Describe max_scan_bytes and examined_bytes as a total in scan order
rather than a prefix from the image start, and place the chunk-boundary
test's marker across an actual read boundary.

* fix(native): keep every stated toolchain version in the report

* fix(native): bound stated toolchain version bytes before keeping them

* feat(native): make the stated version budget a per-call control

* fix(native): give no larger-limit retry once a toolchain control is at its maximum

* fix(native): do not match toolchain markers on truncated runs

* fix(native): keep exact markers on a final run at the image end

* style(native): format the toolchain changes

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-04 12:09:21 -05:00
Eliran Zachandmorluto 208b81d724 feat(artifacts): inspect Game Boy and GBA ROM headers (#16249)
* feat(artifacts): inspect Game Boy and GBA ROM headers

Game Boy and Game Boy Color images (game-boy-rom) are claimed when at
least the first 24 bytes of the boot logo at 0x104 match, the half every
boot ROM compares. Root metadata reports the entry code and its JP
target, full or top-half logo match, title and manufacturer code, CGB
and SGB flags, mapper and features, declared ROM and RAM sizes,
destination, licensee codes, version, and declared and computed header
and global checksums. The global checksum is summed over the file in
bounded reads.

Game Boy Advance images (gba-rom) are claimed from an ARM branch at 0,
the fixed 0x96 at 0xB2, and the boot logo or a matching complement
check. Root metadata reports the entry branch target, logo match, title,
game and maker codes, fixed value, unit and device type, version, the
complement check, and the multiboot fields when that layout could apply.

Both serve header.bin and program.bin as stored ranges. Logos are
compared by SHA-256 digest, so no logo bytes are carried. Checksum,
logo and size disagreements leave coverage unknown; a header cut short
is refused as truncated with the offset where the file ends.

* fix(artifacts): keep missing GBA multiboot fields unknown and pin checksum vectors

A GBA file that ends inside the multiboot fields reported boot_mode and
slave_id as zero. They are now null, with a limitation naming where the
file ends. The Game Boy reader charges artifact_limits.expanded_bytes
from the file size before it sums the file for the global checksum.
Checksum tests now use hand-derived vectors instead of copying the
parser's own result.

* refactor(artifacts): read Game Boy and GBA header fields through BinaryReader

The GBA parser decoded words with a local reader that read missing bytes
as zero. Both parsers now read header fields through BinaryReader, as the
tool-design guide requires, after their length checks. The fixtures write
literal offsets instead of the parsers' field constants, and the guides
say inventory reads the stored members to hash them.

* fix(artifacts): read documented GB size codes and MBC4, refuse truncated GBA headers

* style(artifacts): format the handheld ROM test

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-04 12:08:57 -05:00
Vincent Koc d1c930c3e5 refactor(config): reuse YAML source-only key groups (#16785) 2026-12-05 00:37:44 +08:00
Vincent Koc 0d8d45a16c test(mips): share an in-memory ELF metadata reader (#16787) 2026-12-05 00:37:23 +08:00
Vincent Koc 0838169c59 refactor(config): reuse YAML sequence item source retention (#16780) 2026-12-05 00:19:07 +08:00
Vincent Koc 1d22bd0580 refactor(config): reuse YAML source-key resolution (#16769) 2026-12-04 23:55:57 +08:00
Vincent Koc 35b1cd7e7a refactor(config): index YAML annotation targets once (#16762) 2026-12-04 23:20:16 +08:00
Vincent Koc b8492dac72 refactor(javascript): derive the reconstruction result from its canonical schema (#16705) 2026-12-04 19:37:00 +08:00
allisaid a25558c24e fix(unknowns): include current revision in duplicate refusals 2026-12-04 17:49:39 +08:00
Vincent Koc f7f3d61d0b refactor(evidence): share the function comparison record builder (#16679) 2026-12-04 17:46:35 +08:00
Vincent Koc bc14d29a0e test(javascript): share semantic unknown projection fixtures (#16647) 2026-12-04 15:56:38 +08:00
Vincent Koc a6896054e7 test(targets): share single-architecture fixtures (#16642) 2026-12-04 15:35:05 +08:00
Vincent Koc f42d7bfd49 refactor(environment): share recorded query matching (#16623) 2026-12-04 14:49:28 +08:00
Vincent Koc e1241ad89a refactor(javascript): share literal definition graph edges (#16619) 2026-12-04 14:47:26 +08:00
Vincent Koc d44c3983bf refactor(javascript): share Promise graph edge construction (#16617) 2026-12-04 14:34:11 +08:00
Vincent Koc 37881b864f refactor(electron): share finding Evidence classification (#16610) 2026-12-04 14:07:49 +08:00
Vincent Koc c33ca2b4f0 refactor(javascript): share reference resolution projection (#16614) 2026-12-04 14:06:44 +08:00
Vincent Koc b2cf8db876 refactor(javascript): share Evidence parameter projection (#16604) 2026-12-04 13:45:50 +08:00
Vincent Koc 85c6312087 refactor(reconstruction): share obligation case defaults (#16606) 2026-12-04 13:44:19 +08:00
Vincent Koc 7f944d35dc refactor(javascript): share Next package directory indexing (#16592) 2026-12-04 13:00:09 +08:00
hhangandhhang 0a71a25e4d fix(tar): recognize gzip archives with long comments (#16188)
Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
2026-12-04 04:28:45 +00:00
Vincent Koc 0ea33dde6f test(decompile): reuse the directory index fixture reader (#16576) 2026-12-04 12:06:04 +08:00
Vincent Koc 042f3308f6 test(setup): share Cursor client descriptors (#16566) 2026-12-04 11:40:45 +08:00
Vincent Koc 0cce417785 refactor(evidence): reuse reconstruction ledger canonical ordering (#16549) 2026-12-04 11:05:59 +08:00
Vincent Koc 5e94333dcb refactor(evidence): share semantic event relation projection (#16528) 2026-12-04 09:39:06 +08:00
morluto a37994b3e8 feat(artifacts): inspect MetaTrader EX4 and EX5 program headers and resources (#16501)
* feat(artifacts): inspect MetaTrader 5 EX5 program headers and resources

Recognize compiled MQL5 programs by their EX5 magic and inventory them
through inspect_artifact and extract_artifact. Report the program type,
compiler build, copyright/link/version property slots, nonzero header
fields of unknown meaning, and the resource table. List the opaque body
and resource payloads as stored byte ranges; nothing is decrypted,
decompressed or decompiled.

Refs #16495

* feat(artifacts): read MetaTrader 4 EX4 programs with the EX5 layout

EX4 (magic EX-) shares the EX5 header, property slots and resource
table, so both containers become one mql-program format with a
container field. The version slot is 64 bytes and the opaque body
starts at 0x2E8 in both containers; the earlier 0x3A8 header length
counted 192 opaque bytes as part of the version slot. EX4 type code 3
is a library; build is reported under a neutral name because its EX4
meaning is not established.

* fix(artifacts): bound repeated MQL resource ranges and let tar outrank printable magics

Resource records may share one payload range, and each occurrence is
hashed and extractable, so the reader now charges every record against
artifact_limits.expanded_bytes, as the DTBO reader does.

A checksum-valid tar header now runs before the recognizers that match a
printable magic at offset 0. A tar whose first member was named EX-...,
GDPC... or UnityFS was claimed as an MQL program, Godot PCK or UnityFS.

Slot text keeps a leading U+FEFF, which is declared content rather than
an encoding mark.

* fix(artifacts): refuse an invalid tar header only after leading-magic formats

Only a checksum-valid tar header outranks the printable leading magics. A
Godot pack can hold ustar at 257 inside its own content without a valid
tar checksum; refusing that header first rejected the valid pack.

* fix(artifacts): compare MetaTrader resource declarations

A resource's name, kind, record index and unpacked size live in the
resource table, outside the stored payload that content comparison
hashes, so a renamed resource compared as unchanged. Compare them as
the resource's declaration, as tar, ar and UnityFS members do.

* fix(artifacts): keep unreadable MetaTrader resource names unknown in comparison
2026-12-03 19:16:36 -05:00
Vincent Koc a59694d492 refactor(evidence): share bundle comparison source index (#16519) 2026-12-04 08:15:24 +08:00
morluto 35d0d013c1 fix(artifacts): report an unrecognized file's leading bytes and working fallbacks (#16508)
* fix(artifacts): report an unrecognized file's leading bytes and working fallbacks

A file no format route recognizes was refused with only the raw-binary
load as recovery, which suits headerless machine code but not data
containers. The refusal now reports the file size and first 16 bytes,
names inspect_byte_entropy and inspect_yara_matches, which accept any
file, and keeps raw-binary for machine code. The REA skill gains a
workflow for continuing analysis when no route recognizes a file.

* docs(development): require recovery fallbacks to fit and accept the refused input

* docs(skill): describe entropy ranges as places to inspect, not content labels
2026-12-04 00:02:34 +00:00
Vincent Koc a0fa9a2618 refactor(evidence): share composed observation mapping (#16512) 2026-12-04 07:35:05 +08:00
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