# `cli.production_counts`

A `--production` file given to `jadpo test` or `jadpo approval` can't be read, or holds anything but production path counts: aggregate numbers by path key.

Area 14, [Tools](/docs/tooling.md); not declinable; the next step is usually the agent's.

## Why Jadpo refuses it

Production path counts come from outside the project, exported from a
monitoring tool, so they are read as untrusted data. They may hold how
many requests took each path, how many of those failed and when one was
last seen, and nothing else. A file holding more could carry a
request's contents or someone's personal data into a review, and a
value out of its form could put anything on your screen, so the command
stops before it runs or builds anything, and says where the problem is
without repeating what the file holds.

## What it looks like

The counts were exported with a column the format doesn't have:


```sh
cat > paths.json <<'EOF'
{
  "from": "2026-11-23",
  "to": "2026-11-30",
  "paths": [
    { "path_key": "pk_d5442fe42e9ae2fc", "path": "114", "requests": 1100, "user": "ada@example.com" }
  ]
}
EOF
jadpo test --production paths.json
```

```text
error: `paths.json` isn't production path counts
  reason: `paths[0]`: it holds `user`, and a path's counts are only `path_key`, `path`, `requests`, `failed` and `last_seen`. Production path counts are aggregate numbers only: `from`, `to`, and for each path its `path_key`, `path`, `requests`, `failed` and `last_seen`.
  next: Export only each path's key, number and counts, then run the command again (agent)
  rule: cli.production_counts
  help: https://jadpo.dev/docs/errors/cli.production_counts
```

`(agent)` at the end of the `next:` line means your coding agent can make
the fix itself.

The same error says when the file can't be read, isn't JSON, is larger
than 16 MB or holds more than 100,000 rows; when `from`, `to` or a
`last_seen` isn't a time, or `to` isn't after `from`; and when a key,
number or count isn't in its form.

## How to fix it

**If the export holds columns of its own**, export only the path counts.
Group your monitoring tool's requests by the `jadpo.path_key` and
`jadpo.path` each request's root span carries, count them and their
failures, and write each group as one row:

```json
{
  "from": "2026-11-23T00:00:00Z",
  "to": "2026-11-30T00:00:00Z",
  "paths": [
    { "path_key": "pk_d5442fe42e9ae2fc", "path": "114", "requests": 1100, "failed": 0 }
  ]
}
```

Then run the command again:

```sh
jadpo test --production paths.json
```

The run then lists the paths production took that no test takes, and
those it hasn't used for 90 days.

**If the file was saved elsewhere**, give its path, or pipe it in:

```sh
pbpaste | jadpo test --production -
```

The counts are read from standard input as from a file, and the run
goes on as with one.

## Related

- [Coverage by path](/docs/what-the-graph-and-production-evidence-add.md#coverage-by-path)
- [Production in review](/docs/what-the-graph-and-production-evidence-add.md#production-in-review)
- [`jadpo test`](/docs/the-jadpo-command.md#jadpo-test)
