nest

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package nest owns ari's data directories: the global nest at ~/.ari and the project nest at .ari/ in the repo. It is the only package that knows the layout; nothing else hardcodes a path, which is what lets a test point the whole nest at a temp dir.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(root string) string

Key sanitizes a project root path into a directory name: every non-alphanumeric byte becomes a dash, and a path too long to be a comfortable directory name is truncated with a hash suffix so distinct paths never collide.

Types

type Nest

type Nest struct {
	// Global is the per-user nest, ~/.ari unless ARI_HOME overrides it.
	Global string
	// Root is the project root: the git repo root when there is one,
	// otherwise the working directory the run started in.
	Root string
	// Key is the sanitized project key that names this project's state
	// under Global/projects.
	Key string
}

Nest is the resolved pair of data directories for one run.

func Resolve

func Resolve(cwd string) (Nest, error)

Resolve computes the nest for cwd. The project root is the enclosing git repo root, or cwd itself outside a repo; worktrees of one repo share a key because the key derives from the repo root path.

func (Nest) ARIMD

func (n Nest) ARIMD() string

ARIMD is <root>/ARI.md, the project memory (D21).

func (Nest) AuthDir

func (n Nest) AuthDir() string

AuthDir holds provider credentials, 0600, never in model context.

func (Nest) ColonyDB

func (n Nest) ColonyDB() string

ColonyDB is the one SQLite file for this project (M2 creates it).

func (Nest) EnsureGlobal

func (n Nest) EnsureGlobal() error

EnsureGlobal creates the global-nest directories with tight modes. The auth directory is 0700 because it holds credential references (D16).

func (Nest) GlobalConfig

func (n Nest) GlobalConfig() string

GlobalConfig is ~/.ari/config.toml.

func (Nest) JournalDir

func (n Nest) JournalDir() string

JournalDir holds the append-only event log.

func (Nest) LocalConfig

func (n Nest) LocalConfig() string

LocalConfig is <root>/.ari/local.toml, gitignored, per-user overrides.

func (Nest) ProjectConfig

func (n Nest) ProjectConfig() string

ProjectConfig is <root>/.ari/config.toml, committable.

func (Nest) ProjectDir

func (n Nest) ProjectDir() string

ProjectDir is <root>/.ari.

func (Nest) ProjectStateDir

func (n Nest) ProjectStateDir() string

ProjectStateDir is this project's per-user state under the global nest: sessions, the colony database, the journal. It lives here and not in the repo so nothing tempts anyone to commit it.

func (Nest) SessionsDir

func (n Nest) SessionsDir() string

SessionsDir holds the JSONL transcripts for this project.

func (Nest) TrustFile

func (n Nest) TrustFile() string

TrustFile holds the per-workspace hook trust decisions, keyed by workspace root path. It lives in the global nest so trust is remembered across sessions and is never committed into a repo (doc 05 section 12, D16).

Jump to

Keyboard shortcuts

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