get_change_risk
Scores a commit or range by diff shape to rank change risk against recent commits, highlighting impacted tests and uncovered lines.
Instructions
Score a live commit or base..head range from its diff shape.
Use this for a pre-merge score of a commit or PR range. It is distinct from
``get_risk``, which assesses indexed files and PR blast radius. ``extensions``
restricts counted suffixes; ``exclude_patterns`` omits gitignore-style paths.
Both filters also apply to the baseline used for the repository percentile.
Prefer ``risk_percentile`` as the indicator of change risk: it ranks this
change against sampled recent commits in the same repository. Summarize it
with ``review_priority`` and ``classification``. ``score``, ``probability``,
and ``level`` are secondary corpus-calibrated context, the fallback only
when ``risk_percentile`` is unavailable.
``impacted_tests`` names the tests the per-test coverage map proves execute
the change's changed *lines* (line-precise, narrower than get_risk's
file-level ``tests_to_run``), with ``missing_tests`` buckets for changed
lines no test covers. Its ``status`` is ``no_map`` (unknown, run the full
suite), never "untested", when no map is ingested.
Args:
revspec: Commit or ``base..head`` range to score. Defaults to ``HEAD``.
repo: Repository alias in workspace mode; omit for the default repository.
extensions: File suffixes to count, for example ``[".py", ".ts"]``.
exclude_patterns: Gitignore-style paths to omit, for example ``["tests/", "*.md"]``.
baseline: Recent commits to sample for percentile ranking; 0 disables it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | ||
| revspec | No | HEAD | |
| baseline | No | ||
| extensions | No | ||
| exclude_patterns | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |