-
Notifications
You must be signed in to change notification settings - Fork 10
PR #7: Fix Critical Bugs in Argument Matching #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #390 +/- ##
=======================================
Coverage 78.90% 78.91%
=======================================
Files 70 70
Lines 7117 7123 +6
=======================================
+ Hits 5616 5621 +5
- Misses 1262 1263 +1
Partials 239 239 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Nov 21, 2025
Owner
Author
Owner
Author
Merge activity
|
Found during PR #6 validation. These bugs prevented argument constraints from working correctly in production. ## Bug #1: Python DSL - Argument wildcard inheritance File: python-dsl/codepathfinder/matchers.py:81 The _make_constraint() method was inheriting the pattern wildcard flag, causing all argument constraints to use wildcard matching when the pattern itself had wildcards. Example: calls("*.bind", match_position={"0[0]": "0.0.0.0"}) Before: Would match ALL .bind() calls (wrong!) After: Only matches .bind(("0.0.0.0", ...)) (correct) ## Bug #2: Go Executor - Missing argument validation File: sourcecode-parser/dsl/call_matcher.go:155-162 The getMatchedPattern() method only checked function name patterns, completely ignoring argument constraints. Since the scan command uses ExecuteWithContext() which calls getMatchedPattern(), all argument checking was bypassed in production! Impact: ALL argument constraints were ignored during scans. ## Bug #3: Tuple extraction - Empty string ambiguity File: sourcecode-parser/dsl/call_matcher.go:318-350 The extractTupleElement() function returned "" for both "index out of bounds" and "extracted value is empty string", making them indistinguishable. Example: s.bind(("", 8080)) # Empty string is valid! Before: Treated as "out of bounds" error (wrong!) After: Returns ("", true) indicating success (correct) Changed signature to return (string, bool) to distinguish error from valid empty string. ## Validation Results Test rule: avoid_bind_to_all_interfaces Before: 6/6 matches (100% false positives) After: 3/6 matches (100% accurate) ## Test Changes - Updated extractTupleElement tests for new (string, bool) signature - Added test case for tuple with empty string element - All existing tests pass 🤖 Generated with Claude Code
2d05862 to
06e2b69
Compare
shivasurya
added a commit
that referenced
this pull request
Nov 28, 2025
Release v1.1.0 includes enhanced argument matching capabilities: - Add positional argument matching (match_position parameter) - Add keyword argument matching (match_name parameter) - Add tuple indexing for nested arguments - Add wildcard support in argument values - Add comprehensive type hints - Fix critical bugs in argument matching Related PRs: #386, #389, #390 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6 tasks
shivasurya
added a commit
that referenced
this pull request
Nov 28, 2025
Release v1.1.0 includes enhanced argument matching capabilities: - Add positional argument matching (match_position parameter) - Add keyword argument matching (match_name parameter) - Add tuple indexing for nested arguments - Add wildcard support in argument values - Add comprehensive type hints - Fix critical bugs in argument matching Related PRs: #386, #389, #390 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
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.

This fixes three critical bugs discovered during validation testing. The first fix prevents wildcard pattern flags from incorrectly propagating to argument constraints. The second ensures argument validation is actually performed during scans. The third changes tuple extraction to properly distinguish between error conditions and valid empty string values using Go idioms. These fixes are essential for correct operation of the argument matching features.