lore

package
v0.50.49 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package lore는 git commit 트레일러 기반의 의사결정 지식 관리를 제공한다.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCommit

func BuildCommit(entry *LoreEntry, message string) (string, error)

BuildCommit는 LoreEntry와 메시지로 git commit 메시지를 생성한다.

func FormatTrailers

func FormatTrailers(entry *LoreEntry) string

FormatTrailers는 LoreEntry를 트레일러 형식 문자열로 변환한다.

Types

type LoreConfig

type LoreConfig struct {
	RequiredTrailers   []string // 필수 트레일러 목록
	StaleThresholdDays int      // 오래된 항목 기준 (일)
}

LoreConfig는 Lore 설정이다.

type LoreEntry

type LoreEntry struct {
	// 9개 트레일러 필드
	Constraint    string // 제약 사항
	Rejected      string // 거부된 대안
	Confidence    string // 신뢰도: low, medium, high
	ScopeRisk     string // 범위 리스크: local, module, system
	Reversibility string // 되돌릴 수 있는 정도: trivial, moderate, difficult
	Directive     string // 지시사항
	Tested        string // 테스트된 항목
	NotTested     string // 테스트되지 않은 항목
	Related       string // 관련 항목

	// 메타데이터 (git log에서 추출)
	CommitHash string    // 커밋 해시
	CommitDate time.Time // 커밋 날짜
	CommitMsg  string    // 커밋 메시지 (트레일러 제외)
	FilePath   string    // 관련 파일 경로
}

LoreEntry는 하나의 Lore 의사결정 항목이다.

func ParseTrailers

func ParseTrailers(commitMsg string) (*LoreEntry, error)

ParseTrailers는 git commit 메시지에서 Lore 트레일러를 파싱한다.

func QueryConstraints

func QueryConstraints(dir string) ([]LoreEntry, error)

QueryConstraints는 Constraint 트레일러가 있는 Lore 항목을 반환한다.

func QueryContext

func QueryContext(dir, path string) ([]LoreEntry, error)

QueryContext는 특정 파일 경로와 관련된 Lore 항목을 반환한다.

func QueryDirectives

func QueryDirectives(dir string) ([]LoreEntry, error)

QueryDirectives는 Directive 트레일러가 있는 Lore 항목을 반환한다.

func QueryRejected

func QueryRejected(dir string) ([]LoreEntry, error)

QueryRejected는 Rejected 트레일러가 있는 Lore 항목을 반환한다.

func QueryStale

func QueryStale(dir string, days int) ([]LoreEntry, error)

QueryStale은 N일보다 오래된 Lore 항목을 반환한다.

type ValidationError

type ValidationError struct {
	Field   string // 오류 필드
	Message string // 오류 메시지
}

ValidationError는 검증 오류이다.

func Validate

func Validate(commitMsg string, config LoreConfig) []ValidationError

Validate는 커밋 메시지의 Lore 트레일러를 검증한다.

func (ValidationError) Error

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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