feat(session): filter comment list by author#500
Open
abgregs wants to merge 1 commit into
Open
Conversation
- Add `--author <name>` and `--no-author` flags to `hunk session comment list` - Thread the author filters through CLI parsing, types, and session protocol - Apply filtering in the broker for both live and stored comment paths - Cover parsing and broker filtering with unit tests and update agent docs Fixes modem-dev#489
Contributor
|
PR author is not in the allowed authors list. |
Member
|
Don't love --no-author meaning "human notes", but I guess we can go with it. Wish there was better / clearer language ... I feel agents would perform better. |
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.
What
Adds
--author <name>and--no-authorfilters tohunk session comment list, letting the CLI narrow inline review comments by author — mirroring the existing--fileand--typefilters.Why
In an agent-assisted review, an agent and a human both leave notes on the same session, so
hunk session comment list --jsonreturns a mixed set. Today the only way to isolate one author's notes is to pipe the JSON throughjq(jq '[.comments[] | select(.author=="pi")]'), which pushes a conceptually one-flag filter into every consumer. A native--author <name>flag — plus a--no-authorcompanion for untagged notes — keeps--jsonconsumers thin and matches the ergonomics of--file/--type.How it works
The filter threads through the same layers as
--type, with the actual filtering in a single place (the daemon list handler):core/cli.ts—--author <name>/--no-authoroptions, parsed and forwarded into the command inputcore/types.ts,session/protocol.ts—author/noAuthoron the command input and wire shapeshunk-session/cli.ts— the client includes them in the requestsession-broker/brokerServer.ts— one post-branch filter narrows the result by author, covering both the live-comment and review-note paths (both carryauthor)--author <name>matches that author exactly;--no-authorreturns only comments with no author tag — comments added viacomment add/applywithout an author. (Humancnotes are auto-taggedauthor: "user", so they're matched by--author user.) Neither flag returns everything. Documented indocs/agent-workflows.md.Testing
core/cli.test.ts):--author pi→{ author: "pi" };--no-author→{ noAuthor: true }.brokerServer.helpers.test.ts): for a mixed-author comment set,--authorreturns only the matching author,--no-authorreturns only the author-less, and no flag returns all.bun run typecheck,bun run lint, andbun run format:checkclean.Screenshots
End-to-end via
hunkdevon this branch — drag each PNG into the GitHub editor to upload it in place:1. Add one
--author picomment and one untagged comment2.
hunk session comment list --author pi→ only pi's3.
hunk session comment list --no-author→ only the untagged one4.
hunk session comment list(no filter) → bothFixes #489