Commit 31f10c9
committed
fix(toolkit): address dojo-code-reviewer feedback on PR #44 (DOJ-4872)
Bot review at 3/5 confidence flagged 2 P2 + 2 P3. All four addressed:
P2 — commands/verify.md ref normalization
- The behavior section assumed every <ref> arg was a bare branch name
and unconditionally prefixed `origin/`, breaking `origin/develop`
(→ `origin/origin/develop`), tags (`v1.31.0` → `origin/v1.31.0`),
and SHAs. Added a normalization step at the top of the pipeline:
* `refs/tags/<tag>` for tag inputs (fetched via `git fetch origin
tag <tag> --quiet`)
* bare SHA for already-local commits (skips fetch entirely;
commits are immutable)
* `origin/<branch>` left as-is when user passes `origin/...`
* `origin/<branch>` only synthesized for bare branch input
- Dropped the `-C "$REPO"` indirection — the slash command's cwd is
the repo root, no need for the hardcoded variable that would fail
when unset.
- Updated the verdict-line shape to `<resolved-ref> @ <sha7>` so the
citation reflects whatever normalization produced (tag refs, SHAs,
branch refs all render correctly). Added tag + SHA examples.
- Expanded the Edge cases section: `origin/<branch>` input, tag input,
commit SHA input, ref not found.
P2 — hooks/pre-tool-use-claim-verification.sh line 116
- The bare-FS detector regex `(ls|find|cat|head)[[:space:]]` failed
to match the command-as-last-token cases like a bare `ls` invocation
or `cd src && ls` (no trailing whitespace). Switched the trailing
class to `([[:space:]]|$)` so end-of-string also matches.
P3 — hooks/pre-tool-use-claim-verification.sh line 162
- Same fix in the suggester branch for `ls`: `ls[[:space:]]` →
`ls([[:space:]]|$)` so the ls-specific replacement text is emitted
even when the command ends in `ls`.
P3 — hooks/pre-tool-use-claim-verification.sh line 181
- Same fix in the suggester branch for `find`: `find[[:space:]]` →
`find([[:space:]]|$)`.
Verification:
- shellcheck hooks/pre-tool-use-claim-verification.sh → 0 issues
- bash hooks/pre-tool-use-claim-verification.sh "ls" → warn (new)
- bash hooks/pre-tool-use-claim-verification.sh "cd src && ls" → warn (new)
- bash hooks/pre-tool-use-claim-verification.sh "ls src/foo" → warn (regression)
- bash hooks/pre-tool-use-claim-verification.sh "echo hello" → silent (regression)
- bash hooks/pre-tool-use-claim-verification.sh "find" → warn (new)
Created by Claude Code on behalf of @lapc506.1 parent 0e2af72 commit 31f10c9
2 files changed
Lines changed: 73 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
39 | 73 | | |
40 | 74 | | |
41 | 75 | | |
42 | | - | |
43 | | - | |
| 76 | + | |
| 77 | + | |
44 | 78 | | |
45 | 79 | | |
46 | | - | |
| 80 | + | |
47 | 81 | | |
48 | 82 | | |
49 | | - | |
| 83 | + | |
50 | 84 | | |
51 | 85 | | |
52 | | - | |
| 86 | + | |
53 | 87 | | |
54 | 88 | | |
55 | | - | |
| 89 | + | |
56 | 90 | | |
57 | 91 | | |
58 | | - | |
| 92 | + | |
59 | 93 | | |
60 | 94 | | |
61 | 95 | | |
62 | 96 | | |
63 | 97 | | |
64 | | - | |
| 98 | + | |
65 | 99 | | |
66 | | - | |
| 100 | + | |
67 | 101 | | |
68 | 102 | | |
69 | 103 | | |
70 | 104 | | |
71 | 105 | | |
72 | | - | |
| 106 | + | |
73 | 107 | | |
74 | | - | |
| 108 | + | |
75 | 109 | | |
76 | 110 | | |
77 | | - | |
| 111 | + | |
78 | 112 | | |
79 | 113 | | |
80 | 114 | | |
81 | | - | |
| 115 | + | |
82 | 116 | | |
83 | 117 | | |
84 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
85 | 122 | | |
86 | 123 | | |
87 | 124 | | |
88 | 125 | | |
89 | 126 | | |
| 127 | + | |
| 128 | + | |
90 | 129 | | |
91 | 130 | | |
92 | | - | |
| 131 | + | |
93 | 132 | | |
94 | 133 | | |
95 | 134 | | |
96 | 135 | | |
97 | 136 | | |
98 | | - | |
99 | | - | |
100 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
101 | 150 | | |
102 | 151 | | |
103 | 152 | | |
104 | | - | |
| 153 | + | |
105 | 154 | | |
106 | 155 | | |
107 | 156 | | |
108 | 157 | | |
109 | | - | |
| 158 | + | |
110 | 159 | | |
111 | 160 | | |
112 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
0 commit comments