* fix(comparisons)!: preserve unknowns across partial observations Share absence and digest semantics, keep unobserved managed bodies unknown, and match unique managed type/name/signatures before structural fallback. BREAKING CHANGE: Managed comparison metadata adds exact-signature matching and its count, and name_matching now reports exact-signature-fallback. * fix(javascript): preserve projected result binding semantics Share syntax-aware property reads and assigned-result resolution. Retain destructuring paths and downgrade downstream whole-result relationships instead of resolving nested or wrapped calls as aliases. * fix(native)!: admit complete parser values and preserve typed failures Decode Mach headers by named columns, validate complete slice keys and lipo alignment, and preserve codesign runtime flags and tagged parser errors. Rename the Ghidra test dossier fixture and connect fake-backed suites to real verification lanes. BREAKING CHANGE: Native load-command results no longer contain the unused, always-null file_offset field. * fix(process): preserve host identity and actionable boundary failures Thread selected platform and environment through process and Doctor seams, stamp observed producer identity in Evidence, and retain PTY, filesystem, lease and lazy-provider failure causes. Drain cancelled lazy loads and omit exited descendants from verified lineage. * fix(browser): preserve cleanup and document-transition evidence Make V8 and Playwright teardown cancellation-aware, expose primary failures alongside incomplete cleanup, share frame-tree and navigation rules, and clear stale WebMCP registrations without pruning unrelated child frames. * fix(adapters): align managed targets and typed CLI outcomes Inspect managed PE/CLI targets independently of native provider selection, reuse successful managed selections, and keep evidence bound to the actual inspected target. Classify canonical CLI error envelopes and exhaustive setup/update/uninstall outcomes, audit registered CLI coverage, and assert platform-specific runtime results. * docs: refresh boundary contracts and shipped roadmap behavior
95 lines
3.8 KiB
TypeScript
95 lines
3.8 KiB
TypeScript
import { z } from "zod";
|
|
|
|
import type { ToolContract } from "./toolContracts.js";
|
|
import { managedOutputSchemas } from "./toolOutputSchemas.js";
|
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
|
|
|
/** Exact caller boundary for execution-free PE/CLI triage and identity. */
|
|
const managedTargetInputSchema = z.object({
|
|
path: z
|
|
.string()
|
|
.min(1)
|
|
.optional()
|
|
.describe(
|
|
"Explicit managed PE/CLI path; omit to reuse the previously selected managed target",
|
|
),
|
|
});
|
|
|
|
export const managedArtifactInputSchema = managedTargetInputSchema;
|
|
|
|
/** Exact caller boundary for execution-free metadata/signature/IL inspection. */
|
|
export const managedMemberInputSchema = managedTargetInputSchema;
|
|
|
|
/** Exact caller boundary for execution-free managed/native boundary inspection. */
|
|
export const managedNativeBoundaryInputSchema = managedTargetInputSchema;
|
|
|
|
const outputSchema = requireOutputSchema(
|
|
managedOutputSchemas,
|
|
"inspect_managed_artifact",
|
|
);
|
|
const memberOutputSchema = requireOutputSchema(
|
|
managedOutputSchemas,
|
|
"inspect_managed_members",
|
|
);
|
|
const nativeBoundaryOutputSchema = requireOutputSchema(
|
|
managedOutputSchemas,
|
|
"inspect_managed_native_boundaries",
|
|
);
|
|
|
|
/** Read-only managed artifact contracts. */
|
|
export const MANAGED_TOOL_CONTRACTS = [
|
|
{
|
|
name: "inspect_managed_artifact",
|
|
...toolContractMetadata("inspect_managed_artifact"),
|
|
description:
|
|
"Open and classify an explicit managed PE/CLI path, or inspect the active managed target, then inventory exact assembly/module identity, target framework evidence, references, resources, and custom attributes without loading or executing target code. Returns complete inline inventories when metadata is admitted and explicit partial or malformed coverage otherwise.",
|
|
kind: "managed-provider",
|
|
inputSchema: managedArtifactInputSchema,
|
|
outputSchema,
|
|
examples: [
|
|
{
|
|
title: "Example inspect managed artifact request",
|
|
input: { path: "/tmp/Example.dll" },
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "inspect_managed_members",
|
|
...toolContractMetadata("inspect_managed_members"),
|
|
description:
|
|
"Inspect PE/CLI metadata members, signatures, raw CIL hashes, decoded-instruction-tuple hashes, separately reported exception regions, call edges, and field-access anchors without loading or executing target code. Metadata tokens are reported as build-local coordinates bound to the artifact SHA-256 and MVID; the tuple hash does not resolve them or fully commit control flow.",
|
|
kind: "managed-provider",
|
|
inputSchema: managedMemberInputSchema,
|
|
outputSchema: memberOutputSchema,
|
|
examples: [
|
|
{
|
|
title: "Example inspect managed members request",
|
|
input: {},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "inspect_managed_native_boundaries",
|
|
...toolContractMetadata("inspect_managed_native_boundaries"),
|
|
description:
|
|
"Inspect PE/CLI ModuleRef, ImplMap/PInvoke declarations, CLI native-header indicators, and non-IL method implementation flags without loading or executing target code. Results are managed declarations and degraded native-boundary observations, not verified native exports or addresses.",
|
|
kind: "managed-provider",
|
|
inputSchema: managedNativeBoundaryInputSchema,
|
|
outputSchema: nativeBoundaryOutputSchema,
|
|
examples: [
|
|
{
|
|
title: "Example inspect managed/native boundary request",
|
|
input: {},
|
|
},
|
|
],
|
|
},
|
|
] as const satisfies readonly ToolContract[];
|
|
|
|
/** Names of execution-free managed static operations. */
|
|
export type ManagedToolName = (typeof MANAGED_TOOL_CONTRACTS)[number]["name"];
|
|
|
|
/** Parse whether an analysis operation belongs to the managed static tools. */
|
|
export const isManagedToolName = (name: string): name is ManagedToolName =>
|
|
MANAGED_TOOL_CONTRACTS.some((contract) => contract.name === name);
|