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.PerRepoConfig, error)
- func ReadConfigLayers(sddDir string) (committed, local *model.PerRepoConfig, err error)
- func ReadLastFetch(sddDir string) (time.Time, error)
- func ResolveConfig(global model.BaseConfig, sddDir string) (*model.PerRepoConfig, error)
- func ResolveGraphDir(repoRoot string, cfg *model.PerRepoConfig) 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 ¶
func ReadConfig(sddDir string) (*model.PerRepoConfig, error)
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, parses as the same PerRepoConfig schema, and carries genuinely machine-specific overrides (API keys, endpoints).
func ReadConfigLayers ¶ added in v0.15.0
func ReadConfigLayers(sddDir string) (committed, local *model.PerRepoConfig, err error)
ReadConfigLayers returns the two per-repo config layers separately — committed .sdd/config.yaml and machine-local .sdd/config.local.yaml — each nil when its file is absent. The effective-config view needs the layers for per-value provenance; everything else wants ReadConfig's merged result.
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 ResolveConfig ¶ added in v0.15.0
func ResolveConfig(global model.BaseConfig, sddDir string) (*model.PerRepoConfig, error)
ResolveConfig builds the effective per-repo config from the full overlay: the user-global base settings under the committed .sdd/config.yaml under .sdd/config.local.yaml. CLI flags apply on top at the call site. Returns nil (no config) only when the global base is empty and neither per-repo file exists — with global settings present, a repo without config files still resolves to them.
func ResolveGraphDir ¶
func ResolveGraphDir(repoRoot string, cfg *model.PerRepoConfig) string
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.