Files
reverse-engineering-anything/src/contracts/releaseExposureToolContracts.ts
T
morluto 717333ce9b refactor(contracts): declare each tool's effect audit on its contract (#11305)
* refactor(contracts): declare each tool's effect audit on its contract

Every public tool's effects lived in a 255-entry TOOL_EFFECT_AUDIT table in
toolEffects.ts, keyed by name and looked up again by toolContractMetadata,
the capability inventory (toolSessionEffects) and tests (TOOL_EFFECTS).

toolContractMetadata(name, audit) now takes the audit from the contract
declaration, and the contract carries both the provider-wide effects and
the session effects. The inventory reads contract.sessionEffects. The
table, TOOL_EFFECTS and toolSessionEffects are removed; toolEffects.ts
keeps the effect type, the shared presets and annotation derivation.

Effects, session effects, annotations and titles are byte-identical for all
255 contracts.

* test(contracts): read focused effect expectations from their contract family
2026-11-16 03:50:32 +08:00

36 lines
1.5 KiB
TypeScript

import {
auditReleaseExposureInputSchema,
releaseExposureReportSchema,
} from "../domain/releaseExposure.js";
import type { ToolContract } from "./toolContractTypes.js";
import { toolContractMetadata, toolEffects } from "./toolEffects.js";
import { evidenceResultOf } from "./toolOutputSchemaPrimitives.js";
/** Read-only report of what static analysis recovers from one shipped artifact. */
export const RELEASE_EXPOSURE_TOOL_CONTRACTS = [
{
name: "audit_release_exposure",
availability: "standalone",
cli: true,
...toolContractMetadata(
"audit_release_exposure",
toolEffects({
mutatesSession: true,
launchesProcess: true,
writesFilesystem: true,
}),
),
kind: "artifact-provider",
description:
"Report what static analysis of a shipped application artifact recovers. Accepts one local .app bundle, installation directory, ASAR, or executable. Each check has a stable id, a status, the observation behind it, and fixed remediation text. Unknown and unassessed checks stay in the report. This does not establish that an application is secure. Reads the selected artifact. When the selection is a file, the parent directory is listed for sibling .pdb, .dSYM, .debug, and .map debug companions.",
inputSchema: auditReleaseExposureInputSchema,
outputSchema: evidenceResultOf(releaseExposureReportSchema),
examples: [
{
title: "Audit a shipped application",
input: { path: "/artifacts/MyApp.app" },
},
],
},
] as const satisfies readonly ToolContract[];