Principle:0sec labs 0 Finding Generation
| Knowledge Sources | |
|---|---|
| Domains | Source_Code_Review, Finding_Management, Reporting |
| Last Updated | 2026-10-30 00:00 GMT |
Overview
Technique for deduplicating confirmed findings by location and signature, severity-ranking them, optionally emitting GitHub PRs with reproduction and suggested patches, and rolling unverified findings into hypotheses.
Description
Finding generation and ranking is the principle that raw agent-loop output must be cleaned and structured before reporting. Confirmed findings are deduplicated by (file, line, rule_id) signature so the same vulnerability found by multiple investigation paths is reported once. Severity is ranked: critical > high > medium > low > info. When --emit pr is set, each reproduced finding emits a GitHub PR with reproduction evidence and a suggested patch. Unverified findings (hypotheses that the agent could not confirm) roll up into a hypotheses.md file for human review. The --dry-run flag prints git/gh commands instead of executing them. Results are persisted to SQLite.
Usage
Use this principle when designing a source code review system that needs to produce clean, actionable output — deduplicated findings ranked by severity with optional automated PR emission.
Theoretical Basis
The finding pipeline:
# Abstract algorithm (NOT real implementation)
raw_findings = agent_loop.run(plan)
# 1. Deduplicate by (file, line, rule_id) signature
deduped = dedup(raw_findings, key=lambda f: (f.file, f.line, f.rule_id))
# 2. Severity rank: critical > high > medium > low > info
ranked = sort(deduped, key=lambda f: severity_order(f.severity))
# 3. Optionally emit GitHub PRs
if emit_pr:
for f in ranked:
if f.reproduced:
pr = create_github_pr(f, base_branch, dry_run=dry_run)
# PR includes repro + suggested patch
# 4. Unverified → hypotheses.md
hypotheses = [f for f in ranked if not f.confirmed]
write_hypotheses_md(hypotheses)
# 5. Persist to SQLite
persist(ranked, db)