Skip to content

Extraction hardening: tcl - #990

Merged
squid-protocol merged 8 commits into
mainfrom
fix-extraction-tcl-848
Aug 2, 2026
Merged

Extraction hardening: tcl#990
squid-protocol merged 8 commits into
mainfrom
fix-extraction-tcl-848

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #848.

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.
@squid-protocol
squid-protocol merged commit bf8b5f6 into main Aug 2, 2026
21 of 26 checks passed
@squid-protocol
squid-protocol deleted the fix-extraction-tcl-848 branch August 2, 2026 21:30
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

# 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
squid-protocol added a commit that referenced this pull request Aug 2, 2026
* Reapply "Extraction hardening: tcl (#990)"

This reverts commit 6cf3478.

* fix: resolve ruff formatting and unused imports

* fix: remove duplicate dictionary key

* fix: remove impossible negative test cases for Tcl

---------

Co-authored-by: Joe Esquibel <squid-protocol@users.noreply.github.com>
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.

Extraction hardening: tcl

2 participants