DashboardcliScan and grep concurrency, matching, an…

Scan and grep concurrency, matching, and SEA worker contracts

Category: gotcha
Confidence: 0.90
ID: 01a08b35-f0b4-79e1-a390-f88231e75ed3
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 1
Source session: (none)
Created: 2026-06-09 11:56:40
Updated: 2026-09-10 12:06:03

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 3 16h ago

Content

In src/lib/scan/, whole-buffer regex execution can lose overall because early exit at maxResults dominates across many files. Literal prefilters are file-level gates; per-line checks break cross-newline patterns and Unicode case folding. Character-group skipping must handle character classes. Use a latched pendingWake flag to avoid wake races. mapFilesConcurrent filters null, not []; return null for no-op files. Collectors must drain uncapped and set truncated themselves. The worker pool is lazy, bounded by available parallelism, uses transferred Uint32Array match quads, and keeps FIFO work per worker. Blob URLs are required because new Worker(new URL(...)) hangs in SEA binaries. Only unref() when inflight work reaches zero; disable workers with SENTRY_SCAN_DISABLE_WORKERS=1.

Move to: