Commit 55cc830
test(graphrag): add Drain miner fuzz target for Scorecard Fuzzing (#115)
Add FuzzDrainMatch, a Go native fuzz test over the Drain log-template
miner's Match() — the ingestion hot path every untrusted log body flows
through (LogsServer.Export -> LogCallback -> Drain.Match). It asserts
Match never panics on malformed input and holds two invariants: empty
or whitespace-only tokenization yields a nil template, and any non-nil
result is well-formed (non-empty tokens, ID == templateID(tokens)). It
also checks Preprocess+tokenize determinism.
Seeds cover empty, whitespace, IPs/UUIDs/timestamps/emails/hex pointers,
NUL + high-byte binary, multibyte UTF-8, and an over-depth token run.
Satisfies OpenSSF Scorecard's Fuzzing check (detects a native Go fuzz
function). Verified: go build/vet/test green (101 tests), and
go test -fuzz=FuzzDrainMatch -fuzztime=10s found no crashers.
Claude-Session: https://claude.ai/code/session_01LDQVJrixs2nJoea67a8pEG
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent ccf7958 commit 55cc830
1 file changed
Lines changed: 72 additions & 0 deletions
| 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 | + | |
| 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 | + | |
0 commit comments