Commit b8d177d
fix(assail): TODO-in-string-literal FP closed (Task #23)
UncheckedError detector was counting TODO/FIXME/HACK/XXX markers
against raw `content` via `content.matches(\"TODO\").count()`. This
inflated counts for every `.expect(\"TODO: handle error\")` call —
observed on 007-lang where parser.rs has 155 such stubs, each
double-counted as both PanicPath (correct) AND UncheckedError (FP).
Fix: replace the substring count with a regex that requires a
comment-starter on the same line. Comment-starters handled:
// /* * # -- ;; %%
Covers Rust/C/JS/Go/Zig (// + /*), Python/Ruby/Shell/Nix/Elixir (#),
Haskell/Ada/SQL/Lua/Idris (--), Lisp/Scheme/Racket (;;),
Erlang/Matlab (%%). OCaml (* *) and a few others are not yet handled
— edge cases for later. Block-comment continuation lines starting
with `*` also match (e.g. ` * TODO: …` inside a /** … */ block).
Regex stored in OnceLock<Regex> — compiled once per process.
Estate-wide impact:
007-lang self-scan: 24 findings -> 9 findings.
UncheckedError: 15 -> 0 (all were TODO-in-.expect-string FPs)
PanicPath: 4 -> 4 (155 .expect() in parser.rs is real debt)
UnsafeCode: 4 -> 4 (legit — see audits/audit-ffi-unsafe.md)
InsecureProtocol:1 -> 1 (integration_tests.rs — test context)
Regression tests added:
test_todo_in_string_literal_does_not_trigger_unchecked_error
test_real_todo_comments_still_detected
190/190 lib tests + 12/12 unbounded corpus + new analyzer tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8b12fec commit b8d177d
2 files changed
Lines changed: 101 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
246 | 260 | | |
247 | 261 | | |
248 | 262 | | |
| |||
4543 | 4557 | | |
4544 | 4558 | | |
4545 | 4559 | | |
4546 | | - | |
4547 | | - | |
4548 | | - | |
4549 | | - | |
4550 | | - | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
4551 | 4569 | | |
4552 | 4570 | | |
4553 | 4571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
212 | 290 | | |
213 | 291 | | |
214 | 292 | | |
| |||
0 commit comments