{
  "slug": "ast-diff",
  "name": "gizza-ai/ast-diff",
  "version": "0.1.0",
  "title": "Rust AST Diff — gizza.ai",
  "description": "Compare two Rust source snippets structurally. The tool parses both files, canonicalizes their ASTs, and ignores formatting, whitespace, and comments.",
  "tags": [
    "ast diff",
    "rust diff",
    "structural diff",
    "semantic diff",
    "ignore formatting",
    "code diff",
    "rust ast"
  ],
  "category": "text",
  "urls": {
    "page": "https://gizza.ai/tools/ast-diff/",
    "markdown": "https://gizza.ai/tools/ast-diff/index.md",
    "descriptor": "https://gizza.ai/tools/ast-diff/tool.json",
    "deep_link_example": "https://gizza.ai/tools/ast-diff/?a=fn%20add%28a%3A%20i32%2C%20b%3A%20i32%29%20-%3E%20i32%20%7B%0A%20%20%20%20a%20%2B%20b%0A%7D&b=fn%20add%28left%3A%20i32%2C%20right%3A%20i32%29%20-%3E%20i32%20%7B%0A%20%20%20%20left%20%2B%20right%0A%7D&mode=unified&context=3"
  },
  "cli": "gizza tool ast-diff \"fn add(a: i32, b: i32) -> i32 {\n    a + b\n}\" 'b=fn add(left: i32, right: i32) -> i32 {\n    left + right\n}'",
  "tool": {
    "description": "Compute a structural (AST-level) diff between two Rust source files. Both inputs are parsed into an abstract syntax tree and re-emitted in one canonical form, so changes to formatting, indentation, whitespace, or line comments never appear as differences — only changes the compiler would see (renamed items, changed expressions, added/removed code) survive. Pass 'a' (the original source) and 'b' (the modified source). mode='unified' (default) returns a git-style unified diff; mode='summary' returns a one-line verdict (identical / formatting-only / N added, M removed); mode='canonical-a'/'canonical-b' return one source re-formatted without diffing. Inputs must be valid Rust; the error names the line/column on a parse failure.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "a": {
          "description": "First Rust source (the 'before' / original). A whole file or a paste-able snippet — must be syntactically valid Rust.",
          "type": "string"
        },
        "b": {
          "description": "Second Rust source (the 'after' / modified). Same rules as 'a'.",
          "type": "string"
        },
        "context": {
          "default": 3,
          "description": "Unified-diff mode only: number of unchanged context lines kept around each change, 0-100. Default 3.",
          "maximum": 100,
          "minimum": 0,
          "type": "integer"
        },
        "mode": {
          "default": "unified",
          "description": "Output style. 'unified' (default) is a git-style unified diff of the two canonical forms; 'summary' is a one-line verdict (identical / formatting-only / N added, M removed); 'canonical-a' and 'canonical-b' return one source re-formatted into canonical form without diffing.",
          "enum": [
            "unified",
            "summary",
            "canonical-a",
            "canonical-b"
          ],
          "type": "string"
        }
      },
      "required": [
        "a",
        "b"
      ],
      "type": "object"
    }
  }
}