mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-04 10:48:19 +00:00
chore(p0): drop never-enabled hunter tools, test-only functions and receiver delivery
Off every active line (PATHFINDER-2026-10-13/03-unified-proposal.md, cuts). Deleted: the four hunter tools no caller enables (read_definition, entry_points, flows, obligations) with their schemas and dispatch, the dead mapping branch of find_refs; 20 functions whose only caller was one test (mapping task records, compute_ranking_metrics, build_quick_hunter_prompt, validate_evidence_transition, should_fuse, harness processors, rank_targets_with_model, model/report slice rendering, taxonomy hierarchical/related, config_value.verdict, taint.verdict, roles.load_roles, features.language_of and build_for_scan, folds.leave_one_*, features.recorded_case, search BatchExecutor and the three __main__ shims, delivery.put_input); the receiver delivery mode of the plane. push_inputs.py moved to benchmarks/push. memory.purge stays: the live-S3 test cleanup uses it. Net: 2,730 lines deleted, 207 added. 473 targeted tests passed; 3,282 tests collect. breadth.toml records the removals. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
f5a904b7f2
commit
f63703a604
@@ -47,16 +47,6 @@ class FalsePositiveLearning:
|
||||
demotion: float = 0.5
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RankingMetrics:
|
||||
tier: str
|
||||
verified_findings: int
|
||||
false_positives: int
|
||||
time_to_verification_seconds: float
|
||||
missed_fixture_vulnerabilities: int
|
||||
false_positive_reasons: dict[str, int]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RankingCalibration:
|
||||
path: str
|
||||
@@ -105,38 +95,6 @@ def learning_from_finding_outcome(
|
||||
)
|
||||
|
||||
|
||||
def compute_ranking_metrics(events: list[dict[str, object]], *, tier: str) -> RankingMetrics:
|
||||
verified = 0
|
||||
false_positives = 0
|
||||
reason_counts: dict[str, int] = {}
|
||||
verification_times: list[float] = []
|
||||
missed = 0
|
||||
for event in events:
|
||||
if event.get("tier") != tier:
|
||||
continue
|
||||
outcome = event.get("outcome")
|
||||
if outcome == FindingOutcome.VERIFIED:
|
||||
verified += 1
|
||||
if outcome in _FALSE_POSITIVE_OUTCOMES:
|
||||
false_positives += 1
|
||||
reason = str(event.get("reason", FalsePositiveReason.UNVERIFIED))
|
||||
reason_counts[reason] = reason_counts.get(reason, 0) + 1
|
||||
duration = event.get("time_to_verification_seconds")
|
||||
if isinstance(duration, int | float) and not isinstance(duration, bool):
|
||||
verification_times.append(float(duration))
|
||||
missed_value = event.get("missed_fixture_vulnerabilities", 0)
|
||||
if isinstance(missed_value, int) and not isinstance(missed_value, bool):
|
||||
missed += missed_value
|
||||
return RankingMetrics(
|
||||
tier=tier,
|
||||
verified_findings=verified,
|
||||
false_positives=false_positives,
|
||||
time_to_verification_seconds=round(sum(verification_times) / len(verification_times), 2) if verification_times else 0.0,
|
||||
missed_fixture_vulnerabilities=missed,
|
||||
false_positive_reasons=dict(sorted(reason_counts.items())),
|
||||
)
|
||||
|
||||
|
||||
def calibrate_ranking(ranking: RankingScore, learnings: list[FalsePositiveLearning]) -> RankingCalibration:
|
||||
applicable = [learning for learning in learnings if _learning_applies(ranking.path, learning)]
|
||||
calibrated = ranking.priority
|
||||
|
||||
Reference in New Issue
Block a user