refactor: return complete tool results inline

This commit is contained in:
morluto
2026-09-29 07:08:46 +08:00
parent 2160d4fae5
commit 0d96275b68
535 changed files with 4084 additions and 13537 deletions
@@ -16,9 +16,7 @@ describe("managed direct-analysis path boundary", () => {
await writeFile(path, buildManagedPeFixture());
const evidence = parseEvidence(
await runProviderAnalysis(path, "inspect_managed_artifact", {
reference_limit: 1,
}),
await runProviderAnalysis(path, "inspect_managed_artifact", {}),
);
expect(evidence).toMatchObject({
operation: "inspect_managed_artifact",
@@ -26,7 +24,7 @@ describe("managed direct-analysis path boundary", () => {
subject: { local_path: path, format: "pe" },
normalized_result: {
classification: { status: "managed", runtime_family: "modern-dotnet" },
references: { limit: 1 },
references: [expect.objectContaining({ name: "System.Runtime" })],
},
});
@@ -39,7 +37,7 @@ describe("managed direct-analysis path boundary", () => {
subject: { local_path: path, format: "pe" },
normalized_result: {
identity_scope: { token_identity: "build-local" },
methods: { total: 1 },
methods: [expect.objectContaining({ token: expect.any(String) })],
},
});
@@ -52,7 +50,7 @@ describe("managed direct-analysis path boundary", () => {
subject: { local_path: path, format: "pe" },
normalized_result: {
identity_scope: { token_identity: "build-local" },
pinvoke_imports: { total: 0 },
pinvoke_imports: [],
},
});
});
@@ -7,10 +7,7 @@ import { createTestTempDirectory } from "../../../fixtures/temporaryDirectory.js
import { compareManagedMemberPaths } from "../../../../src/application/ManagedMemberComparisonService.js";
import { managedMemberComparisonResultSchema } from "../../../../src/domain/managedMemberComparison.js";
import {
buildManagedPeFixture,
MANAGED_MEMBER_PATH_FIXTURE_LIMITS,
} from "../../../../src/dotnet/ManagedPe.fixture.js";
import { buildManagedPeFixture } from "../../../../src/dotnet/ManagedPe.fixture.js";
describe("managed member comparison path workflow", () => {
it("compares two local paths and returns derived Evidence", async () => {
@@ -26,12 +23,6 @@ describe("managed member comparison path workflow", () => {
const result = await compareManagedMemberPaths({
leftPath,
rightPath,
memberLimits: MANAGED_MEMBER_PATH_FIXTURE_LIMITS,
comparisonLimits: {
max_method_matches: 100,
max_field_matches: 100,
max_candidates: 10,
},
});
expect(result.ok).toBe(true);
@@ -41,9 +41,9 @@ describe("managed static provider path boundary", () => {
if (!members.ok) return;
expect(asManagedMemberResult(members.value)).toMatchObject({
artifact: { path, sha256: parsed.value.sha256, format: "pe" },
methods: { total: 1 },
call_edges: { total: 1 },
field_accesses: { total: 1 },
methods: [expect.objectContaining({ token: "0x06000001" })],
call_edges: [expect.objectContaining({ target_name: ".ctor" })],
field_accesses: [expect.objectContaining({ field_name: "counter" })],
});
const boundaries = await client.execute(
@@ -54,9 +54,9 @@ describe("managed static provider path boundary", () => {
if (!boundaries.ok) return;
expect(asManagedNativeBoundaryResult(boundaries.value)).toMatchObject({
artifact: { path, sha256: parsed.value.sha256, format: "pe" },
module_refs: { total: 0 },
pinvoke_imports: { total: 0 },
native_implementations: { total: 0 },
module_refs: [],
pinvoke_imports: [],
native_implementations: [],
});
const cancelled = new AbortController();