diff --git a/.claude/skills/amy-expert/SKILL.md b/.claude/skills/amy-expert/SKILL.md index bf423a0250..1677296d17 100644 --- a/.claude/skills/amy-expert/SKILL.md +++ b/.claude/skills/amy-expert/SKILL.md @@ -104,9 +104,15 @@ Wire-up checklist: 4. Extend `printUsage()` in `Main.kt`. 5. Add the row to `cli/README.md`'s command table. 6. Update `cli/ROADMAP.md` โ€” move the row from ๐Ÿ†• / ๐Ÿ“ฆ to โœ…. +7. If the verb changes observable wire behaviour (a new event kind, + a new relay-routing rule, a new JSON discriminator), add a case + in the appropriate harness under `cli/tests/` โ€” `cli/tests/marmot/` + for MLS flows, `cli/tests/dm/` for NIP-17, or a new sibling suite + if it's neither. If you change output shape: note it in the commit message, bump the -example in `README.md`, update any interop fixtures. +example in `README.md`, update any interop fixtures under +`cli/tests/`. ## Where things live @@ -116,6 +122,11 @@ cli/ โ”œโ”€โ”€ DEVELOPMENT.md # touch-the-code: architecture, conventions, testing โ”œโ”€โ”€ ROADMAP.md # parity matrix + ordered milestones โ”œโ”€โ”€ plans/ # dated design docs (use for new subsystems) +โ”œโ”€โ”€ tests/ # end-to-end shell harnesses against a local relay +โ”‚ โ”œโ”€โ”€ lib.sh # shared logging + result tracking +โ”‚ โ”œโ”€โ”€ headless/ # shared amy wrappers + assertions +โ”‚ โ”œโ”€โ”€ marmot/ # MLS group-messaging interop (vs whitenoise-rs) +โ”‚ โ””โ”€โ”€ dm/ # NIP-17 DM interop (two amy clients) โ””โ”€โ”€ src/main/kotlin/โ€ฆ/cli/ โ”œโ”€โ”€ Main.kt # argv dispatch โ”œโ”€โ”€ Args.kt # flag parser diff --git a/cli/DEVELOPMENT.md b/cli/DEVELOPMENT.md index 2d5b990c2a..6b855761aa 100644 --- a/cli/DEVELOPMENT.md +++ b/cli/DEVELOPMENT.md @@ -197,8 +197,8 @@ Amy-specific layer still needs its own coverage: | Error / exit-code contract (bad args โ†’ 2, await timeout โ†’ 124, runtime โ†’ 1) | Table-driven tests invoking `main(argv)` with captured stdout/stderr. | | JSON output shape (each command's keys and types) | Snapshot tests: run a command against a throwaway data-dir, assert the JSON matches a golden file. | | File layout on disk (`identity.json`, `relays.json`, `groups/*.mls`, `keypackages.bundle`) | Structural assertions after a command sequence. | -| Round-trip between two data-dirs on a local relay | End-to-end shell scripts under `cli/src/test/resources/scripts/`. Spin up `nostr-rs-relay`, run Alice + Bob, assert await verbs resolve. | -| Interop with other clients | External harness consumes Amy as a binary; out of scope here but the JSON contract is what keeps it stable. | +| Round-trip between two data-dirs on a local relay | End-to-end shell harnesses under `cli/tests/`. Each harness spins up a local `nostr-rs-relay`, bootstraps two or more fresh identities in their own `--data-dir`s, and drives a scenario via `amy` (+ `wn` for Marmot interop against whitenoise-rs). Today there are two suites: `cli/tests/marmot/` (13 MLS scenarios vs whitenoise-rs) and `cli/tests/dm/` (NIP-17 DM round-trips between two `amy` clients). | +| Interop with other clients | Covered by `cli/tests/marmot/marmot-interop-headless.sh` (drives Amy against whitenoise-rs `wn`/`wnd`). Add new scenarios there or start a new sibling under `cli/tests/`. | **What not to test here:** event signing, filter assembly, MLS correctness, NIP-44 encryption. Those belong in `quartz`/`commons`. @@ -207,6 +207,11 @@ If an Amy bug can only be caught here, it's a contract violation **Interop-test script template:** +The canonical examples live under `cli/tests/` โ€” read +[`cli/tests/README.md`](./tests/README.md) for the layout, then +crib from `cli/tests/dm/tests-dm.sh` or `cli/tests/marmot/tests-create.sh`. +At the byte-banging level, a minimal round-trip looks like: + ```bash set -euo pipefail TMP=$(mktemp -d) diff --git a/cli/README.md b/cli/README.md index a1077f37e3..abc2141470 100644 --- a/cli/README.md +++ b/cli/README.md @@ -98,7 +98,10 @@ GID=$(amy --data-dir ./alice marmot group create --name "Test" | jq -r .group_id ``` For an interop-test script template, see -[DEVELOPMENT.md ยง Testing](./DEVELOPMENT.md#testing). +[DEVELOPMENT.md ยง Testing](./DEVELOPMENT.md#testing). The runnable +harnesses live under [`cli/tests/`](./tests/README.md) โ€” +`cli/tests/marmot/` for MLS group messaging vs whitenoise-rs, +`cli/tests/dm/` for NIP-17 DMs between two `amy` clients. ---