analyzer

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatValidationErrors

func FormatValidationErrors(result ValidationResult) string

FormatValidationErrors formats validation errors as a string

func PrintBanner

func PrintBanner(opts BannerOptions)

PrintBanner prints the startup banner with width adaptation

func SetStatus

func SetStatus(memoDir string, status string) error

SetStatus writes status to .memo/status.json

func TryLock

func TryLock(memoDir string) (*os.File, error)

TryLock attempts to acquire an exclusive lock on .memo/watcher.lock Returns the lock file handle if successful, nil and error if already locked

func Unlock

func Unlock(f *os.File)

Unlock releases the lock and closes the file

Types

type AgentConfig

type AgentConfig struct {
	APIKey string
	Model  string
}

AgentConfig holds the agent configuration

type Analyser

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

Analyser performs code analysis using AI

func NewAnalyser

func NewAnalyser(agentCfg AgentConfig, workDir string) *Analyser

NewAnalyser creates a new Analyser instance

func (*Analyser) Analyse

func (a *Analyser) Analyse(ctx context.Context, changedFiles []string) error

Analyse performs analysis on the given changed files

func (*Analyser) AnalyseCheckpoints added in v0.0.9

func (a *Analyser) AnalyseCheckpoints(ctx context.Context, checkpoints []CheckpointData) error

AnalyseCheckpoints analyses Entire.io checkpoint data and fuses insights into the existing 4 index files (arch, interface, stories, issues).

type BannerOptions

type BannerOptions struct {
	WorkDir    string
	Version    string
	UpdateInfo *UpdateInfo // Optional: update information to display
}

BannerOptions contains the information to display in the banner

type CheckpointData added in v0.0.9

type CheckpointData struct {
	CommitSHA    string
	CheckpointID string            // extracted from directory name (2-char prefix + remaining)
	Files        map[string]string // path → content on the checkpoint tree
}

CheckpointData holds the data extracted from a single checkpoint

type CheckpointMonitor added in v0.0.9

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

CheckpointMonitor watches the entire/checkpoints/v1 ref for new commits

func NewCheckpointMonitor added in v0.0.9

func NewCheckpointMonitor(workDir string, debounceMs int, onChange func([]CheckpointData)) (*CheckpointMonitor, error)

NewCheckpointMonitor creates a monitor for Entire.io checkpoint branch changes

func (*CheckpointMonitor) Close added in v0.0.9

func (m *CheckpointMonitor) Close() error

Close stops the checkpoint monitor

func (*CheckpointMonitor) Run added in v0.0.9

func (m *CheckpointMonitor) Run() error

Run starts the monitoring loop. It watches the git ref file if available, otherwise falls back to polling every 30 seconds.

func (*CheckpointMonitor) ScanAll added in v0.0.9

func (m *CheckpointMonitor) ScanAll() ([]CheckpointData, error)

ScanAll performs a one-shot extraction of all checkpoints relevant to the current branch

type EntireConfig added in v0.0.9

type EntireConfig struct {
	Enabled  bool
	Strategy string // e.g. "manual-commit"
	Branch   string // e.g. "entire/checkpoints/v1"
}

EntireConfig describes the detected Entire.io configuration

func DetectEntire added in v0.0.9

func DetectEntire(workDir string) (*EntireConfig, error)

DetectEntire checks if Entire.io is configured in the given work directory. Returns nil if Entire.io is not detected.

type GitignoreMatcher added in v0.0.9

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

GitignoreMatcher handles nested .gitignore files like Git does

func NewGitignoreMatcher added in v0.0.9

func NewGitignoreMatcher(root string, globalPatterns []string) (*GitignoreMatcher, error)

NewGitignoreMatcher creates a new matcher and scans all .gitignore files

func (*GitignoreMatcher) AddGitignore added in v0.0.9

func (m *GitignoreMatcher) AddGitignore(gitignorePath string) error

AddGitignore dynamically adds or updates a .gitignore file

func (*GitignoreMatcher) Match added in v0.0.9

func (m *GitignoreMatcher) Match(absPath string) bool

Match checks if a path should be ignored Following Git's rules: 1. Global patterns (from config.yaml) always apply 2. Walk from file directory up to root, checking each directory's .gitignore 3. Each .gitignore's rules are matched relative to its directory

func (*GitignoreMatcher) RemoveGitignore added in v0.0.9

func (m *GitignoreMatcher) RemoveGitignore(gitignorePath string)

RemoveGitignore removes a deleted .gitignore file from the matcher

type Status

type Status struct {
	Status string     `json:"status"`          // "idle" | "analyzing"
	Since  *time.Time `json:"since,omitempty"` // when analysis started
}

Status represents the current analysis status

func GetStatus

func GetStatus(memoDir string) Status

GetStatus reads status from .memo/status.json Returns "idle" if file doesn't exist or is invalid

type UpdateInfo added in v0.0.7

type UpdateInfo struct {
	LatestVersion string
	UpdateCommand string
}

UpdateInfo contains information about an available update

type ValidationResult

type ValidationResult struct {
	Valid  bool
	Errors []string
}

ValidationResult holds the result of index validation

func ValidateIndex

func ValidateIndex(indexDir string) ValidationResult

ValidateIndex validates all JSON files in the index directory

type Watcher

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

func NewWatcher

func NewWatcher(root string, globalPatterns []string, debounceMs, maxWaitMs int, onChange func([]string)) (*Watcher, error)

func (*Watcher) Close

func (w *Watcher) Close() error

func (*Watcher) Flush

func (w *Watcher) Flush()

func (*Watcher) Run

func (w *Watcher) Run() error

func (*Watcher) ScanAll

func (w *Watcher) ScanAll()

ScanAll traverses all files and adds them to pending, triggering initial analysis

Jump to

Keyboard shortcuts

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