Commit 2a721c8
committed
improvement(logs): only flag genuine regex intent, document the truncated invariant
Review follow-ups on the literal log-grep.
The `patternNotice` fired on any regex metacharacter, which includes `.` — so
ordinary literal searches (`example.com`, `file.pdf`, `v1.2.3`,
`block_1.output`) were told their pattern "was not interpreted as a regex",
inviting the agent to retry a search that had in fact worked. Measured 10 false
notices across 19 realistic literal searches. `REGEX_INTENT` now keys on actual
regex intent — escape classes, character class, group, alternation, a
leading/trailing anchor, or a repetition quantifier — which drops that to 0/19
while still flagging all 10 regex attempts tested.
`truncated` gains a TSDoc block stating its invariant: it reports that trace was
left unread, not that a budget was reached. Every point that skips work goes
through `done()`, which sets it, so a budget exhausted by the final match
correctly reports `false`. Raised by Cursor Bugbot; behavior is right, the
contract was just implicit.
Also drops `snippetAround`'s `maxChars` parameter, which every caller passed
from the state object it already receives.1 parent cbce1e5 commit 2a721c8
2 files changed
Lines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
180 | 190 | | |
181 | 191 | | |
182 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
191 | 197 | | |
192 | 198 | | |
193 | 199 | | |
| |||
224 | 230 | | |
225 | 231 | | |
226 | 232 | | |
227 | | - | |
228 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
229 | 244 | | |
230 | 245 | | |
231 | 246 | | |
| |||
244 | 259 | | |
245 | 260 | | |
246 | 261 | | |
247 | | - | |
| 262 | + | |
248 | 263 | | |
249 | 264 | | |
250 | 265 | | |
| |||
266 | 281 | | |
267 | 282 | | |
268 | 283 | | |
269 | | - | |
| 284 | + | |
270 | 285 | | |
271 | 286 | | |
| 287 | + | |
272 | 288 | | |
273 | 289 | | |
274 | 290 | | |
| |||
304 | 320 | | |
305 | 321 | | |
306 | 322 | | |
307 | | - | |
| 323 | + | |
308 | 324 | | |
309 | 325 | | |
310 | 326 | | |
| |||
0 commit comments