Documentation
¶
Overview ¶
Package describework implements the "describe-work" 🤖 transform primitive: it turns a group of raw commit titles into a one-line, natural-language description of the work — because commit subjects like "fix", "wip", or "asdf" don't belong in a timesheet or client report. A thin or junk title triggers a diff fetch so the description reflects what actually changed, not a meaningless subject line.
The primitive depends on nothing concrete: CacheStore, LLMClient, and GHDiffer (interfaces.go) are small in-package interfaces the engine wires to real implementations (the db-backed llm_cache table, elelem, commander's gh shell-out). That dependency inversion keeps this package unit-testable with mocks — see /home/bw/work/psyb0t/.git-trakz.md's "LLM steps are versioned + cached" section for the cache contract this implements.
Every group is cached by (step, processingVersion, inputHash): processingVersion hashes the whole LLM config (prompt version + model), so a cache hit skips the LLM call entirely, and changing the prompt or model bumps the version, cleanly invalidating old entries without deleting them.
Index ¶
Constants ¶
const Name = "describe-work"
Name is the primitive's registry key.
Variables ¶
var ErrMissingDependency = errors.New(
"describe-work missing required dependency",
)
ErrMissingDependency is returned by New when cache, llm, or gh is nil — describe-work cannot run without all three.
var ErrUnknownBy = errors.New("unknown describe-work group field")
ErrUnknownBy is returned by New when the "by" param names a field describe-work doesn't know how to group on.
Functions ¶
Types ¶
type CacheStore ¶
type CacheStore interface {
Get(ctx context.Context, key string) (string, bool, error)
Put(
ctx context.Context,
key, step, processingVersion, inputHash, output string,
) error
}
CacheStore persists and retrieves LLM step outputs keyed by a deterministic hash of (step, processingVersion, inputHash) — the llm_cache table's shape (see common/transform doc + git-trakz.md's "LLM steps are versioned + cached"). Get's second return reports a cache hit; a miss returns ("", false, nil) with no error.