Files
buzz/desktop/src-tauri/src
Jemiah Westerman 11970789eb feat(cli)!: consistent channels list/get/search output (type, visibility, labels, real created_at) (#9617)
Closes #6390

## Summary

`buzz channels list`, `get` and `search` each projected kind:39000
channel metadata differently. `list`/`get` dropped the classification
tags, so a script couldn't tell a Solo chat from a stream or a private
channel from an open one. The three commands also disagreed on field
names, defaults and empty values, and `created_at` reported the
last-edit time (#6390).

All three now print one `ChannelSummary`, with `pubkey` added on `get`:

| Field | Source |
|---|---|
| `channel_id`, `name` | `d`, `name` tags |
| `channel_type` | first `t` tag (`stream`, `forum`, `dm`, `workflow`,
`system`) |
| `visibility` | `open` for `["public"]`, `private` for `["private"]` |
| `labels` | the `t` tags after the first, e.g. `["buzz.solo"]` |
| `archived` | `["archived","true"]` |
| `description` | NIP-29 `about` tag |
| `topic`, `purpose`, `ttl_seconds` | `topic`, `purpose`, `ttl` tags |
| `created_at` | the channel's `created_at` tag (NIP-CL), or `null` when
absent |
| `updated_at` | the event's own `created_at`, which is the last
metadata change |

Compact `list` output (`{channel_id, name}`) is unchanged.

### Breaking output changes

These are intentional, and they were discussed with a maintainer before
this change:

- **`search`:** `about` is renamed `description`, matching `list`/`get`
and `create`/`update --description`.
- **`list`/`get`/`search`:** `created_at` is now the real creation time.
The old value, the last-edit time, moves to the new `updated_at`.
- **`list`:** archived channels are hidden by default, as `search`
already did. The new `--include-archived` flag shows them. `get
--channel <id>` still returns an archived channel. `--limit` (and
`--visibility`) count the channels printed: `list` reads past filtered
channels, bounded by `MAX_QUERY_PAGES` on the default path and by 10,000
memberships with `--member`.
- **Missing values:** they print `null` instead of `""`. This mainly
affects `description`.
- **`visibility`:** it prints `open`/`private`, the values
`--visibility` takes, instead of the raw `public` tag. `search` printed
`public` before.

No in-repo consumer reads the renamed fields or the `public` value. The
benchmarks read `search`'s `channel_type`, `visibility == "private"`,
`archived` and `ttl_seconds`, all of which are unchanged.

### Related

- Closes #6390.
- Overlaps with #5664 and draft #6353, which add type and visibility to
`list`/`get`. This PR covers both: it uses `open` like #6353, plus
labels, archived, parity and the `created_at` fix. A maintainer may want
to close them as superseded. Unlike #6353, it doesn't error on missing
or contradictory visibility tags, so one malformed channel can't fail a
whole `list`.

### Testing

- `cargo test -p buzz-cli`: 699 passed. Clippy is clean. The tests build
events from the captured `test-fixtures/solo-creation.json` identity
tags and pin the full JSON shape, including the all-`null` case. They
also cover the production `listed_channels` and `search_matches`
filters: archived hiding, `--visibility`, and search's name and ID
requirement and ordering.
- An agent ran the changed commands against a live relay:
- `get` and `search --exact` return identical fields for the same
channel.
- Over 2,000 channels, `list` hides 162 archived channels unless
`--include-archived` is passed.
  - `--visibility open` returns only `open` channels.
  - 1,777 channels have `created_at < updated_at`.
  - No `description` is `""`.
  - Compact output is unchanged.
- `list --limit 10` and `--member --limit 5` return exactly 10 and 5
non-archived channels, and `--limit 2000` returns 2,000 with none
archived.
- An independent agent review found no blockers. Its one cheap nit,
`get` printing `pubkey: ""`, now prints `null`.
- The pre-push workspace `rust-tests` lane was skipped for this push.
When the push was made, `origin/main` didn't compile `buzz-db`'s lib
tests, which is unrelated to this `crates/buzz-cli`-only diff. That
breakage has since been fixed on main, so CI runs the full workspace.


buzz-review-completed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Jemiah Westerman <jemiah@squareup.com>
Co-authored-by: Son of Anton <8e0ef2ab02d69a7ac089ef5eca90d1a3fbbdc546f6322dc34d0c4f3deecea7f4@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 09:41:04 -08:00
..
…