Versions in this module Expand all Collapse all v0 v0.5.4 Jun 13, 2026 Changes in this version + const AlgorithmVersionAnalyzed + const AlgorithmVersionTransport + const DeviceIDFileName + const FindingSchemaVersion + const MaxBundleCommits + const MaxBundleDiffBytes + const MaxBundleTurns + const ProducerStateAnalyzed + const ProducerStateErrored + const ProducerStateTransportOnly + const PromptTemplateVersion + const RedactionVersion + var ErrAmbiguousPR = errors.New("intentgap: multiple open PRs for branch") + var ErrAnalyzerInternal = errors.New("intentgap: analyzer internal error") + var ErrAnalyzerLLMUnavailable = errors.New("intentgap: no LLM CLI produced a response") + var ErrAnalyzerParseFailed = errors.New("intentgap: could not parse findings JSON from LLM output") + var ErrAnalyzerSchemaFailed = errors.New("intentgap: LLM findings failed schema validation") + var ErrLineageUnavailable = errors.New("intentgap: lineage data unavailable") + var ErrNoInstalledProvider = errors.New("intentgap: no LLM CLI installed") + var ErrNoOpenPR = errors.New("intentgap: no open PR for branch") + var ErrRedactionFailed = errors.New("intentgap: redaction failed for at least one captured turn") + var ErrSkipped = errors.New("intentgap: upload skipped") + var ErrUnavailable = errors.New("intentgap: PR-context discovery server unavailable") + func BuildAnalyzedBody(in AnalyzedBodyInput, producedAt time.Time) ([]byte, string, error) + func BuildErroredBody(in UploadInput, reason, promptTemplateVersion string, producedAt time.Time) ([]byte, string, error) + func BuildTransportOnlyBody(in UploadInput, producedAt time.Time) ([]byte, string, error) + func ComputePayloadHash(in PayloadHashInput) (string, []byte, error) + func IntentGapFindingSchema() (*jsonschema.Schema, error) + func LoadOrCreateDeviceID() (string, error) + func MapWriterNameToWire(writerName string) (string, bool) + func ValidateFindings(findings json.RawMessage) error + type AmbiguousPRError struct + Matches []OpenPR + func (e *AmbiguousPRError) Error() string + func (e *AmbiguousPRError) Is(target error) bool + type AnalysisInput struct + Bundle Bundle + PRNumber int32 + RepositoryID string + type AnalysisResult struct + CoverageSummary json.RawMessage + Findings json.RawMessage + Model string + PromptTemplateVersion string + Provider string + type AnalyzedBodyInput struct + CoverageSummary json.RawMessage + Findings json.RawMessage + PromptTemplateVersion string + type Bundle struct + BaseRef string + BaseSHA string + Commits []BundleCommit + Diff []byte + HeadSHA string + RepoRoot string + Truncated BundleTruncation + Turns []BundleTurn + type BundleAssembler interface + Assemble func(ctx context.Context, in BundleInput) (Bundle, error) + type BundleCommit struct + Hash string + Subject string + type BundleInput struct + Base string + HeadSHA string + RepoRoot string + type BundleTruncation struct + CommitsDropped int + DiffBytesDropped int + TurnsDropped int + type BundleTurn struct + CommitHash string + PromptExcerpt string + PromptExcerptHash string + TS int64 + TurnID string + type CiteOrDropResult struct + AcceptedCount int + DroppedCount int + DroppedReasons map[string]int + Findings json.RawMessage + func FilterFindingsByCitations(findings json.RawMessage, bundle Bundle) (CiteOrDropResult, error) + type CommitMetaBetween struct + Hash string + Subject string + type GitBundleAssembler struct + func NewGitBundleAssembler(opener GitRepoOpener, turns TurnLoader) *GitBundleAssembler + func (a *GitBundleAssembler) Assemble(ctx context.Context, in BundleInput) (Bundle, error) + type GitRepo interface + CommitSummariesBetween func(ctx context.Context, base, head string, limit int) ([]CommitMetaBetween, error) + CountCommitsBetween func(ctx context.Context, base, head string) (int, error) + DefaultBaseRef func(ctx context.Context) (string, error) + DiffBetween func(ctx context.Context, base, head string) ([]byte, error) + MergeBase func(ctx context.Context, a, b string) (string, error) + type GitRepoOpener func(repoPath string) (GitRepo, error) + type InstalledProvider struct + Model string + Name string + func PickInstalledProvider(reg *llm.WriterRegistry) (InstalledProvider, error) + type IntentGapAnalyzer interface + Analyze func(ctx context.Context, in AnalysisInput) (AnalysisResult, error) + type LLMAnalyzer struct + func NewLLMAnalyzer(runner LLMRunner) *LLMAnalyzer + func (a *LLMAnalyzer) Analyze(ctx context.Context, in AnalysisInput) (AnalysisResult, error) + type LLMRunner interface + GenerateText func(ctx context.Context, prompt string) (*llm.GenerateTextResult, error) + type NoopTurnLoader struct + func (NoopTurnLoader) LoadTurnsForCommits(context.Context, []string) ([]BundleTurn, error) + type OpenPR struct + BaseBranch string + HeadBranch string + HeadSHA string + IsDraft bool + PRNumber int32 + State string + Title string + func LookupOpenPRByBranch(ctx context.Context, httpClient *http.Client, ...) (*OpenPR, error) + type PayloadHashInput struct + AlgorithmVersion string + BaseSHA string + CoverageSummary json.RawMessage + FindingSchemaVersion string + Findings json.RawMessage + HeadSHA string + Model string + PRNumber int32 + ProducerState string + PromptTemplateVersion string + Provider string + RedactionVersion string + RepositoryID string + type ReasonCode string + const ReasonAnalyzerInternal + const ReasonBundleFailed + const ReasonLLMUnavailable + const ReasonLineageUnavailable + const ReasonParseFailed + const ReasonRedactionFailed + const ReasonSchemaFailed + func ReasonCodeFor(err error) ReasonCode + type SkipReason struct + Reason string + func (e *SkipReason) Error() string + func (e *SkipReason) Is(target error) bool + type TurnLoader interface + LoadTurnsForCommits func(ctx context.Context, commitHashes []string) ([]BundleTurn, error) + type UploadInput struct + BaseSHA string + HeadSHA string + Model string + PRNumber int32 + ProducerDeviceID string + Provider string + RepositoryID string + type UploadResponse struct + ReceivedAt string + UploadID string + type UploadResult struct + ReceivedAt string + StatusCode int + UploadID string + func PostUpload(ctx context.Context, httpClient *http.Client, endpoint, token string, ...) (*UploadResult, error)