Skip to content

feat(buzz-cli): add 'patches status-list' to read NIP-34 status events - #3255

Draft
RMSTrucks wants to merge 1 commit into
block:mainfrom
RMSTrucks:feat/patches-status-list
Draft

feat(buzz-cli): add 'patches status-list' to read NIP-34 status events#3255
RMSTrucks wants to merge 1 commit into
block:mainfrom
RMSTrucks:feat/patches-status-list

Conversation

@RMSTrucks

Copy link
Copy Markdown

Problem

buzz patches can write status events (patches status) but has no way to read them. patches list returns only kind:1617 patches; patches get fetches a patch by id. So patch/PR status (kind:1630–1633: open/merged/closed/draft) is write-only from the CLI — an agent or auditor can set a patch to merged but cannot query whether anything was ever merged/closed, or by whom. That makes agent sign-off/review flows impossible to verify from the CLI: the sign-off is a signed event on the relay, but nothing in the CLI surface reads it back.

Change

Add buzz patches status-list --repo-owner <hex> --repo-id <id> [--patch <root-id>] [--limit N]. It mirrors cmd_list_patches, selecting the status kinds instead of the patch kind:

  • filter {"kinds":[1630,1631,1632,1633],"#a":["30617:<owner>:<repo>"]}
  • optional --patch <root-id> narrows to status events referencing a specific patch root (#e)
  • reuses the existing client.query() path (NIP-98 auth, pagination, retries) — no new I/O

Three parts: a StatusList variant in PatchesCmd (lib.rs), cmd_list_status (commands/patches.rs), and one dispatch arm. The subcommand-inventory guard tests are updated for the new command.

Testing

  • cargo fmt + cargo clippy -p buzz-cli clean
  • cargo test -p buzz-cli passes (250 tests)
  • Manually verified against a live relay: patches status-list returns the kind:1631 merged-status events for a repo, matching sign-offs written by patches status.

Notes

Surfaced while dogfooding Buzz's agent sign-off flow (drafted with Claude Code): an agent-proposed patch was signed off, and nothing in the CLI could read the sign-off back. Happy to adjust the name (status-list vs folding into list --status) or add tests to whatever you'd prefer.

`buzz patches` could write status events (`patches status`) but not read them:
`patches list` returns only kind:1617 and `patches get` fetches a patch by id.
Patch/PR status (kind:1630-1633: open/merged/closed/draft) was therefore
write-only from the CLI, so agent sign-off/review state could be set but never
queried or audited.

Add `patches status-list --repo-owner <hex> --repo-id <id> [--patch <root>]
[--limit N]`, mirroring cmd_list_patches but selecting the status kinds and
reusing the existing client.query() path (NIP-98 auth, pagination, retries).
Update the subcommand-inventory guard tests for the new command.

Signed-off-by: Jake Deaton <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant