fix(analyze): add Go --exploitable-all parity; priority-sort --limit truncation#81
Closed
gadievron wants to merge 1 commit into
Closed
Conversation
…truncation Two confirmed bugs on the analyze path; both fixes are additive and keep existing callers' behavior unchanged when the new code path is not taken. Go --exploitable-all missing: the Python backend (openant/cli.py analyze_p) defines both --exploitable-all and --exploitable-only in a mutually-exclusive group (-> exploitable_filter 'all'|'strict'|None), but the Go CLI defined/forwarded only --exploitable-only, so `openant analyze --exploitable-all` failed with `unknown flag`. The no-flag DEFAULT is most inclusive (analyzer runs the filter under `if exploitable_filter:`), so the omitted flag is a narrowing cost filter with no recall loss. FIX: add --exploitable-all (BoolVar + forward) mirroring the Python help; mark the two exploitable flags mutually exclusive. Extract the inline argv build into a pure buildAnalyzePyArgs helper (mirrors buildParsePyArgs) so the flag-forwarding contract is unit-testable without spawning Python. --limit drops high-value units: run_analysis truncated with a raw head-slice `units = units[:limit]` over parser-sorted alphabetical-by-path units (Doc/ before Lib/), dropping high-value code with no relevance weighting. FIX: extract _apply_limit(units, limit) that priority-sorts by enhancement security_classification (exploitable > vulnerable_internal > other) before the head-slice; stable within a tier, no-op when limit is unset, reads classification mode-agnostically (agent_context or llm_context). The bias is bounded to --limit runs; full runs pass no limit. The sibling head-slice at experiment.py:526 is separate and not touched here. Tests: cmd/analyze_flags_test.go (flag defined + forwarded via buildAnalyzePyArgs) + tests/test_analyzer_limit_priority.py (6 tests). go test ./cmd/ ok, gofmt + vet clean; python regression suite passing; ruff clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
gadievron
requested review from
ar7casper,
dgeyshis,
shahar-davidson,
sounil and
yotamleo
as code owners
May 28, 2026 23:53
Collaborator
Author
|
Closing as already resolved on current master. This fix's behavior shipped via the parser-fix-stack release (#133/#134); confirmed by independent reproduction — the original bug (reconstructed from its bug-pipeline investigation) no longer manifests on master, not merely by line-presence. Part of a full validated sweep of the open-PR corpus. |
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.
Two confirmed bugs on the analyze path; both fixes are additive and keep
existing callers' behavior unchanged when the new code path is not taken.
Go --exploitable-all missing: the Python backend (openant/cli.py analyze_p)
defines both --exploitable-all and --exploitable-only in a mutually-exclusive
group (-> exploitable_filter 'all'|'strict'|None), but the Go CLI
defined/forwarded only --exploitable-only, so
openant analyze --exploitable-allfailed withunknown flag. The no-flagDEFAULT is most inclusive (analyzer runs the filter under
if exploitable_filter:), so the omitted flag is a narrowing cost filter withno recall loss. FIX: add --exploitable-all (BoolVar + forward) mirroring the
Python help; mark the two exploitable flags mutually exclusive. Extract the
inline argv build into a pure buildAnalyzePyArgs helper (mirrors
buildParsePyArgs) so the flag-forwarding contract is unit-testable without
spawning Python.
--limit drops high-value units: run_analysis truncated with a raw head-slice
units = units[:limit]over parser-sorted alphabetical-by-path units (Doc/before Lib/), dropping high-value code with no relevance weighting. FIX:
extract _apply_limit(units, limit) that priority-sorts by enhancement
security_classification (exploitable > vulnerable_internal > other) before the
head-slice; stable within a tier, no-op when limit is unset, reads
classification mode-agnostically (agent_context or llm_context). The bias is
bounded to --limit runs; full runs pass no limit. The sibling head-slice at
experiment.py:526 is separate and not touched here.
Tests: cmd/analyze_flags_test.go (flag defined + forwarded via
buildAnalyzePyArgs) + tests/test_analyzer_limit_priority.py (6 tests). go test
./cmd/ ok, gofmt + vet clean; python regression suite passing; ruff clean.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com