Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:0sec labs 0 Versioned Report Emission

From Leeroopedia
Knowledge Sources
Domains Binary_Analysis, API, Reporting
Last Updated 2026-10-30 00:00 GMT

Overview

Technique for providing a single embeddable scan entrypoint with a versioned result contract that can be serialized to JSON, NDJSON, and SARIF formats.

Description

Versioned report emission is the principle that a binary scan API should have one entrypoint with a stable, versioned output contract. The single scan() function decompiles, analyzes, triages, prunes, confirms, and optionally patches a binary, returning a ScanResult (contract v1.5) that includes findings (each with id, bug_class, severity, confirmed, hypothesis, pruned, pov_path, repro_cmd, patch info), stages_run, terminal_state, and stage_outcomes. The result can be serialized to JSON, NDJSON (one finding per line), or SARIF (OASIS standard for CI/CD integration). The process environment is never mutated, so concurrent embedded scans can select different backends safely.

Usage

Use this principle when designing a binary analysis API that needs to be embedded in CI/CD pipelines, fleet analysis, or MCP integration. The versioned contract ensures consumers can depend on a stable schema while the implementation evolves.

Theoretical Basis

The contract versioning principle:

# Abstract contract (NOT real implementation)
CONTRACT_VERSION = "1.5"

@dataclass
class ScanResult:
    contract_version: str = CONTRACT_VERSION
    findings: list[Finding]       # id, bug_class, severity, confirmed, hypothesis, pov_path
    stages_run: list[str]        # which pipeline stages executed
    terminal_state: str          # "completed" | "degraded" | "error"
    stage_outcomes: list[dict]   # per-stage result/notes

# Serializers are contract-bound, not implementation-bound
def result_to_json(result): ...   # full ScanResult as JSON
def result_to_ndjson(result): ... # one finding per line (streaming-friendly)
def result_to_sarif(result): ...  # OASIS SARIF v2.1.0 for CI/CD

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment