Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(cli): align advertised analysis contracts with runtime

morluto7df85f16a0a5
diff --git a/src/cli/analysisViewCommands.ts b/src/cli/analysisViewCommands.ts
index cbe63ab25..aaaca2323 100644
--- a/src/cli/analysisViewCommands.ts
+++ b/src/cli/analysisViewCommands.ts
@@ -71,7 +71,7 @@ export const registerAnalysisViewCommands = (
});
cli.command(CLI_COMMANDS.inspectAnalysisView, {
description:
- "Project a selected view of completed layout, JavaScript application or native function Evidence JSON",
+ "Project a selected view of completed binary-layout, JavaScript application, native function, artifact-inventory, WASM, Mach-O, Interface Builder, EVM, managed, Android package, Dart AOT, web network capture or pcap Evidence JSON",
args: z.object({
inputJson: z.string().describe("Inline workflow JSON or JSON file path"),
}),
diff --git a/src/cli/binaryDiagnosticsCommands.ts b/src/cli/binaryDiagnosticsCommands.ts
index 5cb9577bd..f57e773a7 100644
--- a/src/cli/binaryDiagnosticsCommands.ts
+++ b/src/cli/binaryDiagnosticsCommands.ts
@@ -74,7 +74,11 @@ export const registerBinaryDiagnosticsCommands = (
cli.command(CLI_COMMANDS.inspectRecordedCrash, {
description:
"Inspect supplied core registers/signals and optional debugger mapping evidence",
- args: z.object({ path: z.string().describe("Local Linux amd64 ELF core") }),
+ args: z.object({
+ path: z
+ .string()
+ .describe("Local Linux ELF64 amd64 or AArch64 little-endian core"),
+ }),
options: z.object({
debuggerContext: z
.boolean()
diff --git a/src/cli/utilityCommands.ts b/src/cli/utilityCommands.ts
index a5da57ac5..ed32905e3 100644
--- a/src/cli/utilityCommands.ts
+++ b/src/cli/utilityCommands.ts
@@ -252,8 +252,10 @@ const registerReferenceSourceCommand = (
outlineDepth: z
.number()
.int()
- .nonnegative()
.safe()
+ // After .safe(): its safe-range check overwrites an earlier minimum,
+ // which advertised negative depths the parser rejects.
+ .nonnegative()
.optional()
.describe(
"Summary outline path depth (default: 2; 0 omits entries); requires --detail summary",
diff --git a/tests/boundary/cli/cliInputSchemaRequired.test.ts b/tests/boundary/cli/cliInputSchemaRequired.test.ts
index 82f72af10..efd72f10d 100644
--- a/tests/boundary/cli/cliInputSchemaRequired.test.ts
+++ b/tests/boundary/cli/cliInputSchemaRequired.test.ts
@@ -200,4 +200,27 @@ describe("web module CLI advertised input schema", () => {
expect(options({ importMapBaseUrl: "" })).toBe(false);
});
});
+
+describe("reference-source outline-depth input schema", () => {
+ it("aligns advertised bounds with the parser's accepted values", async () => {
+ const cli = createCli({});
+ const advertised = await advertisedSchema(cli, "import-reference-source");
+ const outlineDepth = advertised.options?.properties?.outlineDepth;
+ expect(outlineDepth).toMatchObject({ type: "integer", minimum: 0 });
+
+ const parser = parserSchema(cli, "import-reference-source", "options");
+ expect(parser?.safeParse({ outlineDepth: -1 }).success).toBe(false);
+ expect(parser?.safeParse({ outlineDepth: 0 }).success).toBe(true);
+ expect(parser?.safeParse({ outlineDepth: 2 }).success).toBe(true);
+
+ const ajv = new Ajv2020({ strict: false });
+ const validate = ajv.compile({
+ ...advertised.options,
+ $schema: "https://json-schema.org/draft/2020-12/schema",
+ });
+ expect(validate({ outlineDepth: -1 })).toBe(false);
+ expect(validate({ outlineDepth: 0 })).toBe(true);
+ expect(validate({ outlineDepth: 2 })).toBe(true);
+ });
+});
import { resolve } from "node:path";