eggsact 1.2.3

Deterministic MCP and in-process utility tools for coding agents
Documentation
use crate::mcp::registry::{ToolCost, ToolExposure, ToolSpec, ToolStability};
use crate::mcp::schemas::*;
use crate::tools::*;

pub const PATCH_TOOLS: &[ToolSpec] = &[
    ToolSpec {
        name: "patch_apply_check",
        description: "Validate and simulate a unified diff against provided in-memory files/text without touching the filesystem. Reports parse status, application success, failed hunks with context, and optional result fingerprint.",
        handler: patch_apply_check,
        input_schema: patch_apply_check_input,
        output_schema: patch_apply_check_output,
        category: "patch",
        tier: 2,
        profiles: &["full", "codegg_preflight", "codegg_patch"],
        tags: &["patch", "diff", "unified", "validation", "apply"],
        exposure: ToolExposure::HarnessOnly,
        harness_use: &["edit_preflight"],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "patch_summary",
        description: "Summarize a unified diff without applying it. Reports file counts, hunk counts, additions, deletions, renames, and line ranges by file.",
        handler: patch_summary,
        input_schema: patch_summary_input,
        output_schema: patch_summary_output,
        category: "patch",
        tier: 2,
        profiles: &["full", "codegg_patch"],
        tags: &["patch", "diff", "unified", "summary", "statistics"],
        exposure: ToolExposure::Contextual,
        harness_use: &["none"],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "edit_preflight",
        description: "Composite: validate a proposed edit before applying it. Calls text_replace_check, patch_apply_check, line_range_extract, text_fingerprint, and text_diff_explain as needed. Optionally composes path_scope_check (when file_path + workspace_root are provided), text_fingerprint newline detection (when newline_policy is not \"skip\"), and text_security_inspect (when unicode_policy is not \"skip\"). Returns ok_to_apply verdict with findings and machine codes.",
        handler: edit_preflight,
        input_schema: edit_preflight_input,
        output_schema: edit_preflight_output,
        category: "patch",
        tier: 1,
        profiles: &["full", "codegg_core", "codegg_core_min", "codegg_preflight", "codegg_patch"],
        tags: &["patch", "edit", "preflight", "composite", "text"],
        exposure: ToolExposure::Default,
        harness_use: &["edit_preflight"],
        aliases: &[],
        cost: ToolCost::Heavy,
        stability: ToolStability::Stable,
        composite: true,
    },
    ToolSpec {
        name: "patch_contract_check",
        description: "Classify a unified diff by contract-relevant change categories (lockfiles, manifests, scope escapes, large deletions, security paths). Reports verdict and structured findings for automated routing.",
        handler: patch_contract_check,
        input_schema: patch_contract_check_input,
        output_schema: patch_contract_check_output,
        category: "patch",
        tier: 2,
        profiles: &["full", "codegg_patch", "codegg_preflight", "codegg_repo_audit"],
        tags: &["patch", "diff", "contract", "classify", "routing"],
        exposure: ToolExposure::Contextual,
        harness_use: &[],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "diff_risk_classify",
        description: "Classify unified diffs by review risk and routing category. Reports risk categories, review focus items, and recommended next tools for reviewer agents.",
        handler: diff_risk_classify,
        input_schema: diff_risk_classify_input,
        output_schema: diff_risk_classify_output,
        category: "patch",
        tier: 2,
        profiles: &["full", "codegg_patch", "codegg_repo_audit"],
        tags: &["patch", "diff", "risk", "classify", "review", "routing"],
        exposure: ToolExposure::Contextual,
        harness_use: &[],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Stable,
        composite: false,
    },
];