Implementation:0sec labs 0 Seed Findings Lead Generation
| Knowledge Sources | |
|---|---|
| Domains | Source_Code_Review, Static_Analysis, Lead_Generation |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete tool for loading external ND-JSON scanner leads and fix-commit variant hunting for the source code review pipeline, provided by the 0security CLI package.
Description
The readSeedFindings function reads an ND-JSON leads file (gemmaforge.leads/v1 schema) or stdin (-), returning SeedFinding objects merged into the review pipeline as initial investigation leads. The huntAppFixVariants function analyzes a fix commit for variant hunting — finding similar unfixed patterns elsewhere in the repo. These provide external lead generation that supplements or replaces (--seed-only) the static scanner prioritization.
Usage
Import these when you need to inject external scanner leads into the review pipeline or hunt for variant bugs from a fix commit. They are Step 2 of the source code security review workflow.
Code Reference
Source Location
- Repository: 0security
- File: packages/cli/src/commands/review.ts:L205-268, @0/core
Signature
// In @0/core:
export function readSeedFindings(path: string): SeedFinding[];
export function huntAppFixVariants(opts: {
repoPath: string;
fixCommit: string;
}): VariantHuntResult;
interface SeedFinding {
// gemmaforge.leads/v1 schema
rule_id: string;
severity: string;
path: string;
line: number;
message: string;
// ... additional fields per schema
}
Import
// readSeedFindings is called internally by the review command action
// Direct import from @0/core:
import { readSeedFindings, huntAppFixVariants } from "@0/core";
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| path | string | Yes (readSeedFindings) /// ND-JSON file path or "-" for stdin | |
| repoPath | string | Yes (huntAppFixVariants) /// Repository path | |
| fixCommit | string | Yes (huntAppFixVariants) /// Fix commit SHA to analyze |
Outputs
| Name | Type | Description |
|---|---|---|
| readSeedFindings return | SeedFinding[] /// Array of external leads | |
| huntAppFixVariants return | VariantHuntResult /// Variant bugs found from fix commit |
Usage Examples
Via CLI
# Load external leads from a file
0 review ./repo --seed-findings leads.ndjson
# Read leads from stdin
cat leads.ndjson | 0 review ./repo --seed-findings -
# Skip static scanner, rely solely on seeds
0 review ./repo --seed-findings leads.ndjson --seed-only
# Variant hunting from a fix commit
0 review ./repo --fix-commit abc1234
Programmatic
import { readSeedFindings } from "@0/core";
const leads = readSeedFindings("leads.ndjson");
for (const lead of leads) {
console.log(`${lead.rule_id}: ${lead.path}:${lead.line} — ${lead.message}`);
}