perf(linter/jest/valid-title): compile disallowedWords regex once #24412
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 245 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.329
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #24412"
general
weight: 0.35
connorshea
The
disallowedWordsregex injest/valid-title(shared withvitest/valid-title) was escaped, joined, and recompiled for everytest/describetitle checked. This moves the compilation intofrom_configuration, storing a compiledOption<Regex>on the config.Benchmark
Fixture: a generated
spec.test.jscontaining 30,000 one-line test cases of the formNone of the titles contain a disallowed word, so the fixture measures the pure per-title overhead of the rule (the common case in a real suite); output parity on the reporting path was verified separately with a canary file whose titles do contain disallowed words.
Config: a single-rule
.oxlintrc.jsonso nothing else contributes to the timing:Method: two release binaries (baseline from
main, this branch), run interleaved in alternating order for 40 paired samples (plus 5 warmup runs each) with--silent, timed withtime.monotonic_ns(). A parse-only config ("rules": {}) run on the same fixture showed no difference between the binaries (0.995×, t=-0.9), so the delta is attributable to the rule and not binary-layout noise.| | mean |
|---|---|
| before | 2161.19 ms |
| after | 28.89 ms |
74.8× faster (paired t=651, 40/40 wins). The magnitude scales with title count × number of disallowed words; suites that don't set
disallowedWordsare unaffected (the rule already early-returns).--format=jsonoutput is byte-identical between the two binaries on the fixture and canaries.Disclosure
This change was implemented and benchmarked with AI assistance (Claude Code), and has been reviewed by the submitter.
🤖 Generated with Claude Code