Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
85c9f88
feat(rust): read cargo-auditable dependencies from WebAssembly modules
yu0809 Oct 18, 2026
9bac2e3
fix(rust): bound the WebAssembly section walk
yu0809 Oct 18, 2026
cda31a6
Merge morluto/rea main into feat/rust-wasm-auditable
yu0809 Oct 18, 2026
162590b
Merge origin/main into feat/rust-wasm-auditable
kaoru0822-kitauji Oct 21, 2026
345f0f4
Merge morluto/rea main into feat/rust-wasm-auditable
yu0809 Oct 21, 2026
d2fd725
fix(rust): accept WebAssembly Evidence in retained dependency views
yu0809 Oct 21, 2026
bdb41d2
fix(rust): name the WebAssembly section-walk allowance in recovery
yu0809 Oct 21, 2026
6ce932e
Merge morluto/rea main into feat/rust-wasm-auditable
yu0809 Oct 25, 2026
084ad35
fix(rust): require WebAssembly container facts in reports
yu0809 Oct 25, 2026
a86deb1
Merge morluto/rea main into feat/rust-wasm-auditable
yu0809 Nov 17, 2026
8865878
docs(rust): record the WebAssembly dependency-metadata feature
yu0809 Nov 17, 2026
e88658c
fix(rust): bind section names to containers and share the LEB128 reader
yu0809 Nov 17, 2026
bb745a3
fix(rust): classify a cut-off WebAssembly integer by its boundary
yu0809 Nov 17, 2026
3753f11
fix(rust): report a duplicate WebAssembly dependency section first
yu0809 Nov 17, 2026
fb270a2
Merge remote-tracking branch 'origin/main' into feat/rust-wasm-auditable
cursoragent Nov 18, 2026
b6510e5
test(rust): assert WebAssembly container facts instead of limitation …
cursoragent Nov 18, 2026
d8b8f22
fix(rust): state container word size as 32 | 64 | null
cursoragent Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge morluto/rea main into feat/rust-wasm-auditable
  • Loading branch information
yu0809 committed Oct 21, 2026
commit 345f0f4caee32b0cd97ae950bd3707f4408cd557
6 changes: 6 additions & 0 deletions .agents/skills/reverse-engineer-anything/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ explicit path or endpoint and do not need it.
range. A missing `.dep-v0` section is null metadata, not proof the binary has
no dependencies. A rustc commit hash is an inference from a
`/rustc/<40-hex>/` path in read-only data or a WebAssembly data section.
For selected crates, use `view: {collection: "packages", names: [...],
fields: ["name", "version", "source"]}` on the first call; explicitly include
`dependencies` for direct index references. Use `detail: "summary"` for counts
and ranges, or retained `inspect_analysis_view` Rust package/edge pages for
subsequent filters. Keep the complete parent Evidence accessible; CLI compact
delivery requires `--evidence_output`.
See the
[Rust binary guide](https://github.com/morluto/rea/blob/main/docs/rust-binaries.md).

Expand Down
13 changes: 0 additions & 13 deletions src/application/rust/RustBinaryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ const SUBJECT_FORMATS = {
wasm: "file",
} as const;

const architectureForSubject = (architecture: string) => {
switch (architecture) {
case "386":
return "x86";
case "amd64":
return "x86_64";
default:
return BINARY_ARCHITECTURES.find(
(supported) => supported === architecture,
);
}
};

/** Shared exact input validation and artifact-bound Evidence for CLI and MCP. */
export class RustBinaryService {
constructor(readonly provider: RustBinaryPort) {}
Expand Down
12 changes: 9 additions & 3 deletions src/contracts/rust/rustToolContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ export const RUST_TOOL_CONTRACTS = [
...toolContractMetadata("inspect_rust_binary"),
kind: "artifact-provider",
description:
"Inspect the cargo-auditable crate dependency list embedded in an explicit local ELF, PE, thin Mach-O or WebAssembly core-module image. Returns the artifact SHA-256, the .dep-v0 section file offset and size, compressed and uncompressed sizes, format version, packages in their original order, the root package index, and dependency edges by index. Reads zlib-compressed JSON without installing Rust, opening a disassembler, executing the target, writing temporary files or accessing the network. A missing section is null metadata with a limitation and is not proof that the binary has no dependencies. A rustc commit hash is reported only as an inference when a /rustc/<40-hex>/ path is present in read-only data or a WebAssembly data section. Resource guards bound files to 256 MiB, dependency sections to 1 MiB, inflated JSON to the smaller of 8 MiB and 64 times the compressed size, WebAssembly framing to 65,536 sections, and the complete report to 8 MiB. Malformed, unsupported and oversized inputs receive typed failures rather than partial success.",
inputSchema: inspectRustBinaryInputSchema,
outputSchema: evidenceResultOf(rustBinarySchema),
"Inspect the cargo-auditable crate dependency list embedded in an explicit local ELF, PE, thin Mach-O or WebAssembly core-module image. Returns the artifact SHA-256, the .dep-v0 section file offset and size, compressed and uncompressed sizes, format version, packages in their original order, the root package index, and dependency edges by index. Omitted or explicit complete detail preserves the full report. Optional detail summary retains that complete Evidence and returns source ranges, counts and parent_evidence_id. Optional view directly selects packages or edges in this call; it cannot be combined with explicit complete detail. Query the same retained facts with inspect_analysis_view kind rust: exact names/versions or package indices, edge from_indices/to_indices, fields and matching-row pagination. Row indices are original and scoped to the parent Evidence; empty filters select none. Default package fields omit dependency vectors; explicitly select dependencies for direct index references. Every matching observed version is retained. No current runtime state is inferred from historical reads. Reads zlib-compressed JSON without installing Rust, opening a disassembler, executing the target, writing temporary files or accessing the network. A missing section is null metadata with a limitation and is not proof that the binary has no dependencies. A rustc commit hash is reported only as an inference when a /rustc/<40-hex>/ path is present in read-only data or a WebAssembly data section. Resource guards bound files to 256 MiB, dependency sections to 1 MiB, inflated JSON to the smaller of 8 MiB and 64 times the compressed size, WebAssembly framing to 65,536 sections, and the complete report to 8 MiB. Malformed, unsupported and oversized inputs receive typed failures rather than partial success.",
inputSchema: inspectRustBinaryRequestSchema,
outputSchema: evidenceResultOf(
z.union([
rustBinarySchema,
rustBinarySummaryViewResultSchema,
rustBinaryPageViewResultSchema,
]),
),
examples: [
{
title: "Inspect an embedded Rust dependency list",
Expand Down
13 changes: 9 additions & 4 deletions tests/boundary/mcp/rustBinaryMcp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ mcpTest(
const absentEvidence = toolContract(
"inspect_rust_binary",
).outputSchema.parse(absent.structuredContent);
expect(absentEvidence.normalized_result.auditable_metadata).toBeNull();
expect(
rustBinarySchema.parse(absentEvidence.normalized_result)
.auditable_metadata,
).toBeNull();
// The listed tools let the client check WebAssembly's null word size
// against the advertised output schema, not only the source contract.
const module = join(root, "sample.wasm");
Expand All @@ -81,9 +84,11 @@ mcpTest(
});
expect(wasm.isError, JSON.stringify(wasm.content)).not.toBe(true);
expect(
toolContract("inspect_rust_binary").outputSchema.parse(
wasm.structuredContent,
).normalized_result,
rustBinarySchema.parse(
toolContract("inspect_rust_binary").outputSchema.parse(
wasm.structuredContent,
).normalized_result,
),
).toMatchObject({
format: "wasm",
bits: null,
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.