ImpactGuard — API Impact Analyzer

3 min read Original article ↗

Catch breaking API
changes before merge

ImpactGuard analyzes your code across 14+ programming languages, detects breaking changes, quantifies risk with the S×E×C×λ model, and auto-generates patches.

MIT Licensed · Python 3.11+

Everything you need for API stability

A complete toolkit for detecting, analyzing, and fixing API breaking changes across your entire codebase.

Multi-Language Extraction

Automatically extract function signatures from Python, TypeScript, JavaScript, Java, Kotlin, Go, Rust, Swift, C/C++, C#, Ruby, Haskell, and Zig.

Semantic API Diffing

Classify changes into breaking vs non-breaking categories. Understand the difference between removing parameters and adding optional ones.

Risk Assessment

Quantify danger using the S×E×C×λ model: Severity × Exposure × Confidence × Lambda for accurate risk scoring.

Impact Analysis

Correlate signature changes with static call-site extraction and optional runtime tracing to identify affected downstream code.

Automated Remediation

Generate format-preserving patches using LibCST to automatically fix broken call sites in your codebase.

Call-Site Analysis

Deep module analysis tracks imports and assignments to resolve method calls to their actual definitions with FQN resolution.

CI/CD Integration

Block or permit CI/CD pipelines automatically based on risk levels. Install git hooks with a single command.

Git Hooks

Pre-commit and post-commit hooks using the pre-commit framework. Catch breaking changes before they reach your main branch.

14+ Languages Supported

Powered by tree-sitter grammars for accurate, battle-tested AST parsing with regex fallback when needed.

Install tree-sitter support with pip install "impactguard[languages]"

Pipe-and-Filter Architecture

Artifacts from one stage inform the next, creating a comprehensive analysis pipeline.

Signature Extraction

Deep inspection of source files using AST for Python and tree-sitter grammars for all other languages. Extracts function metadata including FQN, parameters, defaults, and decorators.

Output:.signatures.json

Semantic Comparison

Performs semantic diff between two snapshots. Categorizes changes into Breaking (removing parameters, reordering) vs Non-breaking (adding optional args).

Output:Change classification

Impact & Risk Analysis

Correlates API changes with call sites. Integrates runtime data to provide context on execution frequency. Applies S×E×C×λ risk scoring.

Output:Risk assessment

Remediation

Generates format-preserving patches using LibCST. Provides high-level suggestions and precise code transformations to fix broken call sites.

Output:Patch files

Quantitative Risk Framework

Transform raw signature changes into actionable risk levels using the S×E×C×λ model.

Score based on change type. REMOVED = 1.0, ADDED = 0.1

Logarithmic scale mapping call counts to exposure level

Measures data reliability based on sample size threshold

Sensitivity multiplier. Higher = more sensitive detection

Risk Classification

HIGH

Blocks CI/CD pipeline

Exit code 1

MEDIUM

Requires review

Warning issued

LOW

Safe to proceed

Exit code 0

UNKNOWN

Insufficient data

Warning issued

Powerful CLI

The impactguard command-line tool is your primary entry point for analysis and automation.

Quick Check

Compare two versions of your code

$ impactguard check-commits HEAD~1 HEAD

Extract Signatures

Extract function metadata from source files

$ impactguard extract $(git ls-files '*.py')

Install Git Hooks

Set up pre-commit and post-commit hooks

$ impactguard install-hooks . --both

Generate Report

Create HTML report from risk analysis

$ impactguard report risk.json output.html

Python API

Also available:

  • quick_check() — Extract + compare only
  • run_pipeline_git() — Compare git commits
  • ImpactGuard class — Full control

Start protecting your APIs today

ImpactGuard is open source and free to use. Install it now and catch breaking changes before they reach production.

View on GitHubPyPI Package

MIT Licensed

Python 3.11+

14+ Languages

CI/CD Ready