File size: 2,099 Bytes
d086025
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# CLI reference

## `pwm` (demo CLI)

Run via:

```bash
cargo run -p pwm-testkit --bin pwm --release -- <command> [args] [--json]
```

Subcommands:

| Command | Description |
|---|---|
| `pwm demo` | The whole story: infer -> prove -> challenge -> accept -> tamper -> reject (the tiny compact model). |
| `pwm prove <file>` | Run the predictor, write the proof (AuditArtifact) to `<file>`. |
| `pwm verify <file>` | Decode a proof and verify it (accept or reject). |
| `pwm audit <file>` | The verifier's story: challenge + accept, then tamper -> reject. |
| `pwm tamper <in> <out>` | Forge one matmul output (the canonical Freivalds-caught lie). |
| `pwm prove-lewm <bundle.json>` | Prove the REAL le-wm `pred_proj` head from an export bundle. |
| `pwm prove-predictor [bundle]` | Prove the full 6-block 16-head predictor. With a bundle: real checkpoint weights. Without: the real V0 dims (192/16/64, depth 6) over synthetic weights. |

Global flag: `--json` for machine-readable output. Output respects `NO_COLOR`.

Exit codes: 0 on success (honest proof accepted, forged one rejected);
non-zero on failure or bad usage.

## `pwm-tui`

Run via:

```bash
cargo run -p pwm-tui --release -- [options]
```

Usage:

```text
pwm-tui                      # the full demo (downloads on first run, cached after)
pwm-tui --cache-dir <path>   # override the cache location
pwm-tui --offline            # cache only, never touch the network
pwm-tui --refresh            # ignore cached assets and re-download
pwm-tui --re-export          # force stage 1 even on a bundle cache hit
pwm-tui --headless [--json]  # no TUI: plain progress lines (+ JSON summary)
pwm-tui cache path|ls|clear  # cache management
```

Notes:

- Cache precedence: `--cache-dir` > `PWM_CACHE_DIR` env > the platform default.
- `cache clear` deletes `checkpoints/`, `datasets/`, and `bundles/` under the
  cache root only; confirm with `--yes`.
- Falls back to headless mode automatically when stdout is not a terminal (CI).
- Exit code 0 means the honest proof was ACCEPTED and the forged one REJECTED.
- `-h` / `--help` prints usage.