coverage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeAtom

func DescribeAtom(atom gitdiff.Atom) string

func SelectTarget added in v0.0.8

func SelectTarget(files []saga.DiffFile, changes gitdiff.ChangeSet) []gitdiff.Atom

SelectTarget returns the changed atoms matched by one narrative target's evidence. It reuses the coverage evaluator's indexed selector semantics but does not construct ownership for any sibling target or retain a whole-report graph. Lazy linked-code endpoints use it after reading only the source files named by that target.

Types

type Assignment

type Assignment struct {
	Target   string `json:"target"`
	DiffFile string `json:"diff_file"`
	Diff     int    `json:"diff"`
}

type Orphan

type Orphan struct {
	Assignment Assignment         `json:"assignment"`
	Reference  saga.DiffReference `json:"reference"`
	Reason     string             `json:"reason"`
}

type Overlap

type Overlap struct {
	Atom      gitdiff.Atom `json:"atom"`
	CoveredBy []Assignment `json:"covered_by"`
}

type Report

type Report struct {
	Complete      bool                    `json:"complete"`
	CoverageScope string                  `json:"coverage_scope"`
	Summary       Summary                 `json:"summary"`
	Uncovered     []gitdiff.Atom          `json:"uncovered"`
	Overlaps      []Overlap               `json:"overlaps"`
	Orphans       []Orphan                `json:"orphans"`
	Targets       []TargetSummary         `json:"targets"`
	SagaChanges   []gitdiff.Atom          `json:"saga_changes"`
	Repository    string                  `json:"repository"`
	Base          string                  `json:"base"`
	Head          string                  `json:"head"`
	BaseOID       string                  `json:"base_oid"`
	HeadOID       string                  `json:"head_oid"`
	SchemaValid   bool                    `json:"schema_valid"`
	SchemaIssues  []saga.Issue            `json:"schema_issues"`
	Ownership     map[string][]Assignment `json:"-"`
}

Report is a machine-consumed contract. Every collection field is always present and never null, so an agent can index into it without first testing for a missing key: a complete saga reports "uncovered": [] rather than omitting the field or emitting null.

func Evaluate

func Evaluate(document *saga.Saga, validation saga.Validation, changes gitdiff.ChangeSet) Report

func EvaluateSummary added in v0.0.8

func EvaluateSummary(document *saga.Saga, validation saga.Validation, changes gitdiff.ChangeSet) Report

EvaluateSummary computes coverage verdicts and per-target rollups without retaining atom-level ownership, uncovered, or overlap details. Overview-style queries use it because their bounded response needs counts, not the complete reverse indexes that gap, fragment, and diff-owner queries traverse.

type Summary

type Summary struct {
	Total       int `json:"total"`
	Covered     int `json:"covered"`
	Uncovered   int `json:"uncovered"`
	Overlapping int `json:"overlapping"`
	Orphaned    int `json:"orphaned"`
	SagaChanges int `json:"saga_changes"`
}

type TargetSummary

type TargetSummary struct {
	Target  string `json:"target"`
	Covered int    `json:"covered"`
}

Jump to

Keyboard shortcuts

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