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§
- Capture
Project Inputs - Inputs to the capture-time project chain. Deliberately has NO
config_defaultfield:.tracevault/config.tomldefault_projectis a NAME, resolving it needs a network call, and the stream hook (which fires per event) never does one — so no caller of this chain can feed it in. - Project
Resolve Inputs - Inputs for the effective-project precedence chain.
project_flagandconfig_defaultare resolved by the caller;session/worktree_pathcome from the per-session state. - Resolve
Inputs - Inputs for the effective-binding precedence chain.
repo_flagandboundare resolved by the caller (the--pathoverride and the boundconfig.toml, respectively);session/worktree_pathcome from the per-session state. - Resolved
Codebase - A checkout path resolved to its codebase: the origin URL it was resolved from, the codebase (git remote) the server deduplicates that URL to, and the live repo records linked to it.
Enums§
- Binding
Source - Which precedence tier produced the
effective_bindingresult. - Project
Source - Which precedence tier produced the
effective_projectresult. - Registration
Plan - What registering a checkout with the server should do, given the repos
its remote’s codebase already has. See
plan_registration. - Repo
Choice - Which of a codebase’s repos to bind, as decided by
ResolvedCodebase::choose.
Functions§
- binding_
from_ config - A RepoBinding from a pinned
.tracevault/config.toml(bound mode), if it has a repo_id. Pure — caller supplies the already-loaded config. Carries through theremote_id/codebase_nameinitpersisted (best-effort, display-only) so bound-modestatuscan print the codebase without an extra network round-trip;git_urlstaysNonehere — bound mode has no live origin URL to hand back (that’s the oldergit_urlfallback’s job, covering bindings that predatecodebase_name). - capture_
project_ binding - THE capture-time project chain:
--projectflag → subagent worktree override →TRACEVAULT_PROJECT→ sessionactive_project→ user default → none. Pure, no network.commands::stream::capture_project(ingest) andcommands::project::statusboth call this, so they cannot drift. - capture_
project_ id - The id the hook will actually send for a capture binding:
Nonewhen the storedproject_idis not a UUID (a hand-edited or corrupteduser_project.toml/session file), in which case ingest treats the binding as absent and the event goes repo-scoped. - checkout_
config_ repo_ id - The repo id a checkout’s own
.tracevault/config.tomlbinds, if any.pathmay be anywhere in the checkout, or in one of its linked worktrees. - effective_
binding - The binding that applies, and which tier produced it:
--pathflag → subagent worktree override → session active → bound config → user default → none. - effective_
project - The project that applies, and which tier produced it:
--projectflag → subagent worktree override →TRACEVAULT_PROJECT→ session active → config default → none. Pure; covers only the local tiers (flag → subagent → env_project → session.active_project → config_default).env_projectis supplied BY THE CALLER — this module never reads the environment — and the capture path fills it fromcommands::stream::env_project_binding, which honours the UUID form only. The user-level default (and, in the display chain only, server-side deduction) are applied afterward bycapture_project_binding/resolve_effective_project, which call this function first and only fall through to those tiers when it returnsNone. - plan_
registration - Decide whether
init/syncmay register a repo forgit_url. - resolve_
effective_ project - DISPLAY chain for
commands::status’s “Project” line:--projectflag → subagent override →TRACEVAULT_PROJECT→ session active → config default (all pure, viaeffective_project; no network call) → user-level default → server-side deduction from the repo’s git remote. - 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 codebase (pre-registered-only). - resolve_
path_ to_ codebase - Resolve a filesystem path to its codebase and live repos: read its origin
remote URL and ask the server.
Ok(None)when the path has no remote or the server has no matching codebase (pre-registered-only); an error when the codebase is registered but has no live repo. - resolve_
url_ to_ codebase - Resolve an origin URL to its codebase (by NORMALIZED URL, deduped) and
list the codebase’s live repos, which may be none.
Ok(None)when the server has no matching codebase.