coverage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderJSON

func RenderJSON(report *CoverageReport) ([]byte, error)

RenderJSON marshals a coverage report to indented JSON.

func RenderMarkdown

func RenderMarkdown(report *CoverageReport) string

RenderMarkdown formats a coverage report as Markdown.

func RenderText

func RenderText(report *CoverageReport) string

RenderText formats a coverage report as plain text.

Types

type Component

type Component struct {
	Type       string // api_endpoint|service_method|ui_screen|api_call
	Identifier string // POST /path, MethodName, ScreenName
	Status     Status
	Evidence   []string // matched symbols/files
	Confidence float64  // 0.0 - 1.0
}

Component is a specific implementable piece of a feature

type CoverageReport

type CoverageReport struct {
	SpecFile        string
	GeneratedAt     time.Time
	Features        []FeatureResult
	TotalFeatures   int
	Implemented     int
	Partial         int
	Missing         int
	CoveragePercent float64
}

CoverageReport is the full analysis result

func GenerateReport

func GenerateReport(features []FeatureResult, specFile string) *CoverageReport

GenerateReport computes summary statistics over feature results.

type Detector

type Detector struct {
	// contains filtered or unexported fields
}

Detector checks whether feature components are present in the indexed codebase.

func NewDetector

NewDetector creates a Detector backed by the given pool and repositories.

func (*Detector) DetectFeature

func (d *Detector) DetectFeature(ctx context.Context, feature *Feature) (*FeatureResult, error)

DetectFeature checks all components of a feature and returns a FeatureResult.

type Feature

type Feature struct {
	Name        string
	Description string
	Backend     []Component
	Frontend    []Component
}

Feature is a high-level product feature from the spec

func ParseWithRegex

func ParseWithRegex(section FeatureSection) *Feature

ParseWithRegex extracts components using regex patterns (no AI, --no-ai flag).

type FeatureResult

type FeatureResult struct {
	Feature        Feature
	BackendStatus  Status
	FrontendStatus Status
	OverallStatus  Status
}

FeatureResult is a feature with its coverage analysis

type FeatureSection

type FeatureSection struct {
	Name    string
	RawText string
}

FeatureSection is a raw parsed section from the spec file

func ParseSpecFile

func ParseSpecFile(path string) ([]FeatureSection, error)

ParseSpecFile reads a Markdown file and splits it into feature sections. Looks for H2/H3 headers with "Feature:" prefix or "Feature " keyword.

type GeminiParser

type GeminiParser struct {
	// contains filtered or unexported fields
}

GeminiParser uses the Gemini API to extract structured feature components from spec text.

func NewGeminiParser

func NewGeminiParser(ctx context.Context, apiKey string) (*GeminiParser, error)

NewGeminiParser creates a new GeminiParser using the provided API key.

func (*GeminiParser) Close

func (p *GeminiParser) Close()

Close releases resources held by the Gemini client.

func (*GeminiParser) ExtractFeatureComponents

func (p *GeminiParser) ExtractFeatureComponents(ctx context.Context, section FeatureSection) (*Feature, error)

ExtractFeatureComponents calls Gemini to parse a FeatureSection into a Feature with typed components.

type Status

type Status string

Status of a feature component implementation

const (
	StatusImplemented Status = "implemented"
	StatusPartial     Status = "partial"
	StatusMissing     Status = "missing"
)

Jump to

Keyboard shortcuts

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