From f3645aa51e55c5207f7b9b1f0156ffaef7aaed42 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Tue, 29 Sep 2026 09:22:57 +0800 Subject: [PATCH] fix(cli): remove ignored result limits --- src/browser/CdpEndpoint.ts | 2 +- src/browser/V8InspectorEndpoint.ts | 2 +- src/cli/coreAnalysisCommands.ts | 35 ++----------------- src/cli/utilityCommands.ts | 3 +- src/domain/reconstructionVerification.test.ts | 2 +- tests/boundary/cli/cliOutput.test.ts | 2 +- .../providers/ghidra/ghidraClient.test.ts | 2 -- tests/fixtures/fakeGhidra.mjs | 4 --- 8 files changed, 7 insertions(+), 45 deletions(-) diff --git a/src/browser/CdpEndpoint.ts b/src/browser/CdpEndpoint.ts index df810721c..d181d613f 100644 --- a/src/browser/CdpEndpoint.ts +++ b/src/browser/CdpEndpoint.ts @@ -32,7 +32,7 @@ const endpointTargetSchema = z.object({ attached: z.boolean().default(false), webSocketDebuggerUrl: z.string().min(1).max(2_048).optional(), }); -const endpointTargetsSchema = z.array(endpointTargetSchema).max(1_000); +const endpointTargetsSchema = z.array(endpointTargetSchema); /** Validated direct CDP WebSocket bound to one discovered page target. */ interface CdpPageWebSocketEndpoint { diff --git a/src/browser/V8InspectorEndpoint.ts b/src/browser/V8InspectorEndpoint.ts index 3c8fd0b96..0fe100e75 100644 --- a/src/browser/V8InspectorEndpoint.ts +++ b/src/browser/V8InspectorEndpoint.ts @@ -30,7 +30,7 @@ const targetSchema = z webSocketDebuggerUrl: z.string().min(1).max(2_048), }) .passthrough(); -const targetsSchema = z.array(targetSchema).max(1_000); +const targetsSchema = z.array(targetSchema); export interface V8InspectorTarget { readonly id: string; diff --git a/src/cli/coreAnalysisCommands.ts b/src/cli/coreAnalysisCommands.ts index 16f5f85e3..890f429fa 100644 --- a/src/cli/coreAnalysisCommands.ts +++ b/src/cli/coreAnalysisCommands.ts @@ -250,26 +250,12 @@ const registerInstructionsCommand = ( logger: Logger, ): void => { cli.command(CLI_COMMANDS.instructions, { - description: "Read one bounded raw-instruction window without decompiling", + description: "Read every raw instruction without decompiling", args: z.object({ path: z.string().describe("App or program path"), address: z.string().describe("Procedure name or address"), }), options: z.object({ - offset: z - .number() - .int() - .min(0) - .max(100_000) - .default(0) - .describe("Zero-based instruction offset"), - limit: z - .number() - .int() - .min(1) - .max(500) - .default(64) - .describe("Maximum raw instructions to return"), snapshot: z .string() .min(1) @@ -284,8 +270,6 @@ const registerInstructionsCommand = ( "read_function_instructions", { procedure: args.address, - offset: options.offset, - limit: options.limit, }, directAnalysisOptions(logger, options.snapshot, options.provider), ), @@ -295,7 +279,7 @@ const registerInstructionsCommand = ( const registerSearchCommand = (cli: CliInstance, logger: Logger): void => { cli.command(CLI_COMMANDS.search, { - description: "Search analyzed strings or procedure names", + description: "Search every analyzed string or procedure name", args: z.object({ path: z.string().describe("App or program path"), pattern: z.string().min(1).describe("Literal text or regex pattern"), @@ -313,19 +297,6 @@ const registerSearchCommand = (cli: CliInstance, logger: Logger): void => { .boolean() .default(false) .describe("Match the pattern with exact letter case"), - offset: z - .number() - .int() - .min(0) - .default(0) - .describe("Zero-based matching-item offset"), - limit: z - .number() - .int() - .min(1) - .max(100) - .default(100) - .describe("Maximum matching items to return"), snapshot: z .string() .min(1) @@ -343,8 +314,6 @@ const registerSearchCommand = (cli: CliInstance, logger: Logger): void => { pattern: args.pattern, mode: options.mode, case_sensitive: options.caseSensitive, - offset: options.offset, - limit: options.limit, }, directAnalysisOptions(logger, options.snapshot, options.provider), ), diff --git a/src/cli/utilityCommands.ts b/src/cli/utilityCommands.ts index b578d17fa..b4146dfb5 100644 --- a/src/cli/utilityCommands.ts +++ b/src/cli/utilityCommands.ts @@ -85,13 +85,12 @@ const registerNativeCommands = (cli: CliInstance, logger: Logger): void => { ), }); cli.command(CLI_COMMANDS.demangleSwift, { - description: "Demangle a bounded Swift symbol batch without Hopper", + description: "Demangle Swift symbols without Hopper", args: z.object({ path: z.string().describe("Artifact path used for evidence identity"), symbols: z .array(z.string().min(1)) .min(1) - .max(500) .describe("Swift mangled symbols to demangle"), }), run: ({ args }) => diff --git a/src/domain/reconstructionVerification.test.ts b/src/domain/reconstructionVerification.test.ts index 5b650a41f..838ce0bc3 100644 --- a/src/domain/reconstructionVerification.test.ts +++ b/src/domain/reconstructionVerification.test.ts @@ -308,7 +308,7 @@ describe("reconstruction verification", () => { createEvidenceBundle([left, comparison, right]), ); expect(result.status).toBe("unknown"); - expect(result.recommended_probes[0]?.operation).toBe("inventory_artifact"); + expect(result.recommended_probes[0]?.operation).toBe("inspect_artifact"); }); }); diff --git a/tests/boundary/cli/cliOutput.test.ts b/tests/boundary/cli/cliOutput.test.ts index 0e4781d11..771cd34db 100644 --- a/tests/boundary/cli/cliOutput.test.ts +++ b/tests/boundary/cli/cliOutput.test.ts @@ -163,7 +163,7 @@ describe("compiled CLI output boundary", () => { await writeFile(join(`${archive}.unpacked`, "main.js"), "changed();\n"); const result = await cli.run({ - arguments: ["--json", "inventory-artifact", archive], + arguments: ["--json", "inspect-artifact", archive], }); expect(result.exitCode).toBe(1); const output = JSON.stringify(result.json); diff --git a/tests/boundary/providers/ghidra/ghidraClient.test.ts b/tests/boundary/providers/ghidra/ghidraClient.test.ts index 11dd77f9e..531d33232 100644 --- a/tests/boundary/providers/ghidra/ghidraClient.test.ts +++ b/tests/boundary/providers/ghidra/ghidraClient.test.ts @@ -36,7 +36,6 @@ type FixtureMode = | "wrong_identity" | "malformed" | "contradictory" - | "oversized_whitespace" | "future_id" | "analysis_timeout" | "remote_error" @@ -208,7 +207,6 @@ describe("GhidraClient", () => { ["wrong_identity", "protocol"], ["malformed", "protocol"], ["contradictory", "protocol"], - ["oversized_whitespace", "protocol"], ["future_id", "protocol"], ["analysis_timeout", "analysis_timeout"], ["exit", "process"], diff --git a/tests/fixtures/fakeGhidra.mjs b/tests/fixtures/fakeGhidra.mjs index 7128f060d..6a31a0dd8 100644 --- a/tests/fixtures/fakeGhidra.mjs +++ b/tests/fixtures/fakeGhidra.mjs @@ -143,10 +143,6 @@ const handlePing = (socket, request, state) => { ); return; } - if (state.mode === "oversized_whitespace") { - socket.write(`${" ".repeat(1024 * 1024 + 1)}\n`); - return; - } if (state.mode === "future_id") { socket.write( `${JSON.stringify({ id: request.id + 10, ok: true, result: null })}\n`,