get_change_risk
Identify risk in code changes by reviewing a commit, diff range, or uncommitted work. Get actionable findings on health impact, affected tests, and prior fixes to decide whether a change is safe.
Instructions
Review a commit, base..head range, or uncommitted work.
Leads with ``directive`` (what to do) and ``health_delta`` (what this
change newly made worse). A finding is reported only when the diff explains
it, and each names its ``attribution`` basis; findings the change wrote
sort above pre-existing ones it only touched.
Trust ``health_delta.status``: ``partial`` means files were skipped and the
change is not cleared.
``impacted_tests`` keeps measured coverage and inferred candidates distinct.
``fix_history`` is the changed files' bug-fix record, ``overlap`` the past
fixes on these exact lines. ``branch_overlap`` names other branches editing
them. ``diff_shape`` is one line on size, not a danger verdict. An empty
diff returns ``status: "nothing_to_score"`` and names the tree it read.
Args:
revspec: Commit or ``base..head`` range. Omit to review uncommitted
work, or ``HEAD`` when the tree is clean.
repo: Repository alias in workspace mode; omit for the default.
extensions: File suffixes to count, e.g. ``[".py", ".ts"]``.
exclude_patterns: Gitignore-style paths to omit, e.g. ``["tests/"]``.
baseline: Recent commits sampled for percentile ranking; 0 disables it.
include: ``"findings"`` for every change finding, ``"diagnostics"`` for
raw score mechanics, ``"scales"`` for units. All identical on
repeat, so ask once.
finding_id: Expand one ``health_delta`` finding by its id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | ||
| include | No | ||
| revspec | No | ||
| baseline | No | ||
| extensions | No | ||
| finding_id | No | ||
| exclude_patterns | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |