git diff tells you what lines changed. SDL-MCP tells you what that change means at the symbol level and which parts of the codebase are affected — ranked by risk.
Beyond Line Diffs
A delta pack contains four categories of semantic information:- Changed symbols with semantic diffs (signature changes, invariant additions/removals, side-effect changes)
- Blast radius — ranked list of dependent symbols that may be impacted, with distance scores
- Fan-in trends — which symbols are becoming increasingly depended upon (amplifiers)
- Risk tiers — whether the interface, behavior, and side effects are stable
Anatomy of a Delta Pack
Here is what a delta pack looks like for avalidateToken() signature change:
Semantic Diff Fields
| Diff Field | What It Captures |
|---|---|
| signatureDiff | Parameters added, removed, or changed; return type changes; new overloads |
| invariantDiff | Preconditions or postconditions added or removed (e.g., “throws on expired token” added) |
| sideEffectDiff | Observable effects added or removed (e.g., “logs to audit trail” added) |
Blast Radius Ranking
Each affected symbol in the blast radius is ranked by multiple signals:| Signal | What It Measures |
|---|---|
| Distance | Hops in the dependency graph from the changed symbol |
| Fan-in | How many other symbols depend on the affected symbol |
| Test proximity | Whether the affected symbol has tests that should be re-run |
| Process participation | Whether the symbol is part of a critical call chain |
Fan-In Trend Analysis (Amplifiers)
SDL-MCP tracks how a symbol’s fan-in changes across versions. A symbol whose fan-in is growing rapidly is an amplifier — changes to it ripple through an increasing number of dependents over time. The delta response flags these explicitly:growthRate: 1.4 has seen its fan-in grow 40% between versions — a signal that future changes to it will have increasing impact.
Delta Analysis Workflow
Detect code changes
SDL-MCP detects changed symbols between two indexed versions of the codebase — either triggered by re-indexing after a commit, or via live buffer updates during editing.
Compute semantic diffs
For each changed symbol, SDL-MCP computes three parallel diffs:
- signatureDiff — parameter and return type changes
- invariantDiff — added and removed invariants
- sideEffectDiff — added and removed side effects
Compute blast radius
SDL-MCP traverses the dependency graph outward from each changed symbol, collecting all direct and transitive dependents. Each dependent receives a distance score and is ranked by the blast radius signals (distance, fan-in, test proximity, process participation).
Run fan-in trend analysis
Fan-in counts from the previous version are compared to the current version. Symbols with rapidly growing fan-in are flagged as amplifiers.
PR Risk Analysis
sdl.pr.risk.analyze wraps delta analysis into a structured risk assessment with numeric scoring, categorized findings, and prioritized test recommendations.
Risk Scoring Formula
The overall risk score (0–100) is a weighted average of four components:| Component | Weight | What It Captures |
|---|---|---|
| Changed Symbols | 40% | Average per-symbol risk: interface stability, behavior stability, side-effect changes |
| Blast Radius | 30% | Number of direct dependents, transitive distance, dependency rank scores |
| Interface Stability | 20% | Proportion of changes with signature modifications |
| Side Effects | 10% | Proportion of changes affecting side effects |
Finding Types
| Type | Severity | Description |
|---|---|---|
high-risk-changes | high | Symbols with risk score ≥ 70 |
interface-breaking-changes | high | Modified symbols with signature changes |
side-effect-changes | medium | Modified symbols with side-effect changes |
removed-symbols | medium | Deleted symbols that may break dependents |
large-impact-radius | medium | Many direct dependents (> 10) potentially affected |
new-symbols | low | Newly added symbols |
Recommended Test Types
| Type | Priority | When Recommended |
|---|---|---|
unit-tests | high | Modified symbols present |
integration-tests | high | Interface-breaking changes detected |
regression-tests | medium | Direct dependents in blast radius |
api-breakage-tests | high | Symbols were removed |
new-coverage-tests | low | New symbols added |
CI/CD Integration
Usesdl.pr.risk.analyze in a pipeline to gate merges on risk score:
escalationRequired is true in the response, the PR’s risk score exceeded the threshold and the merge should be blocked pending additional review.
sdl.pr.risk.analyze requires both fromVersion and toVersion to be indexed. Run sdl-mcp index on both branches before invoking the tool in CI.MCP Tools for Delta and Risk
| Tool | Description |
|---|---|
sdl.delta.get | Raw delta pack: semantic diffs, blast radius, amplifiers |
sdl.pr.risk.analyze | Structured risk assessment with score, findings, and test recommendations |
sdl.slice.refresh | Delta-scoped slice update — returns only cards that changed since the last slice version |