pub async fn resolve_effective_project(
inputs: &ProjectResolveInputs<'_>,
user_default: Option<ProjectBinding>,
git_url: Option<&str>,
client: &ApiClient,
) -> Result<Option<(ProjectBinding, ProjectSource)>, Box<dyn Error>>Expand description
DISPLAY chain for commands::status’s “Project” line: --project flag →
subagent override → TRACEVAULT_PROJECT → session active → config default
(all pure, via effective_project; no network call) → user-level default
→ server-side deduction from the repo’s git remote.
The user-level default outranks deduction because that is what ingest
does: the capture chain (capture_project_binding) applies the user
default and never deduces, so a display chain that ranked deduction above
it would name a project no event is attributed to — exactly in the
orchestrator’s configuration (a pod bound via project switch --user). The
server is only asked once every local tier, user default included, is empty.
An Ambiguous deduction result is an error (the caller can’t safely guess
among several candidate projects). This resolver never prints: callers
render the tier via ProjectSource’s Display. Returns Ok(None) only
when every tier in the chain is empty. commands::project::status does not
use this chain: it reports capture_project_binding and shows deduction
on a separate line.