provenance: set POC_PROVENANCE for agent subprocesses, Jaccard initial strength

Agent subprocess calls now set POC_PROVENANCE=agent:{name} so any
nodes/links created via tool calls are tagged with the creating agent.
This makes agent transcripts indistinguishable from conscious sessions
in format — important for future model training.

new_relation() now reads POC_PROVENANCE env var directly (raw string,
not enum) since agent names are dynamic.

link-add now computes initial strength from Jaccard similarity instead
of hardcoded 0.8. New links start at a strength reflecting actual
neighborhood overlap.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
ProofOfConcept 2026-03-14 12:27:30 -04:00
parent 58a95a22a0
commit 51ee082faf
3 changed files with 16 additions and 4 deletions

View file

@ -560,7 +560,8 @@ pub fn new_visit(node_uuid: [u8; 16], node_key: &str, agent: &str, outcome: &str
pub(crate) fn visits_path() -> PathBuf { memory_dir().join("visits.capnp") }
/// Create a new relation
/// Create a new relation.
/// Provenance is set from POC_PROVENANCE env var if present, else "manual".
pub fn new_relation(
source_uuid: [u8; 16],
target_uuid: [u8; 16],
@ -569,6 +570,9 @@ pub fn new_relation(
source_key: &str,
target_key: &str,
) -> Relation {
// Use raw env var for provenance — agent names are dynamic
let provenance = std::env::var("POC_PROVENANCE")
.unwrap_or_else(|_| "manual".to_string());
Relation {
uuid: *Uuid::new_v4().as_bytes(),
version: 1,
@ -577,7 +581,7 @@ pub fn new_relation(
target: target_uuid,
rel_type,
strength,
provenance: "manual".to_string(),
provenance,
deleted: false,
source_key: source_key.to_string(),
target_key: target_key.to_string(),