get_health
Self-check code health before or after editing a file, returning defect-risk, maintainability, and performance scores plus ranked findings and a directive for the file to fix first.
Instructions
Code-health scores and findings — self-check a file before/after editing.
No ``targets`` → repo dashboard, led by a ``directive`` naming the one file
to fix first. With ``targets`` → per-file scores + findings. Rank by
``weighted_deficit``, not ``score``: the score floors at 1.0 and cannot
separate the worst band.
Three co-equal dimensions per file: ``score`` (defect risk, the headline),
``maintainability_score``, and ``performance_score`` (static I/O-in-loop /
N+1 risk, never blended into the defect headline). Each finding carries its
``dimension``.
Args:
targets: file paths or ``module:<name>``. Empty → dashboard mode. Any
target matching nothing is named in ``unresolved`` with a reason
(``not_indexed`` → run ``repowise update`` | ``no_such_path`` |
``excluded`` | ``no_such_module``), so an empty ``findings`` means
healthy and nothing else.
include: opt-in blocks: ``biomarkers`` | ``refactoring`` | ``trend`` |
``coverage`` | ``accuracy`` | ``signals`` | ``churn_complexity`` |
``performance``/``defect``/``maintainability`` (filter findings to
one dimension).
only: keep just these top-level keys. ``include`` adds blocks, ``only``
subtracts them — pass ``["directive"]`` for the cheapest useful call.
repo: usually omitted.
limit: max rows in every ranked list (capped at 50); each carries a
``*_total`` sibling so truncation is never silent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| only | No | ||
| repo | No | ||
| limit | No | ||
| include | No | ||
| targets | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |