signal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package signal defines the core domain types for stringer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorOpts

type CollectorOpts struct {
	// MinConfidence filters signals below this threshold.
	MinConfidence float64

	// IncludePatterns limits collection to files matching these globs.
	IncludePatterns []string

	// ExcludePatterns skips files matching these globs.
	ExcludePatterns []string

	// ErrorMode controls how errors from this collector are handled.
	// Default (zero value or empty string) is treated as ErrorModeWarn.
	ErrorMode ErrorMode

	// LargeFileThreshold overrides the default large-file line count.
	// If zero, the default (1000 lines) is used.
	LargeFileThreshold int

	// GitRoot is the path to the .git directory root, which may differ
	// from RepoPath when scanning a subdirectory.
	GitRoot string

	// GitDepth caps the number of commits walked. 0 uses default (1000).
	GitDepth int

	// GitSince limits commit walking to commits after this duration (e.g., "90d", "6m", "1y").
	GitSince string

	// ProgressFunc is called periodically with status messages during long operations.
	ProgressFunc func(msg string)

	// IncludeClosed includes closed/merged issues and PRs in the GitHub collector.
	IncludeClosed bool

	// Anonymize controls author name anonymization: "auto", "always", or "never".
	Anonymize string
}

CollectorOpts holds per-collector configuration options.

type CollectorResult

type CollectorResult struct {
	// Collector is the name of the collector that produced these signals.
	Collector string

	// Signals are the raw signals extracted.
	Signals []RawSignal

	// Duration is how long the collector took.
	Duration time.Duration

	// Err is any error encountered during collection.
	Err error
}

CollectorResult holds the output from a single collector run.

type ErrorMode

type ErrorMode string

ErrorMode controls how the pipeline handles errors from a collector.

const (
	// ErrorModeWarn logs the error and continues (default).
	ErrorModeWarn ErrorMode = "warn"

	// ErrorModeSkip silently ignores errors.
	ErrorModeSkip ErrorMode = "skip"

	// ErrorModeFail aborts the entire scan on first error.
	ErrorModeFail ErrorMode = "fail"
)

type RawSignal

type RawSignal struct {
	Source      string    // Collector name: "todos", "gitlog", etc.
	Kind        string    // Signal kind: "todo", "fixme", "revert", "churn", etc.
	FilePath    string    // Path within the repo where this was found.
	Line        int       // Line number (0 if not applicable).
	Title       string    // Short description (used as bead title).
	Description string    // Longer context (used as bead description).
	Author      string    // Git blame author or commit author.
	Timestamp   time.Time // When this signal was created.
	Confidence  float64   // 0.0-1.0, how certain we are this is real work.
	Tags        []string  // Free-form tags for clustering hints.
	ClosedAt    time.Time // When this signal was closed/resolved (zero if open).
}

RawSignal represents a single actionable signal extracted from a repository.

type ScanConfig

type ScanConfig struct {
	// RepoPath is the path to the repository to scan.
	RepoPath string

	// Collectors lists the collector names to run. Empty means all registered.
	Collectors []string

	// OutputFormat specifies the output format (e.g., "beads", "json", "markdown").
	OutputFormat string

	// NoLLM disables the LLM clustering pass.
	NoLLM bool

	// CollectorOpts provides per-collector options keyed by collector name.
	CollectorOpts map[string]CollectorOpts

	// ExcludePatterns holds global exclude globs applied to all collectors.
	ExcludePatterns []string

	// MaxIssues caps the number of output issues (0 = unlimited).
	MaxIssues int
}

ScanConfig holds the overall configuration for a scan operation.

type ScanResult

type ScanResult struct {
	// Signals is the combined list of signals from all collectors.
	Signals []RawSignal

	// Results is the per-collector breakdown.
	Results []CollectorResult

	// Duration is the total scan duration.
	Duration time.Duration
}

ScanResult holds the aggregate output of a scan operation.

Jump to

Keyboard shortcuts

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