-
Notifications
You must be signed in to change notification settings - Fork 3
fude-watch の echo 対策: author_type の全イベント付与と機械的フィルタの導入 #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5db738b
feat: add author_type to all local review action events
shusann01116 c13b7b0
feat: add mechanical event filter and reply helper to fude-watch skill
shusann01116 cd07f4c
test: verify author_type passthrough for all local store event builders
shusann01116 dd6b5a0
fix: remove racy post-append verification from fude-watch-reply.sh
shusann01116 b7877cd
docs: PR #169 のレビュー知見を review-lessons.md に記録
shusann01116 67a4a3a
fix: parse events structurally in fude-watch-filter.sh instead of str…
shusann01116 6afe372
fix: fail loudly instead of silently on missing uuidgen or jq
shusann01116 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/bin/bash | ||
| # fude-watch: pass through only actionable, human-authored review events. | ||
| # Reads JSONL lines on stdin (from tail -f) and prints only lines the watch | ||
| # session should react to: comment / reply / resolve / reopen written by a | ||
| # human. Agent-authored lines (author_type "agent") and non-actionable kinds | ||
| # (viewed / move / edit / delete / session) are dropped. | ||
| # | ||
| # Fields are extracted with jq rather than string-matched, so formatting | ||
| # (spaces) and free-text fields (e.g. a comment body that happens to contain | ||
| # the literal text `"event":"comment"`) can't cause a false match. | ||
| command -v jq >/dev/null 2>&1 || { | ||
| echo 'fude-watch-filter: jq is required but not found in PATH' >&2 | ||
| exit 1 | ||
| } | ||
|
|
||
| while IFS= read -r line; do | ||
| event=$(printf '%s' "$line" | jq -r '.event // empty' 2>/dev/null) || continue | ||
| author_type=$(printf '%s' "$line" | jq -r '.author_type // empty' 2>/dev/null) | ||
|
|
||
| if [ "$author_type" = "agent" ]; then | ||
| continue | ||
| fi | ||
|
|
||
| case $event in | ||
| comment | reply | resolve | reopen) | ||
| printf '%s\n' "$line" ;; | ||
| esac | ||
| done |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/bin/bash | ||
| # fude-watch: append an agent reply event to a local review JSONL. | ||
| # | ||
| # Usage: fude-watch-reply.sh <review-file> <root-comment-id> <body-file> | ||
| # | ||
| # The body is passed as a file to avoid shell quoting issues. The event is | ||
| # serialized with jq -c, which guarantees a single compact (no-space) line — | ||
| # the format fude.nvim's line-based parser and fude-watch-filter.sh both | ||
| # rely on. On success the appended line is printed to stdout. | ||
| set -euo pipefail | ||
|
|
||
| review_file=$1 | ||
| thread_id=$2 | ||
| body_file=$3 | ||
|
|
||
| id=$(uuidgen | tr 'A-Z' 'a-z') | ||
| created_at=$(date -u +%Y-%m-%dT%H:%M:%SZ) | ||
|
|
||
| line=$(jq -cn \ | ||
| --arg id "$id" \ | ||
| --arg thread "$thread_id" \ | ||
| --rawfile body "$body_file" \ | ||
| --arg ts "$created_at" \ | ||
| '{event:"reply",id:$id,thread_id:$thread,in_reply_to:$thread,body:($body|sub("\n+$";"")),author:"claude",author_type:"agent",created_at:$ts}') | ||
|
|
||
| printf '%s\n' "$line" >> "$review_file" | ||
|
|
||
| printf '%s\n' "$line" | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.