# Open-source health snapshot

Status: 2026-12-05. A scannable heuristic, not a certification or ranking.

## What it is

A “nutrition label” for each software record with a public GitHub repository: contributors, last
commit, licence, code of conduct, `ACCESSIBILITY.md`, `SECURITY.md`, documentation, homepage, stars,
forks, release-asset downloads and archived status. It answers “what should
I look at next?” before reading the full record.

The design follows the spirit of CHAOSS community health metrics — activity, community and governance
signals — without claiming CHAOSS conformance. It is deliberately small and reproducible from GitHub
metadata.

## DPG status

A registered Digital Public Good is shown as a separate badge and table column. It is **not folded into
the score**: DPG status is a third-party assessment against the DPG Standard, while the score is a
heuristic over repository metadata. Governments can use the badge as a vetting signal without the score
implying clinical or security approval. See `docs/software/dpg-status.md`.

## Score

| Signal | Points | Rule |
| --- | --- | --- |
| Licence | 15 | A detected SPDX licence, or the catalogue’s verified fallback |
| Code of conduct | 5 | GitHub community profile reports one |
| `ACCESSIBILITY.md` | 10 | Present at the repository root or in `.github/` |
| `SECURITY.md` | 10 | Present at the repository root or in `.github/` |
| Contributors | 15 | 10+ = 15, 3–9 = 9, 1–2 = 4 |
| Last commit | 15 | ≤90 days = 15, ≤365 = 9, older = 3 |
| Documentation | 8 | `docs/` or `documentation/` directory, or a recorded docs URL |
| Homepage | 4 | Repository or catalogue homepage present |
| Stars | 5 | 500+ = 5, 50–499 = 3, 5–49 = 1 |
| Forks | 5 | 100+ = 5, 10–99 = 3, 1–9 = 1 |
| Not archived | 3 | Repository is active |
| Release downloads | 5 | 1,000+ assets = 5, 100–999 = 3, 1–99 = 1 |

Bands: 75–100 **strong**, 50–74 **moderate**, 25–49 **limited**, below 25 **weak**, missing metadata
**unknown**.

## What it does not measure

- Code quality, security, clinical suitability, conformance or community inclusiveness.
- Bus factor, maintainer concentration, responsiveness or funding.
- Whether documentation is accurate or accessible.
- Projects without a GitHub repository; 2 of 47 records are unchecked and shown as “No public repo” or “Specification”.
- Data completeness: a missing code of conduct or docs link lowers the score even when the project may
  have them elsewhere.

Release downloads count GitHub release assets only; they are not package installs or real-world use.
A high score is not an endorsement. A low score is not proof of abandonment; it may be missing metadata.

## Method

`tools/health_snapshot.py` reads `data/software.json`, selects the first GitHub repository for each
record, and queries the GitHub API for repository metadata, contributors (including anonymous), the
latest commit, the community profile, root/`.github` file names and release assets. It writes
`data/software-health.json`.
The site build reads that file only; **no network call happens during the build**.

Refresh manually and commit the result. A token is optional: without one GitHub allows 60 requests/hour,
which covers roughly 12 records. Use `--limit` and `--resume` to pace across sessions; the script stops
cleanly when the limit is reached and keeps previous results.

```zsh
python3 tools/health_snapshot.py --limit 12 --resume   # repeat until complete
GITHUB_TOKEN=... python3 tools/health_snapshot.py      # or one authenticated run
python3 tools/build.py
python3 tools/validate_catalogue.py
python3 tools/check.py
```

Record the snapshot date on the software page. Do not present an old snapshot as current.

## CHAOSS alignment

CHAOSS defines metrics across activity, community, diversity, evolution, risk and value. This snapshot
uses a small subset — contributors and commit recency — and adds licence, code of conduct and
documentation because they affect adoption and governance. It does not implement CHAOSS metrics
formally; a future version should adopt the relevant metric definitions and document deviations.

## Scheduled refresh

`.github/workflows/snapshot.yml` runs on the first day of each month and can be started manually.
It uses the workflow `GITHUB_TOKEN` (higher rate limit, no personal token), runs both snapshot scripts,
rebuilds the site, validates the catalogue and runs the local checks. If data changed it opens a PR
against `main`; it never pushes directly.

The repository must allow GitHub Actions to create pull requests (Settings → Actions → General → Workflow permissions). If that setting is disabled, the job stops after pushing a branch and reports it.

PRs created with the workflow token may not trigger other workflows. The refresh job runs build,
validation and `check.py` itself, but review the diff and run the accessibility suite if the software
page changed. A maintainer can close the PR if the upstream data looks wrong.
