CodeRadius LogoCodeRadius Docs

Impact Evaluation

Calculate the precise blast radius of code changes before they are committed — locally, in CI, or inside AI agent reasoning loops.

Impact Evaluation

The CodeRadius Impact Evaluation engine enables you to calculate the precise "Blast Radius" of code changes before they are committed. It executes a full architectural impact analysis in under 10 seconds, making it practical for every local commit, IDE agent loop, and CI pipeline.

By combining deterministic code heuristics with semantic code analysis, CodeRadius detects breaking changes and orphan resources — locally on your machine, in your AI agent's reasoning loop, or in your CI pipeline — warning your team or automatically blocking unsafe deployments.


How It Works: The In-Memory Graph Overlay

Unlike primitive tools that require spinning up ephemeral test databases or cloning full repositories, cr blast operates entirely in memory using a non-destructive "overlay" approach.

The Analysis Pipeline

sequenceDiagram
    autonumber
    participant Dev as Developer / CI
    participant Eval as cr blast
    participant MasterGraph as Memgraph (Master)
    participant LLM as extraction-agent
    
    Dev->>Eval: eval impact --base main --head HEAD
    Eval->>Eval: 1. Compute Git Delta (git diff)
    
    rect rgb(20, 20, 20)
        Note over Eval,MasterGraph: Read-Only Baseline
        Eval->>MasterGraph: 2. Snapshot current topology for changed files
        Eval->>MasterGraph: 3. Load Base SymbolRegistry (Read-only)
    end
    
    rect rgb(0, 40, 10)
        Note over Eval,LLM: Ephemeral "Dry-Run" Extraction
        Eval->>LLM: 4. Re-extract modified config files
        Eval->>Eval: 5. Parse AST for modified TS/PHP/Python code
    end
    Eval->>Eval: 6. O(E) In-Memory Diff (Baseline vs Proposed)
    
    rect rgb(40, 0, 0)
        Note over Eval,MasterGraph: Blast Radius Resolution
        Eval->>MasterGraph: 7. Query downstream dependencies of deleted/modified edges
    end
    
    Eval-->>Dev: 8. Render Report (Markdown/JSON) & Exit Code

This ensures zero risk of polluting the production graph, while maintaining precise downstream impact detection.


Local Usage (Primary Use Case)

Developers can run impact analyses locally to test changes before pushing to remote branches. Think of it as terraform plan for your architecture. When executed in a TTY terminal, CodeRadius prints a color-coded, human-readable summary.

# Analyze changes between main and your current branch
cr blast --base main --head HEAD

# Describe the intent of your change for better LLM context
cr blast --base main --head HEAD -m "Migrate auth module to Redis"

# Analyze explicit files without Git
cr blast --files "src/OrderController.php,config/messenger.yaml"

# Advisory Mode (always return exit code 0, even on DANGER findings)
cr blast --base main --head HEAD --advisory

Performance: A typical analysis delta on 5 files executes in roughly 2.8s - 4.5s, including LLM semantic extraction for configuration files.


Enterprise CI Integrations

CodeRadius is CI-agnostic. It adheres to the UNIX philosophy: it consumes text inputs (git diffs), performs the "What-If" logic, and emits structured outputs (JSON/Markdown) or exit codes. It is the responsibility of your pipeline to inject these results as PR comments.

CI Platforms

Use gh pr comment to safely inject the blast-cr dashboard directly into the conversation feed.

name: "CodeRadius: Architecture Impact Evaluation"
on:
  pull_request:
    branches: [ "main" ]

jobs:
  impact-evaluation:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0 # Required for accurate git diffing
          
      - name: Install CodeRadius CLI
        run: curl -sSL https://cdn.coderadius.ai/install.sh | bash
        
      - name: Evaluate Impact
        id: coderadius
        env:
          MEMGRAPH_URI: ${{ secrets.CODERADIUS_MEMGRAPH_URI }}
          MEMGRAPH_USER: ${{ secrets.CODERADIUS_MEMGRAPH_USER }}
          MEMGRAPH_PASSWORD: ${{ secrets.CODERADIUS_MEMGRAPH_PASSWORD }}
          GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_VERTEX_CREDENTIALS }}
        run: |
          # Run analysis and dump to report.md
          cr blast \
            --base ${{ github.event.pull_request.base.sha }} \
            --head ${{ github.sha }} \
            -m "${{ github.event.pull_request.title }}" \
            --format markdown > report.md
            
      - name: Inject PR Comment
        if: always() # Run even if the eval step fails (returns non-zero)
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh pr comment ${{ github.event.pull_request.number }} --body-file report.md

Integrate with GitLab Merge Requests using the native glab CLI tool.

impact_evaluation:
  stage: test
  image: node:20-alpine
  before_script:
    - apk add --no-cache git glab
    - curl -sSL https://cdn.coderadius.ai/install.sh | bash
    - glab auth login --token $GITLAB_API_TOKEN
  script:
    - |
      cr blast \
        --base $CI_MERGE_REQUEST_DIFF_BASE_SHA \
        --head $CI_COMMIT_SHA \
        -m "$CI_MERGE_REQUEST_TITLE" \
        --format markdown > report.md
  after_script:
    - glab mr note $CI_MERGE_REQUEST_IID -F report.md
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

For Bitbucket, utilize the native curl command against the Bitbucket Cloud REST API to comment on a Pull Request.

pipelines:
  pull-requests:
    '**':
      - step:
          name: "CodeRadius Impact Evaluation"
          image: node:20
          script:
            - curl -sSL https://cdn.coderadius.ai/install.sh | bash
            - git fetch origin $BITBUCKET_PR_DESTINATION_BRANCH
            - |
              cr blast \
                --base FETCH_HEAD \
                --head HEAD \
                --format markdown > report.md || EXIT_CODE=$?
            - |
              # Format body for Bitbucket JSON payload
              BODY=$(cat report.md | jq -Rs .)
              curl -s -X POST \
                "https://api.bitbucket.org/2.0/repositories/$BITBUCKET_WORKSPACE/$BITBUCKET_REPO_SLUG/pullrequests/$BITBUCKET_PR_ID/comments" \
                -u "$BITBUCKET_USERNAME:$BITBUCKET_APP_PASSWORD" \
                -H "Content-Type: application/json" \
                -d "{\"content\": {\"raw\": $BODY}}"
            - exit ${EXIT_CODE:-0}

Findings & Severity Levels

The impact evaluation engine categorises architectural delta findings into 3 severity tiers and maps them to semantic exit codes so CI / agents can branch without parsing text.

DANGER (Exit 2, BREAKING state)

  • Breaking Changes: A relationship (e.g., PUBLISHES_TO, PRODUCES) to an infrastructure resource was modified or deleted, and the master graph confirms that downstream consumers exist.
  • Behavior: Fails the process immediately to prevent a production incident.

WARNING (Exit 1, WATCH state)

  • Orphan Producers: You added a new producer relationship (e.g., publishing to an AMQP queue payments.initiated), but no consumer currently listens to that queue in the ecosystem.
  • Behavior: Surfaces a signal worth reviewing without blocking.

INFO (Exit 0, folded into SAFE)

  • New Dependency: A new safe relationship was added (e.g. READS from a DataContainer, or CALLS a new API Endpoint).
  • Behavior: Logged for programmatic consumers; suppressed from the default TTY view to keep signal-to-noise high.

Semantic exit codes: by default cr blast returns 0 SAFE, 1 WATCH, or 2 BREAKING. CI can branch directly on the code without parsing the rendered output. If you are trailing the product on a subset of services, use the --advisory flag to enforce purely Advisory Checks (returns 0 regardless of findings) while teams acclimate.


Agentic Code Review via MCP

CodeRadius exposes its impact evaluation engine programmatically via the Model Context Protocol (MCP), unlocking a new paradigm for AI-assisted engineering: Agentic Code Review.

Using the evaluate_code_change_impact tool, AI agents (like Claude Desktop, Cursor, or autonomous CI review bots) can calculate the exact architectural blast radius of code changes during their reasoning loop, before ever writing a commit.

How it Works

When an agent invokes the tool, it provides the repository path and the proposed new contents of the files it intends to modify:

  1. VFS Emulation: The tool temporarily writes the proposed content to the local filesystem, backing up the originals.
  2. Ephemeral Diffing: CodeRadius runs the same high-performance extraction and topological diffing used by the CLI.
  3. Atomic Restore: Regardless of the outcome, the tool instantly restores the original filesystem state.
  4. JSON Feedback Loop: The tool returns the findings (breaking changes, new resources) as structured JSON back to the agent.

Integration in CI (Code Review Bots)

If you are running an AI-driven agent (e.g., a custom script powered by LangChain or direct LLM calls) as part of your PR review process, you can provide it the CodeRadius MCP Server so it can preemptively evaluate its own suggestions.

// Example: An autonomous AI agent deciding if a refactor is safe
const agentPrompt = `
You are a Staff Engineer reviewing this Pull Request. 
Before suggesting any architectural modifications:
1. Use the 'evaluate_code_change_impact' tool with your proposed file contents.
2. If the tool returns a DANGER severity (e.g., breaking a downstream consumer), 
   you MUST revise your approach to be backward-compatible.
3. Only submit PR comments once the impact is safe.
`;

By putting CodeRadius in the loop, AI agents graduate from generating syntactically correct code to generating architecturally safe code.

On this page