Change-Impact Analysis¶
The --diff flag enriches the review with git diff context and a change-impact graph showing callers and callees of modified symbols.
Usage¶
# Diff against current HEAD
/adversarial-reviewing src/ --diff
# Specify a commit range
/adversarial-reviewing src/ --diff --range main..HEAD
# Combined with triage
/adversarial-reviewing --triage pr:42 --diff
What it provides¶
When --diff is active, each specialist receives:
- The raw git diff of changed files
- Changed files list with modification type (added/modified/deleted)
- Change-impact graph built by
build-impact-graph.sh
Change-impact graph¶
The impact graph uses grep-based symbol analysis to trace:
- Callers: Functions that call the modified symbols
- Callees: Functions called by the modified code
- Affected types: Structs and interfaces used by changed functions
This helps specialists identify side effects. For example, if a function signature changes, the impact graph shows all callers that might need updating.
Example output¶
Changed symbol: pkg/auth.ValidateToken
Callers:
- pkg/middleware.AuthMiddleware (middleware.go:28)
- cmd/server.handleLogin (server.go:115)
- pkg/api.RefreshToken (api.go:72)
Callees:
- pkg/crypto.VerifySignature (crypto.go:45)
- pkg/store.GetPublicKey (store.go:33)
When to use it¶
- Reviewing PRs where you want specialists to focus on what changed
- Re-reviewing after fixes to verify the fix doesn't break callers
- Combining with
--triageto give specialists full context when evaluating external comments
How it works internally¶
build-impact-graph.shextracts changed symbols from the git diff- For each changed symbol, it searches the codebase for references (callers)
- It also extracts function calls within the changed code (callees)
- The graph is serialized and injected into each specialist's input alongside the diff
The graph is grep-based (not AST-based) to stay fast and language-agnostic. This means it may produce false positives for common symbol names, but it prioritizes recall over precision.