vault

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package vault provides vault scanning and configuration loading.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Vault  VaultConfig        `yaml:"vault"`
	Types  map[string]TypeDef `yaml:"types"`
	Git    GitPolicyConfig    `yaml:"git"`
	Index  IndexConfig        `yaml:"index"`
	Memory MemoryConfig       `yaml:"memory"`
	Schema SchemaConfig       `yaml:"schema"`
}

Config represents the full .vaultmind/config.yaml

func LoadConfig

func LoadConfig(vaultRoot string) (*Config, error)

LoadConfig reads .vaultmind/config.yaml from the vault root. Returns defaults if the config file doesn't exist.

type GitPolicyConfig

type GitPolicyConfig struct {
	Policy map[string]string `yaml:"policy"`
}

GitPolicyConfig holds git policy overrides.

type IndexConfig

type IndexConfig struct {
	DBPath string `yaml:"db_path"`
}

IndexConfig holds indexing settings.

type MemoryConfig

type MemoryConfig struct {
	AliasMinLength           int     `yaml:"alias_min_length"`
	TagOverlapThreshold      float64 `yaml:"tag_overlap_threshold"`
	ContextPackDefaultBudget int     `yaml:"context_pack_default_budget"`
}

MemoryConfig holds memory engine settings.

type ScannedFile

type ScannedFile struct {
	RelPath string    // Vault-relative path (e.g., "concepts/act-r.md")
	AbsPath string    // Absolute filesystem path
	ModTime time.Time // Last modification time
}

ScannedFile represents a discovered .md file in the vault.

func Scan

func Scan(vaultRoot string, excludes []string) ([]ScannedFile, error)

Scan walks the vault directory and returns all .md files, excluding directories that match any of the exclude patterns.

type SchemaConfig

type SchemaConfig struct {
	Aliases map[string][]string `yaml:"aliases"`
}

SchemaConfig holds per-vault schema settings beyond the type registry. Aliases let migrating users keep their existing frontmatter field names (e.g. `last_updated`) while vaultmind validates against canonical names (e.g. `updated`). The map is canonical → list of aliases. Aliasing is non-destructive: vaultmind never rewrites frontmatter to normalize field names; the alias and the canonical are equivalent at validation only.

type TypeDef

type TypeDef struct {
	Required []string `yaml:"required" json:"required"`
	Optional []string `yaml:"optional" json:"optional"`
	Statuses []string `yaml:"statuses" json:"statuses"`
	Template string   `yaml:"template" json:"template"`
}

TypeDef defines a note type in the registry.

type VaultConfig

type VaultConfig struct {
	Exclude []string `yaml:"exclude"`
}

VaultConfig holds vault scanning settings.

Jump to

Keyboard shortcuts

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