# Plans and limits

Each plan on hushrun's hosted service includes a number of recorded checks a month: the passes and
fails it records. Skips and reads are free, and at the limit your checks still run.

## The plans

| Plan | Price | Included | Past what's included | How |
|---|---|---|---|---|
| Free | $0 | 2,000 recorded checks a month | Recording pauses until the next month; checks still run | [Start free](https://app.hushrun.com/sign-up) |
| Team | $49/month, billed monthly, or $490 billed yearly | 10,000 recorded checks a month | $3 per 1,000 more, up to your spend cap ($30 of overage by default) | Checkout in the dashboard |
| Growth | $99/month, billed monthly, or $990 billed yearly | 75,000 recorded checks a month | $1.50 per 1,000 more, up to your spend cap ($112.50 of overage by default) | Checkout in the dashboard |
| Scale | ~$399/month, billed yearly | 300,000 recorded checks a month | Never cut off; a contract sets what is included | [Talk to the founder](https://hushrun.com/pricing#scale) |
| Enterprise | From $1,500/month, billed yearly | By contract | Never cut off; a contract sets what is included | [Contact form](https://hushrun.com/pricing#enterprise) |

- Prices are in US dollars. Included checks are per month, on yearly plans too.
- A plan belongs to an organization ([Your team on hushrun](https://hushrun.com/docs/teams.md)). Every organization
  starts on Free, and the checks its members, agents and CI record all count toward its plan.
- Free takes a sign-up at https://app.hushrun.com/sign-up. Owners and admins buy Team and Growth in the dashboard.
  Scale and Enterprise start with a conversation, from the forms on [the pricing page](https://hushrun.com/pricing);
  hushrun then sets the plan on your organization.

## What counts as a recorded check

A recorded check is a pass or a fail that hushrun's hosted service records:

- a result of `hushrun run NAME -- COMMAND` that passed or failed;
- a check event from a pipeline, `hushrun run --stage` or `hushrun attest --check`, passed or
  failed.

Everything else is free:

- skips, when this exact code already passed the check;
- every read: result lookups, the dashboard, `hushrun repository usage` and
  `hushrun repository stats`;
- every other event: builds, deploys, approvals and the rest of a pipeline's record.

Repeats of the same run count once:

- Within a usage period, re-runs and retries of the same CI run count once per check: GitHub
  Actions' second and third attempts of a run, or a retried job in the same GitLab pipeline.
- On a laptop or in an agent's sandbox, each run counts, and a request sent twice counts once.

## Free on your own machine or server

hushrun's hosted service meters only what it records. These never reach it, and cost nothing:

- results kept in hushrun's cache directory on your machine, where they go when no backend is set
  and you aren't signed in;
- results and events recorded to a server you run.

On a machine that keeps its results, `hushrun repository usage` says
`results stay on this machine, so nothing is metered`. How to choose where results go:
[Where results go](https://hushrun.com/docs/results.md).

## At the limit, checks still run

On Free, once your organization has recorded the checks its plan includes this month, hushrun's
server stops recording new passes and fails until the next month, or until an owner or admin
upgrades. On Team and Growth, the same happens past the [spend cap](#spend-cap). Nothing breaks:

- Checks run as they did before hushrun: with no new pass recorded, there is nothing to skip on.
- Exit codes don't change. `hushrun run NAME -- COMMAND` exits with the command's code;
  `hushrun run --stage` exits 0 when its checks passed and 8 when one failed; `hushrun attest`
  exits 0.
- Passes recorded before still skip: lookups and skips stay free.
- Builds, deploys and the pipeline's other events are still recorded.

Owners and admins get an email at 80% and 100% of the included checks, and when recording stops.
The dashboard's [Usage page](#usage) shows where the organization stands.

### What the CLI prints

`hushrun run` ends with its usual line, then why the result wasn't recorded and where to upgrade:

- `hushrun: NAME passed in TIME; not recorded: REASON; upgrade: URL`
- `hushrun: NAME failed in TIME (exit CODE); not recorded: REASON; upgrade: URL`

REASON is the server's sentence, which names the day recording starts again:

- on Free: `ORG used the N recorded checks its PLAN plan includes this month, so checks run instead of skipping until DATE`;
- past a spend cap: `ORG reached its spend cap for this period (N recorded checks, AMOUNT of overage), so checks run instead of skipping until DATE`.

URL is the organization's Usage page, `https://app.hushrun.com/<org>/-/billing`.

A pipeline warns once per command: `warning: check results aren't recorded: REASON; upgrade: URL`.
GitHub Actions shows it as a warning annotation titled `hushrun: check results not recorded`. The
output marks each check that wasn't recorded: `hushrun run --stage` adds `not recorded` to the
check's detail, and `hushrun attest` prints `not recorded check: NAME`.

## Overage and the spend cap

Team and Growth keep recording past the checks they include, as overage, priced per 1,000 checks,
up to the organization's spend cap. The table above shows the price and the cap each plan starts
with.

- Owners and admins change the cap under **Spend cap** on the Usage page: from 0, which records no
  overage, up to a maximum, or back to the plan's default. Each change is in the audit log.
- Past the cap, recording stops, as on Free, until the period ends, the cap goes up or the plan
  changes.
- During early access, overage isn't charged automatically. When a period ends with overage,
  owners and admins get an email with what it comes to: reply to settle it with the founder, or
  move to a plan that includes more.
- When a Team organization records enough checks, the Usage page suggests Growth, and says from
  how many checks Growth costs less.

Scale and Enterprise have no limit the server enforces: a contract says what they include.

## Usage periods

- On Free, a period is the calendar month, in UTC.
- On a paid plan, a period is a month from the day the subscription started, on yearly plans too.

## See where your organization stands

### In the dashboard

**Usage**, under Organization in the sidebar, at `https://app.hushrun.com/<org>/-/billing`, is for every
member. It shows the plan, the period and how far into it you are, the recorded checks against
those included, a chart by day, any overage and what it comes to, each repository's share, and the
checks `hushrun run` skipped this period, with the time they saved.

### `hushrun repository usage`

```bash
hushrun repository usage
```

It asks the server that `hushrun run` records results to here, with the same credential, and
prints:

| Line | What it shows |
|---|---|
| `backend` | The server it asked, and what named it |
| `org`, `plan`, `period` | The organization, its plan and the current period |
| `checks` | Recorded checks this period, of those included |
| `limit` | Where recording stops, and whether the organization reached it |
| `overage` | Checks past the included ones and what they come to, when there are any |
| `repository` | This repository's share of the period's checks |
| `dashboard` | The organization's Usage page |

When results stay on this machine, it says nothing is metered; when the server doesn't report
usage, it says that. With `--format json`, it prints a `hushrun.repository.usage/v1` document,
whose `usage.state` is `ok`, `near` (80% of the included checks), `over_included` (in overage) or
`at_limit` (recording stopped). It exits 0, or 6 when the server can't be reached or refuses the
credential.

### `hushrun repository stats`

```bash
hushrun repository stats
hushrun repository stats --local
```

It counts what hushrun recorded, so you can share your volume without telemetry. It prints the
counts, and sends nothing else anywhere.

- Without `--local`, it counts the repository's events on its server from one listing, reading no
  event: events by kind, distinct digests, and check events by stage. It needs the
  repository's URL on hushrun, from `hushrun.yaml` or `HUSHRUN_REPOSITORY_URL`.
- With `--local`, it counts this machine's `hushrun run` results in hushrun's cache directory: by
  verdict, by check, distinct run keys, and the time skips saved. It sends nothing.
- `--since` sets how far back it counts, such as `7d` or `12w`: 30 days by default.

These count everything recorded, skips and re-runs included. What your plan meters is what
`hushrun repository usage` shows.

## Upgrade or change plans

Owners and admins change the plan under **Plans** on the Usage page. Members see the plans there,
and ask an owner or admin.

- **Upgrade to Team** and **Upgrade to Growth** open the checkout, billed yearly unless you choose
  monthly. Back on the Usage page, the plan changes once the payment is confirmed, usually within a
  minute.
- On [the pricing page](https://hushrun.com/pricing), **Choose Team** and **Choose Growth** sign you in and open your
  organization's Usage page with that plan ready to buy. With several organizations, you choose
  one. Someone who is only a member is asked to go to an owner or admin, or to create an
  organization of their own.
- **Manage billing**, once the organization has paid, opens the billing portal: changing plans,
  the card, invoices and cancelling.
- A canceled plan lasts until the end of the period paid for; then the organization is on Free.
- For Scale and Enterprise, **Talk to the founder** opens the pricing page's forms.

## Refund guarantee

Paid plans come with a 60-day guarantee: if the time hushrun saved you in your first 60 days on a
paid plan doesn't cover the bill, you get a refund. Refunds are handled by hand for now:
[the pricing page](https://hushrun.com/pricing#refund) has the details. The Usage page and each repository's checks
show the time saved.

## Other limits

- hushrun's server takes only so many recorded checks a minute from one credential, set high
  enough to catch loops, not pipelines. Past it, a write gets 429, and `hushrun run` ends with
  `not recorded:` and the server's reason.
- An agent token records at most the results a minute set on it:
  [Agents and sandboxes](https://hushrun.com/docs/agents.md).
- Lookups aren't limited.
