userdata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package userdata resolves Human's private, per-user durable state.

Product defaults must never be relative to the process working directory: that directory is commonly a customer's Git workspace. Callers may still supply explicit paths when they deliberately want a different layout.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path(elements ...string) (string, error)

Path resolves a private product path below Root. Empty, absolute, dot, and parent-traversal elements are rejected so defaults cannot escape the product directory accidentally.

func ResolveDirectory

func ResolveDirectory(value string) (string, error)

ResolveDirectory returns the real path of an existing directory. It is used before hashing workspace identity so symlink aliases share durable state.

func ResolveGitWorkspace

func ResolveGitWorkspace(value string) (string, error)

ResolveGitWorkspace resolves value to its real path and then walks upward to the nearest Git worktree root. A directory without a .git marker is itself a valid workspace root. Both .git directories and worktree .git files count.

func Root

func Root() (string, error)

Root returns the platform user-data directory dedicated to Human. An absolute HUMAN_DATA_HOME overrides the platform convention, primarily for managed installations and hermetic tests.

func WorkspaceKey

func WorkspaceKey(realWorkspace string) (string, error)

WorkspaceKey returns a stable, non-reversible correctness key for a real workspace path. The caller must first resolve symlinks and select its desired workspace root (normally with ResolveGitWorkspace). The digest deliberately keeps customer path names out of generated Agent configuration.

func WorkspacePath

func WorkspacePath(component, realWorkspace string, elements ...string) (string, error)

WorkspacePath returns a private path scoped to the real workspace identity. The full SHA-256 digest avoids leaking customer path names into directory listings and makes independently selected workspaces collision-resistant.

Types

This section is empty.

Jump to

Keyboard shortcuts

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