Skip to content

fix(analyze): add Go --exploitable-all parity; priority-sort --limit truncation#81

Closed
gadievron wants to merge 1 commit into
masterfrom
fix/analyze-add-go-exploitable-all-parity-priority-sort
Closed

fix(analyze): add Go --exploitable-all parity; priority-sort --limit truncation#81
gadievron wants to merge 1 commit into
masterfrom
fix/analyze-add-go-exploitable-all-parity-priority-sort

Conversation

@gadievron

Copy link
Copy Markdown
Collaborator

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

…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

Copy link
Copy Markdown
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.

@gadievron gadievron closed this Jul 10, 2026
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.

1 participant