GitNexus/gitnexus/src
Mick Cooney 7ce3ea6230 fix(r): bound total exportPattern matching work per package-config load
Each exportPattern matcher has its own work cap, but nothing bounded how many
patterns a repository may carry, so a NAMESPACE with 200 pathological patterns
cost about 77 s of analysis and one with tens of thousands of cheap patterns
cost minutes and gigabytes.

loadRPackageConfig now creates one SharedWorkBudget per call and a sub-budget
per package. Every matcher draws on its package's sub-budget and on the load's:
state visits spent matching (100M per load, 30M per package) and NFA states kept
by compiled patterns (500k per load, 100k per package). A pattern that does not
fit the state allowance is refused before its NFA is fully built, and the first
refusal closes the allowance so later patterns are refused without being parsed.
Once the matching budget is spent, refineRExportStatus and the R import resolver
stop calling the matchers. Refused and cut-short patterns take the existing
drop-and-warn path (export nothing), with at most 50 named per package and one
summary line for the rest. A hostile package can therefore not starve the
packages after it. Budgets count work units, so the outcome is deterministic.
Benign monorepos spend a negligible fraction of every budget.
2026-10-04 02:06:38 +01:00
..
cli feat(go): index gin/echo routes and report them in impact (#3402) (#3417) 2026-10-01 10:22:45 +01:00
config feat(analyze): add incremental watch mode (#3072) 2026-08-29 10:40:56 +00:00
core fix(r): bound total exportPattern matching work per package-config load 2026-10-04 02:06:38 +01:00
lib fix(mcp): stop scaling the detect_changes query with the diff's hunk count (#2915) (#2930) 2026-08-12 14:51:17 +01:00
mcp feat(go): index gin/echo routes and report them in impact (#3402) (#3417) 2026-10-01 10:22:45 +01:00
server feat(mcp): add read_file + grep tools (REST parity for /api/file slice + /api/grep) (#3377) 2026-09-27 13:16:11 +00:00
storage fix(r): select the naming argument in the scope query's import and class declarations 2026-10-02 09:59:54 +01:00
types fix(resolution): label fallback guesses and preserve export visibility (#3190) 2026-09-10 11:38:19 +01:00
utils perf(lock): probe this process's own start time once (#3222) 2026-09-08 19:06:03 +01:00