buzz icon indicating copy to clipboard operation
buzz copied to clipboard

NIP-34 statuses are settable but not readable from the CLI

Open hccbuddy-svg opened this issue 4 months ago • 2 comments

buzz patches status, buzz pr status, and buzz issues status can SET kind:1630-1633 status events, but nothing in the CLI reads them back: list returns only the root events, and get --event returns the single event with no status envelope.

Any tool that wants to render current status — review dashboards, bots that post git activity into channels (our use case: a renderer bot that posts patch/PR/issue cards), CI-style overviews — has to speak raw relay filters to answer "is this patch merged?".

Proposal: either a --with-status flag on list/get that resolves the latest kind:1630-1633 event per root (respecting NIP-34's rule that the latest status from the repo owner or root author wins), or a status get twin to the existing status setter. The first feels more ergonomic; the second is more primitive-shaped. Either unblocks status rendering without every consumer reimplementing the resolution rule.

🤖 Generated with Claude Code

hccbuddy-svg avatar Aug 01 '26 12:08 hccbuddy-svg

Went with the second shape — a status get twin to the existing setters — since it keeps the read primitive-shaped and mirrors the setter's --repo-owner eligibility hint 1:1. PR #4116 adds patches status-get / pr status-get / issues status-get, all backed by a single client-side resolver implementing the NIP-34 winner rule (latest created_at from root author or repo owner; tie → lexicographic id) over one paginated /query and printing a JSON envelope ({root, state, implicit, kind, author, created_at, event}) with the full winning event included so merge-commit / q-ref / revision consumers don't need a second request. implicit: true distinguishes "no status ever set" from "an explicit kind:1630 open exists", matching the setter's open/closed/draft vocabulary and the default state the protocol bakes in.

Eight resolver unit tests cover the rule itself, tie-breaking, outsider events, eligibility with and without the owner hint, malformed rows, and the implicit-open case.

iroiro147 avatar Aug 01 '26 13:08 iroiro147

Ran into this building an external consumer (GitHub ↔ Buzz issue bridge): buzz issues list returns the raw kind-1621 events with no resolved state, and with statuses unreadable from the CLI the only way to know an issue's current state was querying the relay's Postgres directly for kinds 1630-1633 and taking the latest per e-tag root — fine for a self-hosted relay, unavailable to anyone else.

Two small additions would cover the consumer story: (1) issues list resolving and including current state per issue (latest status event, defaulting open), and (2) while touching the surface — issues get takes --event where issues status takes --issue for the same identifier; aligning them would help scripted callers. Can PR if maintainers agree.

jdrolls avatar Aug 02 '26 15:08 jdrolls