# Let the owner allow a repair

> Add an alive proof and a repair to a chart; the owner allows it once, sees each use in the journal, and takes it back with one command.

A chart can say how to tell that it still works, and what to try when it does not. The owner decides, repair by repair, which ones may run without asking.

## 1. Say how to tell it still works

An `alive` proof is read on a period. This one checks every hour that the morning brief ran in the last 26 hours, and names the repair to try.

```json [chart.json: proofs.alive]
{
  "id": "ran",
  "check": {
    "type": "automation",
    "key": "morning-brief",
    "ranWithinHours": 26
  },
  "every": "1h",
  "repair": ["rerun"]
}
```

## 2. Declare the repair

```json [chart.json: repairs]
{
  "id": "rerun",
  "kind": "automation.rerun",
  "args": { "key": "morning-brief" }
}
```

The kind comes from a [closed list](https://docs.altasystem.ai/charts/concepts/repairs#the-kinds); its arguments name only what the chart declares, never a value or a secret. `alta lint` checks both.

This kind, `automation.rerun`, is always asked: a run may cost a model call. A restart of a service the chart owns (`service.restart`), pulling a model (`model.pull`) and recovering the gateway (`gateway.recover`) may be allowed in advance.

## 3. What the owner sees

At install, the plan lists the chart's repairs, each with an unticked box when it may be allowed. Later, from a terminal:

```sh [Terminal]
alta repairs list
alta repairs grant alta-os restart-ollama
alta repairs log
alta repairs revoke alta-os restart-ollama
alta repairs pause
alta repairs resume
```

Each command goes through the machine's server, with its token in `WORLD_TOKEN`. A grant holds until it is revoked; a new version of the chart that changes the repair voids it.

## 4. What happens on the machine

The guard loop reads the proofs every 5 minutes. When one fails, it runs a granted repair only if the server was started with `--allow-repair`, then reads the proof again. Everything else is asked. Each decision is one line of the journal.

**Next:**

- [Repairs and grants](https://docs.altasystem.ai/charts/concepts/repairs)
- [alta repairs](https://docs.altasystem.ai/reference/cli/repairs)
