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 ¶
- func Path(elements ...string) (string, error)
- func ResolveDirectory(value string) (string, error)
- func ResolveGitWorkspace(value string) (string, error)
- func Root() (string, error)
- func WorkspaceKey(realWorkspace string) (string, error)
- func WorkspacePath(component, realWorkspace string, elements ...string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Path ¶
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 ¶
ResolveDirectory returns the real path of an existing directory. It is used before hashing workspace identity so symlink aliases share durable state.
func ResolveGitWorkspace ¶
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 ¶
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 ¶
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 ¶
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.