Skip to content

Add bounded regex timeouts for extraction - #2920

Merged
Widthdom merged 2 commits into
mainfrom
fix-issue2876-2887
Jun 2, 2026
Merged

Add bounded regex timeouts for extraction#2920
Widthdom merged 2 commits into
mainfrom
fix-issue2876-2887

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added a bounded Regex wrapper for built-in extraction regexes so match operations use a finite timeout and fail closed on timeout.
  • Switched built-in symbol and reference extractors to the bounded wrapper, including the Go reference regexes that previously used fully-qualified BCL Regex types.
  • Added reflection/adversarial coverage plus changelog fragments for both issues.

Validation

  • dotnet build CodeIndex.sln -p:UseSharedCompilation=false
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -p:UseSharedCompilation=false --filter "FullyQualifiedName~SymbolExtractorTests.BuiltInSymbolRegexes_HaveBoundedMatchTimeouts|FullyQualifiedName~SymbolExtractorTests.Extract_BuiltInSymbolRegexes_AdversarialLongLinesDoNotThrow"
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -p:UseSharedCompilation=false --filter "FullyQualifiedName~ReferenceExtractorTests.BuiltInReferenceRegexes_HaveBoundedMatchTimeouts|FullyQualifiedName~ReferenceExtractorTests.Extract_BuiltInReferenceRegexes_AdversarialLongLinesDoNotThrow"
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • dotnet test CodeIndex.sln -p:UseSharedCompilation=false
  • Codex adversarial review: No blocking/actionable issues found.

Fixes #2876
Fixes #2887

@Widthdom
Widthdom marked this pull request as ready for review June 2, 2026 06:13
@Widthdom
Widthdom merged commit 23f9be0 into main Jun 2, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue2876-2887 branch June 2, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add timeouts or non-backtracking to reference extraction regexes Add timeouts or non-backtracking to built-in symbol extraction regexes

1 participant