# `jadpo approval`

Explain a change, decisions first.

Writes the approval report a reviewer reads (area 17): build/review/approval.md and approval.json, the difference between this change and its before side, the default branch at its merge base, or the branch or commit --before names. It builds the before side with this compiler and keeps its manifest in build/before/<commit>/, so each base is built once. First each change that needs a person, in plain words, with whether its acceptance exists and the path that makes it true; then the declarations newly reachable; then the other behaviour: the API record, schema and migrations, failures, events and subscribers, integrations, who can do what and wording not yet accepted; then the source by declaration. `jadpo check` is what fails until each decision has its acceptance.

```text
jadpo approval
```

## Flags

- `--before <ref>`: The branch or commit to compare with

## On every command

- `--json`: Print data for tools instead of text
- `--help`: Show every flag, with examples
- `--color <when>`: Choose when to use colour

`jadpo approval --json` writes one JSON document to standard output instead of text, with the same exit code. The document has `schemaVersion`, `command` (`"approval"`), `ok`, `data` (what the command produced, `null` when it failed) and `diagnostics` (each error with its `rule`, `reason`, `next` and `help`). A command that needs a terminal refuses `--json` and names the flags that do the same job.

## Examples

```text
# Explain this branch's change against the default branch
jadpo approval
# Explain what changed since a deployed commit
jadpo approval --before 8d113e6
```

## Errors

- [`cli.approval_arguments`](../errors/cli.approval_arguments.md): A `jadpo approval` command is given an argument it doesn't take, names a `--before` git doesn't know, or has nothing to compare with
- [`acceptance.base_missing`](../errors/acceptance.base_missing.md): Base commit the change is compared with isn't in this clone
- [`toolchain.artifact_write_failed`](../errors/toolchain.artifact_write_failed.md): A file Jadpo writes for you, such as a record, couldn't be written, usually because it or its folder is read-only
- [`toolchain.project_not_found`](../errors/toolchain.project_not_found.md): You ran a command that works on a project in a folder with no `app.jadpo`, in it or in any folder above it
