meta

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 5 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverRoot

func DiscoverRoot(startDir string) string

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

func IsSDDMetaDir(d fs.DirEntry) bool

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

func LastFetchPath(sddDir string) string

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.Config, 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 and carries per-machine overrides (API keys, Ollama endpoint, participant name).

func ReadLastFetch added in v0.3.0

func ReadLastFetch(sddDir string) (time.Time, error)

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

func ResolveGraphDir(repoRoot string, cfg *model.Config) 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 SDDDir

func SDDDir(repoRoot string) string

SDDDir returns the absolute path to .sdd/ given the repo root.

func TmpDir

func TmpDir(sddDir string) string

TmpDir returns the path to .sdd/tmp/ given the .sdd/ directory path.

func TouchLastFetch added in v0.3.0

func TouchLastFetch(sddDir string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL