provenance: pass directly through thought::dispatch, remove globals

Provenance now flows as a function parameter through the entire tool
dispatch chain: thought::dispatch → memory::dispatch → store methods.

Removed task_local (TASK_AGENT), thread_local (TASK_PHASE), and env
var (POC_PROVENANCE) from the tool dispatch path. The env var remains
only as a fallback for non-tool paths (CLI commands, digest).

Phase names are passed from knowledge.rs → llm.rs → api.rs, and
api.rs updates the provenance string between steps. No globals needed.
This commit is contained in:
ProofOfConcept 2026-03-27 15:44:39 -04:00
parent 36bde60ba0
commit 92ca2bf2c8
7 changed files with 34 additions and 47 deletions

View file

@ -39,8 +39,8 @@ pub async fn dispatch(
return result.unwrap_or_else(ToolOutput::error);
}
// Delegate to shared thought layer
if let Some(output) = crate::thought::dispatch(name, args, tracker).await {
// Delegate to shared thought layer (poc-agent uses default provenance)
if let Some(output) = crate::thought::dispatch(name, args, tracker, None).await {
return output;
}