feat(cli): --author and --since filters on buzz messages search#1665
Open
tlongwell-block wants to merge 1 commit into
Open
feat(cli): --author and --since filters on buzz messages search#1665tlongwell-block wants to merge 1 commit into
tlongwell-block wants to merge 1 commit into
Conversation
Answers the buzz-feature-requests ask: query all messages by a specific user across channels without an N-channel sweep. `--author` accepts a 64-char hex pubkey, an npub, or a display name (resolved via NIP-50 kind:0 search; exact case-insensitive match, ambiguity is an error listing candidates). `--query` becomes optional — at least one of --query/--author is required. `--since` passes through to the relay filter on both paths. No relay changes: the HTTP bridge FTS path already pushes the standard nostr `authors` filter field into buzz-search, and author-only queries land on the general query path which honors `authors` via the EventQuery IN-list pushdown and post-filters channel access. Author-only results are sorted newest-first client-side (the FTS path returns relevance order; a pure author/time query has none). Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the buzz-feature-requests ask (Aaron): query all messages by a specific user across channels without an N-channel sweep.
What
buzz messages searchgains two flags:--author <pubkey|npub|display-name>— filter by author. Hex and npub are used directly; a display name is resolved via NIP-50 kind:0 search with an exact case-insensitive match ondisplay_name/name. Zero matches or ambiguity (e.g. 100 users named "Fizz") is a clear usage error rather than a silent wrong-author query.--since <unix-ts>— passes through to the relay filter.--querybecomes optional; at least one of--query/--authoris required. All flags combine.No relay changes
Both relay paths already honor the standard nostr
authorsfilter field:--author+--query→ HTTP bridge FTS path (handle_bridge_search) pushesauthorsintobuzz_search::SearchQuery(bridge.rs).--authoralone → general query path (build_event_query_from_filter) uses theauthorsIN-list pushdown inbuzz-dband post-filters channel access as usual.Author-only results are sorted newest-first client-side (the FTS path returns relevance order; a pure author/time query has none).
Verification
cargo test -p buzz-cli— 139 pass, incl. 4 new unit tests pinning the name-resolution semantics (exact-not-substring, case-insensitive, ambiguity, dedup of duplicate kind:0 rows, malformed content).cargo fmtapplied.--sincewindow bounds respected, and error paths (no flags, unknown name, ambiguous name with capped candidate listing, invalid npub) all verified.The nice-to-haves from the request (
--channelscope,--mentions) are deliberately left out per the "minimal ask" framing — both relay paths already support them if wanted later.