test(ida): place capability composition at provider boundary
This commit is contained in:
1 parent
c25ee582c5
commit
0adcd83b1a
2 files changed
+40
-30
No files matched your search
@@ -5,8 +5,6 @@ import {
|
||||
buildCapabilityInventory,
|
||||
compactToolAvailability,
|
||||
} from "./CapabilityInventory.js";
|
||||
import { idaCapabilities } from "../ida/IdaProviderCapabilities.js";
|
||||
import { providerCapabilitySets } from "./binary/BinarySessionStatus.js";
|
||||
import { TOOL_CONTRACTS } from "../contracts/toolContracts.js";
|
||||
import {
|
||||
expandToolAvailability,
|
||||
@@ -887,31 +885,3 @@ it("keeps independent native sessions discoverable without an unrelated binary t
|
||||
{ available: false, reason: "target_required" },
|
||||
);
|
||||
});
|
||||
|
||||
it.each([false, true])(
|
||||
"retains selected provider UI/process/network effects in direct and composed discovery (UI=%s)",
|
||||
(showUi) => {
|
||||
const input = {
|
||||
open: true,
|
||||
kind: "executable",
|
||||
capabilities: providerCapabilitySets(
|
||||
idaCapabilities(showUi ? "attached" : "headless", false),
|
||||
),
|
||||
};
|
||||
const entries = buildCapabilityInventory(input, enabledPolicy);
|
||||
for (const name of [
|
||||
"procedure_pseudo_code",
|
||||
"analyze_function",
|
||||
"batch_decompile",
|
||||
]) {
|
||||
expect(entries.find((entry) => entry.name === name)).toMatchObject({
|
||||
effects: {
|
||||
changesUiState: showUi,
|
||||
accessesNetwork: true,
|
||||
launchesProcess: !showUi,
|
||||
},
|
||||
annotations: { open_world: true },
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,40 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { buildCapabilityInventory } from "../../../../src/application/CapabilityInventory.js";
|
||||
import { providerCapabilitySets } from "../../../../src/application/binary/BinarySessionStatus.js";
|
||||
import { idaCapabilities } from "../../../../src/ida/IdaProviderCapabilities.js";
|
||||
|
||||
const enabledPolicy: Parameters<typeof buildCapabilityInventory>[1] = {
|
||||
processCaptureEnabled: true,
|
||||
browserObservationEnabled: true,
|
||||
browserScenarioEnabled: true,
|
||||
electronObservationEnabled: true,
|
||||
v8InspectorObservationEnabled: true,
|
||||
};
|
||||
|
||||
it.each([false, true])(
|
||||
"retains selected provider UI/process/network effects in direct and composed discovery (UI=%s)",
|
||||
(showUi) => {
|
||||
const input = {
|
||||
open: true,
|
||||
kind: "executable",
|
||||
capabilities: providerCapabilitySets(
|
||||
idaCapabilities(showUi ? "attached" : "headless", false),
|
||||
),
|
||||
};
|
||||
const entries = buildCapabilityInventory(input, enabledPolicy);
|
||||
for (const name of [
|
||||
"procedure_pseudo_code",
|
||||
"analyze_function",
|
||||
"batch_decompile",
|
||||
]) {
|
||||
expect(entries.find((entry) => entry.name === name)).toMatchObject({
|
||||
effects: {
|
||||
changesUiState: showUi,
|
||||
accessesNetwork: true,
|
||||
launchesProcess: !showUi,
|
||||
},
|
||||
annotations: { open_world: true },
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user