Versions in this module Expand all Collapse all v0 v0.2.9 May 22, 2026 Changes in this version + const RecordKindCase + const RecordKindPattern + const RecordKindRule + const RecordKindTask + var ErrApplyDraftFailed = errors.New("apply draft failed") + func ApplyLifecycleState(paths Paths, profile SkillProfile, next SkillStatus) error + func SaveAppliedProfile(store *Store, workspace string, draft SkillDraft, now time.Time) error + func ValidateDraft(draft SkillDraft) []string + type Applier struct + func NewApplier(paths Paths, now func() time.Time) *Applier + func (a *Applier) ApplyDraft(ctx context.Context, workspace string, draft SkillDraft) error + type AttemptTrail struct + AttemptedSkills []string + FinalSuccessfulPath []string + SkillContextSnapshots []SkillContextSnapshot + type CaseWriter struct + func NewCaseWriter(paths Paths) *CaseWriter + func (w *CaseWriter) AppendCase(ctx context.Context, record LearningRecord) error + type ChangeKind string + const ChangeKindAppend + const ChangeKindCreate + const ChangeKindMerge + const ChangeKindReplace + type ColdPathRunner struct + func NewColdPathRunner(runtime coldPathRuntime) *ColdPathRunner + func NewColdPathRunnerWithErrorHandler(runtime coldPathRuntime, onError func(error)) *ColdPathRunner + func (r *ColdPathRunner) Close() error + func (r *ColdPathRunner) Trigger(workspace string) bool + type DefaultDraftGenerator struct + func NewDefaultDraftGenerator(workspace string) *DefaultDraftGenerator + func (g *DefaultDraftGenerator) GenerateDraft(_ context.Context, rule LearningRecord, matches []skills.SkillInfo) (SkillDraft, error) + func (g *DefaultDraftGenerator) GenerateDraftWithEvidence(_ context.Context, rule LearningRecord, matches []skills.SkillInfo, ...) (SkillDraft, error) + type DraftEvidence struct + TaskRecords []LearningRecord + type DraftGenerator interface + GenerateDraft func(ctx context.Context, rule LearningRecord, matches []skills.SkillInfo) (SkillDraft, error) + func NewDraftGeneratorForWorkspace(workspace string, provider providers.LLMProvider, modelID string) DraftGenerator + type DraftPreview struct + CurrentBody string + DiffPreview string + RenderedBody string + func BuildDraftPreview(workspace string, draft SkillDraft) (DraftPreview, error) + type DraftReviewResult struct + Findings []string + ReviewNotes []string + Status DraftStatus + func ReviewDraft(draft SkillDraft) DraftReviewResult + type DraftStatus string + const DraftStatusAccepted + const DraftStatusCandidate + const DraftStatusQuarantined + type DraftType string + const DraftTypeShortcut + const DraftTypeWorkflow + type EvidenceAwareDraftGenerator interface + GenerateDraftWithEvidence func(ctx context.Context, rule LearningRecord, matches []skills.SkillInfo, ...) (SkillDraft, error) + type HeuristicPatternClusterer struct + func NewHeuristicPatternClusterer(minCaseCount int, now func() time.Time) *HeuristicPatternClusterer + func (c *HeuristicPatternClusterer) BuildPatterns(_ context.Context, workspace string, tasks []LearningRecord, ...) ([]LearningRecord, []string, error) + type HeuristicSuccessJudge struct + func (j *HeuristicSuccessJudge) JudgeTaskRecord(_ context.Context, record LearningRecord) (TaskSuccessDecision, error) + type LLMDraftGenerator struct + func NewLLMDraftGenerator(provider providers.LLMProvider, model string, fallback DraftGenerator) *LLMDraftGenerator + func (g *LLMDraftGenerator) GenerateDraft(ctx context.Context, rule LearningRecord, matches []skills.SkillInfo) (SkillDraft, error) + func (g *LLMDraftGenerator) GenerateDraftWithEvidence(ctx context.Context, rule LearningRecord, matches []skills.SkillInfo, ...) (SkillDraft, error) + type LLMPatternClusterer struct + func NewLLMPatternClusterer(provider providers.LLMProvider, model string, fallback PatternClusterer, ...) *LLMPatternClusterer + func (c *LLMPatternClusterer) BuildPatterns(ctx context.Context, workspace string, tasks []LearningRecord, ...) ([]LearningRecord, []string, error) + func (c *LLMPatternClusterer) BuildPatternsWithEvidence(ctx context.Context, workspace string, successfulTasks []LearningRecord, ...) ([]LearningRecord, []string, error) + type LLMTaskSuccessJudge struct + func NewLLMTaskSuccessJudge(provider providers.LLMProvider, model string, fallback SuccessJudge) *LLMTaskSuccessJudge + func (j *LLMTaskSuccessJudge) JudgeTaskRecord(ctx context.Context, record LearningRecord) (TaskSuccessDecision, error) + type LearningRecord struct + ActiveSkillNames []string + AddedSkillNames []string + AllLoadedSkillNames []string + AttemptTrail *AttemptTrail + ClusterReason string + CreatedAt time.Time + EventCount int + FinalOutput string + FinalSnapshotTrigger string + ID string + InitialSkillNames []string + Kind RecordKind + Label string + LateAddedSkills []string + MatchedSkillNames []string + MaturityScore float64 + SessionKey string + Signals []string + Source map[string]any + SourceRecordIDs []string + Status RecordStatus + Success *bool + SuccessRate float64 + Summary string + TaskHash string + TaskRecordIDs []string + ToolExecutions []ToolExecutionRecord + ToolKinds []string + UpdatedAt *time.Time + UsedSkillNames []string + UserGoal string + WinningPath []string + WorkspaceID string + type LifecycleRunSummary struct + DeletedSkills int + EvaluatedProfiles int + TransitionedProfiles int + func RunLifecycleOnce(store *Store, paths Paths, workspace string, now time.Time) (LifecycleRunSummary, error) + type Organizer struct + func NewOrganizer(opts OrganizerOptions) *Organizer + func (o *Organizer) BuildRules(records []LearningRecord) ([]LearningRecord, error) + type OrganizerOptions struct + MinCaseCount int + MinSuccessRate float64 + Now func() time.Time + type Paths struct + BackupsDir string + LearningRecords string + PatternRecords string + ProfilesDir string + RootDir string + SkillDrafts string + TaskRecords string + Workspace string + func NewPaths(workspace, override string) Paths + type PatternClusterer interface + BuildPatterns func(ctx context.Context, workspace string, tasks []LearningRecord, ...) ([]LearningRecord, []string, error) + type RecordKind string + type RecordStatus string + type Runtime struct + func NewRuntime(opts RuntimeOptions) (*Runtime, error) + func (rt *Runtime) FinalizeTurn(ctx context.Context, input TurnCaseInput) error + func (rt *Runtime) RunColdPathOnce(ctx context.Context, workspace string) error + type RuntimeOptions struct + Applier *Applier + ApplierFactory func(workspace string) *Applier + Config config.EvolutionConfig + DraftGenerator DraftGenerator + GeneratorFactory func(workspace string) DraftGenerator + Now func() time.Time + Organizer *Organizer + PatternClusterer PatternClusterer + SkillsRecaller *SkillsRecaller + Store *Store + SuccessJudge SuccessJudge + SuccessJudgeFactory func(workspace string) SuccessJudge + type SkillContextSnapshot struct + Sequence int + SkillNames []string + Trigger string + type SkillDraft struct + AvoidPatterns []string + BodyOrPatch string + ChangeKind ChangeKind + CreatedAt time.Time + DraftType DraftType + HumanSummary string + ID string + IntendedUseCases []string + MatchedSkillRefs []string + PreferredEntryPath []string + ReviewNotes []string + ScanFindings []string + SourceRecordID string + Status DraftStatus + TargetSkillName string + UpdatedAt *time.Time + WorkspaceID string + type SkillProfile struct + AvoidPatterns []string + ChangeReason string + CurrentVersion string + HumanSummary string + IntendedUseCases []string + LastUsedAt time.Time + Origin string + PreferredEntryPath []string + RetentionScore float64 + SkillName string + Status SkillStatus + UseCount int + VersionHistory []SkillVersionEntry + WorkspaceID string + type SkillStatus string + const SkillStatusActive + const SkillStatusArchived + const SkillStatusCold + const SkillStatusDeleted + func NextLifecycleState(profile SkillProfile, now time.Time) SkillStatus + type SkillVersionEntry struct + Action string + DraftID string + Rollback bool + RollbackReason string + Summary string + Timestamp time.Time + Version string + type SkillsRecaller struct + func NewSkillsRecaller(workspace string) *SkillsRecaller + func (r *SkillsRecaller) RecallSimilarSkills(rule LearningRecord) ([]skills.SkillInfo, error) + type Store struct + func NewStore(paths Paths) *Store + func (s *Store) AppendLearningRecord(ctx context.Context, record LearningRecord) error + func (s *Store) AppendLearningRecords(records []LearningRecord) error + func (s *Store) AppendPatternRecords(records []LearningRecord) error + func (s *Store) AppendTaskRecord(ctx context.Context, record LearningRecord) error + func (s *Store) AppendTaskRecords(ctx context.Context, records []LearningRecord) error + func (s *Store) LoadDrafts() ([]SkillDraft, error) + func (s *Store) LoadLearningRecords() ([]LearningRecord, error) + func (s *Store) LoadPatternRecords() ([]LearningRecord, error) + func (s *Store) LoadProfile(skillName string) (SkillProfile, error) + func (s *Store) LoadProfiles() ([]SkillProfile, error) + func (s *Store) LoadTaskRecords() ([]LearningRecord, error) + func (s *Store) MarkTaskRecordsClustered(ids []string) error + func (s *Store) MergePatternRecords(records []LearningRecord) error + func (s *Store) SaveDrafts(drafts []SkillDraft) error + func (s *Store) SavePatternRecords(records []LearningRecord) error + func (s *Store) SaveProfile(profile SkillProfile) error + func (s *Store) SaveTaskRecords(records []LearningRecord) error + func (s *Store) UpdateProfile(workspaceID, skillName string, ...) error + type SuccessJudge interface + JudgeTaskRecord func(ctx context.Context, record LearningRecord) (TaskSuccessDecision, error) + type TaskSuccessDecision struct + Reason string + Success bool + type ToolExecutionRecord struct + ErrorSummary string + Name string + SkillNames []string + Success bool + type TurnCaseInput struct + ActiveSkillNames []string + AgentID string + AttemptedSkillNames []string + FinalContent string + FinalSuccessfulPath []string + SessionKey string + SkillContextSnapshots []SkillContextSnapshot + Status string + ToolExecutions []ToolExecutionRecord + ToolKinds []string + TurnID string + UserMessage string + Workspace string + WorkspaceID string