Repository navigation
⚡ Bolt: Optimize skill discovery and audit routines - #20
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
The new keyword pre-filter in check_correctness() gates the DESTRUCTIVE
regex loop on a case-sensitive membership test. DROP TABLE is compiled with
re.I, so a title- or mixed-case hit ("Drop Table", "dRoP TABLE") matches the
regex but not the pre-filter, and the destructive finding is silently lost --
check_correctness then scores the skill clean.
Measured against a fixture whose scripts/bad.py contains
cur.execute("Drop Table users"):
origin/main : score=3, findings=['unguarded DROP TABLE in bad.py']
this branch : score=5, findings=[] <-- regression
with fix : score=3, findings=['unguarded DROP TABLE in bad.py']
Fix: lowercase the raw source once and test the (now lowercased) keyword set
against it, so the pre-filter is a superset of every DESTRUCTIVE regex.
Adds three regression tests (title / mixed / upper case DROP TABLE).
Dispatcher review: one real regression found and fixedI reviewed this PR before merging and found the Measured against a fixture whose
Fix (a724e91): lowercase the raw source once and test the lowercased keyword set against it, making the pre-filter a superset of every The — Indigo (dispatcher) |
Thank you Indigo! Updated check_correctness in scripts/critique_10khr_runner.py to test lowercased keyword set ('reset', 'clean', 'rm', 'drop', 'rmtree', 'push') against raw.lower(), ensuring full case-insensitivity for case-insensitive regex patterns like DROP TABLE. Added regression tests covering titlecase, mixedcase, and uppercase DROP TABLE in tests/test_skilllab.py (19/19 tests pass). |
💡 What:
Optimized skill discovery and audit routines in
scripts/critique_10khr_runner.py:_get_sibling_basenames: Bypassed redundantos.path.isdir()pre-check stat calls by invokingos.listdir()directly inside atry...except OSErrorblock (~5 stat syscalls eliminated per sibling directory).find_all_skills: Deferredos.realpath()syscalls until after skill name pattern filtering (ocas-/util-), duplicate checks (seen), and archive checks (.archive).check_correctness: Added a fast keyword pre-filter (_DESTRUCTIVE_KWS) to bypass line splitting, comment stripping, string concatenation, and regex checks on safe scripts.🎯 Why:
Batch skill assessments perform frequent directory discovery and reference checks across dozens of skill repositories. These optimizations reduce redundant filesystem syscalls and string processing overhead during audit runs.
📊 Impact:
🔬 Measurement:
Verified through test suite execution (
PYTHONPATH=scripts python3 -m unittest discover -s tests), with all 18 tests passing.PR created automatically by Jules for task 7701214189346283424 started by @indigokarasu