Documentation
¶
Overview ¶
Package cache stores finished reviews on disk, keyed by everything that shapes them, so an unchanged spec reviewed again with unchanged settings costs nothing and gets the same verdict.
Agents and CI re-run the gate on the same spec over and over. A model asked the same question twice may answer differently, so caching also makes the gate stable: the verdict changes only when the spec or the settings do.
Index ¶
Constants ¶
const DefaultMaxAge = 30 * 24 * time.Hour
DefaultMaxAge is how long a stored review is used. Older entries are ignored and removed.
Variables ¶
var ErrUnknownBuild = errors.New("cannot identify this build of speccritic")
ErrUnknownBuild is returned by Key when the running program cannot be identified. Caching is then off: a review from another build could be served after an upgrade.
Functions ¶
Types ¶
type Store ¶
Store keeps reviews in one directory, one file per key.
func Default ¶
Default returns the store in SPECCRITIC_CACHE_DIR if set, and otherwise in the user's cache directory.