Commit Graph
3312 Commits
Author SHA1 Message Date
morluto fbd895281c fix(setup): name the analysis tool to add and explain missing tools (#17297)
* fix(setup): name the analysis tool to add when none is ready

When no native analysis tool is ready, setup names the one to add for this
operating system and links its guide, and automatic provider selection says so
plainly. Its recovery lists only providers this host can run, explains each,
asks the agent to get the person's agreement before setting one up, and says
what REA can still do without one.

Fixes #17292

* fix(providers): explain missing tools and ask before setting them up

Each external tool's repair for a missing installation now starts with what
the tool is and what setting it up installs, from one domain table, and tells
the agent to ask the person before installing it. The no-ready-provider
recovery skips providers this host refuses or that refused the target, Kuna
reports an unsupported host before its unset command, and IDA's repair carries
its description in remediationAction. AGENTS.md notes that agents are the
primary users, with a person behind them who may not know what is missing.

* fix(android): keep JADX release metadata loadable from source

Pre-install fixture scripts import JadxRelease.ts directly, so it stays
dependency-free. JadxConfiguration adds the tool description where it reports
a missing JAR.

* fix(pcap): keep the tool refusal reason in the repair action

pcapToolUnavailable had set remediationAction to the shared tshark setup
text alone, so the projected action dropped the refusal reason while the
message kept only the bare steps. adb and apktool still project both as
`${reason}. ${toolSetupRemediation(...)}` through providerConfigurationRefusal.

The helper now puts that same combined text in userMessage and leaves
remediationAction unset, so the projection copies it into the action. The
pcap CLI tests assert the reason, the Wireshark steps, and the tshark setup
prefix in both fields.

* fix(pcap): carry the tool-setup repair on the refusal itself

The recovery guide requires each refusal to carry its remediation; shared
projection formats those facts and must not fill them in. pcapToolUnavailable
had left remediationAction unset so the action was copied from the message.

The helper now sets remediationAction to PCAP_TOOL_REMEDIATION and keeps the
reason in userMessage. providerConfigurationRefusal, which adb and apktool
use, does the same with the configuration's own repair. CLI tests check the
reason and the repair separately.

* test(android): expect the tool repair in remediation, not the message
2026-12-05 20:03:04 -05:00
Ysopwnableandgensokyo-dev e5004c11ea feat(managed): recover protobuf descriptors from .NET assemblies (#17287)
* feat(managed): describe the protobuf descriptor recovery report and its budget

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(managed): recover protobuf descriptors from generated Reflection classes

Google.Protobuf's generated <File>Reflection classes build each
FileDescriptorProto in a static constructor that concatenates string
literals and passes them to System.Convert.FromBase64String. Read those
literals from the CIL in order, decode each site and keep the results that
parse as FileDescriptorProtos, byte for byte. A FileDescriptorSet lists
them dependencies first, with the well-known protobuf files they import;
other imports are named as missing. Literal characters count against
max_descriptor_bytes before they are joined. Nothing is loaded or run.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(managed): report descriptor recovery refusals as parse failures

A metadata representation budget stops the whole call as a named limit,
including inside one static constructor; other managed reader refusals
become malformed or unsupported input.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(managed): recover protobuf descriptors through an identity-checked provider

The provider reads one bounded managed assembly. A refusal at
max_descriptor_bytes, max_metadata_representation_bytes or
max_snapshot_bytes names the control to raise.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(analysis): summarize retained protobuf descriptor recovery

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(managed): add the recover_protobuf_descriptors tool

CLI recover-protobuf-descriptors and MCP recover_protobuf_descriptors
return each embedded .proto file's package, imports, messages, enums and
services, and a FileDescriptorSet for decoding captured payloads. Large
reports return the retained per-file summary within the agent budget.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* test(managed): cover protobuf descriptor recovery through the service, MCP and CLI

The protoc-style assembly fixture moves to tests/fixtures so the unit,
MCP and CLI tests share it.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): describe protobuf descriptor recovery

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(skill): route Google.Protobuf assemblies to recover_protobuf_descriptors

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* ci: scope protobuf descriptor recovery with the managed formats

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* chore(schemas): record the advertised recover_protobuf_descriptors catalog summary

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(managed): attribute, bound and account for every descriptor search

- Static constructors are found among physical MethodDef rows and named by
  the shared ownership lookup, so a MethodPtr table cannot attribute a
  descriptor to the wrong type.
- A FileDescriptorProto's wire form is walked along its schema first, and
  every nested message it would create is charged to the representation
  budget before protobuf-es decodes it.
- A body whose CIL was not fully decoded, and malformed member lists, make
  coverage partial instead of looking searched.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* test(managed): build descriptor fixtures in protoc's String.Concat shapes

The fixture's static constructor now joins its literals through
String.Concat, as arguments or a string[], before calling
FromBase64String with its real static byte[](string) signature; the
managed PE fixture can name each MemberRef row. Tests cover both forms
and the descriptor tree bound.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(analysis): sample missing imports in the protobuf descriptor summary

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): save the descriptor set from complete delivery and fail on null

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(managed): name the descriptor nesting limit instead of rejecting deep files

The nesting cutoff is now the max_descriptor_depth control (100 by
default, up to 1,000). A deeper descriptor stops the call with a named
limit rather than being listed as not a descriptor, and protobuf-es
decodes up to the same depth so it cannot refuse what the walk admitted.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): list the descriptor depth budget and record its schema

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-06 08:42:26 +08:00
morluto 48eaa07b82 fix(setup): show a plain review of setup changes (#17241)
* fix(setup): show a plain review of setup changes

The approval screen printed each action's full disclosure paragraph,
registration command, detected provider environment and integrity hash.
Someone who is not a developer could not tell what they were approving.

The review now lists each change in plain words, the file or folder it
touches, any backup kept, and the download sources and commands of
software it installs. Full detail stays in `setup --dry-run --json`.

Refs #17236

* fix(setup): keep quit prerequisites and accurate verbs in the review

- Claude Desktop's instruction to quit fully before approval lived only
  in the action detail the review no longer prints. Setup now records it
  as a plain `prerequisite` on the action, and the review shows it before
  the change.
- `install` actions can replace an existing copy, such as a changed REA
  guide, so the review says "Adds or updates".
- The build-computer runtime action creates an archive; title it so.
2026-12-06 00:04:06 +00:00
Ysopwnableandgensokyo-dev e1b66df5bc feat(native): recover UniFFI library interfaces from exports (#17215)
* feat(native): describe the UniFFI library report and its read budgets

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(native): recover UniFFI interfaces from a library's exports

Group a library's UniFFI scaffolding exports by namespace: objects named
by their free and clone functions with their constructors and methods,
functions, callback interfaces and runtime helpers. The contract version
and each item's checksum are read from function bodies that return only
that constant (x86, x86-64 with or without endbr, arm64), and NAMESPACE
and UDL_FILE metadata buffers are decoded. Nothing is called; a method
that two object names could own is listed under the longer and counted.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(native): read UniFFI libraries through an identity-checked provider

The provider reads one bounded PE or ELF file, maps its export addresses
through the image's own declarations and decodes the UniFFI interface. A
refusal at max_entries, max_text_bytes or max_file_bytes names the budget
to raise.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(analysis): summarize retained UniFFI library reports

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* refactor(analysis): bound the UniFFI summary's namespaces with boundedList

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(native): add the inspect_uniffi_library tool

CLI inspect-uniffi-library and MCP inspect_uniffi_library recover a
UniFFI library's namespaces, objects, methods, functions, callback
interfaces, contract version and checksums from its exports without
loading it. Large reports return the retained per-namespace summary
within the agent budget.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(native): describe UniFFI interface recovery

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(skill): route UniFFI libraries to inspect_uniffi_library

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* ci: scope the UniFFI reader with the native formats

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* chore(schemas): record the advertised inspect_uniffi_library catalog summary

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(native): keep UniFFI grouping linear and its omissions visible

- Namespaces, metadata owners and object owners are found by looking up
  each underscore-delimited prefix of a name, instead of scanning every
  namespace or object for every export.
- A body or metadata buffer reads the longest mapped prefix, so a constant
  that ends at its mapping's end is still decoded.
- A metadata buffer that cannot be read or decoded is counted apart from
  kinds this reader does not decode, and makes coverage partial.
- A partial export table carries its reasons into the report.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(native): expose max_structure_bytes for UniFFI library inspection

The export reader's table-size limit is now a caller control, and its
refusal names it, as inspect_native_exports does.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(cli): honour delivery options for inspect-uniffi-library

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(native): list the UniFFI structure budget and record its schema

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(native): match UniFFI namespaces and owners with a prefix trie

Namespaces, metadata owners and object owners are now found by walking
the name once through a trie of the known words, from the positions where
UniFFI spells them. The cost per name grows with its length, not with its
underscore count squared or with the number of known words.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(native): index UniFFI prefixes by hash instead of a character trie

A character trie allocated a node and a map for every distinct prefix, so
long crafted export names could exhaust the heap before the report's text
checks. The prefix index now keeps one entry per known word, keyed by two
polynomial hashes, and walks each name once computing the hashes of its
underscore-ended prefixes; only the longest matches are compared.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(native): map UniFFI reads through one index and check namespace shapes

- Constant and metadata reads use one file-mapping index built with the
  image's zero-filled ranges, so each read is a lookup and an ambiguous
  address reads as unknown instead of as definite bytes.
- The ELF container read honours max_structure_bytes, as the export read
  already did.
- 32-bit x86 images, which the shared readers name 386, decode their
  constants.
- A scaffolding symbol belongs to the longest namespace whose remainder
  has a scaffolding shape, so a namespace ending in _fn cannot take
  another namespace's functions.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(native): carry the export reader's issues into a partial UniFFI report

A partial export table now reports its first issues by code and message,
counting the rest, before falling back to its limitations.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(native): consider every shaped namespace match for UniFFI symbols

The scaffolding shape after a namespace is now checked while the name is
walked, so every span followed by _fn_ or _checksum_ is a candidate, not
only the longest four matches; only the chosen word is compared.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-06 06:30:31 +08:00
morluto 308e7aba30 fix(setup): name the next step after setup and preselect detected agents (#17237)
* fix(setup): name the next step after setup and preselect detected agents

A first-time user could press Enter in the agent picker without selecting
anything, finish with no agent connected, and see only "REA is ready for
local app analysis." with no next step.

- Start the interactive picker from detected agents REA can connect, in
  addition to existing registrations, and confirm before continuing with
  no agent selected.
- Decide the next step once in setup (restart changed agents, open a
  connected agent, or run setup again to choose one) and return it as
  `nextStep` in the setup result, so agents running `setup --json` can
  relay it. The terminal ending renders the same decision.
- Show one line per finished step and drop developer-only wording.
- Get started: plain `npx rea-agents setup`, a sample of a finished setup,
  a pre-selection note, and an onboarding prompt that asks the agent to
  explain what it can now do. Update sections keep `@latest`.

Fixes #17236

* fix(setup): decide the next step from the final status and skip foreign agents

- A detected agent whose "rea" entry launches another program was
  classified as needs_configuration, so the picker preselected it and
  setup's ownership check then refused the plan. Classify it as foreign,
  leave it unselected, and say why in the picker.
- Decide nextStep after skill settlement and cleanup, so a setup that
  ends needing attention or is cancelled carries no next step.
- Tell people to make sure their agent is selected before pressing Enter,
  since pressing Space on a preselected agent clears it.
- Remove a repeated sentence from the installation guide.
2026-12-05 21:33:22 +00:00
Ysopwnableandgensokyo-dev e5945805a4 feat(managed): inspect WPF BAML documents (#17167)
* feat(managed): generate WPF's known BAML type and property IDs

BAML names WPF's own types, properties and strings by negative IDs. The
table is generated from KnownTypes.cs and Baml2006KnownTypes.cs at a
pinned dotnet/wpf commit, with the source digests recorded and the MIT
license preserved.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(managed): describe the BAML document report and its read budgets

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(managed): decode BAML record streams into their element tree

Read the BAML 0.96 records WPF's Baml2006Reader reads, without loading
any type: the element tree with names, keys and code-behind connection
IDs; property values with their converters, markup extensions and known
binary serializers; dictionary keys and their static resources from the
deferred key section; bindings and resource references. WPF's own types,
properties and strings are named from the generated known-type table.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(analysis): summarize retained BAML documents

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(managed): read BAML files through an identity-checked provider

The provider reads one bounded regular file and decodes it; a refusal at
max_records, max_elements or max_file_bytes names the budget to raise.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(managed): add the inspect_baml tool

CLI inspect-baml and MCP inspect_baml decode a WPF BAML document, such as
a view extracted from <Assembly>.g.resources, without loading WPF or the
document's assemblies. Large reports return the retained summary within
the agent budget.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): point .NET resource sets with BAML views at inspect_baml

A resource set now proposes extraction, and inspect_baml when it holds
.baml members.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): describe WPF BAML document inspection

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(skill): route extracted BAML views to inspect_baml

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* ci: scope the BAML reader with the managed formats

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* build: expose the BAML provider and its identity as dotnet entry files

Composition constructs the provider and the capability declarations name
its identity, as they do for the managed static provider.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* refactor(managed): fold BAML coverage through the coverage accumulator

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* refactor(managed): refuse oversized BAML files through the shared parse-limit owner

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* chore(schemas): record the advertised inspect_baml catalog summary

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* build: fetch the pinned WPF sources for the BAML known-type table

The generator now downloads KnownTypes.cs and Baml2006KnownTypes.cs at the
pinned dotnet/wpf commit and checks their recorded digests, instead of
reading a caller-supplied checkout, and runs as
npm run generate:wpf-baml-known-types. The regenerated table is unchanged.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* test(managed): cover inspect-baml through the CLI and declare its conformance case

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): recognise BAML documents and route them to inspect_baml

A file that starts with the MSBAML FormatVersion header is a standalone
baml artifact; inspect_artifact proposes inspect_baml for it, as it does
for other formats a dedicated tool reads.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(managed): add a max_text_bytes budget for reported BAML text

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(managed): bound BAML expansion and validate its nesting and dictionaries

- Every reported copy of a declared name counts against max_text_bytes,
  so repeated references to one long name cannot expand without bound.
- The nearest open element is kept on its own stack, and a property or
  constructor scope must open directly inside an element.
- Deferred content must fit its document and enclosing section; each
  dictionary key's value position must start a value element.
- Bindings inside MultiBinding or PriorityBinding report the container's
  target property.
- A test names WPF's known IDs by the literal numbers of the pinned source.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): describe BAML recognition and the text budget

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* chore(schemas): record the inspect_baml max_text_bytes input

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(managed): inherit BAML binding targets instead of walking ancestors

Each element records the binding target it inherits, so a binding inside
nested MultiBinding or PriorityBinding containers resolves its target in
constant time. TemplateBinding and resource-extension elements now also
charge their reported copies against max_text_bytes.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(managed): count declared BAML type and assembly names against the text budget

Every declared type reports its assembly's name, so many types can repeat
one long assembly name; those copies now count against max_text_bytes too.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-06 03:17:31 +08:00
Ysopwnableandgensokyo-dev c2960db49f feat(artifacts): inventory resources embedded in .NET assemblies (#17105)
* refactor(managed): read ManifestResource rows and the CLI Resources directory separately

Split a ManifestResource row's columns from its data, so a caller that
holds only the metadata can list resources, and let the CLI header prefix
report its Resources directory when it is read that far.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): bound .NET assembly manifest resource admission

Add the dotnet_assembly reader limit group: the resource count follows the
session member count, and metadata bytes bound the CLI metadata read to
list ManifestResource rows.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): locate a managed image's metadata and Resources directory

Read only the PE headers, section table and CLI header to find where a
managed image keeps its metadata and embedded manifest resources, so
recognition does not load the image.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): list the manifest resources a .NET assembly embeds

Add the dotnet-assembly reader. It reads the ManifestResource rows from
the CLI metadata and lists each resource embedded in the Resources
directory as its stored bytes. Linked resources are named in the root
metadata, since their bytes live in other files.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): open managed assemblies with embedded resources as containers

A PE whose CLI header declares a Resources directory, and that carries no
other package, now inventories as dotnet-assembly, so a WPF assembly's
.g.resources can be extracted and inspected as a resource set. Managed
inspection still leads its next probes; extraction follows.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): describe resources embedded in a .NET assembly

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(skill): route assemblies with embedded resources to extraction

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* ci: scope the .NET assembly resource reader with the managed formats

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): keep located managed directories inside the file

A section can declare raw data past the end of the file. A metadata or
Resources directory mapped there is now malformed at location, instead of
failing the later exact read.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): report invalid manifest resource rows once

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): require a complete CLI header before locating managed directories

Check the declared header size against the 72-byte header and the CLI
directory, and that the whole header lies in the file, as the managed PE
reader does.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* test(managed): build fixtures that embed several manifest resources

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): inventory manifest resource names as flat keys

Names such as `a` and `a/b` are distinct resources. Inventory keeps both,
as it does for resource set names; extraction still refuses to write
conflicting paths together.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): add decode and retained-name controls for .NET assemblies

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): bound assembly resource names and keep readable rows

The metadata decode budget is now the group's representation_bytes
control, so a refusal names a field the caller can raise. Every listed
name counts against retained_name_bytes before output is built, since
rows can share one stored name. A row whose name cannot be read is
skipped and counted instead of refusing the whole assembly.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): list the .NET assembly reader controls

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* refactor(artifacts): pass the classified managed location to the assembly reader

Classification carries the located metadata and Resources directory in a
typed admission for the same descriptor, so the reader does not locate
them again.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): explain a damaged CLI Resources directory on extraction

Extraction now refuses such a PE with the location's reason instead of
reporting that the format has no reader. Inspection keeps the PE root,
where managed inspection reports the CLI header.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): require the CLI header's declared size inside the file

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-06 00:53:42 +08:00
Ysopwnableandgensokyo-dev c07901b9c9 feat(artifacts): inventory and extract .NET resource sets (#17072)
* feat(managed): decode .NET resource set headers and values

Parse the ResourceManager and RuntimeResourceSet headers of a .resources
stream, its name table and each entry's type code and payload range, as
System.Resources.ResourceReader lays them out. Fixed-size primitives get a
decoded value; strings, byte arrays and streams are payload ranges;
serialized user types are named from the type table and never decoded.

The test fixture writes resource sets the way ResourceWriter does, and its
output is byte-identical to .NET Framework 4.8 ResourceWriter for the same
values.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): bound .NET resource set admission

Add the dotnet_resources reader limit group: the resource count follows the
session member count, and the type count and header bytes bound what a
reader holds before it reaches the data section.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): read .NET resource sets as members

Serve each named resource of a .resources stream as a member whose bytes
are one range of the set: a string's UTF-8 bytes, a byte array's or
stream's payload, or a primitive's stored bytes with its decoded value in
the entry metadata. Serialized objects are listed by type name. Names that
are not safe paths, malformed values, hash table damage and version 1 sets
are reported as limitations.

Entry heads are read through windows of the data section in offset order,
so a large set costs few reads.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): recognize .NET resource sets for inventory and extraction

Claim a .resources stream by its 0xBEEFCACE magic and a usable
ResourceManager header, open it as an archive target, and register the
extractable dotnet-resources container so inspect_artifact,
extract_artifact and inventory views reach its members.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* test(artifacts): cover .NET resource sets through the artifact provider

Open a resource set as a target, inventory its members with value facts,
extract payloads, and recover from a resource count limit.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): document .NET resource set inventory

Describe how resource sets are recognized, what each member's bytes and
metadata hold, which values stay unknown, extraction, and reader admission.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(reference): list .NET resource set limits and compared metadata

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(skill): route .NET resource sets to artifact inventory

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* refactor(managed): read resource set fields through BinaryReader

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(skill): sync the Cursor plugin skill

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* test(artifacts): select the .NET resource count among explicit member counts

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* test(artifacts): resolve .NET resource limits from the member count setting

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(managed): reject negative type codes and show Local dates as UTC instants

A version 2 type code decoded as a negative Int32 is malformed, so the
entry is omitted instead of failing the metadata schema. DateTime.ToBinary
stores a Local value's UTC instant, so it is shown with a Z suffix like a
Utc value. Name records are read without decoding, so callers can bound
decoded names.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* feat(artifacts): bound retained .NET resource names

Count every decoded name, including names several table entries share,
against dotnet_resources.retained_name_bytes.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): bound shared resource names and keep neighbors' data ranges

Entry data ranges now come from every record with a data offset, so an
entry whose name does not decode no longer extends its neighbor. Decoded
names are charged against retained_name_bytes; a set that exceeds it keeps
the members read before the limit.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): inventory .NET resource names that collide as paths

Resource names are flat keys, so a and a/b are distinct resources. Inventory
lists both, as for PyInstaller, Bun and Deno members, and extraction still
refuses to write colliding destinations together.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(managed): describe resource name limits, flat keys and DateTime instants

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* refactor(managed): report resource set header failures through ParseFailureError

The header parser now throws the shared parse failure with the format,
offset and field: truncated with the available and required bytes,
unsupported for a set version ResourceReader does not read, limit naming
the exceeded artifact_limits.dotnet_resources field, and malformed
otherwise. Name and value decoders take the caller's BinaryReader instead
of allocating one per record, and the metadata schemas live in
formatMetadata.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(artifacts): report the full retained name requirement in bytes

The retained name refusal now names every reference's bytes, which are
known before decoding, so retrying with that value succeeds, and both byte
allowances report the bytes unit. The reader maps shared parse failures,
grows its header read on truncation inside the set, and holds one reader
per name section and data window.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* ci: select the Apple artifact lane for .NET resource set changes

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(cli): show .NET resource set inventory and extraction

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(skill): describe .NET resource set members for agents

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-05 22:15:09 +08:00
morluto 1da3afc139 feat(website): add a beginner's guide, case-study pictures and FAQ answers (#16987)
* feat(website): add a beginner's guide, case-study pictures and FAQ answers

Start the site in dark with the logo palette, and show the homepage case
studies as tabbed product images below the setup box. Add Contributors and
the X and Discord links near the top, and keep the star count from moving
the navigation after load.

Add a "New to AI agents?" guide, link it from the homepage, Get started,
Guides and every README edition, and link the case-study index, the reverse
engineering intro and the Ghidra and IDA guide from the READMEs.

Balance heading and paragraph wrapping, cap article text near 80
characters, add pictures to the case-study and blog indexes, fix skipped
heading levels in three case studies, and remove the small labels above
headings, keeping each target's name and version in its details line.

Add FAQ answers about coding experience, platforms, choosing an agent,
removing REA, copy protection and suspicious files, and reword the privacy
answer. All new text is translated into the 26 site languages.

Ignore local Impeccable design tool files.

* fix(website): keep the homepage tabs usable at the edges and without scripts

Show the tab row only once the script runs, so visitors without
JavaScript see the first picture and no controls that do nothing. Handle
Home and End on the first and last tab so they no longer scroll the page,
and stop the progress animation as soon as reduced motion is turned on.
2026-12-05 03:07:04 -05:00
Entrpiandmorluto 782b12a826 fix(ghidra)!: refuse Xtensa ELF unless .xtensa.info declares PC-relative literals (#16664)
* fix(ghidra)!: refuse Xtensa ELF unless .xtensa.info declares PC-relative literals

Ghidra's Xtensa language computes every L32R address from the instruction's
own address and never reads LITBASE, so a build with absolute (LITBASE)
literals decodes to wrong literal values and references without any sign of
error. Main admitted every Xtensa ELF without reading the build declaration.

Target resolution now reads the `.xtensa.info` note once, by section name,
and records its USE_ABSOLUTE_LITERALS and ABI declarations beside the header
facts. Ghidra admission refuses absolute literals and any declaration it
cannot establish, with architecture_unsupported and a reason that names the
declaration. Call0 builds stay admitted and carry a limitation naming the
calling-convention mismatch until a call0 lane assigns Ghidra's __call0
prototype. The header-selected language and profile from #11178 are kept.

The reader, note parser, fixture and real-Ghidra lane come from #7486; its
header gates, pinned language and separate guide page are not ported.

BREAKING CHANGE: Ghidra now refuses Xtensa ELF files whose .xtensa.info
section declares absolute literals (USE_ABSOLUTE_LITERALS=1), declares a
literal or ABI value other than 0 or 1, cannot be read, or is missing. Main
opened them and decoded every L32R as PC-relative. No setting restores the
old behavior.

* refactor(ghidra): move the processor dispatch out of the PSP profile

ghidraProcessorUnsupportedReason selects each architecture's profile for
every Ghidra target, so it now lives in GhidraProcessorAdmission.ts.
GhidraPspProfile.ts keeps only the Allegrex predicate and the PSPSDK
declaration checks, as ghidraPspUnsupportedReason. The callers' result
is renamed from mipsReason to processorReason.

* refactor(targets): read .xtensa.info through the shared ELF section walk

The .xtensa.info lookup had its own batched section-header loop and its
own cancellable file reader. It is now a declaration reader like the
RISC-V one: readXtensaElfDeclarations walks the headers with
visitElfSectionHeaders, and target resolution drives it with
readElfDeclarations, which owns the descriptor reads and cancellation.
The section-name table is copied in reads of at most 64 KiB, within the
driver's window.

The boundary tests drive the reader with a recording source for the
bounded-request check, and check cancellation through parseBinaryTarget
at the note payload read.

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-05 06:19:17 +00:00
639da1a3cf feat(artifacts): read ESP8266 images when the caller names the chip (#16662)
* feat(artifacts): inventory and extract ESP32 firmware images

ESP32-family app and bootloader images (magic 0xE9) had no reader, so
open_binary refused OTA downloads, app partitions and bootloaders.

Add the esp-image container format behind inspect_artifact and
extract_artifact. A pure decoder reads each byte once and keeps only
fixed-size fields. Derived facts cover the chip, from a table cited to
ESP-IDF v6.1; segment classification as ESP-IDF's should_map and
should_load; checksum and appended SHA-256 results; app and bootloader
descriptors; Secure Boot v2 signature blocks, observed and unverified;
and undescribed trailing byte ranges. Truncation and undescribed bytes
make coverage unknown. ESP8266 images are refused with a specific
reason, and ciphertext stays unrecognized.

Add the format to every target, Evidence, snapshot, live-summary and
artifact vocabulary, document it, and add an optional verify:esp-images
lane that compares esptool-built images with esptool image-info and
espsecure signature-info-v2.

Refs #3615

* test(artifacts): run the ESP image lane on esptool v5.6.0

The lane compared descriptor fields only when esptool image-info printed
one, so a descriptor that REA reports and esptool does not print passed
without comparison. Compare the descriptor kind in both directions.

Record that the lane passed for all 13 images with esptool and espsecure
v5.6.0, the version the layout facts cite, as well as with 4.12.0.

* refactor(artifacts): define ESP image layout sizes once

The decoder and the derived facts each defined the segment-header,
appended-digest and flash-sector sizes, the erased-byte scan and the
offset formatter. Define them once with the other fixed-layout structures
and import them in both places. The signature slot count is the one
constant that drives the slot scan.

Correct the observedEnd comment: it is the end of the last chunk read.

* fix(artifacts): report ESP-IDF's segment length limit by chip

ESP-IDF's verify_segment_header rejects a segment of 16 MiB or more
unless the chip maps flash through 32-bit cache addresses
(SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP: ESP32-S3, P4, C5, C61, H4 and
S31 in v6.1). Record that capability in the chip table and add a
limitation for such segments; unknown chips get none.

`loaded` repeats should_load. It does not mean the bootloader accepts the
segment: verify_load_addresses still rejects one outside the chip's RAM,
which REA does not model. Say so in the docs, the skill reference and the
inventory limitation.

* test(artifacts): check ESP lane tools first and verify extraction

The lane started work before checking its tools, so a missing RISC-V
target, ld.lld, esptool or espsecure surfaced as a raw spawn or command
error. Check each one before building and name the variable to set. Warn
when esptool is not v5.6.0, the release the layout facts cite.

Assert each segment's class for the ESP32-C3 app, its variants and the
bootloader, as the Xtensa image already did. Extract the app and the
signed image through the CLI and compare every file with the bytes at
esptool's segment offsets or in the appended signature sector; the
source's SHA-256 must be unchanged and equal the reported root_sha256.

* docs(artifacts): state what the ESP image lane does not establish

The Verification section listed the lane's checks but not its gaps: only
ESP32-C3 and ESP32 images come from a real producer, no real project
build, OTA download or flash dump is inspected, no signature is verified,
and the lane does not run in CI.

Record the timing of the final lane run on esptool v5.6.0.

* fix(artifacts): compare ESP segment declarations

Segment entries hash only their data, so compare_artifacts reported a
segment that moved to another load address with the same bytes as
unchanged; only the image itself changed. Compare each segment's
load_addr and data_len as its declaration, as Node SEA and PyInstaller
members are compared, and count a changed declaration as a metadata
change, also when content is unavailable.

Header offsets are layout and the classification is derived, so neither
is compared.

* test(artifacts): run ESP lane commands as owned process trees

The lane ran its tools through execFile. A timeout killed only the direct
child, so a linker or assembler that Clang or GCC had started could keep
running while the lane removed its workspace. Run every command through
createVerifierCommands, check the tools inside withVerifierCleanup, and
remove the workspace only after commands.close() has stopped every tree;
a failed close keeps the workspace.

Only a nonzero exit now counts as a refusal or an expected esptool
failure; timeouts and spawn failures propagate. Supervising each command
roughly doubles the lane's run time.

* test(artifacts): cancel ESP decoding after its first decoded chunk

The cancellation test requested cancel or close on setImmediate, which
can land while the file is still being opened and checked, so it never
showed that decoding had started. It also passed against a reader that
ignored both requests while decoding. Acknowledge the decoder's first
chunk, then cancel or close, join the operation, and assert that no
later chunk reaches the decoder and that the reader ends closed.

* docs(artifacts): record which ESP metadata comparison ignores

Segments are compared by their declaration. The image's and the
signature blocks' format_metadata are not: every field comes from their
own bytes, which content comparison already covers, and a block's
image_digest_matches follows the image's content.

* docs(artifacts): state that ESP mmu_page_size is a base-2 logarithm

The app descriptor's mmu_page_size keeps ESP-IDF's name and value, the
MMU page size in log base 2 as esp_app_desc_t declares it, so 16 means
64 KiB. Say so in docs/esp-image.md and the schema comment; a reader
could otherwise take 16 as 16 KiB.

* fix(esp-image): retain member consumption and share lifecycle regressions

* test(artifacts): scope MCP catalogs and budget full-schema validation

* test(artifacts): verify compact output profiles and document bounded catalogs

* test(artifacts): close readers when cleanup-test admission fails

* test(artifacts): compare ESP image limitations with their owners

The decoder and reader tests froze complete limitation sentences, so a
harmless rewording failed them. The wording now has two owners:
ESP_IMAGE_LIMITATIONS in espImageFacts.ts, which the decoder, the inventory
and the reader use, and ESP_DESCRIPTOR_LIMITATIONS beside the descriptor
decoder. Tests compare delivered limitations with the owner, called with the
facts each case establishes (segment index, declared and available bytes,
offsets, chip, page range), next to the structured assertions they already
make. Delivered text is unchanged.

* test(esp-image): assert structured facts and owned guidance

* fix(esp-image): keep spi_flash_mode and descriptor fields before a truncated tail

ESP-IDF v6.1's esp_app_desc_t declares spi_flash_mode at byte 181, after
mmu_page_size, as the committed reference layout shows; the descriptor now
keeps it as stored. The decoder also required all 256 descriptor bytes,
though it reads none past byte 181, so a file ending in the reserved tail
lost the version, project, digest and revision facts it does hold. The app
descriptor now needs only its fields; the segment's truncation is reported
as before.

* test(esp-image): pin the P-192 public key digest to espsecure's layout

espsecure packs ECDSA signature blocks as "<BBBx32sB64s64s1031x" and
zero-pads a 48-byte P-192 point to 64 bytes, so the signature starts at
byte 101 for every SHA-256 curve. signature_info_v2 hashes sig_block[36:101]
and _digest_sbv2_public_key the curve ID with the padded point. No test built
a P-192 block; this one checks public_key_sha256 against that definition.

* fix(esp-image): keep each app descriptor field the file holds in full

A file can end anywhere inside the 256-byte esp_app_desc_t. The decoder
needed every field byte, so a cut at byte 176 dropped the version, project
and app_elf_sha256 it does hold. Once the 4-byte magic identifies an app
descriptor, each field is now kept when the file holds all of its bytes and
is null otherwise; observed_length records where the descriptor ends, so a
cut field is told apart from text that is not UTF-8. The fields after the
magic become nullable in the metadata schema.

* fix(esp-image): report a signature block whose image digest does not match

A CRC-valid Secure Boot v2 block can carry another image's digest. The
block recorded image_digest_matches false, but no limitation said so, unlike
a checksum or appended-SHA mismatch, so CLI and MCP summaries showed only
the generic unverified note. The mismatch is now a limitation; coverage
stays complete and signature_status stays unverified. The three other
signature-sector limitations move into ESP_IMAGE_LIMITATIONS with their
text unchanged, so all ESP image wording has one owner.

* feat(artifacts): read ESP8266 images when the caller names the chip

An ESP8266 image shares the 0xE9 magic with ESP32-family images, and its
8-byte header does not name the chip, so REA still never detects one.
The caller now names it with one additive explicit format,
`esp8266-image`: `open_binary` `format`, or `--target-format` on
`inspect-artifact` and `extract-artifact`. The native `--target-format`
excludes it, because the target is an archive.

With the chip named, REA reads the file as esptool v5.6.0's
ESP8266ROMFirmwareImage does: the 8-byte header, the header-declared
segments and the XOR checksum seeded with 0xEF. The shared streaming
decoder takes the layout from the caller's format, and one domain function
admits the header for the resolver, inventory classification and the
decoder. Integrity, truncation and coverage follow the ESP32 rules where
they apply. Segments keep `esp-image-segment` metadata and its comparison
declaration, but their classification is always unknown, because ESP-IDF's
should_map and should_load do not describe the ESP8266 loaders. A segment
that esptool warns about, or that esptool would not write, gets a
limitation, which also shows when an ESP32-family image was named
ESP8266. Magic 0xEA (esptool's version 2) is refused as unsupported.

The auto-detection refusal now names the explicit format. Inventory and
extraction receive the caller's format, so byte classification does not
reclassify the root.

Contract: `esp8266-image` joins the explicit format, Evidence subject,
artifact graph, snapshot target and live summary enums, and
`format_metadata` gains the `esp8266-image` root kind. The ESP32 schemas
are unchanged: the shared checksum and byte-range shapes are separate
instances, so the advertised JSON Schema keeps them inline.

* fix(artifacts): name every ESP8266 route and own the caller's root format (panel review)

The refusal for an unnamed ESP8266 image told CLI users to pass
`--target-format esp8266-image`, which the native commands reject. It now
names `open_binary` `format` and the two artifact commands.

`CALLER_SELECTED_ROOT_FORMATS`, next to the explicit-format enum, owns the
formats whose root inventory must not reclassify. The CLI option, the
native exclusion, the artifact selection type and inventory derive from it,
and extraction derives the format from its input format instead of taking
a second field.

Other changes:
- The 8-byte common header has one parser.
- Reader messages name an ESP8266 image as one.
- The lane's version 3 digest check no longer assumes the digest begins
  with a byte other than 0xFF.
- The docs no longer call the absent digest fields established, and no
  longer claim that snapshots record the format. Artifact sessions cannot
  be saved as snapshots.
- New tests cover esptool's segment-warning bounds.
- The lane passed with esptool v5.6.0 and 4.12.0.

* chore(plugin): regenerate the skill bundle from the authored skill

* refactor(firmware): format the ESP8266 magic byte with the shared byteToHex owner

Main's architecture guard admits no new inline byte-to-hex formatting; the
header refusal now uses src/kernel/byteToHex.

* chore(verify): record open_binary's input schema with esp8266-image

CI's package build compares the committed advertised-schema summaries with
the packaged catalog; regenerated with
`node scripts/verify-advertised-schemas.mjs --update-summary`.

* fix(artifacts): say how to read an ESP8266 image inside an ESP flash dump

A partition or bootloader region of an ESP flash dump that begins with an
ESP8266 image header carried the whole-file refusal, which tells the caller
to open "this file" as esp8266-image. Inside a dump that file is the dump.

The region now carries ESP8266_REGION_REFUSAL: extract the region, then
open the extracted file with format esp8266-image. Both refusals share the
reason ESP8266 images are never detected. The test follows that advice
through extraction and a named read, and fails with the old message.

* refactor(artifacts): skip ESP32-only decoder state for ESP8266 images

---------

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-05 04:16:40 +00:00
morluto 2576839f0d docs: show the star history chart under the contributors (#16931)
Put the star history chart back below the contributor avatars in every
README, as in the Orca README, without the hard-coded star count.
2026-12-04 23:06:58 -05:00
morluto 7bdf9d47dd docs: rebuild the README around the website and real showcase images (#16929)
* docs: rebuild the README around the website and real showcase images

Shorten the README to a hero, a short setup section and six showcase rows,
each with an image built from a real capture of its case study. Move setup
detail, the FAQ and updates to rea.tools, keep one Discord link, and remove
unsourced community and star numbers. Rewrite all 26 translations to match.

The in-page README link test now proves parsing by counting headings, since
a README may have no in-page links.

* docs: say the dinosaur speed grows while it is below 13

The recovered rule adds 0.001 only while the speed is below 13, so the
speed ends just above 13 rather than stopping at it. Match the homepage
wording in the README image, its alt text and all translations.
2026-12-04 23:04:11 -05: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
Eliran Zachandmorluto d28ee2b639 feat(model): inspect PyTorch checkpoints and pickle opcodes statically (#16257)
* feat(model): inspect PyTorch checkpoints and pickle opcodes statically

inspect_model_artifact now reads PyTorch ZIP checkpoints, legacy torch.save
files and protocol 2-5 pickle streams without unpickling. A bounded static
walker (protocols 0-5) reports each stream's protocol and opcode counts and
every GLOBAL, STACK_GLOBAL, INST, OBJ, REDUCE, NEWOBJ, BUILD and EXT reference
with its offset, marking callables outside PyTorch's tensor-rebuild allow-list
as observations of what loading would import or call.

ZIP checkpoints report their archive prefix, version, byteorder and
serialization records and each referenced data/<key> storage; legacy files
locate every storage in the file. State-dict tensors get dtype, shape, byte
span and parameter counts, and names when one unshared key path reaches them.
Malformed opcodes, truncation and memo misuse are target failures with their
offset; max_pickle_opcodes and max_pickle_memo_entries bound the walk.

Refs #3652

* fix(model): address pickle walker and PyTorch interpretation review findings

- push APPENDS/ADDITEMS values one at a time instead of spreading them
- replace an equal key on SETITEM(S), as unpickling does
- refuse a FRAME longer than the remaining stream as truncated
- decode BINUNICODE with surrogatepass and validate raw-unicode-escape text
- unwrap _rebuild_parameter chains iteratively
- resolve tensor key paths once per node and charge names before building them
- inventory every storage persistent ID and require its storage bytes
- bound archive records in the MCP summary with record_count and records_omitted

* fix(model): bound pickle integers, ZIP names and keep partial facts

- validate but do not convert protocol 0 integers beyond an exact long; refuse inexact memo keys
- decode STRING with Python's escape rules, keeping unknown escapes
- fill the format peek before classifying the file
- read PyTorch ZIPs under the session member count with a bounded metadata read, charging names as they are listed
- retain completed pickle facts before full-file hashing
- mark tensor coverage partial when a rebuild call cannot be read

* fix(model): keep Python string identity and bound dict-key work

- record the exact code point sequence of strings holding Python surrogates, so distinct keys stay distinct
- build each key's identity once per node, so a reused memoized key is not rebuilt per write
- decode raw-unicode-escape text in bounded batches instead of one fragment per backslash run
- keep the first equal key when SETITEM replaces its value

* fix(model): scan raw-unicode-escape text in one pass

Measure each backslash run once instead of retrying a regular expression from every backslash, and build output without a per-escape list.

* fix(model): keep GGUF partial tensor data offsets non-null

* fix(model): bound pickle tensor counts and validate FLOAT operands

* fix(model): bound shared tensor work and read expanded views

* fix(model): format the pickle changes and drop the unused ModelFormat type

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-04 17:10:56 +00: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
morluto ca66ab63ba feat(website): improve search reach and complete 27 language editions (#16783)
* feat(website): lead search metadata with the REA tagline

Search results showed a generic homepage description, and rea.tools did not
rank for its own name, "Reverse Engineer Anything".

- Homepage title and description lead with "Reverse engineer anything,
  reimagine everything" in plain language, and the hero shows the tagline.
- Guide hub and first investigation titles match "how to reverse engineer
  an app with AI" searches.
- The English homepage publishes WebSite and SoftwareApplication structured
  data naming REA and "Reverse Engineer Anything", linked to GitHub, npm and X.
- The npm package homepage points to https://rea.tools.
- Translations of the changed messages keep 19 language homepages indexable.

* fix(website): match local search terms and list rea.tools in the MCP registry

Japanese and French coverage of REA uses なんでもリバースエンジニアリング and rétro-ingénierie, so the new titles and descriptions use the same terms. The MCP registry websiteUrl now points to https://rea.tools instead of the repository.

* fix(website): say the AI agent understands software, and repair blog descriptions

The homepage description now says REA lets your AI agent understand how any app, game or website works, translated for 19 editions. The blog index description had machine-translation errors in 8 languages, including Arabic rendering AI as Amnesty International; those are corrected.

* fix(website): rewrite Vietnamese translations for clarity

Replace machine-translated Vietnamese with natural wording across every
page: consistent terms for coding agent, case study, prompt and file,
correct breadcrumbs and number formats, and readable case studies, guides
and essays.

* fix(website): align translated titles and coding-agent terms

End translated titles with the same " — REA" separator as English, use
the established coding-agent term in German, Thai and Arabic, and fix the
French get-started title.

* feat(website): describe page breadcrumbs for search results

Search engines can show a page's place on the site (rea.tools > Guides > ...)
instead of a bare URL. The trail is read from each built page's visible
breadcrumb, so every language edition gets its own translated names.

* feat(website): add beginner and Ghidra/IDA guides and complete all 27 editions

New pages for people searching for reverse engineering itself:
"What is reverse engineering?", "Reverse engineering with AI" and
"Use Ghidra or IDA with an AI agent", linked from the homepage and guides.
The FAQ answers where to get REA safely, whether it is free, how it
differs from a Ghidra or IDA MCP server, whether it recovers source code
and whether reverse engineering is legal.

Case-study, browser and dinosaur pages get titles that match what people
search for, and the case-study index leads with "REA Examples".

Every translation was reviewed and largely rewritten where it was machine
translated, including wrong word senses, broken placeholders and, in Thai,
unrelated text. Malayalam, Roman Urdu, Romanian and Bulgarian are now
complete, and Hindi, Dutch and Bengali are new editions with READMEs. All
26 catalogs are fully translated, so no page falls back to English.

* fix(website): read breadcrumbs with an HTML parser and correct IDA support

Breadcrumb structured data now finds the trail by its class with an
HTML-aware parser, so extra classes, attribute order and line breaks no
longer drop a valid breadcrumb.

The Ghidra and IDA guide no longer promises callers or byte reads through
IDA, which no IDA profile provides; it suggests cross-references instead.
The example prompt is engine-neutral, the terminal example says how to
select IDA, and the ida-free-mcp choice warns that its 1.1.2 release
accepts connections from other computers until a firewall or a
local-only build restricts it.
2026-12-04 11:49:29 -05:00
Saim Shafique 77b43be692 fix(cli): say array options repeat per value in help 2026-12-04 17:35:20 +08:00
N0zoM1z0andgensokyo-dev 68a7ab70cf fix(fit): account for legacy external devicetree alignment
Accept the exact four-byte padding emitted by older mkimage releases
alongside the eight-byte padding used for flat_dt today.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-04 17:32:48 +08:00
N0zoM1z0andgensokyo-dev 46e92e2b64 fix(fit): require exact external image padding
Derive the trailing padding length while validating external ranges.
Attribute linked ranges to their owning image. Only accept a fully read
zero-filled tail of the expected length as mkimage padding.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-04 17:32:48 +08:00
Anurag Singh c75b676637 fix(fit): report bytes after the image data as unknown coverage
FIT inventory reported complete coverage whenever the devicetree and
image ranges were valid, even when bytes followed the last of them.
OpenWrt sysupgrade images carry metadata and an fwtool signature there,
and recovery images pad to 64 KiB; neither was exposed or mentioned.

The FIT structure now reports its extent, the first byte after the
devicetree and every external image range. Bytes past it leave coverage
unknown with a limitation naming their size and offset. Up to 7 zero
bytes after external image data stay accounted for, since mkimage -E
pads the last image to its 4- or 8-byte alignment.

Closes #16230
2026-12-04 17:32:48 +08:00
Anurag Singh 3741beeafc fix(asar): report bytes outside every packed member as unknown coverage
The ASAR reader declared complete coverage after listing the header's
members, even when bytes after the header belonged to no packed member:
bytes after the last member, gaps between members, or the declared range
of a member that cannot be read. Coverage is now unknown in those cases,
with a limitation giving the unaccounted bytes, their range count and the
first offset. Unpacked members need no packed bytes.

The gap measurement the wxapkg reader used moves to a shared
unaccountedBytes helper that both readers call.

Closes #16588
2026-12-04 17:06:37 +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
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
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
morluto f33f0e1c0c fix(artifacts): honor expanded_bytes for FIT images and share repeated-range admission (#16517)
FIT charged its images against the default expansion budget inside the
structure parser, ignoring a configured artifact_limits.expanded_bytes
and refusing without limit facts. The reader now charges every image,
including image-data links that repeat one range, through a helper the
DTBO reader also uses, and reports the standard expanded_bytes refusal.
The parser's untyped copy is removed.
2026-12-03 18:50:50 -05:00
morluto cbf9e0000b docs(development): add an artifact format guide and contributor skill (#16506)
* docs(development): add an artifact format guide and contributor skill

Document the files, registration points, parsing rules, limits, tests
and docs a new inspect_artifact format needs, and add a
rea-artifact-format skill for the judgment calls: establishing a layout
from samples, naming only established fields, and what a reader exposes.

* docs(development): correct artifact format registration and evidence guidance
2026-12-03 23:34:11 +00:00
RRFZ fe29cab95a test(ida): compare verifier reads in one database state (#16483)
* test(ida): compare verifier reads in one database state

With IDA Pro 9.5, decompiling a function applies its inferred prototype
and can merge adjacent stack slots in the live database. The verifier
read the dossier before its first pseudocode, then compared
procedure_assembly and read_function_instructions with it after that
pseudocode, so the public fixture's rea_fixture_add failed parity.

Keep the CLI/MCP dossier comparison, which both read before any
decompilation, and compare the later MCP reads with a second dossier
read in the same post-decompilation state. Document the behavior and
the IDA 9.5 Windows x64 headless run.

* test(ida): cover verifier reads after a frame change

The verifier fixture always returned the same assembly, so pointing the
later assembly or instruction comparison back at the first dossier still
passed. The fixture now changes main's assembly once it has been
decompiled a chosen number of times: a change after the MCP dossier's
decompilation must pass, and a change before the assembly or instruction
read must fail in that phase.

Drop the second dossier's address, name and pseudocode assertions.
procedure_pseudo_code already compares later pseudocode with the first
dossier, and a second dossier for another function fails the assembly
comparison.

* test(ida): check the post-decompilation dossier's identity and pseudocode
2026-12-03 17:19:13 -05:00
RRFZ c80acb9c1d fix(artifacts): read paletted KTX mip chains as one block (#16000) 2026-12-03 20:30:23 +00:00
RRFZ 2a96f92293 fix(ogg): accept compatible OpusHead minor versions (#16009) 2026-12-03 19:50:31 +00:00
Vincent Koc d4c100e995 refactor(docs): share guide source path prefixes (#16422) 2026-12-03 18:11:40 +00:00
gensokyo-dev baafd3535d docs(firmware): list the filters each firmware-mmio collection accepts
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-03 21:19:29 +08:00
gensokyo-dev f06019cf09 docs(firmware): document inspect_firmware_mmio
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>
2026-12-03 21:19:29 +08: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
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
morluto 47efad6c17 docs(readme): link the header showcases entry to the website (#16253) 2026-12-03 01:23:06 -05:00
morluto 1279e52ef9 docs(readme): trim header badges and lead with quick start and showcases 2026-12-03 01:18:26 -05:00
morluto 7cd7f5bc85 docs(readme): replace the header link row with a website button (#16250) 2026-12-03 01:15:17 -05: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
Som SamantrayandYsopwnable cfaee2f5f7 feat(build): add non-turbo source-build path for freebsd (#15247)
* 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>
2026-12-03 12:46:27 +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
d318d752a5 feat(api-contract): resolve same-document OpenAPI path item references (#15966)
* feat(api-contract): resolve same-document OpenAPI path item references

Refs #14392.

* fix(api-contract): deduplicate shared declaration diagnostics

* fix(api-contract): preserve operations from unresolved reference chains

* fix(api-contract): preserve and deduplicate source diagnostics

* perf(api-contract): avoid temporary reference counting work

* fix(api-contract): locate malformed shared path references

* fix(api-contract): preserve reference failure reasons in narrow pages

* test(api-contract): assert narrow pages without assuming union fields

* fix(api-contract): diagnose malformed references in conflicting path items

* feat(api-contract): filter path item references by resolution state

Once same-document Path Items resolve, a contract can hold thousands of
resolved references beside a few unresolved ones. Finding those required
paging every reference. The path-item-references collection now accepts
states, and the partial-coverage unknown names the selection to use.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@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:23:04 +08:00
2SinceJuly 30bac88e18 feat(config): persist REA_WABT_BIN_DIRECTORY in the user config file
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.
2026-12-03 12:22:58 +08:00
Vincent Koc 00a0d98620 refactor(docs): derive guide sources from unchanged routes (#16093) 2026-12-02 20:19:28 +00:00
Vincent Koc 624d2f1ec1 fix(artifacts): preserve FAT table coverage for unsupported Mach-O slices (#15802)
* fix(artifacts): preserve FAT table coverage for unsupported Mach-O slices

* test(artifacts): check retained FAT table extent on truncated slices
2026-12-02 14:51:45 +08:00
gensokyo-devandgensokyo-dev 37f2426123 docs(settings): describe the operation filter refusal
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-02 14:11:07 +08:00