Repository navigation
Commit d2c2cd6
fix(hygiene): [#1052 bot-review round 2] address open bot findings
Round 1 fixed 10 of the 22 bot comments; this covers the rest, plus two the
round-1 fixes introduced.
models.dev (coderabbit Major + kilo + cubic P1 — all three flagged it):
- Remove the import-time `Promise.resolve().then(() => ModelsDev.refresh())`.
The comment defending it argued a microtask cannot keep Bun alive. The
microtask cannot, but the `fetch()` it starts can — and on a cold cache
`refresh()` reaches `fetchApi()`, whose `AbortSignal.timeout` still cannot
cancel a blocking `getaddrinfo()`. That is the D14 release-blocker shape, so
the eager refresh is gone rather than rescheduled. Snapshot + on-demand load +
the unref'd hourly interval remain.
- Reject JSON that parses but is not a catalog object (`null`, `[]`, scalars —
what a misconfigured proxy returns with a JSON content-type) before writing
the disk cache, so the "don't poison the cache" intent holds for
structured-but-wrong bodies too.
Build stamp (cubic P2 x2, coderabbit Major, coderabbit Minor):
- Stamp `packages/opencode/package.json`. The workspace walk skips `opencode`,
so its own manifest was unstamped while a comment claimed otherwise.
- Extract the input walk to `script/stamp-inputs.ts` so the smoke-test guard can
re-enumerate with identical rules. Rehashing recorded inputs only catches
CHANGED and DELETED files; a file ADDED after the build left every hash
matching while the binary was stale. The stamp now records the walked roots
and the guard treats an unrecorded file under them as stale.
- Validate the stamp shape at runtime. `as BuildStamp` is a compile-time claim:
`{"inputs":"x"}` passed the old length check and then threw in the loop.
Tracker scanner (cubic P1 x2, cubic P2, cubic P3, coderabbit Major):
- Scan the refs actually being pushed, read from the pre-push stdin, instead of
always scanning HEAD. `git push origin dirty:other` previously approved a ref
nobody had looked at.
- A deletion-only push now scans nothing rather than falling back to HEAD.
Found by the new end-to-end tests, not by a reviewer.
- An unborn HEAD (`git init`, zero commits) no longer exits 2. That regression
came from round 1's `failOnError: true` default and contradicted the
documented brand-new-repo path.
- A missing base ref says so on stderr instead of exiting silently, so a guard
that has disabled itself is visible.
Test harness (coderabbit Major):
- `cli-process` SQLite scrub rethrows anything that is not ENOENT, so a
permission or removal failure no longer lets the retry start on half-written
state — the exact condition the scrub exists to prevent.
Verification: 5 end-to-end tests drive the real script against throwaway
repositories, including two real `git push` runs through an installed pre-push
hook (clean branch pushes; a branch carrying a tracker ref is blocked). Three of
them fail against the pre-fix scanner. Suites: 33 scanner, 580 provider, 218
install, 13/13 typecheck; lint warnings down from 15 to 13; markers verified
"All blocks properly closed" repo-wide.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>1 parent 5b30a30 commit d2c2cd6
7 files changed
Lines changed: 357 additions & 119 deletions
File tree
- packages/opencode
- script
- src/provider
- test
- install
- lib
- skill
- script
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
151 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
152 | 156 | | |
153 | | - | |
| 157 | + | |
154 | 158 | | |
155 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
159 | 165 | | |
160 | 166 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
| |||
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
206 | 214 | | |
207 | 215 | | |
208 | 216 | | |
| |||
221 | 229 | | |
222 | 230 | | |
223 | 231 | | |
224 | | - | |
225 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
226 | 238 | | |
227 | 239 | | |
228 | 240 | | |
| |||
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
243 | | - | |
244 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
245 | 263 | | |
246 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
247 | 267 | | |
248 | 268 | | |
249 | 269 | | |
| |||
267 | 287 | | |
268 | 288 | | |
269 | 289 | | |
270 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
271 | 293 | | |
272 | 294 | | |
273 | 295 | | |
| |||
282 | 304 | | |
283 | 305 | | |
284 | 306 | | |
285 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
286 | 310 | | |
287 | 311 | | |
288 | 312 | | |
| |||
299 | 323 | | |
300 | 324 | | |
301 | 325 | | |
302 | | - | |
303 | | - | |
304 | | - | |
| 326 | + | |
305 | 327 | | |
306 | 328 | | |
307 | 329 | | |
| |||
568 | 590 | | |
569 | 591 | | |
570 | 592 | | |
571 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
572 | 597 | | |
573 | 598 | | |
| 599 | + | |
574 | 600 | | |
575 | 601 | | |
576 | 602 | | |
577 | | - | |
578 | | - | |
579 | | - | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
580 | 607 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
598 | 611 | | |
599 | 612 | | |
600 | 613 | | |
| |||
633 | 646 | | |
634 | 647 | | |
635 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
636 | 652 | | |
637 | 653 | | |
638 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
149 | 160 | | |
150 | 161 | | |
151 | 162 | | |
| |||
195 | 206 | | |
196 | 207 | | |
197 | 208 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
204 | 212 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
211 | 226 | | |
212 | 227 | | |
0 commit comments