fix(scoring): bound label-pattern RegExp cache with LRU eviction - #2513
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 07:24:29 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
8230654 to
0eed7e0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2513 +/- ##
==========================================
+ Coverage 95.94% 95.95% +0.01%
==========================================
Files 226 226
Lines 25361 25438 +77
Branches 9229 9246 +17
==========================================
+ Hits 24333 24410 +77
Misses 417 417
Partials 611 611
🚀 New features to boost your workflow:
|
Motivation
Description
LABEL_PATTERN_REGEXP_CACHE_MAX_ENTRIES = 256and evict the oldest entry when the limit is reached inlabelPatternToRegExpinsrc/scoring/preview.ts.clearLabelPatternRegExpCacheForTestandlabelPatternRegExpCacheKeysForTestso tests can deterministically exercise caching behavior, and add a regression unit test that fills the cache, asserts the bound, refreshes an entry, and verifies LRU eviction intest/unit/scoring.test.ts.Testing
npx vitest run test/unit/scoring.test.ts -t "label pattern cache|fnmatch globs"and the added tests passed.npm run typecheckand TypeScript typecheck succeeded with no errors.npm run test:ciandnpm audit --audit-level=moderatewas blocked by external network/setup issues (actionlint setup / npm audit endpoint) in this environment, so those checks were not completed here.Codex Task