- Added
KindDataRacetointernal/detector/detector.go - Created
internal/detector/race.go— ParseRaceOutput() parser forgo test -raceoutput - Added
RunRace()tointernal/tracer/tracer.go - Added
--raceflag tocmd/root.go(varflagRace bool)
- Wired
--raceintocmd/run.go— after static block, callstracer.RunRace()+detector.ParseRaceOutput() - Updated
internal/reporter/terminal.go:- Added data race count to summary (red, like leaks)
- Added
● DATA RACEcase toprintFinding - Fixed
Goroutine 0display for static/race findings (shows "Issue:" instead)
- Implemented
detectWaitGroupDeadlockininternal/detector/deadlock.go:- Finds goroutines blocked on
sync.(*WaitGroup).Wait - BFS descendants via parentID tree
- If ALL live descendants are blocked →
KindDeadlock,ConfidenceMedium - Wired into
Analyze()indetector.go
- Finds goroutines blocked on
- Created test cases:
testdata/race-condition/race_test.go— deliberate data racetestdata/waitgroup-deadlock/wg_test.go— WaitGroup deadlock pattern
testdata/buggy/→ 5 goroutine leaks ✅ (regression OK)testdata/waitgroup-deadlock/→ 3 leaks + 1 deadlock (WaitGroup) + 1 long block ✅testdata/race-condition/ --race→ 2 data races ✅- JSON output validates ✅
internal/detector/detector.go— Finding types, Analyze() orchestratorinternal/detector/deadlock.go— detectDeadlocks, detectLockCycles, detectChanLockCycle, detectWaitGroupDeadlock (NEW)internal/detector/leaks.go— detectLeaks, detectOrphans, detectTransientBlocksinternal/detector/filter.go— isRuntimeGoroutine, isNonTestRuntimeGoroutine, extractStackinternal/detector/race.go— ParseRaceOutputinternal/tracer/tracer.go— Run, RunRaceinternal/static/lockorder.go— AnalyzeLockOrder, AnalyzeChanLockHolding (Tarjan SCC)internal/static/lockrelease.go— AnalyzeLockRelease (go/ssa CFG analysis)cmd/run.go— main run command, wires all analysescmd/root.go— global flags incl. flagRaceinternal/reporter/terminal.go— colored output (now handles data races)internal/llm/claude.go— Claude API explanations with readCodeContext
Architecture: trace-based runtime + go/ssa static analysis + race detector + WaitGroup deadlock + optional LLM
- Goroutine provenance tree grouping — group findings by common ancestor for cleaner output
- Baseline comparison in CI —
--baselinealready implemented, needs CI workflow template - HTML report — goroutine timeline visualization
- VS Code extension — inline annotations (the real moat)
- Hybrid static + dynamic confirmation — cross-reference
go/ssapredictions with runtime trace