# backupcheck — Changelog

## v1.0.0 — 2026-06-25

Initial release. Ninth tool in the "productivity-boost" series.

### Purpose

DORA Art. 12 says backups must be *tested*: not just taken, but
restored to prove the restore path works. backupcheck automates the
restore test — extract the archive, optionally run an operator-supplied
validator script, log the verdict, emit jfind. Pair with `notify` and
a systemd timer for a self-running compliance signal.

### Subcommands

```
backupcheck test     <archive> [--validator '<sh>'] [--label <T>] [--keep]
backupcheck verify   <archive> [--label <T>]
backupcheck list     [--limit N]
backupcheck report   [--since <ISO>] [-F human|json|jfind]
backupcheck schedule <archive> [--cadence daily|weekly|…]
```

### Archive formats

- `tar`, `tar.gz` / `tgz`, `zip`. Anything else → exit 3.
- Refuses entries with `..` / absolute paths (zip-slip / tar-slip).

### Validator

`--validator '<sh>'` runs `sh -c <cmd>` with `$BACKUPCHECK_DIR` set to
the extract directory. Exit 0 → `pass`, anything else → `fail`. With
no validator the verdict is `skipped` (extract OK, but compliance value
is partial).

### Audit log

Append-only JSONL at `$XDG_DATA_HOME/cli-johlem/backupcheck/runs.jsonl`.
`$BACKUPCHECK_DIR` overrides the root.

### jfind/v1 output

| Verdict | Category | Severity |
|---|---|---|
| `pass`    | `asset-inventory` | Info |
| `skipped` | `asset-inventory` | Low |
| `fail`    | `ict-incident`    | High |

Controls: DORA Art. 12 + NIS2 Art. 21(2)(c) + ISO/IEC 27001:2022 A.8.13.

### Exit codes

```
0  ok (verdict pass or skipped)
2  usage
3  runtime (io, extract failure, unknown archive)
4  verdict fail
```

### Build

- Library crate + thin CLI binary.
- 2 unit + 12 integration tests = 14 tests, all green.
- Zero compiler warnings.
- Archives via `tar`, `flate2`, `zip`.

### Suite interop

| Producer | Consumer | Use case |
|---|---|---|
| operator   | backupcheck | run a restore test |
| backupcheck | notify     | dispatch fail to Slack |
| backupcheck | dossier    | append run history to incident report |
| backupcheck | complymap  | DORA Art. 12 evidence |

### Deferred to v1.1

- Object-store source (S3 / R2 / GCS) — today: local files only.
- GPG-encrypted archive support.
- Per-file SHA-256 manifest comparison against a baseline.
- Built-in systemd-timer install (today: schedule prints a template).
