Extraction hardening: tcl - #990
Merged
Merged
Conversation
This PR implements extraction hardening for Haskell (#833), mitigating ReDoS and catastrophic backtracking risks while improving semantic parsing precision. Key Changes: - `func_start`: Rewritten to avoid ReDoS by utilizing character-level stepwise whitespace matches instead of greedy group repeaters. Added lookahead checks for `::` to correctly parse type signatures and FFI bounds. - `class_start`: Eliminated catastrophic backtracking wildcard matches (`[\s\S]`). Refined bounds to accurately parse `data`, `class`, `type`, and `newtype` while capturing optional `deriving` and type constraints. - `args`: Explicitly excludes block and line comments to avoid matching false arguments, restricting capture to exact Haskell type constructs and typeclass derivations. - Golden Master Crucible Baseline: Updated the structural golden master after 69 legitimately missed functions (including operators and FFI) were surfaced across test suites due to the heightened parsing precision, resulting in cascading but completely valid PCA/UMAP topological shifts.
- Updated full-precision `golden_master_audit.json` (previously only zero-dep was committed). - Removed unused `assert_redos_immune` import in `test_haskell.py`. - Cleaned up legacy tests in `test_dependency_extraction_strict.py` and `test_function_extraction_strict.py` that were fully migrated.
Contributor
| # 24. import (Dependency Inclusions) | ||
| # Package and module loading. | ||
| "import": re.compile(r"^[ \t]*(?:package[ \t]+require|source|load)\b", re.M), | ||
| "dependency_injection": None, |
Comment on lines
+20
to
+27
| from _extraction_harness import ( # noqa: E402 | ||
| assert_invalid_no_match, | ||
| assert_pathological_dependency_match, | ||
| assert_pathological_match, | ||
| assert_redos_immune, | ||
| assert_valid_dependency_match, | ||
| assert_valid_match, | ||
| ) |
squid-protocol
added a commit
that referenced
this pull request
Aug 2, 2026
This reverts commit bf8b5f6.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #848.