Documentation
¶
Overview ¶
Package config loads ~/.culi/config.yaml with defaults. The base directory is overridable via CULI_HOME so tests and sandboxes never touch the real user store.
Index ¶
- func BaseDir() (string, error)
- func DBPath(base string) string
- func InboxDir(base string) string
- func KnowledgeDir(base string) string
- func LogDir(base string) string
- func SetRepos(base string, repos []string) error
- func StateDir(base string) string
- type Config
- type ImportConfig
- type LearnConfig
- type OllamaConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KnowledgeDir ¶
KnowledgeDir returns the canonical card store directory under base.
func SetRepos ¶
SetRepos rewrites only the `repos:` list in config.yaml, preserving every other key and all of the operator's comments. It round-trips through yaml.Node and replaces just the repos sequence node — a full Marshal of the Config struct would strip comments (C4: never destroy user content).
Types ¶
type Config ¶
type Config struct {
// PushBudget is the max estimated tokens injected per UserPromptSubmit.
PushBudget int `yaml:"push_budget"`
// BaselineBudget is the max estimated tokens injected at SessionStart.
BaselineBudget int `yaml:"baseline_budget"`
// Ollama configures the local embedding endpoint (used from Phase 3).
Ollama OllamaConfig `yaml:"ollama"`
// ExtraAcks extends the built-in acknowledgement lexicon (the
// inject-nothing gate) with the user's own phrases, any language.
ExtraAcks []string `yaml:"extra_acks"`
// ExtraStopwords extends the built-in stopword packs.
ExtraStopwords []string `yaml:"extra_stopwords"`
// Repos lists absolute paths of repositories whose .claude directories
// and CLAUDE.md files `culi import` reconciles into the canonical store.
Repos []string `yaml:"repos"`
// Import configures the drift-reconcile pipeline.
Import ImportConfig `yaml:"import"`
// Learn configures the background learning pipelines.
Learn LearnConfig `yaml:"learn"`
}
Config holds user-tunable settings. Zero values are replaced by defaults in Load so a partial (or absent) config.yaml always yields a usable Config.
type ImportConfig ¶
type ImportConfig struct {
// Provider selects the merge backend: auto (default — anthropic when
// ANTHROPIC_API_KEY is set, else claude-cli when the claude binary is in
// PATH), anthropic, claude-cli, ollama, or none (mechanical only).
Provider string `yaml:"provider"`
// MergeModel is the model used to reconcile diverged clusters and
// decompose CLAUDE.md files. For anthropic/claude-cli this is a Claude
// model ID; for ollama it MUST be a local generation model (e.g. qwen3).
MergeModel string `yaml:"merge_model"`
}
ImportConfig tunes `culi import merge`.
type LearnConfig ¶
type LearnConfig struct {
// Enabled is the master switch (default true).
Enabled bool `yaml:"enabled"`
// Provider selects the mining backend like import.provider: auto (default),
// anthropic, claude-cli, ollama, or none.
Provider string `yaml:"provider"`
// CheapModel handles routine mining; StrongModel is the one-step
// escalation on schema failures. For ollama both MUST be local models.
CheapModel string `yaml:"cheap_model"`
StrongModel string `yaml:"strong_model"`
// DailyUSDCap bounds estimated API spend per day (anthropic backend only;
// claude-cli and ollama cost $0). 0 = default.
DailyUSDCap float64 `yaml:"daily_usd_cap"`
// DailyCallCap bounds model calls per day on every backend — the
// subscription-quota guard for claude-cli. 0 = default.
DailyCallCap int `yaml:"daily_call_cap"`
// CandidateTTLDays auto-retires mined candidate cards left unreinforced for
// this many days (file mtime is the clock). 0 = default (30); a negative
// value disables the janitor. Confirmed cards are NEVER auto-retired —
// dormant ones are only reported by `culi stats` (C4).
CandidateTTLDays int `yaml:"candidate_ttl_days"`
}
LearnConfig tunes transcript mining (Phase 4). Both caps must pass for a model call to run; hooks always enqueue regardless (the queue drains when caps reset). To spend nothing, set enabled: false or provider: none.
type OllamaConfig ¶
OllamaConfig points at the local embedding server.