enrichment

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package enrichment provides task handlers for enrichment operations.

Index

Constants

View Source
const MaxDiffLength = 100_000

MaxDiffLength is the maximum characters for a commit diff (~25k tokens).

Variables

This section is empty.

Functions

func TruncateDiff

func TruncateDiff(diff string, maxLength int) string

TruncateDiff truncates a diff to a reasonable length for LLM processing.

Types

type APIDocExtractor

type APIDocExtractor interface {
	Extract(ctx context.Context, files []repository.File, language string, includePrivate bool) ([]enrichment.Enrichment, error)
}

APIDocExtractor extracts API documentation from files.

type APIDocs

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

APIDocs handles the CREATE_PUBLIC_API_DOCS_FOR_COMMIT operation.

func NewAPIDocs

func NewAPIDocs(
	fileStore repository.FileStore,
	enrichCtx handler.EnrichmentContext,
	extractor APIDocExtractor,
) *APIDocs

NewAPIDocs creates a new APIDocs handler.

func (*APIDocs) Execute

func (h *APIDocs) Execute(ctx context.Context, payload map[string]any) error

Execute processes the CREATE_PUBLIC_API_DOCS_FOR_COMMIT task.

type ArchitectureDiscoverer

type ArchitectureDiscoverer interface {
	Discover(ctx context.Context, repoPath string) (string, error)
}

ArchitectureDiscoverer discovers physical architecture from a repository.

type ArchitectureDiscovery

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

ArchitectureDiscovery handles the CREATE_ARCHITECTURE_ENRICHMENT_FOR_COMMIT operation.

func NewArchitectureDiscovery

func NewArchitectureDiscovery(
	repoStore repository.RepositoryStore,
	enrichCtx handler.EnrichmentContext,
	discoverer ArchitectureDiscoverer,
) (*ArchitectureDiscovery, error)

NewArchitectureDiscovery creates a new ArchitectureDiscovery handler.

func (*ArchitectureDiscovery) Execute

func (h *ArchitectureDiscovery) Execute(ctx context.Context, payload map[string]any) error

Execute processes the CREATE_ARCHITECTURE_ENRICHMENT_FOR_COMMIT task.

type CommitDescription

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

CommitDescription handles the CREATE_COMMIT_DESCRIPTION_FOR_COMMIT operation.

func NewCommitDescription

func NewCommitDescription(
	repoStore repository.RepositoryStore,
	enrichCtx handler.EnrichmentContext,
	adapter infraGit.Adapter,
) (*CommitDescription, error)

NewCommitDescription creates a new CommitDescription handler.

func (*CommitDescription) Execute

func (h *CommitDescription) Execute(ctx context.Context, payload map[string]any) error

Execute processes the CREATE_COMMIT_DESCRIPTION_FOR_COMMIT task.

type Cookbook

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

Cookbook handles the CREATE_COOKBOOK_FOR_COMMIT operation.

func NewCookbook

func NewCookbook(
	repoStore repository.RepositoryStore,
	fileStore repository.FileStore,
	enrichCtx handler.EnrichmentContext,
	contextGatherer CookbookContextGatherer,
) (*Cookbook, error)

NewCookbook creates a new Cookbook handler.

func (*Cookbook) Execute

func (h *Cookbook) Execute(ctx context.Context, payload map[string]any) error

Execute processes the CREATE_COOKBOOK_FOR_COMMIT task.

type CookbookContextGatherer

type CookbookContextGatherer interface {
	Gather(ctx context.Context, repoPath, language string) (string, error)
}

CookbookContextGatherer gathers context for cookbook generation.

type CreateSummary

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

CreateSummary handles the CREATE_SUMMARY_ENRICHMENT_FOR_COMMIT operation.

func NewCreateSummary

func NewCreateSummary(
	enrichCtx handler.EnrichmentContext,
) (*CreateSummary, error)

NewCreateSummary creates a new CreateSummary handler.

func (*CreateSummary) Execute

func (h *CreateSummary) Execute(ctx context.Context, payload map[string]any) error

Execute processes the CREATE_SUMMARY_ENRICHMENT_FOR_COMMIT task.

type DatabaseSchema

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

DatabaseSchema handles the CREATE_DATABASE_SCHEMA_FOR_COMMIT operation.

func NewDatabaseSchema

func NewDatabaseSchema(
	repoStore repository.RepositoryStore,
	enrichCtx handler.EnrichmentContext,
	discoverer SchemaDiscoverer,
) (*DatabaseSchema, error)

NewDatabaseSchema creates a new DatabaseSchema handler.

func (*DatabaseSchema) Execute

func (h *DatabaseSchema) Execute(ctx context.Context, payload map[string]any) error

Execute processes the CREATE_DATABASE_SCHEMA_FOR_COMMIT task.

type ExampleDiscoverer

type ExampleDiscoverer interface {
	IsExampleCandidate(path string) bool
	IsDocumentationFile(path string) bool
}

ExampleDiscoverer determines if files are example candidates.

type ExampleSummary

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

ExampleSummary handles the CREATE_EXAMPLE_SUMMARY_FOR_COMMIT operation.

func NewExampleSummary

func NewExampleSummary(
	enrichCtx handler.EnrichmentContext,
) (*ExampleSummary, error)

NewExampleSummary creates a new ExampleSummary handler.

func (*ExampleSummary) Execute

func (h *ExampleSummary) Execute(ctx context.Context, payload map[string]any) error

Execute processes the CREATE_EXAMPLE_SUMMARY_FOR_COMMIT task.

type ExtractExamples

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

ExtractExamples handles the EXTRACT_EXAMPLES_FOR_COMMIT operation.

func NewExtractExamples

func NewExtractExamples(
	repoStore repository.RepositoryStore,
	commitStore repository.CommitStore,
	adapter infraGit.Adapter,
	enrichCtx handler.EnrichmentContext,
	discoverer ExampleDiscoverer,
) *ExtractExamples

NewExtractExamples creates a new ExtractExamples handler.

func (*ExtractExamples) Execute

func (h *ExtractExamples) Execute(ctx context.Context, payload map[string]any) error

Execute processes the EXTRACT_EXAMPLES_FOR_COMMIT task.

type SchemaDiscoverer

type SchemaDiscoverer interface {
	Discover(ctx context.Context, repoPath string) (string, error)
}

SchemaDiscoverer detects database schemas from a repository.

type Wiki

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

Wiki handles the GENERATE_WIKI_FOR_COMMIT operation.

func NewWiki

func NewWiki(
	repoStore repository.RepositoryStore,
	commitStore repository.CommitStore,
	fileStore repository.FileStore,
	enrichCtx handler.EnrichmentContext,
	contextGatherer WikiContextGatherer,
) (*Wiki, error)

NewWiki creates a new Wiki handler.

func (*Wiki) Execute

func (h *Wiki) Execute(ctx context.Context, payload map[string]any) error

Execute processes the GENERATE_WIKI_FOR_COMMIT task.

type WikiContextGatherer

type WikiContextGatherer interface {
	Gather(ctx context.Context, repoPath string, files []repository.File, existingEnrichments []enrichment.Enrichment) (readme, fileTree, enrichments string, err error)
	FileContent(repoPath, filePath string, maxLen int) string
}

WikiContextGatherer gathers context for wiki generation.

Jump to

Keyboard shortcuts

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