Commit 317a0e9
fix(assail): tighten UnboundedAllocation Rust heuristic (72→6 on 007)
- Scan code_only (comments + string literals already stripped) instead of
raw content, same fix shape as 6f18caf for UnsafeCode. Dangerous-word
keywords (unbounded / infinite / unlimited / …) no longer trigger on
comment text, doc-strings, or source embedded in raw string literals.
- Remove the bare `for ` + `push(`, `while let` + `push(`,
`loop` + `push/Vec::new`, and `recursion` pair heuristics. These
substrings co-occur in virtually every non-trivial Rust file (normal
bounded iteration is `for x in collection { v.push(y) }`), so they
produced ~60 Critical findings per average repo at near-zero signal.
- Add `is_infinite` exclusion so Rust std `f64::is_infinite()` no longer
counts as an `infinite` keyword hit.
Measured impact on 007-lang:
- Before: 72 UnboundedAllocation Critical findings (72 distinct files).
- After: 6 residual findings, all either accepted full-file reads of
trusted source/config inputs (`std::fs::read_to_string` in
CLI/import-resolver/diagnostics paths) or benign test-fn
identifiers inside `#[cfg(test)] mod tests` blocks that the
file-path-based test suppressor does not yet reach
(`choreography_unbounded_loop`, `validate_detects_left_recursion`).
All 167 lib tests still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 72e96a7 commit 317a0e9
1 file changed
Lines changed: 31 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
836 | 836 | | |
837 | 837 | | |
838 | 838 | | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
859 | 870 | | |
860 | 871 | | |
861 | 872 | | |
| |||
0 commit comments