get_health_score
Compute repository health from scan metrics and persist a timestamped history entry. Use when you need a 0-100 health score with breakdown and coverage caveats.
Instructions
Compute repository health from scan metrics and append a timestamped state entry. Use when: you need a before/after health metric and persisted history. Don't use when: you only need findings without writing state (use scan_repo instead).
Returns {score, coverage, breakdown, scan_summary}, plus caveat for limited coverage or parse failures. score is 0-100 (higher is healthier), or null when no files were analysed. coverage is the analysed fraction (0-1, three decimal places), not test coverage. Breakdown contains dead_code_ratio, duplicate_ratio (fractions rounded to three decimals), god_file_count and circular_count. Deductions cap at 30/30/20/20 points respectively; only Python/JS/TS-sensitive cycles reduce health. The history entry is appended on every call, so repeated calls are not idempotent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | Existing repository directory to scan and persist health_history in reforge-state.json; prefer an absolute path, e.g. /work/app. Every call appends a UTC-timestamped entry and rotates state backups. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| score | Yes | ||
| caveat | No | ||
| coverage | Yes | ||
| breakdown | Yes | ||
| scan_summary | Yes |