Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions crates/buzz-cli/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,9 @@ buzz notes get --name dco-check # exits non-zero: not found
buzz notes rm --name does-not-exist # exits non-zero
```

### 6.13 Personas (NIP-AP, kind:30175)
### 6.13 Personas & Teams (NIP-AP, kind:30175 / kind:30176)

Owner-authored agent definitions. These are the same coordinates
Owner-authored agent definitions and rosters. These are the same coordinates
Buzz Desktop reads, so run them with the **same key as the Desktop you expect
the definitions to appear in** — a different key writes to a different
coordinate space and Desktop shows nothing.
Expand Down Expand Up @@ -521,15 +521,25 @@ buzz personas list
buzz personas get herring
buzz personas get herring --json | jq . # sig-stripped array of one

# create a team; members resolve by d-tag OR persona display name
buzz teams create --name "Red team" --persona Herring --persona quinby | jq .
# → {event_id, accepted, message, team_id}
buzz teams create --from ~/Downloads/Red\ team.team.json --replace | jq .
buzz teams get red-team

# delete (NIP-09 a-tag tombstone; the CLI re-reads to confirm the coordinate
# is gone, because the relay accepts a tombstone that deleted nothing)
buzz teams delete red-team
buzz personas delete herring
buzz personas get herring # exits non-zero: not found
```

Checks worth making by hand:

```bash
# A member with no published persona is refused rather than seated empty
buzz teams create --name "Ghost team" --persona nobody-published; echo "exit: $?" # 1

# Desktop rejects invisible characters in definition text; so must the CLI
buzz personas create --display-name $'Review​er' --prompt x; echo "exit: $?" # 1

Expand All @@ -541,6 +551,15 @@ buzz personas create --display-name "Herring" --prompt x --shared --replace
buzz personas create --display-name "Herring" --prompt y --replace
buzz personas get herring | grep shared # → shared: true

# A team created from --name is addressed by its slug; the miss says so
buzz teams create --name "Red team" --persona herring
buzz teams get "Red team"; echo "exit: $?" # 1, error names 'red-team'
buzz teams get red-team # found

# A team past the relay's content cap fails locally, before members resolve
buzz teams create --name "Red team" --instructions "$(head -c 300000 /dev/zero | tr '\0' a)"
echo "exit: $?" # 1, "too large to publish"

# A non-image --avatar is refused locally rather than after a round trip
buzz personas create --display-name "Herring" --prompt x --avatar ./notes.txt; echo "exit: $?" # 1

Expand Down Expand Up @@ -578,10 +597,15 @@ buzz personas create --from /tmp/bad.agent.json; echo "exit: $?"
# Past the 5 MiB Desktop itself refuses to import
head -c 6000000 /dev/zero | tr '\0' a > /tmp/big.agent.json
buzz personas create --from /tmp/big.agent.json; echo "exit: $?" # 1, "snapshot limit"

# Same for a team snapshot, at Desktop's 25 MiB team limit
jq '.team.instructions = ["be terse"]' ~/Downloads/Red\ team.team.json > /tmp/bad.team.json
buzz teams create --from /tmp/bad.team.json; echo "exit: $?"
# → "not a valid v1 team snapshot", exit 1
```

Cross-check in Desktop: after `personas create`, the definition appears in the
agent picker.
agent picker; after `teams create`, the team appears with every member seated.

---

Expand Down Expand Up @@ -726,3 +750,6 @@ buzz channels delete --channel "$FORUM_ID" | jq .
| 63a | `personas create --avatar` | ☐ | Small image inlines with its metadata stripped; large flat art downscales back to inline; EXIF-bearing photo succeeds and lands upright; non-image → exit 1; `--avatar-url` conflict or non-http(s) URL → exit 1 |
| 64 | `personas list` / `get` | ☐ | `--json` is a sig-stripped array |
| 65 | `personas delete` | ☐ | Delete→get 404; warns when a published team still lists it |
| 66 | `teams create` | ☐ | Flags, `--from` snapshot, members by d-tag and by display name, unpublished member → exit 1 |
| 67 | `teams list` / `get` | ☐ | Members absent vs. empty render differently |
| 68 | `teams delete` | ☐ | Delete→get 404; verify in Desktop the team is gone |
5 changes: 5 additions & 0 deletions crates/buzz-cli/src/commands/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ pub const SNAPSHOT_VERSION: u64 = 1;
/// in Buzz Desktop's persona import.
pub const MAX_AGENT_SNAPSHOT_BYTES: usize = 5 * 1024 * 1024;

/// Largest team snapshot this CLI reads, mirroring `MAX_TEAM_SNAPSHOT_JSON_BYTES`
/// in Buzz Desktop's team import. Larger than the agent cap because a team
/// carries a snapshot per member.
pub const MAX_TEAM_SNAPSHOT_BYTES: usize = 25 * 1024 * 1024;

/// Load and parse a Buzz Desktop snapshot export (`.agent.json` /
/// `.team.json`), checking the `format` and `version` envelope before the caller
/// reads its payload. Refuses a file past `max_bytes`.
Expand Down
1 change: 1 addition & 0 deletions crates/buzz-cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mod projects;
pub mod reactions;
pub mod repos;
pub mod social;
pub mod teams;
pub mod upload;
pub mod users;
pub mod workflows;
Expand Down
Loading
Loading