fix(android): bound inline search Evidence with retained inventory provenance (#1890)
Focused and zero-match search_android_classes responses embedded every examined class name: JadxSession records each raw list_classes page into observed calls, those calls ride into Evidence raw_result on the registration path, and the complete inline Evidence is serialized into every tool response (issue #1850: 382,435 bytes for one match). When the server session retains Evidence, record the complete raw-call record first, then deliver a summary Evidence that keeps the pagination audit (totals, offsets, page sizes, elided item counts), the unchanged normalized matches and truthful coverage metadata, and links the retained complete inventory by Evidence ID. Sessions without retention keep the complete inline delivery, so complete CLI JSON output is unchanged and no provenance is discarded. 🤖 Generated with AI assistance (disclosure voluntary per repo policy)
This commit is contained in:
Vendored
+11
-1
@@ -10,10 +10,20 @@ const server = new McpServer({
|
||||
version:
|
||||
mode === "empty-server-identity" ? "" : mode === "version" ? "99.0.0" : "1",
|
||||
});
|
||||
const requestedCount = Number.parseInt(
|
||||
process.env.REA_FAKE_JADX_CLASS_COUNT ?? "",
|
||||
10,
|
||||
);
|
||||
const generatedCount =
|
||||
Number.isInteger(requestedCount) && requestedCount >= 0
|
||||
? requestedCount
|
||||
: mode === "large-inventory"
|
||||
? 9000
|
||||
: 400;
|
||||
const classes = [
|
||||
"fixture.Target",
|
||||
...Array.from(
|
||||
{ length: mode === "large-inventory" ? 9000 : 400 },
|
||||
{ length: generatedCount },
|
||||
(_, index) => `fixture.Class${index}`,
|
||||
),
|
||||
];
|
||||
|
||||
Vendored
+10
-1
@@ -27,6 +27,7 @@ const fixture = fileURLToPath(new URL("./jadx-mcp.mjs", import.meta.url));
|
||||
export const createJadxProtocolFixture = async (
|
||||
mode = "normal",
|
||||
cleanupFailure?: () => boolean,
|
||||
inventory?: { readonly classCount?: number },
|
||||
) => {
|
||||
const root = await createTestTempDirectory("rea-android-boundary-");
|
||||
const apk = join(root, "fixture.apk");
|
||||
@@ -64,7 +65,15 @@ export const createJadxProtocolFixture = async (
|
||||
command: process.execPath,
|
||||
arguments: [fixture],
|
||||
expectedCommand: process.execPath,
|
||||
env: { ...options.env, REA_FAKE_JADX_MODE: mode },
|
||||
env: {
|
||||
...options.env,
|
||||
REA_FAKE_JADX_MODE: mode,
|
||||
...(inventory?.classCount === undefined
|
||||
? {}
|
||||
: {
|
||||
REA_FAKE_JADX_CLASS_COUNT: String(inventory.classCount),
|
||||
}),
|
||||
},
|
||||
});
|
||||
launches.push({
|
||||
runId: options.runId,
|
||||
|
||||
Reference in New Issue
Block a user