Documentation
¶
Overview ¶
Package meta manages the .sdd/ metadata directory: discovery, config reading, and path resolution. This is project-level infrastructure, separate from the domain model (pure) and graph finders (query-driven).
Index ¶
- func DiscoverRoot(startDir string) string
- func IsSDDMetaDir(d fs.DirEntry) bool
- func LastFetchPath(sddDir string) string
- func ReadConfig(sddDir string) (*model.Config, error)
- func ReadLastFetch(sddDir string) (time.Time, error)
- func ResolveGraphDir(repoRoot string, cfg *model.Config) string
- func SDDDir(repoRoot string) string
- func TmpDir(sddDir string) string
- func TouchLastFetch(sddDir string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverRoot ¶
DiscoverRoot walks up from startDir looking for a directory named ".sdd". Returns the repo root (parent of .sdd/) or empty string if not found.
func IsSDDMetaDir ¶
IsSDDMetaDir returns true if the directory entry is the .sdd metadata directory. Used by graph scanning to skip .sdd/ contents.
func LastFetchPath ¶ added in v0.3.0
LastFetchPath returns the path to the background-sync last-fetch marker. The file's mtime records the last time sdd attempted git fetch; its presence short-circuits further fetches within the configured cooldown.
func ReadConfig ¶
ReadConfig reads and parses .sdd/config.yaml from the given .sdd directory, then overlays any .sdd/config.local.yaml present. Returns nil config with nil error if neither file exists. The local file is gitignored and carries per-machine overrides (API keys, Ollama endpoint, participant name).
func ReadLastFetch ¶ added in v0.3.0
ReadLastFetch returns the mtime of the last-fetch marker, or the zero time if the marker does not exist. A zero result means "never fetched," treat as stale.
func ResolveGraphDir ¶
ResolveGraphDir returns the absolute graph directory path from a config and the repo root (parent of .sdd/). If cfg is nil or GraphDir is empty, falls back to model.DefaultGraphDir.
func TouchLastFetch ¶ added in v0.3.0
TouchLastFetch stamps the last-fetch marker with the current time, creating the .sdd/tmp/ directory and the file itself as needed. Called whether the fetch succeeded or failed — the cooldown applies to attempts, not successes, so transient offline periods don't re-fetch per command.
Types ¶
This section is empty.