---
title: "18.10 Recap and reference"
url: https://una-lang.org/en/learn/tools/recap-and-reference/
release: v0.4.0
edition: "0.2"
---

# 18.10 Recap and reference

## 18.10.1 For agents

:::agents
Every command but `una lsp` prints one JSON document with `--json`, its `schema` key first. The run of the day-to-day program, with its trace:

```json include="day-to-day/expected/commands/run.txt#L2"
{"schema":"una.run/1","tier":1,"status":"ok","output":["LAMP-01  19.90 now 13.93","DESK-02  129.00 now 110.00","CHAIR-09  not in the catalog"],"failure":null,"diagnostics":[],"trace":[{"seq":1,"instance":"with:listed#1","capability":"Catalog","op":"product","args":{"sku":"\"LAMP-01\""},"outcome":{"kind":"ok","value":"Some(Product(sku: \"LAMP-01\", price: 1990, cost: 1200))"}},{"seq":2,"instance":"host:Console","capability":"Console","op":"print","args":{"line":"\"LAMP-01  19.90 now 13.93\""},"outcome":{"kind":"ok","value":"unit"}},{"seq":3,"instance":"with:listed#2","capability":"Catalog","op":"product","args":{"sku":"\"DESK-02\""},"outcome":{"kind":"ok","value":"Some(Product(sku: \"DESK-02\", price: 12900, cost: 11000))"}},{"seq":4,"instance":"host:Console","capability":"Console","op":"print","args":{"line":"\"DESK-02  129.00 now 110.00\""},"outcome":{"kind":"ok","value":"unit"}},{"seq":5,"instance":"with:listed#3","capability":"Catalog","op":"product","args":{"sku":"\"CHAIR-09\""},"outcome":{"kind":"ok","value":"None"}},{"seq":6,"instance":"host:Console","capability":"Console","op":"print","args":{"line":"\"CHAIR-09  not in the catalog\""},"outcome":{"kind":"ok","value":"unit"}}]}
```

Each event names the handler instance that answered, such as `with:listed#1`, so an agent can check what a run asked of each service. The loop for an agent: `una --json check .`, apply what `una fix .` applies, read the remaining repairs by `rank` and `escape_cost`, then `una --json test .`. `una fix` never widens authority, never edits `una.toml`, and never applies an escape. Exit codes: 0 success, 1 an error, an unproven obligation or a failed example, 2 a usage error, 3 an internal error.
:::

## 18.10.2 Recap

:::recap
- `una check .` is the loop. `--tier 0` skips the proofs for a quick answer; run the full check before a change is done.
- `una fix --dry-run .` shows the exact repairs, and `una fix .` applies them and formats. It never widens authority, applies an escape, or edits `una.toml`.
- A diagnostic has a code, places, ranked repairs, and for a proof, an obligation and a counterexample. `una explain` explains any code.
- `--json` turns the output of every command but `una lsp` into one document with a `schema` key, and exit codes say the same as the text.
- `una obligations`, `una contract` and `una trace` show what was proven, what a function promises, and which code carries a rule.
- `una report` shows what the package may do and trusts; compare it between releases.
- `una run`, `una test` and `una build` check first, and run nothing that does not check.
:::

## 18.10.3 Reference

:::reference
- Command line: [all commands](https://una-lang.org/en/docs/cli/), [`una check`](https://una-lang.org/en/docs/cli/check/), [`una fmt`](https://una-lang.org/en/docs/cli/fmt/), [`una fix`](https://una-lang.org/en/docs/cli/fix/), [`una explain`](https://una-lang.org/en/docs/cli/explain/), [`una obligations`](https://una-lang.org/en/docs/cli/obligations/), [`una contract`](https://una-lang.org/en/docs/cli/contract/), [`una trace`](https://una-lang.org/en/docs/cli/trace/), [`una report`](https://una-lang.org/en/docs/cli/report/), [`una run`](https://una-lang.org/en/docs/cli/run/), [`una test`](https://una-lang.org/en/docs/cli/test/), [`una build`](https://una-lang.org/en/docs/cli/build/), [`una lsp`](https://una-lang.org/en/docs/cli/lsp/)
- For agents: [Una for agents](https://una-lang.org/en/docs/agents/), [JSON output and diagnostics](https://una-lang.org/en/docs/agents/json/), [repairs](https://una-lang.org/en/docs/agents/repairs/), [the build report](https://una-lang.org/en/docs/agents/build-report/)
- Construct pages: [`ensures`](https://una-lang.org/en/docs/language/functions/ensures/), [`requires`](https://una-lang.org/en/docs/language/functions/requires/), [`requirement` and `derived from`](https://una-lang.org/en/docs/language/requirements/requirement/), [`where` and refinements](https://una-lang.org/en/docs/language/types/where/), [`example`](https://una-lang.org/en/docs/language/examples/example/)
- Diagnostics: [U0001](https://una-lang.org/en/docs/errors/U0001/), [U0101](https://una-lang.org/en/docs/errors/U0101/), [U1001](https://una-lang.org/en/docs/errors/U1001/), [U1006](https://una-lang.org/en/docs/errors/U1006/), [U2004](https://una-lang.org/en/docs/errors/U2004/), [U3001](https://una-lang.org/en/docs/errors/U3001/), [U5001](https://una-lang.org/en/docs/errors/U5001/), [U7001](https://una-lang.org/en/docs/errors/U7001/), and [all codes](https://una-lang.org/en/docs/errors/)
- Specification: [diagnostics, agent ABI and project files](https://una-lang.org/en/docs/spec/13-diagnostics-and-abi/), [verification](https://una-lang.org/en/docs/spec/12-verification/), [canonical form](https://una-lang.org/en/docs/spec/15-canonical-form/), [native backend](https://una-lang.org/en/docs/spec/16-native-backend/)
:::
