$ show makenowjust-labs/recheck
recheck is a monorepo for a ReDoS (Regular expression Denial of Service) vulnerability checker, written in Scala 3 and cross-compiled to JVM and JavaScript via Scala.js. The system parses regular expression patterns, builds an execution model, and detects catastrophic backtracking vulnerabilities. It exposes multiple interfaces: a core library (`recheck-core`) with a high-level `ReDoS.check` API, a CLI (`recheck-cli`) with `check` and `batch` subcommands (the latter using JSON-RPC over stdio), JavaScript bindings (`recheck-js`) for browser/Node usage, and an ESLint plugin (`eslint-plugin-redos`) for CI integration. The architecture is a multi-module sbt build with Lerna/pnpm for JS workspace management, featuring clean separation between parsing, execution, unicode data, and platform-specific adapters.
The LLM identified 3 files worth highlighting for reuse:
A lightweight JSON-RPC implementation with Handler traits and push support, used for the CLI's batch mode over stdio. It demonstrates a clean protocol abstraction that could be extracted for any tool needing language-server-style communication, decoupling message serialization from business logic.
A Context class bundling deadline, cancellation token, and logger into a single implicit parameter. This is a textbook async-context pattern (similar to Kotlin Coroutines or ZIO) that is self-contained and directly reusable in any Scala application needing timeout propagation, cooperative cancellation, and structured logging without heavy framework dependencies.
Source code generators (CaseMapDataGen, PropertyDataGen, etc.) that produce Scala source files from ICU4J Unicode data resources. This demonstrates a robust pattern for embedding large reference datasets into compiled code with reproducible generation, applicable to any project needing to vendor data tables with compile-time safety and cross-platform (JVM/JS) compatibility.