/** * Capability-diff — "did this change widen the agent's blast radius?" (moat #2). * * The whole-harness capability lattice ({@link HarnessCapabilities}, computed by * `computeHarnessCapabilities`) is the set of effects an agent/harness can reach: * read-only tools, side-effecting tools, unknown/MCP tools, and the loosest purity. * Diffing two lattices (a PR's base vs head) yields a deterministic, model-free * verdict: a change WIDENED the blast radius iff it adds a side-effecting or * unknown/MCP tool, or loosens the purity floor. New read-only tools and removals * are reported but are NOT a widening. * * Honesty / don't-cry-wolf: a widening is INFORMATIONAL by default (a PR comment), * not an automatic failure — widening the surface is often intended. The CLI gates * a non-zero exit behind an explicit `--fail-on-widen`. Pure + harness-agnostic * (operates on the lattice, no dialect needed). See research/typed-spec-moat.md (#2). */ import type { HarnessCapabilities } from "./generate-harness.js"; import type { PurityLevel } from "./effects.js"; /** A purity move between two lattices (omitted when unchanged). */ export interface PurityChange { readonly from: PurityLevel; readonly to: PurityLevel; /** `widened` = loosened (pure→bounded→unrestricted); `narrowed` = tightened. */ readonly direction: "widened" | "narrowed"; } export interface CapabilityDiff { /** Side-effecting tools reachable AFTER but not before — the core blast-radius growth. */ readonly addedSideEffecting: readonly string[]; /** Unknown-effect (MCP / unrecognized) tools newly reachable — also widened reach. */ readonly addedUnknown: readonly string[]; /** Read-only tools newly reachable — benign (reported, NOT a widening). */ readonly addedReadOnly: readonly string[]; /** Tools reachable before but not after — a NARROWING (good; informational). */ readonly removed: readonly string[]; /** The purity move, or null when unchanged. */ readonly purity: PurityChange | null; /** The verdict: did the blast radius GROW (new side-effecting/unknown, or purity loosened)? */ readonly widened: boolean; } /** Diff two capability lattices → what changed + the widened verdict. Pure. */ export declare function diffCapabilities(before: HarnessCapabilities, after: HarnessCapabilities): CapabilityDiff; /** True when the diff carries no change at all (the common, quiet case). */ export declare function isNoOpDiff(d: CapabilityDiff): boolean; /** Render a capability-diff as a PR-comment-style report (Markdown-friendly). */ export declare function formatCapabilityDiff(d: CapabilityDiff): string; //# sourceMappingURL=capability-diff.d.ts.map