Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(agent): remove residual profile session contracts

Steven Enamakelea45878d4198
diff --git a/app/test/playwright/specs/settings-navigation-panels.spec.ts b/app/test/playwright/specs/settings-navigation-panels.spec.ts
index 5a931994cc..bf46068aba 100644
--- a/app/test/playwright/specs/settings-navigation-panels.spec.ts
+++ b/app/test/playwright/specs/settings-navigation-panels.spec.ts
@@ -68,13 +68,6 @@ const PANELS = [
marker: null,
text: 'Categories',
},
- {
- id: 'profiles',
- route: 'profiles',
- heading: 'Agent Profiles',
- marker: null,
- text: 'New profile',
- },
{
id: 'agent-access',
route: 'agent-access',
diff --git a/crates/openhuman-core/src/agent/debug/mod.rs b/crates/openhuman-core/src/agent/debug/mod.rs
index 1ced95337a..18584cc0bb 100644
--- a/crates/openhuman-core/src/agent/debug/mod.rs
+++ b/crates/openhuman-core/src/agent/debug/mod.rs
@@ -498,8 +498,6 @@ async fn render_integrations_agent(config: &Config, toolkit: &str) -> Result<Dum
include_memory_md: !definition.omit_memory_md,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/experience/ops.rs b/crates/openhuman-core/src/agent/experience/ops.rs
index 8d35f28305..b4deee3bc6 100644
--- a/crates/openhuman-core/src/agent/experience/ops.rs
+++ b/crates/openhuman-core/src/agent/experience/ops.rs
@@ -22,7 +22,7 @@ use crate::memory::api::types::{
use crate::memory::Memory;
use crate::rpc::RpcOutcome;
use async_trait::async_trait;
-use std::collections::{BTreeMap, BTreeSet};
+use std::collections::BTreeMap;
use std::sync::Arc;
/// The [`Memory`] view of a bound memory driver.
@@ -325,7 +325,7 @@ pub async fn retrieve(params: RetrieveParams) -> Result<RpcOutcome<Vec<Experienc
Ok(RpcOutcome::single_log(hits, "agent experiences retrieved"))
}
-pub async fn list(params: ListParams) -> Result<RpcOutcome<Vec<AgentExperience>>, String> {
+pub async fn list(_params: ListParams) -> Result<RpcOutcome<Vec<AgentExperience>>, String> {
let stores = open_query_stores().await?;
let mut by_id: BTreeMap<String, AgentExperience> = BTreeMap::new();
for store in stores {
diff --git a/crates/openhuman-core/src/agent/experience/schemas.rs b/crates/openhuman-core/src/agent/experience/schemas.rs
index d312d19af0..f63089494c 100644
--- a/crates/openhuman-core/src/agent/experience/schemas.rs
+++ b/crates/openhuman-core/src/agent/experience/schemas.rs
@@ -109,6 +109,7 @@ pub fn schemas(function: &str) -> ControllerSchema {
namespace: "agent_experience",
function: "list",
description: "List locally stored procedural operating experiences.",
+ inputs: vec![],
outputs: vec![FieldSchema {
name: "experiences",
ty: TypeSchema::Array(Box::new(TypeSchema::Ref("AgentExperience"))),
diff --git a/crates/openhuman-core/src/agent/harness/session/builder/builder_build.rs b/crates/openhuman-core/src/agent/harness/session/builder/builder_build.rs
index ec6a5148ff..037c7d291f 100644
--- a/crates/openhuman-core/src/agent/harness/session/builder/builder_build.rs
+++ b/crates/openhuman-core/src/agent/harness/session/builder/builder_build.rs
@@ -230,10 +230,6 @@ impl AgentBuilder {
.workspace_dir
.unwrap_or_else(|| std::path::PathBuf::from("."));
let action_dir = self.action_dir.unwrap_or_else(|| workspace_dir.clone());
- let memory_subdir = self.memory_subdir.unwrap_or_else(|| "memory".to_string());
- let session_raw_subdir = self
- .session_raw_subdir
- .unwrap_or_else(|| "session_raw".to_string());
let tools = Arc::new(tools);
let synthesized_tools = Arc::new(synthesized_tools);
@@ -291,10 +287,6 @@ impl AgentBuilder {
// `refresh_delegation_tools` to re-resolve the agent's
// `subagents` declaration against the global registry.
agent_definition_id: agent_definition_name.clone(),
- personality_soul_md: self.personality_soul_md,
- personality_memory_md: self.personality_memory_md,
- memory_subdir,
- session_raw_subdir,
session_transcript_path: None,
session_history: None,
session_history_locator: self.session_history_locator,
diff --git a/crates/openhuman-core/src/agent/harness/session/builder/factory.rs b/crates/openhuman-core/src/agent/harness/session/builder/factory.rs
index 8dbc919884..512f606049 100644
--- a/crates/openhuman-core/src/agent/harness/session/builder/factory.rs
+++ b/crates/openhuman-core/src/agent/harness/session/builder/factory.rs
@@ -159,8 +159,6 @@ impl Agent {
config.workspace_dir.clone(),
)?;
- let memory_subdir = "memory".to_string();
- let session_raw_subdir = "raw".to_string();
// The session's store, through the same binding the archivist resolves
// two statements down — so one subtree yields one store rather than an
// engine handle beside a driver over the same files.
@@ -181,7 +179,7 @@ impl Agent {
// and degrades to the null driver otherwise, which is the same footing
// the archivist has had here all along.
let memory: Arc<dyn Memory> =
- crate::agent::experience::ops::DriverMemory::for_subtree(config, &memory_subdir)
+ crate::agent::experience::ops::DriverMemory::for_config(config)
.map_err(|e| anyhow::anyhow!("session memory binding: {e}"))?;
// The archivist takes the bound driver for this session's memory
// subtree — the same subtree `session_memory` opened — rather than the
@@ -189,8 +187,7 @@ impl Agent {
// That handle was the #5378 `:290` blocker: a concrete connection no
// module or remote driver can supply. The engine's connection is now
// exclusively the engine's. Lane C (#6040) rides the same binding.
- let (archivist_provider, auto_recall) =
- super::helpers::bind_session_memory(config, &memory_subdir)?;
+ let (archivist_provider, auto_recall) = super::helpers::bind_session_memory(config)?;
// Load the user's persisted tool preferences once. They drive two
// things below: granting the App UI Control / App Automation mutation
@@ -993,7 +990,6 @@ impl Agent {
.workspace_dir(config.workspace_dir.clone())
.action_dir(config.action_dir.clone())
.workspace_descriptor(workspace_descriptor)
- .profile_memory_storage(memory_subdir, session_raw_subdir)
.workflows({
let mut catalogue = crate::skills::load_workflow_metadata(&config.workspace_dir);
#[cfg(feature = "flows")]
diff --git a/crates/openhuman-core/src/agent/harness/session/builder/helpers.rs b/crates/openhuman-core/src/agent/harness/session/builder/helpers.rs
index 8b1b03d3fe..06096c7129 100644
--- a/crates/openhuman-core/src/agent/harness/session/builder/helpers.rs
+++ b/crates/openhuman-core/src/agent/harness/session/builder/helpers.rs
@@ -9,13 +9,9 @@
//! record's serde) comes from the contract that both ends read.
//!
//! **Do not "modernise" this onto `active_memory_guard().as_tool_memory()`.**
-//! `memory` here is the session's own subtree — `DriverMemory::for_subtree`,
-//! resolved in `factory` from the profile's `memory_subdir` — so a profile with
-//! `dedicatedMemory` prefetches its own rules. The ambient guard is the
-//! *shared* tree, and routing this through it would quietly merge every
-//! profile's tool rules into one prompt. The correct family call is the one
-//! reached through this session's own `binding::for_subtree(..)`, which needs
-//! the subtree passed in rather than the memory object.
+//! `memory` is the session's canonical workspace store. The binding below is
+//! shared with the session's `DriverMemory`, so recall and tool-memory rules
+//! always address the same durable data.
use crate::memory::api::provider::MemoryProvider;
use crate::memory::auto_recall::AutoRecall;
@@ -34,14 +30,9 @@ use tinytools::Tool;
/// its own facts, never the shared tree's.
pub(super) fn bind_session_memory(
config: &crate::config::Config,
- memory_subdir: &str,
) -> anyhow::Result<(Arc<dyn MemoryProvider>, Arc<AutoRecall>)> {
- let binding = crate::memory::binding::for_subtree(
- &config.workspace_dir,
- memory_subdir,
- &config.subsystems.memory,
- )
- .map_err(|e| anyhow::anyhow!("archivist memory binding: {e}"))?;
+ let binding = crate::memory::binding::for_config(config)
+ .map_err(|e| anyhow::anyhow!("archivist memory binding: {e}"))?;
let auto_recall = Arc::new(AutoRecall::from_guard(binding.guard()));
Ok((binding.provider().clone(), auto_recall))
}
diff --git a/crates/openhuman-core/src/agent/harness/session/builder/setters.rs b/crates/openhuman-core/src/agent/harness/session/builder/setters.rs
index 3a39108557..17ddc2d0eb 100644
--- a/crates/openhuman-core/src/agent/harness/session/builder/setters.rs
+++ b/crates/openhuman-core/src/agent/harness/session/builder/setters.rs
@@ -37,10 +37,6 @@ impl AgentBuilder {
event_session_id: None,
event_channel: None,
agent_definition_name: None,
- personality_soul_md: None,
- personality_memory_md: None,
- memory_subdir: None,
- session_raw_subdir: None,
session_parent_prefix: None,
session_history_locator: None,
omit_profile: None,
@@ -198,28 +194,6 @@ impl AgentBuilder {
self
}
- /// Binds a session identity override.
- pub fn personality_soul_md(mut self, soul_md: Option<String>) -> Self {
- self.personality_soul_md = soul_md;
- self
- }
-
- /// Binds curated memory content to the frozen session prompt.
- pub fn personality_memory_md(mut self, memory_md: Option<String>) -> Self {
- self.personality_memory_md = memory_md;
- self
- }
-
- pub fn profile_memory_storage(
- mut self,
- memory_subdir: String,
- session_raw_subdir: String,
- ) -> Self {
- self.memory_subdir = Some(memory_subdir);
- self.session_raw_subdir = Some(session_raw_subdir);
- self
- }
-
/// Sets the skills available to the agent.
pub fn workflows(mut self, skills: Vec<crate::skills::Workflow>) -> Self {
self.workflows = Some(skills);
diff --git a/crates/openhuman-core/src/agent/harness/session/runtime/resume.rs b/crates/openhuman-core/src/agent/harness/session/runtime/resume.rs
index a93023f153..11759d14f9 100644
--- a/crates/openhuman-core/src/agent/harness/session/runtime/resume.rs
+++ b/crates/openhuman-core/src/agent/harness/session/runtime/resume.rs
@@ -155,7 +155,7 @@ impl Agent {
// The thread's conversation belongs to the THREAD, not the active
// profile: the locator resolves cross-dir, newest-wins across the
- // shared `session_raw/` and every profile-scoped `session_raw-<id>/`
+ // shared `session_raw/` and every canonical `session_raw-<id>/`
// (#5351), so switching profile mid-thread continues the same
// conversation. See `FileTranscriptLocator::root_for_thread` for why
// this must not be own-dir-first. `agent_id` additionally narrows to
@@ -167,7 +167,7 @@ impl Agent {
else {
log::debug!(
"[web-channel] no root session_raw transcript for thread={thread_id} in any \
- (shared or profile-scoped) session_raw dir — falling back to \
+ (shared or canonical) session_raw dir — falling back to \
conversation-log prose seeding"
);
return false;
diff --git a/crates/openhuman-core/src/agent/harness/session/session_thread_resume_tests.rs b/crates/openhuman-core/src/agent/harness/session/session_thread_resume_tests.rs
index 68bfdba64e..13630677d7 100644
--- a/crates/openhuman-core/src/agent/harness/session/session_thread_resume_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/session_thread_resume_tests.rs
@@ -216,73 +216,6 @@ fn seed_resume_replays_compaction_to_reduced_context() {
);
}
-/// #5351: a profile-scoped session (running in its own `session_raw-<id>/`
-/// subtree) must still resume a thread whose earlier turns were written under a
-/// DIFFERENT profile's subtree — here the shared `session_raw/`. Without the
-/// cross-dir fallback the Reasoning profile could not see the plan the Quick
-/// profile wrote, dropping all prior context on a mid-thread Quick↔Reasoning
-/// switch.
-#[test]
-fn seed_resume_from_thread_transcript_crosses_profile_scoped_dirs() {
- use super::super::transcript::{self, TranscriptMeta};
- use crate::agent::messages::ChatMessage;
-
- let ws = tempfile::TempDir::new().expect("temp workspace");
- let wsp = ws.path().to_path_buf();
- let thread_id = "thr_cross_profile";
-
- // Prior turns written by the QUICK (default) profile into the SHARED
- // `session_raw/` subtree.
- let messages = vec![
- ChatMessage::system("system prompt"),
- ChatMessage::user("set up Minimax for image generation"),
- ChatMessage::assistant("Minimax is configured as the image generator."),
- ];
- let meta = TranscriptMeta {
- agent_name: "orchestrator_thr_cross_pr".to_string(),
- agent_id: Some("orchestrator".to_string()),
- agent_type: Some("root".to_string()),
- dispatcher: "native".to_string(),
- provider: None,
- model: None,
- created: "2026-01-01T00:00:00Z".to_string(),
- updated: "2026-01-01T00:00:00Z".to_string(),
- turn_count: 1,
- input_tokens: 0,
- output_tokens: 0,
- cached_input_tokens: 0,
- charged_amount_usd: 0.0,
- thread_id: Some(thread_id.to_string()),
- task_id: None,
- };
- // The shared `session_raw/` (default resolve path) — the Quick profile's dir.
- let path = transcript::resolve_keyed_transcript_path(&wsp, "1700000000_orchestrator")
- .expect("resolve transcript path");
- transcript::write_transcript(&path, &messages, &meta, None).expect("write transcript");
-
- // The REASONING profile runs in a scoped `session_raw-1/` subtree — its own
- // dir holds no transcript for this thread, so the in-dir lookup misses and
- // only the cross-dir fallback can recover the conversation.
- let mut agent = build_minimal_agent_with_definition_name(Some("orchestrator"));
- agent.workspace_dir = wsp.clone();
- agent.session_raw_subdir = "session_raw-1".to_string();
-
- let loaded = agent.seed_resume_from_thread_transcript(thread_id);
- assert!(
- loaded,
- "a profile-scoped session must resume the thread's transcript from the shared \
- session_raw dir via the cross-dir fallback (#5351)"
- );
- let cached = agent
- .cached_transcript_messages
- .as_ref()
- .expect("cached transcript populated");
- assert!(
- cached.iter().any(|m| m.content.contains("image generator")),
- "the prior plan context must be recovered across the profile-scoped dir boundary"
- );
-}
-
/// #5351 regression guard: resume must pick the NEWEST transcript across profile
/// dirs, never the one in the agent's own dir. After the Reasoning profile is
/// healed back to the shared `session_raw/`, an OLDER transcript there must not
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript.rs b/crates/openhuman-core/src/agent/harness/session/transcript.rs
index 1e2a41aec3..0f5f86e317 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript.rs
@@ -121,10 +121,7 @@ pub(crate) use metadata::attach_tool_failure_metadata;
#[cfg(test)]
pub(crate) use metadata::attach_turn_usage_metadata;
pub(crate) use metadata::mark_replayed_if_unmarked;
-pub use paths::{
- find_latest_transcript_in_subdir, resolve_keyed_transcript_path,
- resolve_keyed_transcript_path_in_dir,
-};
+pub use paths::{find_latest_transcript, resolve_keyed_transcript_path};
pub use reader::{read_transcript, read_transcript_display};
pub use thread_lookup::{
find_root_transcript_for_thread, find_root_transcript_for_thread_scoped,
@@ -141,8 +138,8 @@ pub use writer::{append_interrupted_partial, append_transcript_turn, write_trans
use jsonl::build_message_line;
#[cfg(test)]
use paths::{
- find_latest_transcript, latest_in_dir, md_companion_path, next_index, raw_session_dir,
- resolve_new_transcript_path, sanitize_agent_name,
+ latest_in_dir, md_companion_path, next_index, raw_session_dir, resolve_new_transcript_path,
+ sanitize_agent_name,
};
// ── Tests ─────────────────────────────────────────────────────────────
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript/paths.rs b/crates/openhuman-core/src/agent/harness/session/transcript/paths.rs
index 49c316cf08..4a5b5d2413 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript/paths.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript/paths.rs
@@ -78,19 +78,8 @@ pub fn resolve_new_transcript_path(workspace_dir: &Path, agent_name: &str) -> Re
/// The fallback is one-release transitional and can be removed once
/// existing transcripts have rolled forward.
pub fn find_latest_transcript(workspace_dir: &Path, agent_name: &str) -> Option<PathBuf> {
- find_latest_transcript_in_subdir(workspace_dir, "session_raw", agent_name)
-}
-
-/// Find the most recent transcript inside a session's configured raw subtree.
-/// Scoped profile sessions must never fall back to shared transcripts; the
-/// legacy date-grouped/markdown fallback applies only to `session_raw`.
-pub fn find_latest_transcript_in_subdir(
- workspace_dir: &Path,
- session_raw_subdir: &str,
- agent_name: &str,
-) -> Option<PathBuf> {
let sanitized = sanitize_agent_name(agent_name);
- let raw_root = workspace_dir.join(session_raw_subdir);
+ let raw_root = raw_session_dir(workspace_dir);
let sessions_root = workspace_dir.join("sessions");
// Primary path: flat session_raw/ directory. The stem-suffix scan
@@ -102,10 +91,6 @@ pub fn find_latest_transcript_in_subdir(
}
}
- if session_raw_subdir != "session_raw" {
- return None;
- }
-
// Fallback: legacy date-grouped layout (one-release migration
// window). Today first, then yesterday — matches the previous
// behaviour so we don't regress while users still have files in
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript/thread_lookup.rs b/crates/openhuman-core/src/agent/harness/session/transcript/thread_lookup.rs
index 51961df277..dff816139c 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript/thread_lookup.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript/thread_lookup.rs
@@ -1,4 +1,4 @@
-//! Thread-keyed lookups over the `session_raw*` stores: locating a thread's
+//! Thread-keyed lookups over the canonical `session_raw` store: locating a thread's
//! root transcripts and summing its token / cost usage.
use super::paths::raw_session_dir;
@@ -8,9 +8,7 @@ use std::collections::BTreeMap;
use std::fs;
use std::path::{Path, PathBuf};
-/// Find the newest root transcript whose metadata declares `thread_id`, across
-/// the shared `session_raw/` store and every profile-scoped
-/// `session_raw-<id>/` store.
+/// Find the newest root transcript whose metadata declares `thread_id`.
///
/// Root transcripts live directly under `session_raw/` and do not carry
/// the `__` separator used for sub-agent siblings. This helper is the
@@ -57,12 +55,10 @@ pub fn find_root_transcript_for_thread_scoped(
pub fn find_root_transcripts_for_thread(workspace_dir: &Path, thread_id: &str) -> Vec<PathBuf> {
let mut matches = Vec::new();
- for raw_dir in raw_session_dirs(workspace_dir) {
- matches.extend(root_transcripts_for_thread_in_dir(&raw_dir, thread_id));
- }
- // Already chronological within each directory (see
- // `root_transcripts_for_thread_in_dir`); re-key across directories on the
- // same `created` stamp rather than the file name.
+ matches.extend(root_transcripts_for_thread_in_dir(
+ &raw_session_dir(workspace_dir),
+ thread_id,
+ ));
matches.sort_by_cached_key(|path| {
let created = read_transcript(path)
.ok()
@@ -73,24 +69,6 @@ pub fn find_root_transcripts_for_thread(workspace_dir: &Path, thread_id: &str) -
matches
}
-fn raw_session_dirs(workspace_dir: &Path) -> Vec<PathBuf> {
- let mut raw_dirs = vec![raw_session_dir(workspace_dir)];
- if let Ok(entries) = fs::read_dir(workspace_dir) {
- raw_dirs.extend(entries.flatten().map(|entry| entry.path()).filter(|path| {
- path.is_dir()
- && path
- .file_name()
- .and_then(|name| name.to_str())
- .is_some_and(|name| {
- name.strip_prefix("session_raw-")
- .is_some_and(|suffix| !suffix.is_empty())
- })
- }));
- }
- raw_dirs.sort();
- raw_dirs
-}
-
pub fn find_root_transcript_for_thread_in_dir(raw_dir: &Path, thread_id: &str) -> Option<PathBuf> {
root_transcripts_for_thread_in_dir(raw_dir, thread_id).pop()
}
@@ -158,29 +136,28 @@ pub fn read_thread_usage_summary(
// grouped by archetype for the per-agent breakdown.
let mut root_matches: Vec<PathBuf> = Vec::new();
let mut sub_matches: Vec<PathBuf> = Vec::new();
- for raw_dir in raw_session_dirs(workspace_dir) {
- let Ok(entries) = fs::read_dir(&raw_dir) else {
+ let raw_dir = raw_session_dir(workspace_dir);
+ let Ok(entries) = fs::read_dir(&raw_dir) else {
+ return None;
+ };
+ for path in entries.flatten().map(|entry| entry.path()) {
+ if path.extension().and_then(|s| s.to_str()) != Some("jsonl") {
+ continue;
+ }
+ let Some(stem) = path.file_stem().and_then(|s| s.to_str()) else {
continue;
};
- for path in entries.flatten().map(|entry| entry.path()) {
- if path.extension().and_then(|s| s.to_str()) != Some("jsonl") {
- continue;
- }
- let Some(stem) = path.file_stem().and_then(|s| s.to_str()) else {
- continue;
- };
- let is_subagent = stem.contains("__");
- let matches_thread = read_transcript_meta_only(&path)
- .map(|m| m.thread_id.as_deref() == Some(thread_id))
- .unwrap_or(false);
- if !matches_thread {
- continue;
- }
- if is_subagent {
- sub_matches.push(path);
- } else {
- root_matches.push(path);
- }
+ let is_subagent = stem.contains("__");
+ let matches_thread = read_transcript_meta_only(&path)
+ .map(|m| m.thread_id.as_deref() == Some(thread_id))
+ .unwrap_or(false);
+ if !matches_thread {
+ continue;
+ }
+ if is_subagent {
+ sub_matches.push(path);
+ } else {
+ root_matches.push(path);
}
}
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript_history.rs b/crates/openhuman-core/src/agent/harness/session/transcript_history.rs
index 156287d297..2b5cd0fd05 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript_history.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript_history.rs
@@ -116,7 +116,7 @@
//! # Why discovery is a separate object ([`SessionHistoryLocator`])
//!
//! A handle is bound to one *file*. The turn path's two reads are *lookups*:
-//! `(workspace, session_raw_subdir, agent name)` → newest match, and
+//! `(workspace, agent name)` → newest match, and
//! `_meta.thread_id` → newest **root** transcript. `ChatHistory` has no
//! discovery concept at all (it is `thread_id`-keyed and returns messages, never
//! a location), so leaving discovery as free functions would keep the read half
@@ -160,9 +160,9 @@ use crate::agent::message_convert::{history_to_messages, message_to_chat_message
use crate::agent::messages::ChatMessage;
use super::transcript::{
- append_transcript_turn, find_latest_transcript_in_subdir, find_root_transcript_for_thread,
+ append_transcript_turn, find_latest_transcript, find_root_transcript_for_thread,
find_root_transcript_for_thread_scoped, read_transcript, resolve_keyed_transcript_path,
- resolve_keyed_transcript_path_in_dir, SessionTranscript, TranscriptMeta, TurnUsage,
+ SessionTranscript, TranscriptMeta, TurnUsage,
};
/// One turn's worth of transcript write, borrowed.
@@ -244,7 +244,7 @@ pub(crate) trait SessionTranscriptRead: Send + Sync {
/// One injected object covers the whole turn path: both resume reads and the
/// first-write bind. `Agent` holds it as `Option<Arc<dyn SessionHistoryLocator>>`
/// and falls back to [`FileTranscriptLocator`] built from the *current*
-/// `workspace_dir`/`session_raw_subdir` — lazily, never frozen at build time,
+/// `workspace_dir` — lazily, never frozen at build time,
/// because tests reassign `agent.workspace_dir` after `build()` and a
/// build-time locator would silently keep pointing at the old directory.
pub(crate) trait SessionHistoryLocator: Send + Sync {
@@ -284,40 +284,26 @@ pub(crate) trait SessionHistoryLocator: Send + Sync {
}
/// The default [`SessionHistoryLocator`]: real files under
-/// `{workspace_dir}/{session_raw_subdir}`.
+/// `{workspace_dir}/session_raw`.
///
/// Thin by design — each method wraps exactly one `transcript::` free function
/// and changes nothing about it, so swapping the turn path onto the locator is
/// behaviour-preserving.
pub(crate) struct FileTranscriptLocator {
workspace_dir: PathBuf,
- session_raw_subdir: String,
}
impl FileTranscriptLocator {
- pub(crate) fn new(
- workspace_dir: impl Into<PathBuf>,
- session_raw_subdir: impl Into<String>,
- ) -> Self {
+ pub(crate) fn new(workspace_dir: impl Into<PathBuf>) -> Self {
Self {
workspace_dir: workspace_dir.into(),
- session_raw_subdir: session_raw_subdir.into(),
}
}
-
- /// `{workspace_dir}/{session_raw_subdir}` — the profile-scoped raw dir.
- fn raw_dir(&self) -> PathBuf {
- self.workspace_dir.join(&self.session_raw_subdir)
- }
}
impl SessionHistoryLocator for FileTranscriptLocator {
fn latest_for_agent(&self, agent_name: &str) -> Option<Arc<dyn SessionTranscriptRead>> {
- let path = find_latest_transcript_in_subdir(
- &self.workspace_dir,
- &self.session_raw_subdir,
- agent_name,
- )?;
+ let path = find_latest_transcript(&self.workspace_dir, agent_name)?;
log::debug!(
"[transcript-history] locator latest_for_agent agent={agent_name} path={}",
path.display()
@@ -329,19 +315,6 @@ impl SessionHistoryLocator for FileTranscriptLocator {
}
fn root_for_thread(&self, thread_id: &str) -> Option<Arc<dyn SessionTranscriptRead>> {
- // Cross-dir, newest-wins — NOT scoped to this locator's own
- // `session_raw-<id>/` (#5351). A thread's conversation belongs to the
- // THREAD, not the active profile, so this scans the shared
- // `session_raw/` and every profile-scoped sibling and takes the newest
- // match. Switching profile mid-thread (the Quick/Reasoning toggle) then
- // continues the same conversation even when earlier turns were written
- // under another profile's subtree.
- //
- // Deliberately not own-dir-first: that lets an OLDER transcript in this
- // agent's own dir shadow a NEWER one a sibling holds for the same
- // thread, dropping recent turns and diverging from the transcript view
- // and turn mirror, which both use this same resolver. The own dir is
- // already in the scan, so newest-wins is a superset.
let path = find_root_transcript_for_thread(&self.workspace_dir, thread_id)?;
log::debug!(
"[transcript-history] locator root_for_thread thread={thread_id} path={}",
@@ -380,11 +353,8 @@ impl SessionHistoryLocator for FileTranscriptLocator {
stem: &str,
seed: TranscriptMeta,
) -> anyhow::Result<Arc<dyn SessionHistory>> {
- // `new_in_dir` — never `new` — because `new` hardcodes
- // `{workspace}/session_raw/`, and a dedicated-memory profile's sessions
- // live in `session_raw-<id>/`.
- Ok(Arc::new(SessionTranscriptHistory::new_in_dir(
- self.raw_dir(),
+ Ok(Arc::new(SessionTranscriptHistory::new(
+ &self.workspace_dir,
stem,
seed,
)?))
@@ -421,9 +391,7 @@ fn seed_meta_for_discovered(agent_name: &str) -> TranscriptMeta {
/// A [`ChatHistory`] backed by one `session_raw/{stem}.jsonl` transcript.
///
/// Construct with [`SessionTranscriptHistory::new`] (workspace-rooted, i.e.
-/// `{workspace}/session_raw/`) or [`SessionTranscriptHistory::new_in_dir`] (an
-/// explicit raw dir — **required** for a dedicated-memory profile, whose
-/// sessions live in `session_raw-<id>/`). The `seed_meta` is used only when the
+/// `{workspace}/session_raw/`). The `seed_meta` is used only when the
/// transcript file does not exist yet; for an existing file the authoritative
/// cumulative `_meta` is read back from disk so turn counts and token rollups
/// keep accumulating rather than resetting.
@@ -432,8 +400,8 @@ pub struct SessionTranscriptHistory {
///
/// Resolved eagerly rather than derived per call from a `(workspace, stem)`
/// pair: the old shape hardcoded `{workspace}/session_raw/`, which is the
- /// **wrong directory** for a profile-scoped session and would have silently
- /// cross-written into the shared profile's transcripts the moment this
+ /// **wrong directory** for a canonical session and would have silently
+ /// cross-written into the canonical session's transcripts the moment this
/// handle was wired into the turn path.
path: PathBuf,
/// `_meta` used for the very first write, before a file exists.
@@ -443,8 +411,6 @@ pub struct SessionTranscriptHistory {
impl SessionTranscriptHistory {
/// Binds a history handle to `{workspace_dir}/session_raw/{stem}.jsonl`.
///
- /// Use [`Self::new_in_dir`] when the session is profile-scoped; this
- /// convenience constructor always resolves under the shared `session_raw/`.
pub fn new(
workspace_dir: impl AsRef<Path>,
stem: &str,
@@ -458,30 +424,12 @@ impl SessionTranscriptHistory {
Ok(Self { path, seed_meta })
}
- /// Binds a history handle to `{session_raw_dir}/{stem}.jsonl`.
- ///
- /// `session_raw_dir` is `{workspace}/{session_raw_subdir}` — `session_raw`
- /// for the shared profile, `session_raw-<id>` for a dedicated-memory one.
- /// The turn path must use this constructor; see [`Self::path`]'s note.
- pub fn new_in_dir(
- session_raw_dir: impl AsRef<Path>,
- stem: &str,
- seed_meta: TranscriptMeta,
- ) -> anyhow::Result<Self> {
- let path = resolve_keyed_transcript_path_in_dir(session_raw_dir.as_ref(), stem)?;
- log::debug!(
- "[transcript-history] bound stem={stem} path={}",
- path.display()
- );
- Ok(Self { path, seed_meta })
- }
-
/// Binds a handle to an **already-discovered** transcript file, verbatim.
///
/// Deliberately does **not** go through `resolve_keyed_transcript_path*`,
/// which the two stem constructors above use. That helper `create_dir_all`s
/// its parent and forces a `.jsonl` extension — both wrong for a discovered
- /// path: `find_latest_transcript_in_subdir` can still return a legacy `.md`
+ /// path: `find_latest_transcript` can still return a legacy `.md`
/// file (`read_transcript` routes by extension), and re-resolving would
/// mangle it into a sibling `.jsonl` that does not exist while creating
/// stray directories on a pure read.
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript_history_tests.rs b/crates/openhuman-core/src/agent/harness/session/transcript_history_tests.rs
index 23b4a86a73..9aeddc7d82 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript_history_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript_history_tests.rs
@@ -298,46 +298,6 @@ fn append_turn_is_byte_identical_to_the_free_function() {
);
}
-/// `new_in_dir` addresses a profile-scoped raw dir.
-///
-/// `new` hardcodes `{workspace}/session_raw/`, which is the wrong directory for
-/// a dedicated-memory profile (`session_raw-<id>/`). Before this constructor
-/// existed, wiring the handle into the turn path would have silently written a
-/// profile session into the shared profile's transcripts.
-#[test]
-fn new_in_dir_writes_into_the_profile_scoped_directory() {
- let dir = TempDir::new().unwrap();
- let profile_dir = dir.path().join("session_raw-1");
-
- let h = SessionTranscriptHistory::new_in_dir(&profile_dir, STEM, meta()).unwrap();
- h.append_turn(TranscriptTurn {
- prev: &[],
- next: &[chat("user", "profile scoped")],
- meta: &meta(),
- turn_usage: None,
- request_id: None,
- })
- .unwrap();
-
- assert_eq!(
- h.path(),
- profile_dir.join(format!("{STEM}.jsonl")),
- "handle must be bound to the profile-scoped dir"
- );
- assert!(h.path().exists());
- assert!(
- !dir.path()
- .join("session_raw")
- .join(format!("{STEM}.jsonl"))
- .exists(),
- "nothing may be written into the shared profile's session_raw/"
- );
- assert_eq!(
- read_transcript(h.path()).unwrap().messages[0].content,
- "profile scoped"
- );
-}
-
/// The executable form of this module's "why the write does not cross the crate
/// trait" note: the same logical message set, written through `append_turn`
/// versus through `ChatHistory::replace`, produces display lines that differ in
diff --git a/crates/openhuman-core/src/agent/harness/session/turn/context.rs b/crates/openhuman-core/src/agent/harness/session/turn/context.rs
index 941005a921..8953c5d785 100644
--- a/crates/openhuman-core/src/agent/harness/session/turn/context.rs
+++ b/crates/openhuman-core/src/agent/harness/session/turn/context.rs
@@ -245,8 +245,6 @@ impl Agent {
// UI takes effect on the very next session-start.
let limits = self.config.resolved_memory_limits();
let tree_root_summaries = collect_tree_root_summaries(
- &self.workspace_dir,
- &self.memory_subdir,
limits.per_namespace_max_chars,
limits.total_tree_max_chars,
)
@@ -330,11 +328,6 @@ impl Agent {
include_memory_md: !self.omit_memory_md,
curated_snapshot: None,
user_identity: crate::security::credentials::identity::peek_credential_user_identity(),
- // Profile SOUL.md and curated MEMORY.md are bound at session
- // construction so the normal identity/user-files sections use
- // them instead of their workspace-root fallbacks.
- personality_soul_md: self.personality_soul_md.clone(),
- personality_memory_md: self.personality_memory_md.clone(),
personality_roster: vec![], // TODO: build_personality_roster(&workspace_dir)
agents_md_global: agents_md.global,
agents_md_local: agents_md.local,
diff --git a/crates/openhuman-core/src/agent/harness/session/turn/mod.rs b/crates/openhuman-core/src/agent/harness/session/turn/mod.rs
index 6e77f66d98..324c30ee5f 100644
--- a/crates/openhuman-core/src/agent/harness/session/turn/mod.rs
+++ b/crates/openhuman-core/src/agent/harness/session/turn/mod.rs
@@ -157,21 +157,6 @@ Do not attempt to run them with `run_skill` — they have been removed. Tell the
/// [`crate::config::schema::agent::MemoryContextWindow`]
/// preset by [`crate::config::schema::agent::AgentConfig::resolved_memory_limits`].
///
-/// # The shared tree is the driver's now (#5560)
-///
-/// `memory_subdir == "memory"` goes through
-/// `MemoryTree::root_summaries_with_caps` instead of
-/// `tree_runtime::store::collect_root_summaries_with_caps`. Same files, same
-/// two caps, same `[... truncated]` marker: the embedded driver's member is
-/// that function, called with its own `config.workspace_dir`, so the block the
-/// prompt renders is unchanged.
-///
-/// The `memory-<id>` arm stays host-local and untouched. The contract member
-/// takes **no path** — deliberately, since a workspace argument would be
-/// configuration crossing the bus — and the driver reachable here is bound to
-/// the shared subtree, so a dedicated profile's tree still has to be scanned
-/// directly by [`collect_profile_tree_root_summaries`].
-///
/// # Why `async` is the whole bridge
///
/// The only caller, `turn::context::fetch_learned_context`, is already an
@@ -185,21 +170,12 @@ Do not attempt to run them with `run_skill` — they have been removed. Tell the
/// scan swallowed its own failures into an empty vector, and the prompt simply
/// carries no memory block.
pub(super) async fn collect_tree_root_summaries(
- workspace_dir: &std::path::Path,
- memory_subdir: &str,
per_namespace_cap: usize,
total_cap: usize,
) -> Vec<crate::agent::prompts::NamespaceSummary> {
- let rows = if memory_subdir == "memory" {
- driver_tree_root_summaries(per_namespace_cap, total_cap).await
- } else {
- collect_profile_tree_root_summaries(
- &workspace_dir.join(memory_subdir),
- per_namespace_cap,
- total_cap,
- )
- };
- rows.into_iter()
+ driver_tree_root_summaries(per_namespace_cap, total_cap)
+ .await
+ .into_iter()
.map(
|(namespace, body, updated_at)| crate::agent::prompts::NamespaceSummary {
namespace,
@@ -213,8 +189,7 @@ pub(super) async fn collect_tree_root_summaries(
/// The shared subtree's root summaries, read from the guarded driver.
///
/// Returns the same positional `(namespace, body, updated_at)` triple the
-/// engine scan did, so [`collect_tree_root_summaries`]'s mapping is shared with
-/// the profile arm rather than written twice.
+/// engine scan did.
async fn driver_tree_root_summaries(
per_namespace_cap: usize,
total_cap: usize,
@@ -250,200 +225,6 @@ async fn driver_tree_root_summaries(
}
}
-/// Read summary-tree root summaries from an already-resolved `memory-*` subtree.
-/// The engine's compatibility helper hardcodes `<workspace>/memory`; dedicated
-/// profiles instead supply `<workspace>/memory-<id>`, so scan that equivalent
-/// namespace layout directly rather than falling back to shared memory.
-fn collect_profile_tree_root_summaries(
- memory_dir: &std::path::Path,
- per_namespace_cap: usize,
- total_cap: usize,
-) -> Vec<(String, String, chrono::DateTime<chrono::Utc>)> {
- let Ok(entries) = std::fs::read_dir(memory_dir.join("namespaces")) else {
- return Vec::new();
- };
- let mut roots: Vec<_> = entries
- .flatten()
- .filter_map(|entry| {
- let namespace = entry.file_name().to_string_lossy().into_owned();
- let raw = std::fs::read_to_string(entry.path().join("tree").join("root.md")).ok()?;
- let node = parse_node_markdown(&raw, &namespace, "root");
- Some((namespace, node))
- })
- .collect();
- roots.sort_by(|(left, _), (right, _)| left.cmp(right));
-
- let mut total_chars = 0usize;
- let mut out = Vec::new();
- for (namespace, node) in roots {
- if total_chars >= total_cap {
- break;
- }
- let body = node.summary.trim();
- if body.is_empty() {
- continue;
- }
- let remaining = total_cap.saturating_sub(total_chars);
- let cap = per_namespace_cap.min(remaining);
- let body_chars = body.chars().count();
- let rendered = if body_chars > cap {
- let mut clipped: String = body.chars().take(cap).collect();
- clipped.push_str("\n\n[... truncated]");
- clipped
- } else {
- body.to_string()
- };
- total_chars += rendered.chars().count();
- out.push((namespace, rendered, node.updated_at));
- }
- out
-}
-
-/// Parse one summary-tree node's markdown file into a [`TreeNode`].
-///
-/// # Why this lives here rather than being called on the engine (#5560)
-///
-/// This is a verbatim port of `tinycortex`'s
-/// `memory::tree::runtime::store::parse_node_markdown`, which
-/// [`collect_profile_tree_root_summaries`] used to reach through
-/// `parse_node_markdown_pub`. It is brought home rather than routed at the
-/// module contract because there is nothing on the contract to route it *at*:
-/// `MemoryTree` is namespace-addressed and its summary members answer from the
-/// driver's own store, whereas this reads a `root.md` **the driver does not
-/// own** — a dedicated profile's `<workspace>/memory-<id>/namespaces/…` tree,
-/// which is exactly the subtree the engine's compatibility helper skips
-/// because it hardcodes `<workspace>/memory`. A bus round-trip cannot answer a
-/// question about a file the far end never opened.
-///
-/// It has no engine coupling to give up: every name it needs — [`TreeNode`],
-/// [`NodeLevel::from_str_label`], [`level_from_node_id`], [`derive_parent_id`]
-/// and [`estimate_tokens`] — is **contract** vocabulary, defined in
-/// `tinymemory-bus` and reached here through
-/// [`crate::memory::api::tree`]. The engine crate re-exported the
-/// same items, so the types this produces are the same types it produced
-/// before, not host look-alikes.
-///
-/// # Two faithfulness notes for a reviewer
-///
-/// - **The engine's signature was `Result<TreeNode>`; this one is not.** Its
-/// body contains no `?` and no `Err` construction — every field falls back
-/// to a derived or default value, which is the documented point of it ("does
-/// not fail on malformed frontmatter", which is also what lets a truncated
-/// write go undetected). So the `.ok()?` the call site used could never skip
-/// a namespace, and dropping the `Result` changes no behaviour. Restore the
-/// `Result` if this ever grows a genuine failure.
-/// - **Timestamps fall back to `UNIX_EPOCH`, not to `now()`**, and
-/// `updated_at` falls back to `created_at` rather than to the epoch
-/// independently. `collect_profile_tree_root_summaries` returns
-/// `node.updated_at` straight to the prompt builder, so a node with no
-/// frontmatter reports 1970 — deliberately, since a missing timestamp
-/// sorting as "just updated" would be worse.
-fn parse_node_markdown(
- raw: &str,
- namespace: &str,
- node_id: &str,
-) -> crate::memory::api::tree::TreeNode {
- use crate::memory::api::tree::{
- derive_parent_id, estimate_tokens, level_from_node_id, NodeLevel, TreeNode,
- };
- use chrono::{DateTime, Utc};
-
- let (frontmatter, body_raw) = split_frontmatter(raw);
- let body = body_raw.trim_end().to_string();
-
- let level = frontmatter
- .get("level")
- .and_then(|v| NodeLevel::from_str_label(v))
- .unwrap_or_else(|| level_from_node_id(node_id));
- let parent_id = frontmatter
- .get("parent_id")
- .and_then(|v| {
- let trimmed = v.trim().trim_matches('"');
- if trimmed == "~" || trimmed.is_empty() {
- None
- } else {
- Some(trimmed.to_string())
- }
- })
- .or_else(|| derive_parent_id(node_id));
- let token_count = frontmatter
- .get("token_count")
- .and_then(|v| v.parse::<u32>().ok())
- .unwrap_or_else(|| estimate_tokens(&body));
- let child_count = frontmatter
- .get("child_count")
- .and_then(|v| v.parse::<u32>().ok())
- .unwrap_or(0);
- let created_at = frontmatter
- .get("created_at")
- .and_then(|v| DateTime::parse_from_rfc3339(v).ok())
- .map(|dt| dt.with_timezone(&Utc))
- .unwrap_or(DateTime::<Utc>::UNIX_EPOCH);
- let updated_at = frontmatter
- .get("updated_at")
- .and_then(|v| DateTime::parse_from_rfc3339(v).ok())
- .map(|dt| dt.with_timezone(&Utc))
- .unwrap_or(created_at);
- let metadata = frontmatter.get("metadata").map(|v| v.to_string());
-
- TreeNode {
- node_id: node_id.to_string(),
- namespace: namespace.to_string(),
- level,
- parent_id,
- summary: body,
- token_count,
- child_count,
- created_at,
- updated_at,
- metadata,
- }
-}
-
-/// Split markdown into a (frontmatter key-value map, body text) pair.
-///
-/// Ported alongside [`parse_node_markdown`] — it is that function's only
-/// helper and is `pub(crate)` in the engine for the engine's own callers, none
-/// of which exist here.
-///
-/// Looks for a leading `---` fence and the first subsequent `\n---`; each
-/// `key: value` line in between is parsed with a single `find(':')` split
-/// (values are trimmed and unwrapped of one layer of surrounding `"`). If the
-/// content doesn't start with `---`, or no closing fence is found, the whole
-/// input is returned unmodified as the body with an empty map — this function
-/// never errors, it degrades to "no frontmatter" instead. That degradation is
-/// what makes [`parse_node_markdown`] total.
-fn split_frontmatter(raw: &str) -> (std::collections::HashMap<String, String>, String) {
- let mut map = std::collections::HashMap::new();
- let trimmed = raw.trim_start();
- if !trimmed.starts_with("---") {
- return (map, raw.to_string());
- }
- let after_open = &trimmed[3..];
- if let Some(close_pos) = after_open.find("\n---") {
- let fm_block = &after_open[..close_pos];
- let body = after_open[close_pos + 4..]
- .trim_start_matches('\n')
- .to_string();
- for line in fm_block.lines() {
- let line = line.trim();
- if line.is_empty() {
- continue;
- }
- if let Some(colon_pos) = line.find(':') {
- let key = line[..colon_pos].trim().to_string();
- let raw_value = line[colon_pos + 1..].trim();
- let value = serde_json::from_str::<String>(raw_value)
- .unwrap_or_else(|_| raw_value.trim_matches('"').to_string());
- map.insert(key, value);
- }
- }
- (map, body)
- } else {
- (map, raw.to_string())
- }
-}
-
/// Sanitize a learned memory entry before injecting into the system prompt.
/// Strips raw data, limits length, and removes potential secrets.
pub(super) fn sanitize_learned_entry(content: &str) -> String {
diff --git a/crates/openhuman-core/src/agent/harness/session/turn/session_io/transcript_load.rs b/crates/openhuman-core/src/agent/harness/session/turn/session_io/transcript_load.rs
index 68e82470e2..4fd046b6b9 100644
--- a/crates/openhuman-core/src/agent/harness/session/turn/session_io/transcript_load.rs
+++ b/crates/openhuman-core/src/agent/harness/session/turn/session_io/transcript_load.rs
@@ -39,7 +39,7 @@ impl Agent {
/// needs all survive by construction.
///
/// Discovery lives on the locator because it is a *lookup*, not a read:
- /// this function's key is `(workspace, session_raw_subdir, agent name)`
+ /// this function's key is `(workspace, agent name)`
/// (newest match, with a legacy `session_raw/DDMMYYYY/` fallback) and the
/// cold-boot sibling
/// [`seed_resume_from_thread_transcript`][Agent::seed_resume_from_thread_transcript]
@@ -103,18 +103,14 @@ impl Agent {
/// The transcript locator for this session — the injected one, or a
/// [`FileTranscriptLocator`] built from the agent's **current** workspace.
///
- /// Built per call rather than cached: `workspace_dir` and
- /// `session_raw_subdir` are reassignable after `build()` (tests do exactly
- /// that), and a locator frozen at build time would silently keep resolving
- /// against the directory the agent no longer uses. The construction is two
- /// clones of small strings — cheaper than the `read_dir` it precedes.
+ /// Built per call rather than cached: `workspace_dir` is reassignable after
+ /// `build()` (tests do exactly that), and a locator frozen at build time
+ /// would silently keep resolving against the directory the agent no longer
+ /// uses.
pub(crate) fn session_locator(&self) -> std::sync::Arc<dyn SessionHistoryLocator> {
match &self.session_history_locator {
Some(locator) => locator.clone(),
- None => std::sync::Arc::new(FileTranscriptLocator::new(
- self.workspace_dir.clone(),
- self.session_raw_subdir.clone(),
- )),
+ None => std::sync::Arc::new(FileTranscriptLocator::new(self.workspace_dir.clone())),
}
}
}
diff --git a/crates/openhuman-core/src/agent/harness/session/turn_history_and_context_tests.rs b/crates/openhuman-core/src/agent/harness/session/turn_history_and_context_tests.rs
index 6ec50a852f..14f389bb2d 100644
--- a/crates/openhuman-core/src/agent/harness/session/turn_history_and_context_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/turn_history_and_context_tests.rs
@@ -103,11 +103,7 @@ async fn build_parent_context_and_sanitize_helpers_cover_snapshot_paths() {
// A profile subtree that was never written. Named rather than `"memory"`
// because the shared subtree is the driver's now (#5560), and what this
// line is here to cover is the host-local scan's empty answer.
- assert!(
- collect_tree_root_summaries(agent.workspace_dir(), "memory-absent", 8_000, 32_000)
- .await
- .is_empty()
- );
+ assert!(collect_tree_root_summaries(8_000, 32_000).await.is_empty());
}
#[test]
@@ -268,96 +264,6 @@ async fn transcript_resume_is_bounded_by_max_history_messages() {
assert_eq!(cached[4].content, "a7");
}
-#[tokio::test]
-async fn transcript_resume_uses_profile_scoped_raw_directory() {
- let mut shared = make_agent(None);
- shared.persist_session_transcript(
- &[
- ChatMessage::system("shared-system"),
- ChatMessage::user("shared-user"),
- ],
- 0,
- 0,
- 0,
- 0.0,
- None,
- );
-
- let mut profile = make_agent(None);
- profile.workspace_dir = shared.workspace_dir.clone();
- profile.agent_definition_name = shared.agent_definition_name.clone();
- profile.session_raw_subdir = "session_raw-alice".to_string();
- profile.persist_session_transcript(
- &[
- ChatMessage::system("profile-system"),
- ChatMessage::user("profile-user"),
- ],
- 0,
- 0,
- 0,
- 0.0,
- None,
- );
-
- let mut resumed = make_agent(None);
- resumed.workspace_dir = shared.workspace_dir.clone();
- resumed.agent_definition_name = shared.agent_definition_name.clone();
- resumed.session_raw_subdir = "session_raw-alice".to_string();
- resumed.try_load_session_transcript();
-
- let cached = resumed
- .cached_transcript_messages
- .expect("profile transcript");
- assert!(cached
- .iter()
- .any(|message| message.content == "profile-user"));
- assert!(cached
- .iter()
- .all(|message| message.content != "shared-user"));
-}
-
-// NOTE: The `execute_tool_call_*` tests that exercised the legacy per-call
-// direct tool executor (`Agent::execute_tool_call`) were removed during the
-// tinyagents migration. The direct executor and its test-only parity shim
-// (`session/agent_tool_exec.rs`) were deleted (commit 8aba23886); tool
-// execution now happens inside the tinyagents graph turn, so these tests target
-// an API that no longer exists. Removed: blocks_invisible_tool_and_emits_events,
-// reports_unknown_tool, rewrites_legacy_run_skill_for_builtin_cron_tools,
-// rewrites_run_workflow_for_builtin_cron_tools,
-// denies_tool_above_channel_permission (and, below,
-// denies_by_policy_before_tool_runs, threads_generated_tool_context_into_policy,
-// applies_inline_result_budget).
-
-#[test]
-fn system_prompt_includes_tool_policy_boundary() {
- let provider: Arc<dyn ChatModel<()>> = Arc::new(DummyProvider);
- let mut config = crate::config::AgentConfig::default();
- config
- .channel_permissions
- .insert("turn-test-channel".into(), "read_only".into());
- let agent = make_agent_with_builder(
- provider,
- vec![
- Box::new(EchoTool),
- Box::new(CountingWriteTool {
- calls: Arc::new(AtomicUsize::new(0)),
- }),
- ],
- vec![],
- config,
- crate::config::ContextConfig::default(),
- );
-
- let prompt = agent
- .build_system_prompt(LearnedContextData::default())
- .expect("prompt");
-
- assert!(prompt.contains("## Tool Policy Boundary"));
- assert!(prompt.contains("Allowed tools: echo"));
- assert!(prompt.contains("Restricted tools: 1 omitted by policy"));
- assert!(!prompt.contains("write_notes"));
-}
-
#[test]
fn set_agent_definition_name_refreshes_tool_policy_identity() {
let provider: Arc<dyn ChatModel<()>> = Arc::new(DummyProvider);
diff --git a/crates/openhuman-core/src/agent/harness/session/types.rs b/crates/openhuman-core/src/agent/harness/session/types.rs
index 3c626f459a..8c4b52164c 100644
--- a/crates/openhuman-core/src/agent/harness/session/types.rs
+++ b/crates/openhuman-core/src/agent/harness/session/types.rs
@@ -247,21 +247,6 @@ pub struct Agent {
///
/// [`AgentDefinitionRegistry`]: crate::agent::harness::definition::AgentDefinitionRegistry
pub(super) agent_definition_id: String,
- /// Profile-local SOUL.md resolved when the session is built. When set,
- /// IdentitySection uses it instead of the workspace-root identity.
- pub(super) personality_soul_md: Option<String>,
- /// Profile-local curated MEMORY.md resolved when the session is built.
- /// `None` preserves the workspace-root MEMORY.md fallback.
- pub(super) personality_memory_md: Option<String>,
- /// Profile-selected memory subtree name (`memory`, `memory-<id>`, or a
- /// legacy numeric suffix). Used for memory-tree reads and paired with the
- /// profile-specific transcript directory below.
- pub(super) memory_subdir: String,
- /// Profile-selected JSONL transcript subdirectory (`session_raw` or
- /// `session_raw-<id>`). It is resolved against the current `workspace_dir`
- /// at I/O time so relocating an agent does not leave transcripts pinned to
- /// its original workspace while dedicated-memory profiles remain isolated.
- pub(super) session_raw_subdir: String,
/// Resolved filesystem path for this session's transcript file.
/// Set on first write, reused for subsequent **appends** within the
/// same session.
@@ -293,7 +278,7 @@ pub struct Agent {
/// and is resolved *lazily* by
/// [`Agent::session_locator`][Self::session_locator] into a
/// [`FileTranscriptLocator`][super::transcript_history::FileTranscriptLocator]
- /// over the **current** `workspace_dir` / `session_raw_subdir` — never
+ /// over the **current** `workspace_dir` — never
/// captured at build time, because callers (tests especially) reassign
/// `workspace_dir` after `build()` and a frozen locator would silently keep
/// reading the old directory.
@@ -549,12 +534,6 @@ pub struct AgentBuilder {
pub(super) event_session_id: Option<String>,
pub(super) event_channel: Option<String>,
pub(super) agent_definition_name: Option<String>,
- /// Forwarded to [`Agent::personality_soul_md`] at build time.
- pub(super) personality_soul_md: Option<String>,
- /// Forwarded to [`Agent::personality_memory_md`] at build time.
- pub(super) personality_memory_md: Option<String>,
- pub(super) memory_subdir: Option<String>,
- pub(super) session_raw_subdir: Option<String>,
/// Directory chain of parent session keys for a sub-agent. `None`
/// (default) means this is a root session — its transcript lands
/// flat in `session_raw/DDMMYYYY/{session_key}.jsonl`. Populated
diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner.rs
index ff96d70561..cf80225a70 100644
--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner.rs
@@ -1420,8 +1420,6 @@ async fn run_typed_mode(
include_memory_md: !definition.omit_memory_md,
curated_snapshot: None,
user_identity: crate::security::credentials::identity::peek_credential_user_identity(),
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: agents_md.global.clone(),
agents_md_local: agents_md.local.clone(),
diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_tests.rs
index 96b042c98c..3fc75ad852 100644
--- a/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_tests.rs
@@ -440,8 +440,6 @@ fn render_tools_at(format: crate::agent::prompts::ToolCallFormat, instructions:
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs b/crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs
index 7e47692d9e..c18bc2ffdc 100644
--- a/crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs
+++ b/crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs
@@ -81,8 +81,6 @@ fn prompt_context(learned: LearnedContextData) -> PromptContext<'static> {
include_profile: false,
include_memory_md: false,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests.rs
index 74b59d6b20..6e51d8a33b 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests.rs
@@ -68,8 +68,6 @@ fn ctx_with_identity(identity: Option<UserIdentity>) -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: identity,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -102,8 +100,6 @@ fn memory_framing_ctx<'a>(
include_memory_md: true,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -128,8 +124,6 @@ fn ctx_with_learned(learned: LearnedContextData) -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -159,8 +153,6 @@ fn agents_md_ctx(global: Option<String>, local: Option<String>) -> PromptContext
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: global,
agents_md_local: local,
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs
index 91e04210df..bde0f8684c 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs
@@ -20,8 +20,6 @@ fn prompt_builder_assembles_sections() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -52,8 +50,6 @@ fn grounding_contract_appended_to_every_build_path() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -146,8 +142,6 @@ fn identity_section_creates_missing_workspace_files() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -229,8 +223,6 @@ fn datetime_section_is_static_grounding_rule_without_volatile_timestamp() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -302,8 +294,6 @@ fn datetime_section_appends_resolve_time_rule_only_when_tool_present() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -461,8 +451,6 @@ fn tools_section_pformat_renders_signature_not_schema() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -521,8 +509,6 @@ fn tools_section_renders_invalid_schema_tool_without_arguments() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -560,8 +546,6 @@ fn tools_section_uses_pformat_signature_for_text_dispatchers() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -612,8 +596,6 @@ fn user_memory_section_renders_namespaces_with_headings() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs
index 54f80daeab..4cb9449462 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs
@@ -23,8 +23,6 @@ fn user_memory_section_returns_empty_when_no_summaries() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests_user_files_reflections_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests_user_files_reflections_tests.rs
index 20387d6a2c..41ea8fa77f 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests_user_files_reflections_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests_user_files_reflections_tests.rs
@@ -153,8 +153,6 @@ fn for_subagent_builder_injects_user_files_even_when_identity_omitted() {
include_memory_md: true,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -200,8 +198,6 @@ fn for_subagent_builder_injects_user_files_even_when_identity_omitted() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -345,8 +341,6 @@ fn prompt_tool_constructors_and_user_memory_skip_empty_bodies() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -490,8 +484,6 @@ fn tools_section_empty_for_native() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -525,8 +517,6 @@ fn tools_section_nonempty_for_pformat() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -562,8 +552,6 @@ fn tools_section_native_with_dispatcher_instructions_returns_instructions() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/prompts/render_helpers/section_renderers.rs b/crates/openhuman-core/src/agent/prompts/render_helpers/section_renderers.rs
index 58e6777605..c088f8200d 100644
--- a/crates/openhuman-core/src/agent/prompts/render_helpers/section_renderers.rs
+++ b/crates/openhuman-core/src/agent/prompts/render_helpers/section_renderers.rs
@@ -228,8 +228,6 @@ fn empty_prompt_context_for_static_sections() -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/prompts/render_helpers/workspace_files.rs b/crates/openhuman-core/src/agent/prompts/render_helpers/workspace_files.rs
index 958373ee28..197ee9e91c 100644
--- a/crates/openhuman-core/src/agent/prompts/render_helpers/workspace_files.rs
+++ b/crates/openhuman-core/src/agent/prompts/render_helpers/workspace_files.rs
@@ -112,9 +112,8 @@ pub fn inject_workspace_file(prompt: &mut String, workspace_dir: &Path, filename
/// Inject pre-loaded string content into `prompt` under a `### label` heading,
/// capped at `max_chars`. Mirrors the format of [`inject_snapshot_content`]
/// and [`inject_workspace_file_capped`] but takes a `&str` instead of a file
-/// path. Used for personality-specific overrides (`personality_soul_md`,
-/// `personality_memory_md`) on [`PromptContext`] so a swap from the file-based
-/// loader to an inline override is byte-compatible with the workspace-file path.
+/// path. Used for pre-loaded prompt sections that need the same rendering as
+/// workspace-file content.
///
/// Empty/whitespace content is silently skipped.
pub fn inject_inline_content(prompt: &mut String, label: &str, content: &str, max_chars: usize) {
diff --git a/crates/openhuman-core/src/agent/prompts/sections.rs b/crates/openhuman-core/src/agent/prompts/sections.rs
index b7a9ab3101..91361063e5 100644
--- a/crates/openhuman-core/src/agent/prompts/sections.rs
+++ b/crates/openhuman-core/src/agent/prompts/sections.rs
@@ -6,8 +6,8 @@
//! sub-agent plumbing.
use super::render_helpers::{
- inject_inline_content, inject_snapshot_content, inject_workspace_file,
- inject_workspace_file_capped, sync_workspace_file,
+ inject_snapshot_content, inject_workspace_file, inject_workspace_file_capped,
+ sync_workspace_file,
};
use super::types::*;
use anyhow::Result;
@@ -247,16 +247,6 @@ impl PromptSection for IdentitySection {
if skip_in_prompt.contains(file) {
continue;
}
- if *file == "SOUL.md" {
- if let Some(ref soul) = ctx.personality_soul_md {
- tracing::debug!(
- "[identity] personality SOUL.md override active ({} chars)",
- soul.len()
- );
- inject_inline_content(&mut prompt, "SOUL.md", soul, BOOTSTRAP_MAX_CHARS);
- continue;
- }
- }
inject_workspace_file(&mut prompt, ctx.workspace_dir, file);
}
@@ -302,8 +292,7 @@ impl PromptSection for UserFilesSection {
);
}
if ctx.include_memory_md {
- // Personality-specific MEMORY.md takes highest priority, then
- // the session-frozen curated-memory snapshot, then the
+ // Prefer the session-frozen curated-memory snapshot, then the
// workspace file (pure prompt-unit tests and older call sites).
//
// Render into a scratch buffer first so the `MEMORY_MD_FRAMING`
@@ -311,13 +300,7 @@ impl PromptSection for UserFilesSection {
// the inject helpers silently skip empty/missing files, and a
// dangling frame pointing at nothing would be worse than none.
let mut mem = String::new();
- if let Some(ref memory_md) = ctx.personality_memory_md {
- tracing::debug!(
- "[user_files] personality MEMORY.md override active ({} chars)",
- memory_md.len()
- );
- inject_inline_content(&mut mem, "MEMORY.md", memory_md, USER_FILE_MAX_CHARS);
- } else if let Some(snap) = &ctx.curated_snapshot {
+ if let Some(snap) = &ctx.curated_snapshot {
inject_snapshot_content(&mut mem, "MEMORY.md", &snap.memory, USER_FILE_MAX_CHARS);
inject_snapshot_content(&mut mem, "USER.md", &snap.user, USER_FILE_MAX_CHARS);
} else {
diff --git a/crates/openhuman-core/src/agent/prompts/types.rs b/crates/openhuman-core/src/agent/prompts/types.rs
index 240db19866..4f61ad3255 100644
--- a/crates/openhuman-core/src/agent/prompts/types.rs
+++ b/crates/openhuman-core/src/agent/prompts/types.rs
@@ -394,14 +394,6 @@ pub struct PromptContext<'a> {
/// session, tests). Pre-fetched by the caller from the
/// stored credential user payload so prompt builders never reach the network.
pub user_identity: Option<UserIdentity>,
- /// Personality-specific SOUL.md content. When `Some`, the
- /// `IdentitySection` uses this instead of reading the workspace
- /// root `SOUL.md`. `None` falls back to existing behavior.
- pub personality_soul_md: Option<String>,
- /// Personality-specific MEMORY.md content. When `Some`, the
- /// `UserFilesSection` uses this instead of reading the workspace
- /// root `MEMORY.md`. `None` falls back to existing behavior.
- pub personality_memory_md: Option<String>,
/// Non-self personality roster entries for the master agent's prompt.
/// Empty for non-master agents.
pub personality_roster: Vec<PersonalityRosterEntry>,
diff --git a/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt_tests.rs
index f317c24eb9..c864269f52 100644
--- a/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt_tests.rs
@@ -22,8 +22,6 @@ fn test_ctx() -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt_tests.rs
index aa9e27a17b..567479446e 100644
--- a/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn empty_ctx() -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/fleet_prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/fleet_prompt_tests.rs
index 4c6823abc8..907dbdc78e 100644
--- a/crates/openhuman-core/src/agent/registry/agents/fleet_prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/fleet_prompt_tests.rs
@@ -68,8 +68,6 @@ fn render(def: &AgentDefinition, definitions: &[AgentDefinition]) -> String {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt_tests.rs
index 2c140aab20..b35f736767 100644
--- a/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt_tests.rs
@@ -22,8 +22,6 @@ fn test_ctx() -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt_tests.rs
index a4c58ff97d..93624a7d6f 100644
--- a/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_nonempty_body() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/help/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/help/prompt_tests.rs
index 3977810d69..f8ecfa56bc 100644
--- a/crates/openhuman-core/src/agent/registry/agents/help/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/help/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_nonempty_body() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs
index 9f3a3b4855..3dd59d61ab 100644
--- a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_nonempty_body() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt_tests.rs
index 86fdca3d9d..126c1758e1 100644
--- a/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt_tests.rs
@@ -23,8 +23,6 @@ fn ctx_with<'a>(integrations: &'a [ConnectedIntegration]) -> PromptContext<'a> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
index 3fc2a8c172..221647fc74 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
@@ -201,8 +201,6 @@ fn every_builtin_has_a_prompt_body() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt_tests.rs
index 1f59e324be..475b7652f0 100644
--- a/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn empty_ctx() -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt_tests.rs
index f037ccfe02..316cb075b3 100644
--- a/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt_tests.rs
@@ -21,8 +21,6 @@ fn empty_ctx() -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt_tests.rs
index 92820db27c..8070009acc 100644
--- a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt_tests.rs
@@ -24,8 +24,6 @@ fn ctx_with_identity(identity: Option<UserIdentity>) -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: identity,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
index 6966ddf256..5309618053 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
@@ -140,8 +140,6 @@ fn ctx_with<'a>(integrations: &'a [ConnectedIntegration]) -> PromptContext<'a> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs
index 68783cc7ff..54f3175d1c 100644
--- a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_grounding_contract() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/researcher/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/researcher/prompt_tests.rs
index 64fecaff98..59b8a7a74e 100644
--- a/crates/openhuman-core/src/agent/registry/agents/researcher/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/researcher/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_nonempty_body() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt_tests.rs
index 716a90f856..27c2b9b09f 100644
--- a/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_scheduler_contract() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt_tests.rs
index c73e4aa7e8..37ce50aea4 100644
--- a/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_nonempty_body() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs
index bc80c4dcb4..51e9f18033 100644
--- a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_task_manager_contract() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt_tests.rs
index 0be8bf981d..74f5e890d8 100644
--- a/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_nonempty_body() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs
index cb2f268932..3929a6db64 100644
--- a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs
@@ -21,8 +21,6 @@ fn build_returns_nonempty_body() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
index f2a41e89d4..568b982a58 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
@@ -290,8 +290,6 @@ impl ContextComposer for OpenHumanContextComposer {
// documented `None` behaviour.
curated_snapshot: None,
user_identity: crate::security::credentials::identity::peek_credential_user_identity(),
- personality_soul_md: None,
- personality_memory_md: None,
// TODO(phase4): the master agent's personality roster is built
// from the profiles domain (`crate::profiles`); the
// existing main-agent path leaves this empty too (see the
diff --git a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
index e2a529260a..d5d435bcdc 100644
--- a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
@@ -491,8 +491,6 @@ impl SubagentPayloadSummarizer {
include_memory_md: !self.definition.omit_memory_md,
curated_snapshot: None,
user_identity: crate::security::credentials::identity::peek_credential_user_identity(),
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
// AGENTS.md layers are intentionally excluded from the payload
// summarizer. This is a narrow internal utility that condenses an
diff --git a/crates/openhuman-core/src/agent/triage/evaluator/prompt.rs b/crates/openhuman-core/src/agent/triage/evaluator/prompt.rs
index 2f9de8fbf7..9dd6f944d6 100644
--- a/crates/openhuman-core/src/agent/triage/evaluator/prompt.rs
+++ b/crates/openhuman-core/src/agent/triage/evaluator/prompt.rs
@@ -35,8 +35,6 @@ pub(crate) fn extract_inline_prompt(def: &AgentDefinition) -> Option<String> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/channels/bus/subscriber.rs b/crates/openhuman-core/src/channels/bus/subscriber.rs
index e67355e3bc..2e9fc85191 100644
--- a/crates/openhuman-core/src/channels/bus/subscriber.rs
+++ b/crates/openhuman-core/src/channels/bus/subscriber.rs
@@ -98,7 +98,6 @@ impl EventHandler<DomainEvent> for ChannelInboundSubscriber {
None,
None,
None,
- None,
crate::web_chat::ChatRequestMetadata {
// Tag inbound provider messages so traces classify as
// run:channel_inbound instead of interactive chat.
diff --git a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
index 491c44d32c..26dc17f2ee 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
@@ -212,10 +212,6 @@ async fn start_channels_inner(mut config: Config) -> Result<()> {
&config.agents,
&config,
None,
- None,
- None,
- None,
- None,
));
let skills = crate::skills::load_workflow_metadata(&workspace);
diff --git a/crates/openhuman-core/src/channels/system_prompt.rs b/crates/openhuman-core/src/channels/system_prompt.rs
index cb88abd003..0053c50b91 100644
--- a/crates/openhuman-core/src/channels/system_prompt.rs
+++ b/crates/openhuman-core/src/channels/system_prompt.rs
@@ -191,7 +191,7 @@ fn hash_file_stat(hasher: &mut DefaultHasher, path: &Path) {
}
}
-fn render(inputs: &ChannelPromptInputs, identity: &ChannelIdentity) -> String {
+fn render(inputs: &ChannelPromptInputs, _identity: &ChannelIdentity) -> String {
let tool_descs: Vec<(&str, &str)> = inputs
.tool_descs
.iter()
@@ -241,7 +241,7 @@ fn ensure_blank_line(prompt: &mut String) {
}
/// Names the profile and which files were inlined — never their contents.
-fn log_render(workspace_dir: &Path, identity: &ChannelIdentity, rendered: &str, reason: &str) {
+fn log_render(workspace_dir: &Path, _identity: &ChannelIdentity, rendered: &str, reason: &str) {
let memory = if workspace_dir.join("MEMORY.md").is_file() {
"root"
} else {
diff --git a/crates/openhuman-core/src/cron/README.md b/crates/openhuman-core/src/cron/README.md
index 5870edcb04..a6bf463c4b 100644
--- a/crates/openhuman-core/src/cron/README.md
+++ b/crates/openhuman-core/src/cron/README.md
@@ -33,7 +33,7 @@ Cron publishes through `core/bus.rs` using variants declared in `core/events.rs`
## Calls into
-- `crates/openhuman-core/src/agent/` — `Agent::from_config[_for_agent[_with_profile]]` for agent jobs; `agent::harness::definition::AgentDefinitionRegistry` to resolve `agent_id`; `agent::profiles::load_profiles` to resolve `profile_id`.
+- `crates/openhuman-core/src/agent/` — `Agent::from_config_for_agent` for agent jobs and `agent::harness::definition::AgentDefinitionRegistry` to resolve `agent_id`.
- `crates/openhuman-core/src/security/` — `SecurityPolicy::from_config` gates shell jobs.
- `crates/openhuman-core/src/config/` — `Config` provides poll interval, workspace dir, autonomy policy, retry counts, and per-job model overrides.
- `crates/openhuman-core/src/inference/` — `provider::create_chat_model_with_model_id` resolves workload-hint model specs on agent-definition overrides.
diff --git a/crates/openhuman-core/src/cron/seed.rs b/crates/openhuman-core/src/cron/seed.rs
index b8f5b9b23b..640ffd95b4 100644
--- a/crates/openhuman-core/src/cron/seed.rs
+++ b/crates/openhuman-core/src/cron/seed.rs
@@ -188,7 +188,6 @@ fn seed_morning_briefing(config: &Config) -> Result<()> {
false, // recurring — do not delete after run
Some(MORNING_BRIEFING_JOB_NAME.to_string()),
false, // enabled=false — opt-in, created disabled atomically
- None,
)?;
tracing::debug!(
diff --git a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs
index 882a965fee..7620cb0351 100644
--- a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs
+++ b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs
@@ -21,8 +21,6 @@ fn ctx() -> PromptContext<'static> {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/memory/tool_memory/prompt_tests.rs b/crates/openhuman-core/src/memory/tool_memory/prompt_tests.rs
index 52255ce1d6..f1476f0e01 100644
--- a/crates/openhuman-core/src/memory/tool_memory/prompt_tests.rs
+++ b/crates/openhuman-core/src/memory/tool_memory/prompt_tests.rs
@@ -48,8 +48,6 @@ fn section_renders_via_prompt_section_trait() {
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/crates/openhuman-core/src/runtime/node/ops.rs b/crates/openhuman-core/src/runtime/node/ops.rs
index 2c52550265..bf13fcac46 100644
--- a/crates/openhuman-core/src/runtime/node/ops.rs
+++ b/crates/openhuman-core/src/runtime/node/ops.rs
@@ -105,10 +105,6 @@ pub fn build_runtime_tools(config: &Config) -> Result<Vec<Box<dyn Tool>>, String
&config.agents,
config,
None,
- None,
- None,
- None,
- None,
);
debug!(
tool_count = built.len(),
diff --git a/crates/openhuman-core/src/sandbox/README.md b/crates/openhuman-core/src/sandbox/README.md
index 7ec88cc96c..6561ee9c0c 100644
--- a/crates/openhuman-core/src/sandbox/README.md
+++ b/crates/openhuman-core/src/sandbox/README.md
@@ -108,9 +108,6 @@ resolved `SandboxBackendKind` as a security boundary on its own.
- `crates/openhuman-core/src/agent/platform_shell.rs` — doc references
only; it is the shared Windows-aware command builder that
`execute_unsandboxed`/`execute_local_jail` call into.
-- `crates/openhuman-core/src/agent/profiles/guard.rs` — doc comment noting
- that its profile-path scan is not an OS sandbox and pointing at
- `cwd_jail` as the confinement layer.
- `crates/openhuman-core/src/config/ops/sandbox.rs` — RPC settings surface
(`get_sandbox_settings`) reads `SANDBOX_ENV_PASSTHROUGH` and
`[security.sandbox]` config.
diff --git a/crates/openhuman-core/src/security/README.md b/crates/openhuman-core/src/security/README.md
index f9f7e54bc1..7a72acbeb1 100644
--- a/crates/openhuman-core/src/security/README.md
+++ b/crates/openhuman-core/src/security/README.md
@@ -114,8 +114,7 @@ behavior, to make a feature work:
- `crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs` — bridges
`SecurityPolicy` into the tinyagents tool-call gate.
-- `crates/openhuman-core/src/agent/profiles/guard.rs`,
- `agent/turn_workspace.rs` — profile and per-turn workspace grants.
+- `crates/openhuman-core/src/agent/turn_workspace.rs` — per-turn workspace grants.
- `crates/openhuman-core/src/tools/ops.rs` and nearly every
`tools/impl/{filesystem,network,system,browser,document,presentation}/*.rs`
— every executable tool consults `SecurityPolicy` before acting.
diff --git a/crates/openhuman-core/src/security/policy/path_checks.rs b/crates/openhuman-core/src/security/policy/path_checks.rs
index d411411717..84a9624da8 100644
--- a/crates/openhuman-core/src/security/policy/path_checks.rs
+++ b/crates/openhuman-core/src/security/policy/path_checks.rs
@@ -289,7 +289,6 @@ impl SecurityPolicy {
}
let workspace_root = self.workspace_root().await;
self.check_resolved_against_forbidden(&resolved, &workspace_root)?;
- self.check_cross_profile(&resolved)?;
log::debug!(
"[security] validate_path: '{}' resolved to '{}'",
path,
@@ -358,7 +357,6 @@ impl SecurityPolicy {
let workspace_root = self.workspace_root().await;
self.check_resolved_against_forbidden(&canonical_ancestor, &workspace_root)?;
self.check_resolved_against_forbidden(&result, &workspace_root)?;
- self.check_cross_profile(&result)?;
log::debug!(
"[security] validate_parent_path: '{}' resolved parent to '{}'",
@@ -368,10 +366,6 @@ impl SecurityPolicy {
Ok(result)
}
- pub(super) fn check_cross_profile(&self, resolved: &Path) -> Result<(), String> {
- Ok(())
- }
-
/// Returns `true` if `path` falls under one of the internal-state
/// subdirectories or files within `workspace_dir`. Agent tools must not
/// write to these locations — they contain memory DBs, session transcripts,
diff --git a/crates/openhuman-core/src/skills/README.md b/crates/openhuman-core/src/skills/README.md
index 59bb6c1f56..b63929c31d 100644
--- a/crates/openhuman-core/src/skills/README.md
+++ b/crates/openhuman-core/src/skills/README.md
@@ -1,6 +1,6 @@
# Skills
-Discovery and parsing of agentskills.io-style skills (a directory containing `SKILL.md`/`WORKFLOW.md` with YAML frontmatter and Markdown instructions). Owns scope resolution (Builtin / User / Project / Legacy / Profile), trust-marker enforcement, resource reading, create/install/uninstall, run logging, search, and the agent-tool wrappers over all of it. Skills are surfaced to agents as a compact catalog (`## Installed Skills` in the orchestrator prompt) and launched through the `run_workflow` tool as a separate agent run; skill bodies are not spliced into chat turns. Remote catalog browsing lives in [`catalog/`](catalog/README.md) and run execution lives in [`runtime/`](runtime/README.md); this module owns local metadata only.
+Discovery and parsing of agentskills.io-style skills (a directory containing `SKILL.md`/`WORKFLOW.md` with YAML frontmatter and Markdown instructions). Owns scope resolution (Builtin / User / Project / Legacy / Flow), trust-marker enforcement, resource reading, create/install/uninstall, run logging, search, and the agent-tool wrappers over all of it. Skills are surfaced to agents as a compact catalog (`## Installed Skills` in the orchestrator prompt) and launched through the `run_workflow` tool as a separate agent run; skill bodies are not spliced into chat turns. Remote catalog browsing lives in [`catalog/`](catalog/README.md) and run execution lives in [`runtime/`](runtime/README.md); this module owns local metadata only.
## Compile-time gate (`skills` feature, see `mod.rs`)
@@ -55,13 +55,13 @@ Plus the sub-domain namespaces: `skill_registry.*` (`browse`, `search`, `sources
- `tinytools` — supplies the shared `ToolResult`/`ToolContent` shape directly.
- `crates/openhuman-core/src/agent/harness/fork_context.rs` — fork context propagates injected skills.
-- `crates/openhuman-core/src/agent/harness/session/turn/context.rs` and `.../turn/tools.rs` — the per-turn `workflows` list handed to `PromptContext`; `refresh_workflows` reloads it via `load_workflow_metadata_for_profile` when a `WorkflowsChanged` event is drained.
+- `crates/openhuman-core/src/agent/harness/session/turn/context.rs` and `.../turn/tools.rs` — the per-turn `workflows` list handed to `PromptContext`; `refresh_workflows` reloads it from the workspace when a `WorkflowsChanged` event is drained.
- `crates/openhuman-core/src/agent/tools/run_workflow.rs` — the separate `run_workflow`/`AwaitWorkflowTool` launch path.
- `crates/openhuman-core/src/core/all.rs` — controller registry wiring for `skills`, `skill_registry`, and `skill_runtime`.
## Tests
-Behavior tests live beside their modules as `*_tests.rs` (e.g. `ops_tests.rs` and its `ops_discovery_tests.rs`, `ops_create_and_url_tests.rs`, `ops_uninstall_tests.rs` siblings, `ops_types_tests.rs`, `ops_create_render_skill_toml_tests_tests.rs`, `ops_discover_include_skills_tests_tests.rs`, `ops_discover_profile_scope_tests_tests.rs`, `ops_install_install_fetch_tests_tests.rs`, `preflight_tests.rs`, `registry_tests.rs`, `run_log_tests.rs`, `schemas_tests.rs`, `search_tests.rs`, `tools_tests.rs`, `types_tests.rs`, `bus_tests.rs`), wired via `#[path]` from the module they cover.
+Behavior tests live beside their modules as `*_tests.rs` (e.g. `ops_tests.rs` and its `ops_discovery_tests.rs`, `ops_create_and_url_tests.rs`, `ops_uninstall_tests.rs` siblings, `ops_types_tests.rs`, `ops_create_render_skill_toml_tests_tests.rs`, `ops_discover_include_skills_tests_tests.rs`, `ops_install_install_fetch_tests_tests.rs`, `preflight_tests.rs`, `registry_tests.rs`, `run_log_tests.rs`, `schemas_tests.rs`, `search_tests.rs`, `tools_tests.rs`, `types_tests.rs`, `bus_tests.rs`), wired via `#[path]` from the module they cover.
`e2e_plumbing_tests.rs` and `e2e_run_tests.rs` are mock-LLM end-to-end tests: plumbing (create → registry round-trip, orchestrator turn calling `list_workflows`/`run_workflow`, `await_run_outcome` polling) and run execution (`spawn_workflow_run_background` → terminal `DONE` → `await_run_outcome`, `#[ignore]`d and serial because they set the process-global `OPENHUMAN_WORKSPACE`).
diff --git a/crates/openhuman-core/src/skills/ops_create.rs b/crates/openhuman-core/src/skills/ops_create.rs
index 5b2da5b02b..a259b8eda2 100644
--- a/crates/openhuman-core/src/skills/ops_create.rs
+++ b/crates/openhuman-core/src/skills/ops_create.rs
@@ -154,7 +154,10 @@ fn legacy_workflow_dir(
// remotely extensible, which is the whole thing it exists to prevent.
// Flow entries are rows in `flows.db`, not bundle directories — there
// is no path to resolve. Creating one is `save_workflow`'s job.
- WorkflowScope::Builtin | WorkflowScope::Legacy | WorkflowScope::Flow => return None,
+ WorkflowScope::Builtin
+ | WorkflowScope::Legacy
+ | WorkflowScope::Profile
+ | WorkflowScope::Flow => return None,
};
for root in roots {
let canonical_root = match std::fs::canonicalize(&root) {
@@ -229,9 +232,9 @@ pub(crate) fn create_workflow_inner(
.to_string(),
);
}
- WorkflowScope::Builtin | WorkflowScope::Legacy => {
+ WorkflowScope::Builtin | WorkflowScope::Legacy | WorkflowScope::Profile => {
return Err(
- "cannot create skill in legacy or builtin scope; choose 'user' or 'project'"
+ "cannot create skill in legacy, builtin, or retired profile scope; choose 'user' or 'project'"
.to_string(),
);
}
@@ -394,7 +397,7 @@ pub(crate) fn create_workflow_inner(
);
let trusted = is_workspace_trusted(workspace_dir);
- let created = discover_workflows_inner(home_dir, Some(workspace_dir), None, trusted)
+ let created = discover_workflows_inner(home_dir, Some(workspace_dir), trusted)
.into_iter()
.find(|s| s.name == slug)
.ok_or_else(|| format!("created skill '{slug}' but failed to re-discover"))?;
diff --git a/crates/openhuman-core/src/skills/ops_discover/collision.rs b/crates/openhuman-core/src/skills/ops_discover/collision.rs
index ed4ef20325..743469cf08 100644
--- a/crates/openhuman-core/src/skills/ops_discover/collision.rs
+++ b/crates/openhuman-core/src/skills/ops_discover/collision.rs
@@ -65,6 +65,6 @@ pub(super) const fn precedence(scope: WorkflowScope) -> u8 {
WorkflowScope::Legacy => 1,
WorkflowScope::User => 2,
WorkflowScope::Project => 3,
- WorkflowScope::Flow => 4,
+ WorkflowScope::Profile | WorkflowScope::Flow => 4,
}
}
diff --git a/crates/openhuman-core/src/skills/ops_install/fetch.rs b/crates/openhuman-core/src/skills/ops_install/fetch.rs
index a6c30b2d74..03121c60c1 100644
--- a/crates/openhuman-core/src/skills/ops_install/fetch.rs
+++ b/crates/openhuman-core/src/skills/ops_install/fetch.rs
@@ -169,7 +169,7 @@ pub(crate) async fn install_workflow_from_url_with_home(
let trusted_before = is_workspace_trusted(workspace_dir);
let before: std::collections::HashSet<String> =
- discover_workflows_inner(home, Some(workspace_dir), None, trusted_before)
+ discover_workflows_inner(home, Some(workspace_dir), trusted_before)
.into_iter()
.map(|s| s.name)
.collect();
@@ -372,7 +372,7 @@ pub(crate) async fn install_workflow_from_url_with_home(
}
let trusted_after = is_workspace_trusted(workspace_dir);
- let after = discover_workflows_inner(home, Some(workspace_dir), None, trusted_after);
+ let after = discover_workflows_inner(home, Some(workspace_dir), trusted_after);
let new_skills: Vec<String> = after
.into_iter()
.map(|s| s.name)
diff --git a/crates/openhuman-core/src/skills/registry.rs b/crates/openhuman-core/src/skills/registry.rs
index b7b35510bc..df3b25b015 100644
--- a/crates/openhuman-core/src/skills/registry.rs
+++ b/crates/openhuman-core/src/skills/registry.rs
@@ -13,7 +13,7 @@ use std::path::Path;
use serde::{Deserialize, Serialize};
use crate::agent::harness::definition::{AgentDefinition, PromptSource};
-use crate::skills::{Workflow, WorkflowScope};
+use crate::skills::Workflow;
/// One declared input — a parameter the skill needs, with a human description.
/// `required` inputs must be supplied at run time; `kind` is an optional type
diff --git a/crates/openhuman-core/src/tools/impl/system/mod.rs b/crates/openhuman-core/src/tools/impl/system/mod.rs
index 1391251dd1..404cdcce67 100644
--- a/crates/openhuman-core/src/tools/impl/system/mod.rs
+++ b/crates/openhuman-core/src/tools/impl/system/mod.rs
@@ -26,7 +26,6 @@ mod workspace_state;
use crate::security::policy::{TrustedAccess, TrustedRoot};
use crate::security::SecurityPolicy;
-use std::path::Path;
use tinytools::ToolRunContext;
pub use current_time::CurrentTimeTool;
diff --git a/crates/openhuman-core/src/tools/impl/system/shell.rs b/crates/openhuman-core/src/tools/impl/system/shell.rs
index 0baeca121c..ce40815147 100644
--- a/crates/openhuman-core/src/tools/impl/system/shell.rs
+++ b/crates/openhuman-core/src/tools/impl/system/shell.rs
@@ -341,7 +341,7 @@ impl ShellTool {
return (false, ToolResult::error(reason));
}
- let cwd = self.effective_action_dir_for_context(context);
+ let _cwd = self.effective_action_dir_for_context(context);
if self.security.is_rate_limited() {
return (
diff --git a/crates/openhuman-core/src/web_chat/session.rs b/crates/openhuman-core/src/web_chat/session.rs
index a0c2e5f9d1..4aa5950c8a 100644
--- a/crates/openhuman-core/src/web_chat/session.rs
+++ b/crates/openhuman-core/src/web_chat/session.rs
@@ -68,7 +68,6 @@ pub(super) fn build_session_agent(
);
let locale_directive = locale.and_then(locale_reply_directive);
- let composed_suffix = locale_directive;
if let Some(s) = locale_directive.as_deref() {
log::info!(
"[web-channel] injecting locale directive client={} thread={} locale={} directive={:?}",
diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.md
index e35b126356..e7ae509e14 100644
--- a/docs/TEST-COVERAGE-MATRIX.md
+++ b/docs/TEST-COVERAGE-MATRIX.md
@@ -360,7 +360,7 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an
| 8.4.6 | vector_chunks Model-Signature Recall Guard | RU | `vendor/tinymemory/crates/tinymemory-core/src/store/namespace_store/query_tests.rs::vector_recall_excludes_other_model_signature` (vendored `tinymemory`) | ✅ | Excludes cross-model vectors; dim-guards legacy rows |
| 8.4.7 | Lane C — Auto-recall of User Facts (gated) | RU | `crates/openhuman-core/src/memory/auto_recall/{gate_tests,auto_recall_tests}.rs`, `crates/openhuman-core/src/agent/harness/session/turn_auto_recall_tests.rs::auto_recall_*` | ✅ | #6040: lexical gate, bounded `fast_retrieve` via the guard, block rides the user message; `hooks.auto_recall` switch |
| 8.4.8 | Lane C Boot Warm-up | RU | `crates/openhuman-core/src/memory/auto_recall/warm_tests.rs` | ✅ | One bounded retrieval after the memory module loads; failure/timeout are log-only |
-| 8.4.9 | Memory-Access Instruction (ungated) | RU | `crates/openhuman-core/src/agent/harness/session/builder/builder_tests_session_agent_profile_tests.rs::memory_access_instruction_is_present_with_learning_disabled`, `crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs` | ✅ | Added whenever a retrieval tool is visible, independent of `learning.enabled`; forbids claiming absence unsearched |
+| 8.4.9 | Memory-Access Instruction (ungated) | RU | `crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs` | ✅ | Added whenever a retrieval tool is visible, independent of `learning.enabled`; forbids claiming absence unsearched |
| 8.4.10 | Memory-Write Instruction + `memory_store` defaults | RU | `crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs::memory_write_*`, `crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs::write_tool_gate_*`, `crates/openhuman-core/src/agent/harness/session/builder/builder_tests_memory_write_instruction_tests.rs::memory_write_instruction_*`, `crates/openhuman-core/src/memory/tools/store_tests.rs::resolve_*` | ✅ | #6048: "remember X" must be a write before the reply; section keyed on write-tool visibility, not `learning.enabled`; `memory_store` namespace/key optional |
| 8.4.11 | Lane C — Notes leg (`global` namespace) + hint | RU | `crates/openhuman-core/src/memory/auto_recall/notes_lane_tests.rs` (all), `crates/openhuman-core/src/memory/auto_recall/auto_recall_tests.rs::from_guard_reads_through_the_guarded_retrieval_family`, `crates/openhuman-core/src/agent/harness/session/turn_auto_recall_tests.rs::auto_recall_injects_a_note_written_by_memory_store_when_the_tree_is_empty` | ✅ | #6063: a fact `memory_store` filed in `global` is recalled through `recall_namespace_scored` beside the tree walk (per-leg budget, absolute 0.35 floor, notes render first, `ExternalSync`/connector-keyed notes wrapped); block opens with the "pre-fetched, not a search" hint |
diff --git a/gitbooks/features/obsidian-wiki/sources.md b/gitbooks/features/obsidian-wiki/sources.md
index 01e1f1a596..8a5cb21589 100644
--- a/gitbooks/features/obsidian-wiki/sources.md
+++ b/gitbooks/features/obsidian-wiki/sources.md
@@ -83,14 +83,6 @@ Sync progress streams as `MemorySyncStageChanged` events (Requested → Fetching
---
-## Source scoping for agent profiles
-
-By default an agent recalls from **every** source. Source scoping lets an agent profile restrict recall to a whitelist of source ids, so a customer-support flavour never surfaces your personal Gmail, and a research flavour stays focused on the repos and feeds that matter. This is a privacy and focus control, not just a relevance tweak.
-
-The mechanism lives in `crates/openhuman-core/src/memory/source_scope.rs`. Threading an allowlist through every memory tool and the deep `select_trees` retrieval layer would touch dozens of call sites. So, mirroring `thread_context`, the channel sets a `tokio::task_local!` around the agent turn and the retrieval layer reads it ambiently, with no explicit plumbing:
-
-- **`None`** (outside any scope, or `with_source_scope(None, …)`) means **unrestricted**. This is the default for cron, sub-agents, the CLI, and any profile that left `memory_sources` unset.
-- **`Some(set)`** restricts recall to source scopes in the set. An **empty** set surfaces nothing (the profile selected no sources).
The gate is **tag-discriminated and fail-open** for everything that is not a memory-source chunk. Every source-ingested chunk carries the `memory_sources` tag; the gate (`chunk_source_allowed`) only touches tagged chunks:
diff --git a/tests/raw_coverage/agent_harness_leftovers_raw_coverage_e2e.rs b/tests/raw_coverage/agent_harness_leftovers_raw_coverage_e2e.rs
index 1673653158..e3d0e085fa 100644
--- a/tests/raw_coverage/agent_harness_leftovers_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/agent_harness_leftovers_raw_coverage_e2e.rs
@@ -310,8 +310,6 @@ fn prompt_context<'a>(
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: Vec::new(),
agents_md_global: None,
agents_md_local: None,
@@ -648,7 +646,6 @@ fn prompt_builder_renders_dynamic_user_files_and_identity_branches() -> Result<(
assert!(prompt.contains("## Current Date & Time"));
ctx.curated_snapshot = None;
- ctx.personality_memory_md = Some("Personality memory".to_string());
let user_files = render_user_files(&ctx)?;
assert!(user_files.contains("Personality memory"));
assert!(!user_files.contains("Workspace memory body"));
diff --git a/tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rs b/tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rs
index 42e91010f3..4000ac1865 100644
--- a/tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rs
@@ -352,8 +352,6 @@ fn prompt_context<'a>(
name: Some("Ada\nLovelace".to_string()),
email: Some("[email protected]".to_string()),
}),
- personality_soul_md: Some("personality soul override".to_string()),
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/tests/raw_coverage/agent_round26_raw_coverage_e2e.rs b/tests/raw_coverage/agent_round26_raw_coverage_e2e.rs
index 3a04e990cf..8ef2896894 100644
--- a/tests/raw_coverage/agent_round26_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/agent_round26_raw_coverage_e2e.rs
@@ -253,8 +253,6 @@ fn prompt_context<'a>(
name: Some("Round\nTwenty Six".to_string()),
email: Some(" [email protected] ".to_string()),
}),
- personality_soul_md: Some("round26 personality soul override".to_string()),
- personality_memory_md: Some("round26 personality memory override".to_string()),
personality_roster: vec![PersonalityRosterEntry {
id: "analyst".to_string(),
name: "Analyst".to_string(),
diff --git a/tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs b/tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs
index bc6e8ad911..442e730b6a 100644
--- a/tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs
@@ -396,8 +396,6 @@ fn prompt_ctx<'a>(
include_memory_md: false,
curated_snapshot: None,
user_identity: None,
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
diff --git a/tests/raw_coverage/inference_agent_raw_coverage_e2e.rs b/tests/raw_coverage/inference_agent_raw_coverage_e2e.rs
index 9437101936..24d058b1b0 100644
--- a/tests/raw_coverage/inference_agent_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_agent_raw_coverage_e2e.rs
@@ -2460,8 +2460,6 @@ fn agent_pformat_and_prompt_renderers_cover_public_paths() {
name: Some(" Coverage\nUser ".into()),
email: Some("[email protected]".into()),
}),
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![],
agents_md_global: None,
agents_md_local: None,
@@ -2568,8 +2566,6 @@ fn agent_builtin_prompt_builders_cover_all_registered_archetypes() {
name: Some("Coverage User".into()),
email: None,
}),
- personality_soul_md: None,
- personality_memory_md: None,
personality_roster: vec![PersonalityRosterEntry {
id: "default".into(),
name: "Default".into(),