Skip to main content

Module resolution

Module resolution 

Source
Expand description

Detached/workspace-mode repo resolution: turn a filesystem path into a RepoBinding (via the path’s git remote + the server), and pick the effective binding for an event/command from the precedence chain (--path flag → subagent worktree override → session active → bound .tracevault/config.toml). See design §2/§3/§4.

Structs§

ResolveInputs
Inputs for the effective-binding precedence chain. repo_flag and bound are resolved by the caller (the --path override and the bound config.toml, respectively); session/worktree_path come from the per-session state.

Enums§

BindingSource
Which precedence tier produced the effective_binding result.

Functions§

binding_from_config
A RepoBinding from a pinned .tracevault/config.toml (bound mode), if it has both org_slug and repo_id. Pure — caller supplies the already-loaded config.
effective_binding
The binding that applies, and which tier produced it: --path flag → subagent worktree override → session active → bound config → none.
org_slug_for
Resolve the org slug for project_root: TRACEVAULT_ORG_SLUG (non-empty) → credentials.json org_slug → bound config.toml org_slug.
org_slug_precedence
Pure precedence for the org slug: first non-None of env, credentials, bound config. Callers pass None for an env value that was empty.
resolve_path_to_binding
Resolve a filesystem path to a registered-repo binding: read its origin remote URL and ask the server. Ok(None) when the path has no remote or the server has no matching repo (pre-registered-only).