report

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package report renders a stored run. A report is a pure function of the run's ledger: Load reads only ledger.jsonl, and renderers use no clock, no environment and no map iteration order, so rendering the same run twice produces the same bytes.

Index

Constants

View Source
const JSONSchema = "spackle.report/v1"

JSONSchema names the envelope renderJSON writes. It changes only when a key is removed or changes meaning; adding a key keeps the version.

Variables

This section is empty.

Functions

func Ext

func Ext(format string) (string, bool)

Ext returns the file extension for a format, without the dot.

func Formats

func Formats() []string

Formats lists the supported format names in a fixed order.

func Render

func Render(format string, run Run, w io.Writer) error

Render writes the run in the named format.

func Terminal

func Terminal(run Run, w io.Writer, color bool) error

Terminal writes the plain-text report. With color false the output has no escape bytes at all. Text that came from the target is cleaned first, so the only escape sequences ever written are the fixed ones above.

Types

type Counts

type Counts struct {
	Critical, High, Medium, Low, None int
	Open, Fixed, Dismissed            int
	Demonstrated                      int
}

Counts summarizes findings by severity label for open findings.

type Run

type Run struct {
	ID          string
	Version     string
	Command     string
	Target      string
	TargetKind  string
	Commit      string
	Mode        string // deterministic|agentic
	Provider    string
	Model       string
	Offline     bool
	Scope       string
	ScopeSource string
	Isolation   string
	StartedAt   time.Time
	EndedAt     time.Time
	Outcome     string

	Map      ledger.MapSummary
	Seeders  []ledger.SeederStatus
	Findings []finding.Finding // ranked; includes dismissed and fixed
	Skipped  []ledger.BudgetSkip
	Notes    []string
	Usage    Usage
}

Run is everything a renderer needs.

func Load

func Load(runDir string) (Run, error)

Load builds a Run from the ledger in runDir and nothing else.

func (Run) Active

func (r Run) Active() []finding.Finding

Active returns the findings that are not dismissed, in rank order.

func (Run) Count

func (r Run) Count() Counts

Count tallies the run's findings.

func (Run) Dismissed

func (r Run) Dismissed() []finding.Finding

Dismissed returns the findings the reviewer refuted, in rank order.

type Usage

type Usage struct {
	ModelCalls   int
	InputTokens  int
	OutputTokens int
	CostUSD      float64
	// Estimated is true when any call's token counts were estimated.
	Estimated bool
	// CostKnown is false when any call used a model with no known price.
	CostKnown   bool
	SandboxRuns int
	Leads       int
}

Usage totals the run's accounting.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL