Repository navigation
Commit b76de25
authored
repo-ops: review-reply-postcondition, an opt-in PostToolUse hook (#84)
* repo-ops: review-reply-postcondition, an opt-in PostToolUse hook
A review reply that claims a fix must name a commit reachable from HEAD (or its
upstream). Gated on review.replyNamesCommit (default false). Adds
lib/gh-exec-words.sh beside the existing scanner without touching it.
Claude-Session: https://claude.ai/code/session_01T7j4GUt15DJp7G9UK4tMNE
* repo-ops: review-reply-postcondition — runtime bodies, long bodies, subdir config
Review round 1 on #84:
- a body whose SHA is a shell expansion ($VAR, ${VAR}, $(cmd), backtick) is
no longer judged, matching the documented limit (address-review posts
"Fixed in $NEW_HEAD")
- gh_exec_words no longer truncates the segment at 2048 chars, so a SHA late
in a long body is still seen
- the opt-in key is read from the checkout's top level when the cwd is a
subdirectory
- SHA candidates are split on non-alphanumerics, so adjacent tokens are each
checked
- the diff context bases on the fork point from origin/HEAD, upstream, or
origin/main|master, and notes when it falls back to HEAD~1
Claude-Session: https://claude.ai/code/session_01T7j4GUt15DJp7G9UK4tMNE
* repo-ops: review-reply-postcondition — runtime check honors shell quoting
Review round 2 on #84: '$NEW_HEAD' in single quotes, an escaped \$, a quoted-
delimiter heredoc, or a --body-file holding "$VAR" all post literal text, so
they are judged rather than skipped. word_is_runtime walks the raw word with
single/double-quote and backslash state, and treats a $(cat <<TAG …) heredoc
as runtime only when TAG is unquoted and its body expands.
Claude-Session: https://claude.ai/code/session_01T7j4GUt15DJp7G9UK4tMNE
* repo-ops: review-reply-postcondition — heredoc bodies walked, not grepped
Review round 3 on #84: in an unquoted-delimiter heredoc a backslash escapes
only the next character, so `\\$X` still expands; and `$@`/`$*`/`$#` expand
too. heredoc_expands walks the body with that rule instead of a regex.
Claude-Session: https://claude.ai/code/session_01T7j4GUt15DJp7G9UK4tMNE
* repo-ops: review-reply-postcondition — name merge-guard in the hook-tests CI step after rebase
Claude-Session: https://claude.ai/code/session_01T7j4GUt15DJp7G9UK4tMNE
* repo-ops: review-reply-postcondition reads only the reply's own body, in the checkout it posts from
- --body-file - reads the segment's own heredoc or here-string, not the whole command, so a
later git show <sha> no longer satisfies the check; stdin from a pipe is runtime.
- gh api -F/--field body=@file reads the file, as gh does; @- reads stdin; an unreadable
file is not judged.
- cd/pushd earlier in the command moves the directory whose opt-in and commits are checked;
a runtime cd target makes later replies unjudged.
- The feedback says a reply that never posted (short-circuited &&) needs no correction.
Claude-Session: https://claude.ai/code/session_01T7j4GUt15DJp7G9UK4tMNE
* repo-ops: review-reply-postcondition tracks pushd/popd and whole-line heredoc terminators
- The opted-out fast path no longer skips a command that only uses pushd/popd.
- pushd/popd keep a stack, so popd returns to the directory the reply is really posted from.
- A stdin heredoc ends at a line that is exactly the tag (leading tabs stripped for <<-); a
body line that merely starts with the tag stays body; no terminator means not judged.
Claude-Session: https://claude.ai/code/session_01T7j4GUt15DJp7G9UK4tMNE
* repo-ops: review-reply-postcondition — pushd by verb, unterminated heredocs judged
- The directory stack pushes only when the resolved verb is pushd, not when the segment merely
contains the substring (cd work/pushd).
- An unterminated stdin heredoc still sends its lines, so its body is judged, not skipped.
Claude-Session: https://claude.ai/code/session_01T7j4GUt15DJp7G9UK4tMNE1 parent 31beb28 commit b76de25
16 files changed
Lines changed: 942 additions & 10 deletions
File tree
- .github/workflows
- plugins
- audits/references
- auto-dev/references
- core/references
- deps-flow/references
- journal/references
- repo-ops
- .claude-plugin
- hooks
- scripts
- lib
- references
- research/references
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
461 | 474 | | |
462 | 475 | | |
463 | 476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
461 | 474 | | |
462 | 475 | | |
463 | 476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
232 | 235 | | |
233 | 236 | | |
234 | 237 | | |
| |||
453 | 456 | | |
454 | 457 | | |
455 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
456 | 469 | | |
457 | 470 | | |
458 | 471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
461 | 474 | | |
462 | 475 | | |
463 | 476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
461 | 474 | | |
462 | 475 | | |
463 | 476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments