primus.scoring.recall module

Recall scoring for scanner eval pipelines.

evaluate_recall takes gold annotations and scanner findings as plain Python data and returns recall/accuracy/precision metrics plus a confusion matrix. No HTTP, no dashboard, no persistence.

primus.scoring.recall.evaluate_recall(annotations: list, findings: list) → dict[str, Any]

Score recall of findings against gold annotations.

Each annotation is a dict with file_path, start_line, end_line, and expected.status ("positive" or "negative"). Each finding is a dict with filePath, startLine, endLine.

Returns a dict with accuracy, recall, precision, confusion_matrix, and denominators. Negative annotations are scored as “No” references; a scanner finding overlapping them is a false positive.