fix(audit): detect explicit-seconds form sleep 30s in sleep-polling-loop - #845
lakshya-dhariwal wants to merge 1 commit into
Conversation
|
Thanks @lakshya-dhariwal for your contribution to Failproof AI! 🙌 We'd love to discuss your PR and welcome you to our community. Discord: https://discord.befailproof.ai/ |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe sleep polling loop detector now accepts an explicit ChangesSleep Seconds Detection
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The detector now recognizes qualifying explicit-second sleeps while retaining the short-sleep distinction. No concrete merge-blocking regression is evident. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
__tests__/audit/detectors.test.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/audit/detectors/sleep-polling-loop.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the sleep command, Comment |
Description
Fixes #522. The
sleep-polling-loopdetector's unit alternation(m|h|d)?omitteds, and the trailing\bthen failed onsleep 30s(both0andsare word characters), so the whole match silently dropped - exactly the most common form. Addedsto the unit group and a comment explaining why. The detector's own docstring example (sleep 0.5m= 30s) now actually behaves the same assleep 30s.Tests:
sleep 30sandsleep 45snow match,sleep 1sstill does not, existing cases unchanged.Type of Change
Checklist
npm run lintpasses (eslint on the touched files - clean)npx tsc --noEmitpassesnpm run test:runpasses - ran the touched suite instead:npx vitest run __tests__/audit/detectors.test.ts(33/33). Full test:run + build need bun, which I don't have here - flagging rather than ticking a box I didn't run.npm run buildsucceeds - same bun constraint.Summary by CodeRabbit
sleep 30s) are now detected. Short intervals likesleep 1sremain undetected.