.png&w=828&q=75)
Problem: Traditional code review often focuses on the lines directly changed in a commit. However, a small change to a function can affect other functions that call it, including code in different files. These indirect effects can be difficult to identify from a diff alone. Solution: ContextGuard is an AI-assisted software impact-analysis and contextual code-review system. It starts from a developer's Git diff, identifies the functions affected by the change, builds a dependency graph of the repository, and traverses that graph to find relevant surrounding code. The resulting context can then be used by an LLM to reason about potential risks and generate a structured review. ContextGuard supports AST-based function extraction, function-call relationships, cross-file dependency analysis, graph traversal, semantic retrieval, LLM reasoning, a CLI, and a Streamlit dashboard. During development, we also validated the system against an external repository and used IBM Bob to make and evaluate a repository-level improvement. The Bob experiment demonstrated a practical workflow where an AI coding agent makes a change and ContextGuard independently analyzes the resulting diff. The project is still under active development, and broader quantitative validation is planned to measure detection coverage and false positives across larger repositories.
27 Sep 2026