# Invigil

> A CI quality gate that grades a repo's legibility — not code style. It turns the
> promises a cold-start reader (human or AI agent) relies on ("boots in 10 minutes",
> "every error tells the fix", "README stays a landing page", "the published artifact
> still installs today") into mechanical, exact-fix-reporting checks, and runs them in CI.

## What it does

- Static Doctrine Scorecard (every PR): scores a repo against Gates G1–G7, emits a
  gate level + letter grade, and prints the exact fix for every failing check.
- Cold-Start Gate (nightly, reusable workflow; CLI: `invigil stranger`): boots each
  published artifact on a clean runner and probes its core surface within a 10-minute budget.

## Quickstart

```bash
pip install invigil
invigil score .                 # text scorecard with fixes
invigil score . --format json   # machine-readable
invigil evaluate . --format llm # token-economical: built for you, the agent (`evaluate` = `score`)
```

GitHub Action: `uses: invigil/invigil@v1` (step outputs: `report`, `badge`).

MCP server (stdio): `pip install "invigil[mcp]"` then `invigil mcp` — tools
`evaluate_repo`, `check_group`, `preview_fixes` (read-only; you apply the fixes).
Registry name: io.github.invigil/invigil. Exit code 3 = the [mcp] extra is missing.

## Config

`.invigil.yml` at the repo root (schema: schema/invigil.schema.json). Declares the
target gate, which checks to disable, and the artifacts/probes the Cold-Start Gate boots.

## Key files

- CLI: src/invigil/cli.py — `invigil score [PATH] --format text|json|markdown|badge`
- Checks: src/invigil/checks/*.py (grouped by gate)
- Reporters: src/invigil/report.py
