upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-25 14:37:16 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-25 14:37:16 +0000
commit9573bb1b5feaa82dad67f9817ec1e9df9639acdb (patch)
treec72fd122465182e6657f08f6b5a9a9c2d2f50bed
parent98f9cbf256151cf576f2b307d5fe4d8f4b35bf43 (diff)
update README to document probe subcommand with checks, flags, and timeout behaviour
-rw-r--r--grasp-audit/README.md58
1 files changed, 48 insertions, 10 deletions
diff --git a/grasp-audit/README.md b/grasp-audit/README.md
index 54e1e93..323451c 100644
--- a/grasp-audit/README.md
+++ b/grasp-audit/README.md
@@ -12,28 +12,66 @@ A reusable audit and compliance testing tool for GRASP protocol implementations.
12 12
13## Quick Start 13## Quick Start
14 14
15Run GRASP compliance tests against any GRASP relay:
16
17```bash 15```bash
18# Install 16# Install
19cd grasp-audit 17cd grasp-audit
20cargo install --path . 18cargo install --path .
21 19
22# Audit a production relay 20# Probe a relay (read-only health check — no keys needed)
23grasp-audit audit --relay wss://relay.ngit.dev 21grasp-audit probe --relay wss://relay.ngit.dev
24 22
25# Or audit a local development relay 23# Full compliance audit
26grasp-audit audit --relay ws://localhost:7334 24grasp-audit audit --relay wss://relay.ngit.dev
27``` 25```
28 26
29## Usage Examples 27## Usage Examples
30 28
31### As a CLI Tool 29### Probe (Health Check)
30
31A fast, lightweight smoke test that checks whether a relay is healthy. Read-only by default — no keys or write access required.
32 32
33```bash 33```bash
34# Install 34# Basic health check
35cargo install --path . 35grasp-audit probe --relay wss://relay.ngit.dev
36
37# Machine-readable JSON (one line per run — pipe-friendly)
38grasp-audit probe --relay wss://relay.ngit.dev --json
39
40# Continuous monitoring (re-runs every 10 seconds)
41grasp-audit probe --relay wss://relay.ngit.dev --watch 10
42
43# Pipe JSON output to a log file
44grasp-audit probe --relay wss://relay.ngit.dev --json --watch 10 >> probe.log
36 45
46# Full write-path check: publish events, git push, verify refs match state
47# (requires write access; use --nsec for whitelisted relays)
48grasp-audit probe --relay wss://relay.ngit.dev --create-repo
49grasp-audit probe --relay wss://relay.ngit.dev --create-repo --nsec nsec1...
50```
51
52**Probe checks (read-only):**
53
54| Check | What it verifies |
55|---|---|
56| `connect_websocket` | WebSocket connection succeeds |
57| `nip11_fetch` | NIP-11 relay info document is served (shows software & version) |
58| `serves_latest_announcement` | At least one kind:30617 repo announcement is served |
59| `git_fetch_refs` | Git HTTP info/refs endpoint responds |
60| `git_refs_match_state` | Git refs match the latest kind:30618 state events |
61
62**Additional checks with `--create-repo`:**
63
64| Check | What it verifies |
65|---|---|
66| `publish_events` | Relay accepts kind:30617 and kind:30618 events |
67| `git_repo_initialised` | Relay initialises the git repo after events are published |
68| `git_push` | Git push succeeds |
69
70**Overall timeout:** The probe enforces an overall deadline of `min(20s, --watch interval)` to prevent overlapping runs. If the deadline fires, completed checks retain their real results; the step that couldn't start is marked failed with a diagnosis (single slow check vs. cumulative slowness); remaining checks are marked skipped.
71
72### Audit (Compliance Tests)
73
74```bash
37# Audit a production GRASP relay (shared fixtures - default) 75# Audit a production GRASP relay (shared fixtures - default)
38grasp-audit audit --relay wss://relay.ngit.dev 76grasp-audit audit --relay wss://relay.ngit.dev
39 77
@@ -44,7 +82,7 @@ grasp-audit audit --relay ws://localhost:7334 --spec nip01-smoke
44grasp-audit audit --relay ws://localhost:7334 --mode isolated --spec push-auth 82grasp-audit audit --relay ws://localhost:7334 --mode isolated --spec push-auth
45``` 83```
46 84
47### As a Library 85### As a Library (Audit)
48 86
49```rust 87```rust
50use grasp_audit::*; 88use grasp_audit::*;