The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(agent): remove remaining agent profile surfaces
Steven Enamakel92ca8f66ad88
diff --git a/crates/openhuman-core/src/agent/README.md b/crates/openhuman-core/src/agent/README.mdindex 8eddc0ddd0..a68ef058e1 100644--- a/crates/openhuman-core/src/agent/README.md+++ b/crates/openhuman-core/src/agent/README.md@@ -62,7 +62,7 @@ Flat files: `bus.rs` (`agent.run_turn` native request handler), `cost.rs` (`pub(## Called by- `crates/openhuman-core/src/channels/runtime/dispatch/` (`processor*.rs`, `routing.rs`) — drives chat turns through the `agent.run_turn` native handler; `web_chat/` (`session.rs`, `run_task.rs`) builds `Agent`s directly.-- `crates/openhuman-core/src/cron/scheduler/agent_run.rs::run_agent_job` — builds an `Agent` directly via `Agent::from_config_for_agent[_with_profile]` / `Agent::from_config` and delivers output through `scheduler/delivery.rs::deliver_if_configured`; it does not go through triage.+- `crates/openhuman-core/src/cron/scheduler/agent_run.rs::run_agent_job` — builds an `Agent` directly via `Agent::from_config_for_agent` and delivers output through `scheduler/delivery.rs::deliver_if_configured`; it does not go through triage.- `crates/openhuman-core/src/skills/webhooks/{ops,bus}.rs` — webhook ingestion routes through `triage::run_triage` + `apply_decision`.- `crates/openhuman-core/src/memory/sync/composio/bus*.rs` — Composio trigger envelopes go through `agent::triage`.- `crates/openhuman-core/src/integrations/task_sources/route.rs` — external task-source events go through the same `TriggerEnvelope` → `run_triage` → `apply_decision` path.diff --git a/crates/openhuman-core/src/agent/context/channels_prompt.rs b/crates/openhuman-core/src/agent/context/channels_prompt.rsindex 908390ba58..ea57704460 100644--- a/crates/openhuman-core/src/agent/context/channels_prompt.rs+++ b/crates/openhuman-core/src/agent/context/channels_prompt.rs@@ -30,13 +30,10 @@ pub(crate) const BOOTSTRAP_MAX_CHARS: usize = 20_000;/// Identity content that takes the place of a workspace-root file in the/// rendered prompt.///-/// A channel turn runs under the active agent profile (#6027), and a profile-/// may carry its own `SOUL.md` and `MEMORY.md` under `personalities/<id>/`.-/// When present, each **replaces** the root file in its slot — the same-/// replace-not-append rule the desktop `IdentitySection` applies — so the+/// When present, each override replaces the root file in its slot, so the/// model never sees two identities side by side. `IDENTITY.md` and-/// `PROFILE.md` are never overridden; they describe the workspace, not the-/// persona. An empty override renders exactly what the root files render.+/// `PROFILE.md` are never overridden because they describe the workspace.+/// An empty override renders exactly what the root files render.#[derive(Debug, Clone, Copy, Default)]pub struct PromptIdentityOverride<'a> {/// Replaces the root `SOUL.md` slot.diff --git a/crates/openhuman-core/src/agent/experience/ops.rs b/crates/openhuman-core/src/agent/experience/ops.rsindex 77b31aabcd..8d35f28305 100644--- a/crates/openhuman-core/src/agent/experience/ops.rs+++ b/crates/openhuman-core/src/agent/experience/ops.rs@@ -59,7 +59,6 @@ use std::sync::Arc;/// `agent::experience` — it is contract-to-trait plumbing, not an/// agent-experience concept. It sits here because both of its callers do/// (`open_store_in_subdir` below, and the session builder's-/// `shared_experience_memory`).pub struct DriverMemory {provider: Arc<dyn MemoryProvider>,}diff --git a/crates/openhuman-core/src/agent/harness/run_queue/run_queue_tests.rs b/crates/openhuman-core/src/agent/harness/run_queue/run_queue_tests.rsindex f77136855d..f4fac02104 100644--- a/crates/openhuman-core/src/agent/harness/run_queue/run_queue_tests.rs+++ b/crates/openhuman-core/src/agent/harness/run_queue/run_queue_tests.rs@@ -9,7 +9,6 @@ fn msg(text: &str, mode: QueueMode) -> QueuedMessage {queued_at_ms: 0,model_override: None,temperature: None,- profile_id: None,locale: None,}}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.rsindex cab22c6f45..ec6a5148ff 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@@ -258,7 +258,6 @@ impl AgentBuilder {memory: self.memory.ok_or_else(|| anyhow::anyhow!("memory is required"))?,- shared_experience_memory: self.shared_experience_memory,auto_recall: self.auto_recall,tool_dispatcher: std::sync::Arc::from(self.tool_dispatcherdiff --git a/crates/openhuman-core/src/agent/harness/session/builder/factory.rs b/crates/openhuman-core/src/agent/harness/session/builder/factory.rsindex d8cb61ef84..8dbc919884 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/factory.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/factory.rs@@ -191,7 +191,6 @@ impl Agent {// 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 shared_experience_memory = None;// Load the user's persisted tool preferences once. They drive two// things below: granting the App UI Control / App Automation mutation@@ -983,7 +982,6 @@ impl Agent {.synthesized_tools(delegation_tools).visible_tool_names(visible).memory(memory)- .shared_experience_memory(shared_experience_memory).auto_recall(Some(auto_recall)).tool_dispatcher(tool_dispatcher).prompt_builder(prompt_builder)@@ -1030,7 +1028,6 @@ impl Agent {definitions,security_policy: security,memory: agent.memory_arc(),- shared_experience_memory: agent.shared_experience_memory.clone(),post_turn_hooks: agent.post_turn_hooks.clone(),})});diff --git a/crates/openhuman-core/src/agent/harness/session/builder/setters.rs b/crates/openhuman-core/src/agent/harness/session/builder/setters.rsindex e04f983bde..3a39108557 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/setters.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/setters.rs@@ -18,7 +18,6 @@ impl AgentBuilder {visible_tool_names: None,subagent_tool_ceiling_names: None,memory: None,- shared_experience_memory: None,auto_recall: None,prompt_builder: None,tool_dispatcher: None,@@ -116,13 +115,6 @@ impl AgentBuilder {self}- /// Retains the shared store for experience recall when `memory` is a- /// dedicated profile subtree.- pub fn shared_experience_memory(mut self, memory: Option<Arc<dyn Memory>>) -> Self {- self.shared_experience_memory = memory;- self- }-/// Binds Lane C, the gated pre-turn auto-recall of facts about the user/// (#6040). `None` leaves the lane out of the turn entirely.pub fn auto_recall(@@ -197,9 +189,7 @@ impl AgentBuilder {self}- /// Sets the per-profile workspace descriptor (section D of agent-profile- /// homes). When set, the top-level chat turn threads it through so acting- /// tools resolve their default cwd to the profile's dedicated workspace.+ /// Sets the optional workspace descriptor for acting tools' default cwd.pub fn workspace_descriptor(mut self,descriptor: Option<tinytools::WorkspaceDescriptor>,@@ -208,14 +198,13 @@ impl AgentBuilder {self}- /// Binds the active profile's SOUL.md as the session identity override.+ /// 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 the active profile's curated MEMORY.md to the frozen session- /// prompt. `None` keeps the legacy workspace-root fallback.+ /// 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;selfdiff --git a/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs b/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rsindex 1ccf7d9705..eb099c32b0 100644--- a/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs+++ b/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs@@ -191,22 +191,11 @@ impl Agent {}/// OpenHuman's [`ExperienceStore`](tinyagents_harness::host::ExperienceStore)- /// capability, scoped to this session's agent profile.- ///- /// Writes go to this session's own `memory`; recall additionally consults- /// `shared_experience_memory` when the session was given one.- ///- /// That asymmetry mirrors the live turn path in `session/turn/core.rs`. For- /// a dedicated-profile session `memory` is the profile-local store and- /// `shared_experience_memory` is the global one holding unstamped records- /// from pre-profile builds — so reading both is what keeps old experience- /// reachable, while writing only to the profile-local store is what keeps- /// new records inside the profile subtree.+ /// capability over this session's memory backend.pub fn host_experience_store(&self,) -> crate::agent::tinyagents::host::OpenHumanExperienceStore {crate::agent::tinyagents::host::OpenHumanExperienceStore::new(self.memory_arc())- .with_shared_recall_memory(self.shared_experience_memory.clone())}/// The agent's working directory.diff --git a/crates/openhuman-core/src/agent/harness/session/turn/core/experience_context.rs b/crates/openhuman-core/src/agent/harness/session/turn/core/experience_context.rsindex 549d4363bc..6eccf73142 100644--- a/crates/openhuman-core/src/agent/harness/session/turn/core/experience_context.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn/core/experience_context.rs@@ -29,10 +29,7 @@ impl Agent {.iter().map(|spec| spec.name.clone()).collect();- let mut stores = vec![AgentExperienceStore::new(self.memory.clone())];- if let Some(shared_memory) = &self.shared_experience_memory {- stores.push(AgentExperienceStore::new(shared_memory.clone()));- }+ let stores = vec![AgentExperienceStore::new(self.memory.clone())];let query = ExperienceQuery {query: user_message.to_string(),tools,@@ -40,10 +37,6 @@ impl Agent {agent_id: Some(self.agent_definition_id.clone()).filter(|id| !id.trim().is_empty()),entrypoint: Some(self.event_channel.clone()).filter(|entrypoint| !entrypoint.trim().is_empty()),- // 1c — partition recall by the active profile: this turn sees records- // stamped with its profile plus unstamped legacy records, and never a- // sibling profile's. `None` (profile-less) recalls the whole pool.- profile_id: None,max_hits: MAX_EXPERIENCE_HITS,};diff --git a/crates/openhuman-core/src/agent/harness/session/turn/graph.rs b/crates/openhuman-core/src/agent/harness/session/turn/graph.rsindex e70854d62a..cf3cf2ae65 100644--- a/crates/openhuman-core/src/agent/harness/session/turn/graph.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn/graph.rs@@ -80,11 +80,8 @@ pub(crate) struct ChatTurnGraph {/// The agent's builder-configured tool policy + session context, enforced at/// the tool boundary. `None` when the session has no explicit policy.pub tool_policy: Option<crate::agent::tinyagents::ToolPolicyEnforcement>,- /// Optional per-profile workspace descriptor (section D of agent-profile- /// homes). `Some` when the session's active profile opted into a dedicated- /// workspace — acting tools then resolve their default cwd to- /// `<action_dir>/profiles/<id>` via `ToolExecutionContext.workspace`. `None`- /// (the common case) keeps the shared-`action_dir` cwd behaviour.+ /// Optional workspace descriptor for acting tools' default cwd. `None`+ /// keeps the shared-`action_dir` cwd behaviour.pub workspace_descriptor: Option<tinytools::WorkspaceDescriptor>,/// Declared sandbox mode for the top-level agent. The chat path scopes it/// around the shared harness so acting tools see the same mode as workers.diff --git a/crates/openhuman-core/src/agent/harness/session/turn/tools.rs b/crates/openhuman-core/src/agent/harness/session/turn/tools.rsindex 8ab245cc29..8a11416946 100644--- a/crates/openhuman-core/src/agent/harness/session/turn/tools.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn/tools.rs@@ -23,15 +23,9 @@ impl Agent {/// Snapshot the parent's runtime so spawned sub-agents can read/// it via the [`harness::PARENT_CONTEXT`] task-local.pub(super) fn build_parent_execution_context(&self) -> harness::ParentExecutionContext {- // Prefer an ambient `current_parent()` descriptor (a nested subagent- // inherits its enclosing worktree/profile workspace threaded down the- // spawn chain). Fall back to THIS session agent's own descriptor: on a- // ROOT chat turn `current_parent()` is `None`, so without the fallback a- // dedicated-workspace profile's descriptor (`<action_dir>/profiles/<id>`,- // set on the Agent at build time) would never reach delegated subagents- // spawned via `spawn_subagent` / `spawn_async_subagent`, and they'd drop- // to the shared `action_dir` — the profile isolation would silently not- // apply to common delegated writes.+ // Prefer an ambient `current_parent()` descriptor so nested subagents+ // inherit their enclosing workspace. On a root turn the ambient value+ // is absent, so fall back to this session's own descriptor.let workspace_descriptor = harness::current_parent().and_then(|parent| parent.workspace_descriptor).or_else(|| self.workspace_descriptor.clone());diff --git a/crates/openhuman-core/src/agent/harness/session/turn_checkpoint_and_wrapup_tests.rs b/crates/openhuman-core/src/agent/harness/session/turn_checkpoint_and_wrapup_tests.rsindex c1ebcca861..9afb389685 100644--- a/crates/openhuman-core/src/agent/harness/session/turn_checkpoint_and_wrapup_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn_checkpoint_and_wrapup_tests.rs@@ -523,48 +523,6 @@ async fn turn_checkpoint_usage_is_folded_into_transcript_accounting() {assert_eq!(transcript.meta.cached_input_tokens, 2);}-#[tokio::test]-async fn dedicated_profile_experience_recall_merges_shared_legacy_store() {- let tmp = tempfile::TempDir::new().unwrap();- let dedicated = make_real_memory(&tmp.path().join("dedicated"));- let shared = make_real_memory(&tmp.path().join("shared"));- AgentExperienceStore::new(shared.clone())- .put(AgentExperience {- id: "legacy-shared-deploy".into(),- created_at_ms: 0,- updated_at_ms: 0,- source: ExperienceSource::ToolLoop,- agent_id: None,- entrypoint: None,- profile_id: None,- task_fingerprint: "deploy-rust-service".into(),- task_summary: "Deploy the Rust service safely".into(),- tools_used: vec![],- tool_sequence: vec![],- outcome: ExperienceOutcome::Success,- error_class: None,- lesson: "Legacy shared deployment guidance".into(),- reuse_hint: "Check the release health endpoint".into(),- avoid_hint: None,- confidence: 0.9,- tags: vec![],- payload_hash: None,- dismissed: false,- })- .await- .unwrap();-- let agent = Agent::builder()- .chat_model(Arc::new(DummyProvider))- .tools(vec![])- .memory(dedicated)- .shared_experience_memory(Some(shared))- .await;-- assert!(enriched.contains("Legacy shared deployment guidance"));- assert!(enriched.contains("original prompt"));-}-#[tokio::test]async fn fetch_learned_context_returns_empty_when_both_flags_off() {let tmp = tempfile::TempDir::new().unwrap();diff --git a/crates/openhuman-core/src/agent/harness/session/types.rs b/crates/openhuman-core/src/agent/harness/session/types.rsindex 63a7932243..3c626f459a 100644--- a/crates/openhuman-core/src/agent/harness/session/types.rs+++ b/crates/openhuman-core/src/agent/harness/session/types.rs@@ -151,10 +151,6 @@ pub struct Agent {pub(super) subagent_tool_ceiling_names: std::collections::HashSet<String>,pub(super) tool_policy_session: ToolPolicySession,pub(super) memory: Arc<dyn Memory>,- /// Shared memory store retained alongside a dedicated profile store so live- /// experience recall can merge unstamped legacy guidance. `None` for the- /// shared/default memory path.- pub(super) shared_experience_memory: Option<Arc<dyn Memory>>,/// Lane C — the gated pre-turn recall of facts about the user (#6040)./// `None` when the session was built without a memory binding (tests,/// embedders that bring their own `Memory`); the lane then stays silent.@@ -525,7 +521,6 @@ pub struct AgentBuilder {/// Channel-policy restrictions are intersected during [`Self::build`].pub(super) subagent_tool_ceiling_names: Option<std::collections::HashSet<String>>,pub(super) memory: Option<Arc<dyn Memory>>,- pub(super) shared_experience_memory: Option<Arc<dyn Memory>>,/// Forwarded to [`Agent::auto_recall`] at build time. Defaults to `None`.pub(super) auto_recall: Option<Arc<crate::memory::auto_recall::AutoRecall>>,pub(super) prompt_builder: Option<SystemPromptBuilder>,diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rsindex bb8d08fa7a..6c390784e9 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs@@ -293,7 +293,6 @@ async fn run_queue_steer_lands_in_subagent_history() {queued_at_ms: 0,model_override: None,temperature: None,- profile_id: None,locale: None,}).await;diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rsindex 241542f6df..79f055ef2a 100644--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs@@ -206,7 +206,6 @@ pub async fn steer(queued_at_ms: now_ms(),model_override: None,temperature: None,- profile_id: None,locale: None,}).await;@@ -261,7 +260,6 @@ pub(crate) async fn steer_control(queued_at_ms: now_ms(),model_override: None,temperature: None,- profile_id: None,locale: None,}).await;diff --git a/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs b/crates/openhuman-core/src/agent/tinyagents/host/bundle.rsindex 92a55c20b6..78e185297b 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs@@ -39,7 +39,6 @@ pub struct OpenHumanHostBundleInputs {pub tool_sets: Vec<Arc<Vec<Box<dyn Tool>>>>,pub tool_policy: Option<Arc<ToolPolicySession>>,pub memory: Arc<dyn Memory>,- pub shared_experience_memory: Option<Arc<dyn Memory>>,pub post_turn_hooks: Vec<Arc<dyn PostTurnHook>>,}@@ -54,7 +53,6 @@ pub struct OpenHumanHostBase {pub definitions: Arc<AgentDefinitionRegistry>,pub security_policy: Arc<SecurityPolicy>,pub memory: Arc<dyn Memory>,- pub shared_experience_memory: Option<Arc<dyn Memory>>,pub post_turn_hooks: Vec<Arc<dyn PostTurnHook>>,}@@ -104,7 +102,6 @@ impl OpenHumanHostBundleFactory {tool_sets: inputs.tool_sets,tool_policy: inputs.tool_policy,memory: inputs.base.memory.clone(),- shared_experience_memory: inputs.base.shared_experience_memory.clone(),post_turn_hooks: inputs.base.post_turn_hooks.clone(),},turn,@@ -145,10 +142,7 @@ impl OpenHumanHostBundleFactory {let progress = Arc::new(OpenHumanProgressSink::new(progress_tx));let learning = Arc::new(OpenHumanLearningSink::new(inputs.post_turn_hooks));let tool_outcomes = Arc::new(OpenHumanToolOutcomeClassifier::new());- let experience = Arc::new(- OpenHumanExperienceStore::new(inputs.memory)- .with_shared_recall_memory(inputs.shared_experience_memory),- );+ let experience = Arc::new(OpenHumanExperienceStore::new(inputs.memory));let capabilities = HostCapabilities::new(context.clone() as Arc<dyn ContextComposer>,diff --git a/crates/openhuman-core/src/agent/tinyagents/host/bundle_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/bundle_tests.rsindex e67d495d2d..da857a9103 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/bundle_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/bundle_tests.rs@@ -23,8 +23,6 @@ fn inputs() -> (OpenHumanHostBundleInputs, OpenHumanRunContext) {tool_sets: Vec::new(),tool_policy: None,memory,- shared_experience_memory: None,- profile_id: Some("profile-a".to_string()),post_turn_hooks: Vec::new(),},turn,diff --git a/crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs b/crates/openhuman-core/src/agent/tinyagents/host/experience_store.rsindex f8bd886299..cc6b04be3b 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs@@ -54,10 +54,6 @@//! stored fields; this adapter also redacts on the way *in* before//! truncating, so a secret cannot survive by being pushed past the truncation//! boundary. Nothing here bypasses that guard.-//! 5. **No profile invention.** OpenHuman partitions experience by agent-//! profile. The crate has no notion of one, so the profile is supplied to the-//! adapter at construction and stamped onto every write; a profile-less-//! adapter reproduces the legacy, unpartitioned behaviour byte-for-byte.use std::sync::Arc;@@ -116,33 +112,19 @@ const ADAPTER_CONFIDENCE: f32 = 0.6;/// [`ExperienceStore`] over OpenHuman's `agent_experience` domain.////// Holds an [`AgentExperienceStore`] (itself a thin façade over-/// `Arc<dyn Memory>` pinned to the experience namespace) plus the two pieces of-/// host context the crate cannot supply: the active agent profile and the-/// recall bound.+/// `Arc<dyn Memory>` pinned to the experience namespace) and a recall bound.#[derive(Clone)]pub struct OpenHumanExperienceStore {/// The namespace-scoped procedural store. All reads and writes go through/// it, so the `agent_experience` namespace confinement and the domain's/// redaction on `put` apply to everything this adapter does.store: AgentExperienceStore,- /// Additional store consulted by `recall_for` only, never written.- ///- /// A dedicated-profile session keeps its procedural records in a- /// profile-local memory subtree, but pre-profile builds wrote unstamped- /// records into the shared workspace store. The live turn path- /// (`session/turn/core.rs`) therefore queries both, profile-local first,- /// and this adapter has to match it or a profile session would silently- /// stop recalling everything it learned before profiles existed. Writes- /// deliberately do **not** fan out: the profile-local store stays the sole- /// write target so new records land inside the profile subtree.- shared_recall_store: Option<AgentExperienceStore>,/// Maximum prior attempts returned by one `recall_for`.max_hits: usize,}impl OpenHumanExperienceStore {- /// Adapter over `memory`, with no profile partition and the default recall- /// bound.+ /// Adapter over `memory` with the default recall bound.pub fn new(memory: Arc<dyn Memory>) -> Self {Self::from_store(AgentExperienceStore::new(memory))}@@ -151,22 +133,10 @@ impl OpenHumanExperienceStore {pub fn from_store(store: AgentExperienceStore) -> Self {Self {store,- shared_recall_store: None,max_hits: DEFAULT_MAX_HITS,}}- /// Adds a second store that [`ExperienceStore::recall_for`] reads and- /// [`ExperienceStore::record`] never writes.- ///- /// Used for the shared, pre-profile workspace store behind a- /// dedicated-profile session. `None` is a no-op, so a profile-less session- /// keeps the single-store behaviour.- pub fn with_shared_recall_memory(mut self, memory: Option<Arc<dyn Memory>>) -> Self {- self.shared_recall_store = memory.map(AgentExperienceStore::new);- self- }-/// How many candidates to pull from the domain before the agent filter.////// Wider than [`Self::max_hits`] because the domain scores an agent match@@ -218,7 +188,7 @@ impl OpenHumanExperienceStore {//// The agent id is folded in through the `tool_sequence` slot, which// is otherwise empty here. That looks odd, so: the domain digest- // covers task summary + tool sequence + outcome + profile and+ // covers task summary + tool sequence + outcome and// deliberately **excludes** `agent_id`, because the native capture// hook always supplies a real tool sequence, which incidentally// keeps two agents' rows apart. This adapter has no tool trace to@@ -237,9 +207,8 @@ impl OpenHumanExperienceStore {// The runtime writes mechanically when a task finishes, which is// the tool loop's vantage point rather than a reflection step.source: ExperienceSource::ToolLoop,- agent_id: normalized_profile(Some(&exp.agent_id)),+ agent_id: normalized_agent_id(Some(&exp.agent_id)),entrypoint: None,- profile_id: None,// `capture.rs` fingerprints with the same public helper over an// empty sequence and a `Success` outcome, so fingerprints agree// across both writers for the same task text.@@ -262,8 +231,8 @@ impl OpenHumanExperienceStore {}}-/// Trims a profile / agent id, mapping blank to `None`.-fn normalized_profile(raw: Option<&str>) -> Option<String> {+/// Trims an agent id, mapping blank to `None`.+fn normalized_agent_id(raw: Option<&str>) -> Option<String> {raw.map(str::trim).filter(|id| !id.is_empty()).map(str::to_string)@@ -393,9 +362,8 @@ impl ExperienceStore for OpenHumanExperienceStore {// an invented seed would skew the overlap terms.tools: Vec::new(),tags: Vec::new(),- agent_id: normalized_profile(Some(agent_id)),+ agent_id: normalized_agent_id(Some(agent_id)),entrypoint: None,- profile_id: None,// Over-fetch, because the agent filter below runs *after* the// domain has already truncated. Agent identity is only a score// bonus there, so another agent's highly-relevant records can fill@@ -406,15 +374,7 @@ impl ExperienceStore for OpenHumanExperienceStore {max_hits: self.candidate_hits(),};- // Profile-local store first, then the shared pre-profile one. Same- // order and same dedupe-by-id/re-rank as the live turn path, so a- // record visible to a native turn is visible here too.- let mut stores = vec![self.store.clone()];- if let Some(shared) = &self.shared_recall_store {- stores.push(shared.clone());- }-- let hits = retrieve_across_stores(&stores, query)+ let hits = retrieve_across_stores(&[self.store.clone()], query).await.map_err(|e| TinyAgentsError::Memory(format!("recall agent experience: {e}")))?;diff --git a/crates/openhuman-core/src/agent/tinyagents/host/experience_store_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/experience_store_tests.rsindex 74a1c3ad8e..d75d6d4eed 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/experience_store_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/experience_store_tests.rs@@ -50,74 +50,6 @@ async fn records_and_recalls_a_prior_attempt() {);}-#[tokio::test]-async fn recall_spans_the_shared_store_while_writes_stay_profile_local() {- // Stand in for a dedicated-profile session: `local` is the profile- // subtree, `shared` the workspace store a pre-profile build wrote into.- let local: Arc<dyn Memory> = Arc::new(MockMemory::default());- let shared: Arc<dyn Memory> = Arc::new(MockMemory::default());-- // Seed the shared store the way a pre-profile build did — unstamped.- OpenHumanExperienceStore::new(shared.clone())- .record(&exp(- "planner",- "migrate the customer schema",- "the legacy attempt hit a lock timeout",- false,- ))- .await- .expect("seed the shared store");-- let store = OpenHumanExperienceStore::new(local.clone())- .with_shared_recall_memory(Some(shared.clone()));-- // Recall reaches the shared store even though nothing was written to- // the profile-local one.- let found = store- .recall_for("planner", "migrate the customer schema")- .await- .expect("recall");- assert_eq!(- found.len(),- 1,- "a profile session must still see pre-profile experience"- );- assert!(found[0].outcome.contains("lock timeout"));-- // A new record lands in the profile-local store, not the shared one.- store- .record(&exp("planner", "rotate the signing key", "clean run", true))- .await- .expect("record");-- // The domain scores rather than filters, so an unrelated query still- // returns the seeded row — assert on which task each store *holds*,- // not on the result count.- let holds_new_task = |found: &[Experience]| {- found- .iter()- .any(|e| e.task.contains("rotate the signing key"))- };-- let shared_only = OpenHumanExperienceStore::new(shared)- .recall_for("planner", "rotate the signing key")- .await- .expect("recall from the shared store");- assert!(- !holds_new_task(&shared_only),- "writes must not fan out into the shared store, got: {shared_only:?}"- );-- let local_only = OpenHumanExperienceStore::new(local)- .recall_for("planner", "rotate the signing key")- .await- .expect("recall from the profile-local store");- assert!(- holds_new_task(&local_only),- "the profile-local store is the write target, got: {local_only:?}"- );-}-#[tokio::test]async fn recall_excludes_another_agents_attempt() {// The domain only score-boosts an agent match, so without the adapter's@@ -301,7 +233,6 @@ fn partial_outcomes_read_as_unsuccessful() {source: ExperienceSource::ToolLoop,agent_id: Some("planner".into()),entrypoint: None,- profile_id: None,task_fingerprint: "fp".into(),task_summary: "migrate the schema".into(),tools_used: vec![],diff --git a/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs b/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rsindex 1ad93a0853..b85c430808 100644--- a/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs+++ b/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs@@ -275,7 +275,6 @@ impl Drop for SteeringForwarderGuard {queued_at_ms: now_ms(),model_override: None,temperature: None,- profile_id: None,locale: None,}).await;diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_runner_tests.rs b/crates/openhuman-core/src/agent/tinyagents/turn_runner_tests.rsindex 743ff40328..2fbaf3b22d 100644--- a/crates/openhuman-core/src/agent/tinyagents/turn_runner_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/turn_runner_tests.rs@@ -10,8 +10,6 @@ fn hosted_base() -> Arc<crate::agent::tinyagents::host::OpenHumanHostBase> {),security_policy: Arc::new(crate::security::policy::SecurityPolicy::default()),memory: crate::memory::test_support::noop_memory(),- shared_experience_memory: None,- profile_id: None,post_turn_hooks: Vec::new(),})}diff --git a/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs b/crates/openhuman-core/src/agent/tools/run_workflow_tests.rsindex 39345bf159..17e5b51bdf 100644--- a/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs+++ b/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs@@ -46,41 +46,6 @@ async fn await_workflow_missing_run_id_returns_tool_error() {assert!(res.output().contains("run_id"));}-#[test]-fn detached_run_visibility_requires_profile_and_allowlist() {- let run = crate::skills::run_log::ScannedRun {- run_id: "run-1".to_string(),- workflow_id: "private-flow".to_string(),- profile_id: Some("alice".to_string()),- started: String::new(),- status: "DONE".to_string(),- duration_ms: None,- finished: None,- log_path: "/tmp/run.log".to_string(),- };- let allowed = ["private-flow".to_string()].into_iter().collect();- let empty = std::collections::HashSet::new();-- assert!(run_visible_to_profile(- &run,- Some("alice"),- Some(&allowed),- &empty- ));- assert!(!run_visible_to_profile(- &run,- Some("bob"),- Some(&allowed),- &empty- ));- assert!(!run_visible_to_profile(- &run,- Some("alice"),- Some(&empty),- &empty- ));-}-#[test]fn wait_seconds_defaults_and_clamps() {assert_eq!(parse_wait_seconds(&json!({})), DEFAULT_WAIT_SECONDS);diff --git a/crates/openhuman-core/src/memory/source_scope.rs b/crates/openhuman-core/src/memory/source_scope.rsindex 88ce9aa1b7..cfc9242fb5 100644--- a/crates/openhuman-core/src/memory/source_scope.rs+++ b/crates/openhuman-core/src/memory/source_scope.rs@@ -13,28 +13,24 @@//!//! So the scope crosses the bus as a value instead. `SourceScope` is a//! `tinymemory-bus` payload type and every scoped `MemoryProvider` method takes-//! it as an argument. What stays host-side is the part that was always the-//! host's: gathering the allowlist off the agent profile and making it ambient-//! for the duration of a turn, so the dozens of call sites between the channel-//! and the provider do not each have to thread it.+//! it as an argument. What stays host-side is installing an allowlist for the+//! duration of a turn, so the dozens of call sites between the channel and the+//! provider do not each have to thread it.//!//! [`as_bus_scope`] is the join between the two — it reads the ambient scope and//! renders it in the vocabulary the provider call expects.//!//! # Semantics//!-//! Agent profiles can restrict which memory sources a flavour recalls (the-//! `AgentProfile::memory_sources` allowlist). Threading that allowlist through-//! every memory tool and the deep `select_trees` retrieval layer would touch-//! dozens of call sites, so the channel sets a [`tokio::task_local`] around the-//! agent turn and the retrieval path reads it.+//! Threading an allowlist through every memory tool and the deep `select_trees`+//! retrieval layer would touch dozens of call sites, so the channel sets a+//! [`tokio::task_local`] around the agent turn and the retrieval path reads it.//!//! - `None` scope (outside any [`with_source_scope`], or `with_source_scope(None, …)`)//! means **unrestricted** — every source tree is visible. This is the default-//! for profile-less cron, sub-agents, the CLI, and any profile that left-//! `memory_sources` unset.-//! - `Some(set)` restricts recall to source trees whose `scope` string is in the-//! set. An empty set surfaces nothing (the profile selected no sources).+//! for cron, sub-agents, and the CLI.+//! - `Some(set)` restricts recall to source trees whose `scope` string is in+//! the set. An empty set surfaces nothing.//!//! The allowlist entries are matched against tree `scope` strings — the same//! identifiers the `memory_tree_query_source` tool accepts as `source_id`.diff --git a/crates/openhuman-core/src/security/policy/README.md b/crates/openhuman-core/src/security/policy/README.mdindex dac092df24..d7338c06cc 100644--- a/crates/openhuman-core/src/security/policy/README.md+++ b/crates/openhuman-core/src/security/policy/README.md@@ -24,17 +24,17 @@ trusted roots, and the per-hour action budget.| File | Purpose || --- | --- |-| `types.rs` | `SecurityPolicy` fields, `AutonomyLevel`, `CommandRiskLevel`, `CommandClass`, `GateDecision`, `ToolOperation`, `ActionTracker`, `TrustedRoot`/`TrustedAccess`, `ActiveProfileGuard`, `WORKSPACE_INTERNAL_DIRS`/`WORKSPACE_INTERNAL_FILES`, the two policy markers |+| `types.rs` | `SecurityPolicy` fields, `AutonomyLevel`, `CommandRiskLevel`, `CommandClass`, `GateDecision`, `ToolOperation`, `ActionTracker`, `TrustedRoot`/`TrustedAccess`, `WORKSPACE_INTERNAL_DIRS`/`WORKSPACE_INTERNAL_FILES`, the two policy markers || `path_checks.rs` | `is_workspace_internal_path`, `is_always_forbidden`, `check_cross_profile`, `is_within_trusted_root`, `is_resolved_path_allowed[_for]`, `check_resolved_against_forbidden` || `command_checks.rs` | `classify_command`, `gate_decision`, `check_gated_command`, `is_command_allowed`, `command_risk_level`, `parse_declared_class`, `is_command_executor`, `split_unquoted_segments` |-| `enforcement.rs` | `can_act`, `enforce_write_tier`, `enforce_tool_operation`, `record_action`/`is_rate_limited`, `from_config`, `with_active_profile`/`with_privacy_mode`, `openhuman_scratch_dir`/`ensure_openhuman_scratch_dir`, `validate_path_within_root` |+| `enforcement.rs` | `can_act`, `enforce_write_tier`, `enforce_tool_operation`, `record_action`/`is_rate_limited`, `from_config`, `with_privacy_mode`, `openhuman_scratch_dir`/`ensure_openhuman_scratch_dir`, `validate_path_within_root` || `policy_command/` (`quoting.rs`, `env_guard.rs`, `command_name.rs`, `classification.rs`) | Shell-parsing helpers behind the command checks: `split_unquoted_segments`, `skip_env_assignments`, `normalized_command_name`, `is_command_executor`, `classify_segment`, `has_hidden_execution`, `contains_unquoted_char` |## Public surfaceRe-exported through `policy/mod.rs` and then through `security/mod.rs`:`SecurityPolicy`, `AutonomyLevel`, `CommandClass`, `CommandRiskLevel`,-`GateDecision`, `ToolOperation`, `ActionTracker`, `ActiveProfileGuard`,+`GateDecision`, `ToolOperation`, `ActionTracker`,`TrustedRoot`, `TrustedAccess`, `POLICY_BLOCKED_MARKER`,`POLICY_DENIED_MARKER`, `validate_path_within_root`,`ensure_openhuman_scratch_dir`, `openhuman_scratch_dir`.diff --git a/crates/openhuman-core/src/security/policy/enforcement.rs b/crates/openhuman-core/src/security/policy/enforcement.rsindex 764fe6246b..214d864165 100644--- a/crates/openhuman-core/src/security/policy/enforcement.rs+++ b/crates/openhuman-core/src/security/policy/enforcement.rs@@ -184,40 +184,9 @@ impl SecurityPolicy {auto_approve_all: autonomy_config.auto_approve_all,tracker: ActionTracker::new(),canonical_workspace: Arc::new(OnceCell::new()),- // No active profile by default — armed explicitly by the session- // builder via [`with_active_profile`] when any profile is in play.- // Keeps every existing profile-less `from_config` caller on- // the byte-identical, guard-off path.- active_profile: None,}}- /// Return a copy of this policy with the cross-profile write guard armed for- /// `profile_id`, whose sibling workspaces live under- /// `<action_dir>/profiles/<id>/` (1b).- ///- /// Builder-style so the session builder reads as- /// `SecurityPolicy::from_config(..).with_active_profile(id, action_dir)`.- /// Every profiled session calls this; a profile-less session never does, so- /// the guard stays dormant and path validation is unchanged.- #[must_use]- pub fn with_active_profile(- mut self,- profile_id: String,- action_dir: std::path::PathBuf,- ) -> Self {- tracing::debug!(- profile_id = %profile_id,- action_dir = %action_dir.display(),- "[profiles][security] cross-profile write guard armed for session"- );- self.active_profile = Some(super::types::ActiveProfileGuard {- profile_id,- action_dir,- });- self- }-/// Return a copy of this policy with `privacy_mode` set. Used by the live-/// policy install / reload chokepoints to layer `config.privacy.mode` onto a/// policy that [`from_config`](Self::from_config) built with the `Standard`diff --git a/crates/openhuman-core/src/security/policy/mod.rs b/crates/openhuman-core/src/security/policy/mod.rsindex cc730b9670..ebb25a122f 100644--- a/crates/openhuman-core/src/security/policy/mod.rs+++ b/crates/openhuman-core/src/security/policy/mod.rs@@ -13,9 +13,8 @@ mod types;pub use enforcement::validate_path_within_root;pub use enforcement::{ensure_openhuman_scratch_dir, openhuman_scratch_dir};pub use types::{- ActionTracker, ActiveProfileGuard, AutonomyLevel, CommandClass, CommandRiskLevel, GateDecision,- SecurityPolicy, ToolOperation, TrustedAccess, TrustedRoot, POLICY_BLOCKED_MARKER,- POLICY_DENIED_MARKER,+ ActionTracker, AutonomyLevel, CommandClass, CommandRiskLevel, GateDecision, SecurityPolicy,+ ToolOperation, TrustedAccess, TrustedRoot, POLICY_BLOCKED_MARKER, POLICY_DENIED_MARKER,};#[cfg(test)]diff --git a/crates/openhuman-core/src/security/policy/policy_allowlist_tests.rs b/crates/openhuman-core/src/security/policy/policy_allowlist_tests.rsindex 7758fe5c69..d1a9335605 100644--- a/crates/openhuman-core/src/security/policy/policy_allowlist_tests.rs+++ b/crates/openhuman-core/src/security/policy/policy_allowlist_tests.rs@@ -1,41 +1,5 @@use super::*;-#[tokio::test]-async fn cross_profile_guard_blocks_write_into_sibling_profile() {- let (_root, action_root, policy) = cross_profile_policy(true);- let sibling = action_root.join("profiles").join("bob").join("loot.txt");- let err = policy- .validate_parent_path(sibling.to_str().unwrap())- .await- .expect_err("write into sibling profile must be blocked");- assert!(err.contains(POLICY_BLOCKED_MARKER), "err: {err}");- assert!(err.contains("bob"), "error should name the sibling: {err}");-}--#[tokio::test]-async fn cross_profile_guard_allows_write_into_own_profile() {- let (_root, action_root, policy) = cross_profile_policy(true);- let own = action_root.join("profiles").join("alice").join("notes.txt");- let resolved = policy- .validate_parent_path(own.to_str().unwrap())- .await- .expect("write into own profile must be allowed");- assert!(resolved.ends_with("notes.txt"));-}--#[tokio::test]-async fn cross_profile_guard_disarmed_allows_sibling_write() {- // Same setup, guard OFF (active_profile None): the sibling write is allowed,- // proving the guard only tightens and the shared path is byte-identical.- let (_root, action_root, policy) = cross_profile_policy(false);- let sibling = action_root.join("profiles").join("bob").join("loot.txt");- let resolved = policy- .validate_parent_path(sibling.to_str().unwrap())- .await- .expect("with the guard disarmed the sibling write must be allowed");- assert!(resolved.ends_with("loot.txt"));-}-// -- AutonomyLevel ------------------------------------------------#[test]diff --git a/crates/openhuman-core/src/security/policy/policy_tests.rs b/crates/openhuman-core/src/security/policy/policy_tests.rsindex 08e20d055b..9b716cbba0 100644--- a/crates/openhuman-core/src/security/policy/policy_tests.rs+++ b/crates/openhuman-core/src/security/policy/policy_tests.rs@@ -18,44 +18,6 @@ fn full_policy() -> SecurityPolicy {}}-// -- Cross-profile write guard (1b) --------------------------------//-// These drive the guard through the real `validate_parent_path` gate that every-// file write tool funnels through, proving the tightening lands at the shared-// call site (not just in the standalone classifier). `active_profile = None`-// keeps the exact same setup passing, pinning the byte-identical shared path.--/// Build a `<root>/projects/profiles/{alice,bob}` layout and a policy whose cwd-/// is scoped to alice (as `security_for_tool_context` would), with the guard-/// optionally armed for alice against the broad action root.-fn cross_profile_policy(arm_for_alice: bool) -> (tempfile::TempDir, PathBuf, SecurityPolicy) {- let root = tempfile::tempdir().expect("root tempdir");- let action_root = root.path().join("projects");- let profiles = action_root.join("profiles");- for id in ["alice", "bob"] {- std::fs::create_dir_all(profiles.join(id)).unwrap();- }- let alice_dir = profiles.join("alice");- let policy = SecurityPolicy {- autonomy: AutonomyLevel::Full,- // Everything under `root` is inside the workspace, so the sibling path- // clears containment and reaches the cross-profile check.- workspace_dir: root.path().to_path_buf(),- // Mirrors the per-tool-call override: cwd scoped to the profile dir.- action_dir: alice_dir.clone(),- workspace_only: false,- // Clear the default forbidden list (it blocks /tmp, /var, …, which the- // OS tempdir lives under) so the guard is what does the blocking.- forbidden_paths: Vec::new(),- active_profile: arm_for_alice.then(|| ActiveProfileGuard {- profile_id: "alice".to_string(),- action_dir: action_root.clone(),- }),- ..SecurityPolicy::default()- };- (root, action_root, policy)-}-// -- trusted_roots allow-list (Phase 1) ---------------------------use std::fs;diff --git a/crates/openhuman-core/src/security/policy/types.rs b/crates/openhuman-core/src/security/policy/types.rsindex 8ca4a6a1ed..8f63dcb7c4 100644--- a/crates/openhuman-core/src/security/policy/types.rs+++ b/crates/openhuman-core/src/security/policy/types.rs@@ -220,24 +220,6 @@ pub(super) const WORKSPACE_INTERNAL_FILES: &[&str] = &["PROFILE.md",];-/// The active agent-profile context that arms the cross-profile write guard-/// (1b). Present **only** when a turn runs under a dedicated-workspace profile;-/// `None` (the common case) leaves every path check byte-identical to today.-///-/// Carries the broad `action_dir` deliberately: `security_for_tool_context`-/// clones the policy and overrides its `action_dir` to the profile's own dir-/// for relative-path resolution, so the guard cannot derive the profiles root-/// from `SecurityPolicy::action_dir` at check time — it reads the immutable-/// `action_dir` captured here instead.-#[derive(Debug, Clone)]-pub struct ActiveProfileGuard {- /// Id of the profile the turn runs under (`P`).- pub profile_id: String,- /// The agent's broad action root; sibling profile workspaces live under- /// `<action_dir>/profiles/<id>/`.- pub action_dir: PathBuf,-}-/// Security policy enforced on all tool executions#[derive(Debug, Clone)]pub struct SecurityPolicy {@@ -316,12 +298,6 @@ pub struct SecurityPolicy {/// default. `pub(crate)` was an over-tight first cut that broke/// `examples/mouse_smoke.rs` with E0451.pub canonical_workspace: Arc<OnceCell<PathBuf>>,- /// Arms the cross-profile write guard (1b) when a dedicated-workspace- /// profile is active. `None` (default) = no active profile → the guard is- /// never consulted and path validation is byte-identical to today. Set once- /// at session build; carried through the per-tool-call clone made by- /// `security_for_tool_context` so file tools see it too.- pub active_profile: Option<ActiveProfileGuard>,}impl Default for SecurityPolicy {@@ -422,7 +398,6 @@ impl Default for SecurityPolicy {auto_approve_all: false,tracker: ActionTracker::new(),canonical_workspace: Arc::new(OnceCell::new()),- active_profile: None,}}}diff --git a/crates/openhuman-core/src/skills/README.md b/crates/openhuman-core/src/skills/README.mdindex e48a0c1a77..59bb6c1f56 100644--- a/crates/openhuman-core/src/skills/README.md+++ b/crates/openhuman-core/src/skills/README.md@@ -18,7 +18,7 @@ Stub signatures must match the real ones exactly; `cargo check --no-default-feat| --- | --- || `ops.rs` | Facade re-exporting `ops_create`/`ops_discover`/`ops_install`/`ops_parse`/`bundled::install_bundled_skills`; the module doc explains scope precedence and the trust marker. || `ops_create.rs` | Scaffolds new `WORKFLOW.md`/`SKILL.md` skills on disk from declared `[[inputs]]`. |-| `ops_discover.rs` | Scans root directories, resolves scope precedence and collisions, skips symlinked bundle entries, and `init_workflows_dir` creates the legacy `<workspace>/skills/` dir. `load_workflow_metadata_for_profile` and `discover_workflows_with_profile` take a profile-local skills root and `include_skills` list so a profile can see its own private skills. |+| `ops_discover.rs` | Scans workspace, user, bundled, and legacy root directories; resolves scope precedence and collisions; skips symlinked bundle entries; and creates the legacy `<workspace>/skills/` directory. || `ops_install.rs` | Facade over submodules `ops_install/fetch.rs`/`ops_install/url_validation.rs`: the hardened HTTPS skill-URL installer (size cap, timeout clamp, non-https/private-IP/non-SKILL.md rejection, GitHub blob→raw normalization). Localhost HTTP installs require `OPENHUMAN_SKILL_INSTALL_ALLOW_LOCAL_HTTP=1` and are for local fixtures only. || `ops_parse.rs` | Splits `SKILL.md`/`WORKFLOW.md` into frontmatter + body, builds the resource inventory, reads a single resource. || `ops_types.rs` | Ungated carve-out: `Workflow`, `WorkflowFrontmatter`, `WorkflowScope` (`Builtin`, `User`, `Project`, `Legacy`, `Profile`, `Flow`), filename/size constants (`MAX_WORKFLOW_RESOURCE_BYTES = 128 KiB`). |@@ -70,4 +70,4 @@ Catalog refresh in a live session (`refresh_workflows`) is covered by `crates/op## Notes- Per AGENTS.md, skill discovery rejects symlinked bundles — copy skills into the `Harness` workspace rather than symlinking them.-- `WorkflowScope` precedence on name collision (`ops_discover::precedence`), lowest to highest: `Builtin` < `Legacy` < `User` < `Project` < `Profile` (profile-local skills are private to the active agent profile and shadow a same-named global one for its owner). `Flow` is a distinct, non-collision-checked scope: a Flows automation row from `flows.db` surfaced in the same catalogue rather than a `SKILL.md` bundle on disk.+- `WorkflowScope` precedence on name collision (`ops_discover::precedence`), lowest to highest: `Builtin` < `Legacy` < `User` < `Project`. `Flow` is a distinct, non-collision-checked scope: a Flows automation row from `flows.db` surfaced in the same catalogue rather than a `SKILL.md` bundle on disk.diff --git a/crates/openhuman-core/src/skills/ops.rs b/crates/openhuman-core/src/skills/ops.rsindex 3c0898e7e6..c18089fdc4 100644--- a/crates/openhuman-core/src/skills/ops.rs+++ b/crates/openhuman-core/src/skills/ops.rs@@ -32,9 +32,8 @@pub use super::bundled::install_bundled_skills;pub use super::ops_create::{create_workflow, CreateWorkflowParams, WorkflowCreateInputDef};pub use super::ops_discover::{- discover_automations, discover_workflows, discover_workflows_with_profile, init_workflows_dir,- is_workspace_trusted, load_workflow_metadata, load_workflow_metadata_for_profile,- profile_local_skill_ids, read_workflow_resource, read_workflow_resource_with_profile,+ discover_automations, discover_workflows, init_workflows_dir, is_workspace_trusted,+ load_workflow_metadata, read_workflow_resource,};pub use super::ops_install::{install_workflow_from_url, uninstall_workflow, validate_install_url, validate_resolved_host,diff --git a/crates/openhuman-core/src/skills/ops_create.rs b/crates/openhuman-core/src/skills/ops_create.rsindex db75758b3f..5b2da5b02b 100644--- a/crates/openhuman-core/src/skills/ops_create.rs+++ b/crates/openhuman-core/src/skills/ops_create.rs@@ -149,18 +149,12 @@ fn legacy_workflow_dir(workspace_dir.join(".openhuman").join("skills"),workspace_dir.join(".agents").join("skills"),],- // Profile-local skills are placed by hand under- // `<workspace>/personalities/<id>/skills/`, never scaffolded through- // the create path; treat them like Legacy here (no create target).// Builtin bundles come from a `const` table compiled into the// binary; a create RPC that could write one would make that table// 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::Profile- | WorkflowScope::Flow => return None,+ WorkflowScope::Builtin | WorkflowScope::Legacy | WorkflowScope::Flow => return None,};for root in roots {let canonical_root = match std::fs::canonicalize(&root) {@@ -235,9 +229,9 @@ pub(crate) fn create_workflow_inner(.to_string(),);}- WorkflowScope::Builtin | WorkflowScope::Legacy | WorkflowScope::Profile => {+ WorkflowScope::Builtin | WorkflowScope::Legacy => {return Err(- "cannot create skill in legacy or profile scope; choose 'user' or 'project'"+ "cannot create skill in legacy or builtin scope; choose 'user' or 'project'".to_string(),);}diff --git a/crates/openhuman-core/src/skills/ops_discover.rs b/crates/openhuman-core/src/skills/ops_discover.rsindex 47db4927fc..d785bc9161 100644--- a/crates/openhuman-core/src/skills/ops_discover.rs+++ b/crates/openhuman-core/src/skills/ops_discover.rs@@ -23,13 +23,10 @@ use collision::precedence;use std::path::Path;pub use api::{- discover_automations, discover_workflows, discover_workflows_with_profile, discovery_home_dir,- init_workflows_dir, is_workspace_trusted, load_workflow_metadata,- load_workflow_metadata_for_profile,-};-pub use resource::{- profile_local_skill_ids, read_workflow_resource, read_workflow_resource_with_profile,+ discover_automations, discover_workflows, discovery_home_dir, init_workflows_dir,+ is_workspace_trusted, load_workflow_metadata,};+pub use resource::read_workflow_resource;pub(crate) use api::discover_workflows_inner;@@ -39,6 +36,3 @@ pub(crate) use api::DISCOVERY_CALLS;#[cfg(test)]#[path = "ops_discover_include_skills_tests_tests.rs"]mod include_skills_tests;-#[cfg(test)]-#[path = "ops_discover_profile_scope_tests_tests.rs"]-mod profile_scope_tests;diff --git a/crates/openhuman-core/src/skills/ops_discover/api.rs b/crates/openhuman-core/src/skills/ops_discover/api.rsindex e25b37a469..a500fb7f4c 100644--- a/crates/openhuman-core/src/skills/ops_discover/api.rs+++ b/crates/openhuman-core/src/skills/ops_discover/api.rs@@ -65,30 +65,7 @@ pub fn discovery_home_dir() -> Option<PathBuf> {pub fn load_workflow_metadata(workspace_dir: &Path) -> Vec<Workflow> {let trusted = is_workspace_trusted(workspace_dir);let home = discovery_home_dir();- discover_workflows_inner(home.as_deref(), Some(workspace_dir), None, trusted)-}--/// Like [`load_workflow_metadata`], but additionally scans a profile-local-/// skills root (`<workspace>/personalities/<id>/skills/`) when one is supplied.-///-/// Callers pass the active profile's root (resolved via-/// `profiles::profile_skills_root`) so the returned catalog carries that-/// profile's private skills. `None` reproduces [`load_workflow_metadata`]-/// byte-for-byte, so the profile-less session and every other profile are-/// unaffected. Profile-local skills win same-name collisions against global-/// scopes (see [`crate::skills::ops_types::WorkflowScope::Profile`]).-pub fn load_workflow_metadata_for_profile(- workspace_dir: &Path,- profile_skills_root: Option<&Path>,-) -> Vec<Workflow> {- let trusted = is_workspace_trusted(workspace_dir);- let home = discovery_home_dir();- discover_workflows_inner(- home.as_deref(),- Some(workspace_dir),- profile_skills_root,- trusted,- )+ discover_workflows_inner(home.as_deref(), Some(workspace_dir), trusted)}/// Discover skills from every supported location.@@ -105,29 +82,10 @@ pub fn discover_workflows(home_dir: Option<&Path>,workspace_dir: Option<&Path>,trusted: bool,-) -> Vec<Workflow> {- discover_workflows_inner(home_dir, workspace_dir, None, trusted)-}--/// Discover skills including a profile-local root, for a turn running under a-/// specific agent profile.-///-/// `profile_skills_root` is `<workspace>/personalities/<id>/skills/` (resolved-/// via `profiles::profile_skills_root`, which validates the id). It is scanned-/// unconditionally — no trust marker is required, since the directory is-/// core-managed under `workspace_dir` — and its bundles win same-name collisions-/// against every global scope for this profile. `None` is identical to-/// [`discover_workflows`], so other profiles and the default session never see-/// these skills.-pub fn discover_workflows_with_profile(- home_dir: Option<&Path>,- workspace_dir: Option<&Path>,- profile_skills_root: Option<&Path>,- trusted: bool,) -> Vec<Workflow> {#[cfg(test)]DISCOVERY_CALLS.with(|c| c.set(c.get() + 1));- discover_workflows_inner(home_dir, workspace_dir, profile_skills_root, trusted)+ discover_workflows_inner(home_dir, workspace_dir, trusted)}#[cfg(test)]@@ -150,16 +108,9 @@ pub fn is_workspace_trusted(workspace_dir: &Path) -> bool {pub(crate) fn discover_workflows_inner(home_dir: Option<&Path>,workspace_dir: Option<&Path>,- profile_skills_root: Option<&Path>,trusted: bool,) -> Vec<Workflow> {- discover_filtered(- home_dir,- workspace_dir,- profile_skills_root,- trusted,- ALL_ROOT_KINDS,- )+ discover_filtered(home_dir, workspace_dir, trusted, ALL_ROOT_KINDS)}/// Discover only automation bundles under the `workflows/` roots.@@ -180,5 +131,5 @@ pub fn discover_automations(has_workspace = workspace_dir.is_some(),"[workflows] discover:automations:enter");- discover_filtered(home_dir, workspace_dir, None, trusted, WORKFLOW_ROOT_KINDS)+ discover_filtered(home_dir, workspace_dir, trusted, WORKFLOW_ROOT_KINDS)}diff --git a/crates/openhuman-core/src/skills/ops_discover/collision.rs b/crates/openhuman-core/src/skills/ops_discover/collision.rsindex c9cf1f5cba..ed4ef20325 100644--- a/crates/openhuman-core/src/skills/ops_discover/collision.rs+++ b/crates/openhuman-core/src/skills/ops_discover/collision.rs@@ -65,7 +65,6 @@ pub(super) const fn precedence(scope: WorkflowScope) -> u8 {WorkflowScope::Legacy => 1,WorkflowScope::User => 2,WorkflowScope::Project => 3,- WorkflowScope::Profile => 4,- WorkflowScope::Flow => 5,+ WorkflowScope::Flow => 4,}}diff --git a/crates/openhuman-core/src/skills/ops_discover/resource.rs b/crates/openhuman-core/src/skills/ops_discover/resource.rsindex d0c3c0cb3e..a8e8009f99 100644--- a/crates/openhuman-core/src/skills/ops_discover/resource.rs+++ b/crates/openhuman-core/src/skills/ops_discover/resource.rs@@ -1,13 +1,8 @@//! OpenHuman discovery context around `tinyskills` resource reads.-use std::collections::HashSet;+use super::api::load_workflow_metadata;use std::path::{Component, Path};-use crate::skills::ops_types::WorkflowScope;--use super::api::load_workflow_metadata_for_profile;-use super::scan::scan_root;-fn reject_symlink_components(root: &Path, relative_path: &Path) -> Result<(), String> {let mut current = root.to_path_buf();for component in relative_path.components() {@@ -41,35 +36,12 @@ pub fn read_workflow_resource(workspace_dir: &Path,skill_id: &str,relative_path: &Path,-) -> Result<String, String> {- read_workflow_resource_with_profile(workspace_dir, skill_id, relative_path, None)-}--pub fn profile_local_skill_ids(profile_skills_root: Option<&Path>) -> HashSet<String> {- let Some(root) = profile_skills_root else {- return HashSet::new();- };- scan_root(root, WorkflowScope::Profile)- .into_iter()- .flat_map(|workflow| [workflow.name, workflow.dir_name])- .filter(|id| !id.is_empty())- .collect()-}--pub fn read_workflow_resource_with_profile(- workspace_dir: &Path,- skill_id: &str,- relative_path: &Path,- profile_skills_root: Option<&Path>,) -> Result<String, String> {if skill_id.trim().is_empty() {return Err("skill_id must not be empty".to_string());}validate_relative_path(relative_path)?;- let skill = tinyskills::resolve_skill(- load_workflow_metadata_for_profile(workspace_dir, profile_skills_root),- skill_id,- )?;+ let skill = tinyskills::resolve_skill(load_workflow_metadata(workspace_dir), skill_id)?;let root = skill.location.as_deref()diff --git a/crates/openhuman-core/src/skills/ops_discover/scan.rs b/crates/openhuman-core/src/skills/ops_discover/scan.rsindex 457274de59..0b2ae0f76a 100644--- a/crates/openhuman-core/src/skills/ops_discover/scan.rs+++ b/crates/openhuman-core/src/skills/ops_discover/scan.rs@@ -34,7 +34,6 @@ pub(super) const WORKFLOW_ROOT_KINDS: &[RootKind] = &[RootKind::Workflow];pub(super) fn discover_filtered(home_dir: Option<&Path>,workspace_dir: Option<&Path>,- profile_skills_root: Option<&Path>,trusted: bool,kinds: &[RootKind],) -> Vec<Workflow> {@@ -42,7 +41,6 @@ pub(super) fn discover_filtered(trusted,has_home = home_dir.is_some(),has_workspace = workspace_dir.is_some(),- has_profile_root = profile_skills_root.is_some(),include_skills = kinds.contains(&RootKind::Skill),include_workflows = kinds.contains(&RootKind::Workflow),"[workflows] discover:enter"@@ -118,33 +116,6 @@ pub(super) fn discover_filtered(}}- // Profile-local skills (`<workspace>/personalities/<id>/skills/`) are a skill- // root scoped to the *active* profile: scanned last and at the highest- // precedence so a profile-local bundle wins any same-name collision against- // the global scopes for its owner (see [`super::collision::precedence`]).- // Excluded from the automations-only view for the same reason as the- // legacy skill root. No trust marker is consulted — the directory is- // core-managed under `workspace_dir`, seeded by `ensure_profile_home`.- if let Some(profile_root) = profile_skills_root {- if kinds.contains(&RootKind::Skill) {- tracing::debug!(- root = %profile_root.display(),- scope = ?WorkflowScope::Profile,- "[profiles] discover:branch:profile-local skills"- );- let before = discovered.len();- absorb(- &mut discovered,- scan_root(profile_root, WorkflowScope::Profile),- );- tracing::debug!(- names_before = before,- names_after = discovered.len(),- "[profiles] profile-local skills absorbed (profile scope wins same-name collisions)"- );- }- }-let mut out: Vec<_> = discovered.into_values().collect();out.sort_by(|left, right| left.name.cmp(&right.name));tracing::debug!(discovered_count = out.len(), "[workflows] discover:exit");diff --git a/crates/openhuman-core/src/skills/ops_discover_profile_scope_tests_tests.rs b/crates/openhuman-core/src/skills/ops_discover_profile_scope_tests_tests.rsdeleted file mode 100644index 08cfb853ae..0000000000--- a/crates/openhuman-core/src/skills/ops_discover_profile_scope_tests_tests.rs+++ /dev/null@@ -1,242 +0,0 @@-use super::*;--/// Write a minimal `WORKFLOW.md` bundle under `root/slug/`.-fn seed_bundle(root: &Path, slug: &str) {- seed_bundle_with_name(root, slug, slug);-}--fn seed_bundle_with_name(root: &Path, slug: &str, name: &str) {- let dir = root.join(slug);- std::fs::create_dir_all(&dir).unwrap();- std::fs::write(- dir.join("WORKFLOW.md"),- format!("---\nname: {name}\ndescription: {name} desc\n---\n\n{name} body\n"),- )- .unwrap();-}--/// Profile-local skills appear ONLY when their root is passed, and never for-/// the profile-less session or a *different* profile's root (2a scoping-/// matrix).-#[test]-fn profile_local_skills_scoped_to_their_owner() {- let home = tempfile::TempDir::new().unwrap();- // A global user-scope skill everyone sees.- seed_bundle(- &home.path().join(".openhuman").join("skills"),- "global-skill",- );-- // Two distinct profile roots (alice / bob), each with a private skill.- let alice_root = tempfile::TempDir::new().unwrap();- seed_bundle(alice_root.path(), "alice-only");- let bob_root = tempfile::TempDir::new().unwrap();- seed_bundle(bob_root.path(), "bob-only");-- let names = |workflows: Vec<Workflow>| {- let mut n: Vec<String> = workflows.into_iter().map(|w| w.name).collect();- n.sort();- n- };-- // No profile: only the global skill.- let none = names(discover_workflows_with_profile(- Some(home.path()),- None,- None,- false,- ));- assert_eq!(none, vec!["global-skill"]);-- // Alice's turn: global + alice-only, never bob-only.- let alice = names(discover_workflows_with_profile(- Some(home.path()),- None,- Some(alice_root.path()),- false,- ));- assert_eq!(alice, vec!["alice-only", "global-skill"]);-- // Bob's turn: global + bob-only, never alice-only.- let bob = names(discover_workflows_with_profile(- Some(home.path()),- None,- Some(bob_root.path()),- false,- ));- assert_eq!(bob, vec!["bob-only", "global-skill"]);-}--/// A profile-local skill named the same as a global skill wins for its owner-/// (highest precedence) and is tagged `WorkflowScope::Profile` (2a collision-/// precedence).-#[test]-fn profile_local_wins_same_name_collision() {- let home = tempfile::TempDir::new().unwrap();- seed_bundle(- &home.path().join(".openhuman").join("skills"),- "shared-name",- );- let profile_root = tempfile::TempDir::new().unwrap();- seed_bundle(profile_root.path(), "shared-name");-- let workflows =- discover_workflows_with_profile(Some(home.path()), None, Some(profile_root.path()), false);- let winner = workflows- .iter()- .find(|w| w.name == "shared-name")- .expect("shared-name resolved");- // Exactly one entry for the name, and it is the profile-local copy.- assert_eq!(- workflows.iter().filter(|w| w.name == "shared-name").count(),- 1,- "collision must collapse to a single winner"- );- assert_eq!(- winner.scope,- WorkflowScope::Profile,- "profile-local skill must win the same-name collision"- );- // The winner resolves under the profile root, not the global one.- let canon_profile = std::fs::canonicalize(profile_root.path()).unwrap();- let loc = std::fs::canonicalize(winner.location.as_ref().unwrap()).unwrap();- assert!(- loc.starts_with(&canon_profile),- "winning skill must live under the profile root, got {}",- loc.display()- );-}--#[test]-fn profile_local_wins_same_runnable_id_with_different_display_name() {- let home = tempfile::TempDir::new().unwrap();- seed_bundle_with_name(- &home.path().join(".openhuman").join("skills"),- "shared-slug",- "Global display name",- );- let profile_root = tempfile::TempDir::new().unwrap();- seed_bundle_with_name(profile_root.path(), "shared-slug", "Profile display name");-- let workflows =- discover_workflows_with_profile(Some(home.path()), None, Some(profile_root.path()), false);- let by_slug: Vec<_> = workflows- .iter()- .filter(|workflow| workflow.dir_name == "shared-slug")- .collect();- assert_eq!(by_slug.len(), 1, "runnable ids must be unique");- assert_eq!(by_slug[0].scope, WorkflowScope::Profile);- assert_eq!(by_slug[0].name, "Profile display name");-}--/// `WorkflowScope::Profile` outranks every global scope in the precedence-/// ladder (the mechanism the collision test relies on).-#[test]-fn profile_scope_has_highest_precedence() {- assert!(precedence(WorkflowScope::Profile) > precedence(WorkflowScope::Project));- assert!(precedence(WorkflowScope::Profile) > precedence(WorkflowScope::User));- assert!(precedence(WorkflowScope::Profile) > precedence(WorkflowScope::Legacy));-}--/// Seed a runnable bundle with a bundled resource under `references/`.-fn seed_bundle_with_resource(root: &Path, slug: &str, resource_body: &str) {- let dir = root.join(slug);- std::fs::create_dir_all(dir.join("references")).unwrap();- std::fs::write(- dir.join("WORKFLOW.md"),- format!("---\nname: {slug}\ndescription: {slug} desc\n---\n\n{slug} body\n"),- )- .unwrap();- std::fs::write(dir.join("references").join("note.md"), resource_body).unwrap();-}--/// `read_workflow_resource_with_profile` (the `read_workflow_resource` tool's-/// seam) resolves a profile's private skill resources for the owner only,-/// resolves collisions to the profile-local copy, hides them from other-/// profiles / the profile-less session, and leaves global-only resources-/// readable everywhere.-#[test]-fn read_workflow_resource_with_profile_resolution_matrix() {- let ws = tempfile::TempDir::new().unwrap();- let profile_root = tempfile::TempDir::new().unwrap();- let other_root = tempfile::TempDir::new().unwrap();-- // Global (legacy) skill + resource, private skill + resource, and a- // collision under both.- seed_bundle_with_resource(&ws.path().join("skills"), "resglobal7788", "GLOBAL_RES");- seed_bundle_with_resource(profile_root.path(), "reslocal7788", "LOCAL_RES");- seed_bundle_with_resource(&ws.path().join("skills"), "rescollide7788", "GLOBAL_RES");- seed_bundle_with_resource(profile_root.path(), "rescollide7788", "PROFILE_RES");-- let rel = Path::new("references/note.md");- let read = |id: &str, root: Option<&Path>| {- read_workflow_resource_with_profile(ws.path(), id, rel, root)- };-- // Owner reads its private skill's resource.- assert_eq!(- read("reslocal7788", Some(profile_root.path())).unwrap(),- "LOCAL_RES"- );- // Profile-less + other profile cannot resolve the private skill at all.- assert!(read("reslocal7788", None).is_err());- assert!(read("reslocal7788", Some(other_root.path())).is_err());-- // Global-only resource is readable with or without a profile root.- assert_eq!(read("resglobal7788", None).unwrap(), "GLOBAL_RES");- assert_eq!(- read("resglobal7788", Some(profile_root.path())).unwrap(),- "GLOBAL_RES"- );-- // Collision: owner reads the profile-local resource; everyone else the global.- assert_eq!(- read("rescollide7788", Some(profile_root.path())).unwrap(),- "PROFILE_RES"- );- assert_eq!(read("rescollide7788", None).unwrap(), "GLOBAL_RES");-}--/// `profile_local_skill_ids` returns both runnable names and directory slugs-/// under the profile root (the implicit-allow set the describe/read/run tools-/// consult), and is empty for the profile-less session.-#[test]-fn profile_local_skill_ids_lists_only_the_profile_root() {- let profile_root = tempfile::TempDir::new().unwrap();- seed_bundle(profile_root.path(), "priv-a");- seed_bundle(profile_root.path(), "priv-b");-- let ids = profile_local_skill_ids(Some(profile_root.path()));- assert_eq!(ids.len(), 2);- assert!(ids.contains("priv-a"));- assert!(ids.contains("priv-b"));-- assert!(- profile_local_skill_ids(None).is_empty(),- "profile-less session has no implicitly-allowed profile-local ids"- );-}--#[test]-fn profile_local_skill_ids_include_distinct_name_and_slug() {- let profile_root = tempfile::TempDir::new().unwrap();- seed_bundle_with_name(profile_root.path(), "mail-helper", "Inbox Assistant");-- let ids = profile_local_skill_ids(Some(profile_root.path()));- assert_eq!(ids.len(), 2);- assert!(ids.contains("mail-helper"));- assert!(ids.contains("Inbox Assistant"));-}--/// A `None` profile root reproduces `load_workflow_metadata` byte-for-byte —-/// the back-compat guarantee for the profile-less session.-#[test]-fn none_profile_root_matches_plain_discovery() {- let home = tempfile::TempDir::new().unwrap();- seed_bundle(&home.path().join(".openhuman").join("skills"), "a-skill");- let with_none = discover_workflows_with_profile(Some(home.path()), None, None, false);- let plain = discover_workflows(Some(home.path()), None, false);- let names: Vec<&str> = with_none.iter().map(|w| w.name.as_str()).collect();- let plain_names: Vec<&str> = plain.iter().map(|w| w.name.as_str()).collect();- assert_eq!(names, plain_names);-}diff --git a/crates/openhuman-core/src/skills/registry.rs b/crates/openhuman-core/src/skills/registry.rsindex fa57da2ad9..b7b35510bc 100644--- a/crates/openhuman-core/src/skills/registry.rs+++ b/crates/openhuman-core/src/skills/registry.rs@@ -154,38 +154,17 @@ pub fn prune_legacy_default_workflows(workspace_dir: &Path) {/// Without `skill.toml`, a synthesized SKILL.md-only definition means a bare workflow is/// still runnable. A bad `skill.toml` falls back to the SKILL.md-only form.pub fn load_workflows(workspace_dir: &Path) -> Vec<WorkflowDefinition> {- load_workflows_with_profile(workspace_dir, None)+ load_workflows_and_discovered(workspace_dir).0}-/// Like [`load_workflows`], but additionally resolves the active profile's-/// private skills (`<workspace>/personalities/<id>/skills/`) when-/// `profile_skills_root` is supplied.-///-/// The profile root is threaded straight into-/// [`super::ops_discover::discover_workflows_with_profile`], so profile-local-/// skills become runnable/describable for their owner and win same-name-/// collisions against global skills (via [`WorkflowScope::Profile`] precedence).-/// `None` reproduces [`load_workflows`] byte-for-byte — other profiles and the-/// profile-less session never see these skills. No global registry state is-/// mutated, so concurrent sessions under different profiles stay isolated.-pub fn load_workflows_with_profile(- workspace_dir: &Path,- profile_skills_root: Option<&Path>,-) -> Vec<WorkflowDefinition> {- load_workflows_and_discovered(workspace_dir, profile_skills_root).0-}--/// [`load_workflows_with_profile`] plus the discovered bundles the definitions+/// [`load_workflows`] plus the discovered bundles the definitions/// were built from.////// Discovery re-reads and re-parses every bundle under every root, so a caller/// that needs both the runnable definitions and the discovered metadata (scope/// and frontmatter `name`, which `WorkflowDefinition` does not carry) takes/// them from this one pass instead of running discovery a second time (#6166).-fn load_workflows_and_discovered(- workspace_dir: &Path,- profile_skills_root: Option<&Path>,-) -> (Vec<WorkflowDefinition>, Vec<Workflow>) {+fn load_workflows_and_discovered(workspace_dir: &Path) -> (Vec<WorkflowDefinition>, Vec<Workflow>) {// Prune any legacy bundled skills an older build left behind so discover's// legacy scan no longer surfaces them (idempotent).prune_legacy_default_workflows(workspace_dir);@@ -206,12 +185,8 @@ fn load_workflows_and_discovered(// discovery the create/list path uses, then load each one's definition.let home = super::ops_discover::discovery_home_dir();let trusted = super::ops_discover::is_workspace_trusted(workspace_dir);- let discovered = super::ops_discover::discover_workflows_with_profile(- home.as_deref(),- Some(workspace_dir),- profile_skills_root,- trusted,- );+ let discovered =+ super::ops_discover::discover_workflows(home.as_deref(), Some(workspace_dir), trusted);for wf in &discovered {let Some(skill_md) = wf.location.as_ref() else {continue;@@ -289,50 +264,11 @@ fn load_workflow_definition(/// Look up one skill by id across the registry.pub fn get_workflow(workspace_dir: &Path, id: &str) -> Option<WorkflowDefinition> {- get_workflow_with_profile(workspace_dir, id, None)-}--/// Like [`get_workflow`], but resolves the active profile's private skills too-/// (`<workspace>/personalities/<id>/skills/`) when `profile_skills_root` is-/// supplied. This is the resolution seam behind `describe_workflow` /-/// `run_workflow`: a profile-local skill is runnable/describable for its owner-/// and wins same-name collisions; `None` is byte-identical to [`get_workflow`].-pub fn get_workflow_with_profile(- workspace_dir: &Path,- id: &str,- profile_skills_root: Option<&Path>,-) -> Option<WorkflowDefinition> {- let (workflows, discovered) = load_workflows_and_discovered(workspace_dir, profile_skills_root);- // Built-ins are prepended and discovered workflows follow them. Search in- // reverse so the scope-resolved discovered entry (profile wins over global)- // also wins over a built-in with the same runnable id.- if let Some(exact) = workflows.iter().rev().find(|s| s.definition.id == id) {- return Some(exact.clone());- }-- // Profile lists advertise the frontmatter display name as well as the- // directory slug. Resolve that name back to the canonical runnable slug so- // a private workflow admitted by the profile-local allow set can actually- // be described and run. Keep the legacy profile-less lookup id-only: global- // display names have never been runnable ids and may collide with builtins.- //- // Answered from the discovery pass already in hand — this used to re-run a- // full on-disk discovery and re-parse every bundle a second time (#6166).- let slug = discovered- .into_iter()- .find(|workflow| workflow.scope == WorkflowScope::Profile && workflow.name == id)- .map(|workflow| {- if workflow.dir_name.is_empty() {- workflow.name- } else {- workflow.dir_name- }- })?;-+ let (workflows, _) = load_workflows_and_discovered(workspace_dir);workflows.into_iter().rev()- .find(|workflow| workflow.definition.id == slug)+ .find(|workflow| workflow.definition.id == id)}#[cfg(test)]diff --git a/crates/openhuman-core/src/skills/registry_tests.rs b/crates/openhuman-core/src/skills/registry_tests.rsindex ecc5e61bd9..b6495d1e19 100644--- a/crates/openhuman-core/src/skills/registry_tests.rs+++ b/crates/openhuman-core/src/skills/registry_tests.rs@@ -74,100 +74,6 @@ fn seed_runnable_with_name(root: &std::path::Path, slug: &str, name: &str, body_.unwrap();}-fn resolved_body(def: &WorkflowDefinition) -> String {- match &def.definition.system_prompt {- PromptSource::Inline(p) => p.clone(),- other => panic!("expected inline prompt, got {other:?}"),- }-}--/// The resolution seam behind `describe_workflow` / `run_workflow`-/// (`get_workflow_with_profile`) resolves a profile's private skills for the-/// owner only, resolves collisions to the profile-local copy, keeps-/// profile-local skills invisible to other profiles / the profile-less-/// session, and leaves global-only skills resolvable everywhere.-#[test]-fn get_workflow_with_profile_resolution_matrix() {- // Unique-ish ids so a developer's real ~/.openhuman/skills can't collide.- let ws = tempfile::TempDir::new().unwrap();- let profile_root = tempfile::TempDir::new().unwrap();- let other_root = tempfile::TempDir::new().unwrap(); // a different profile-- // A global skill under the legacy `<ws>/skills/` root (no trust marker- // needed), and a private skill under the profile root.- seed_runnable(&ws.path().join("skills"), "zzglobalonly7788", "GLOBAL_BODY");- seed_runnable(profile_root.path(), "zzlocalonly7788", "LOCAL_BODY");- // Collision: same id in both the global legacy root and the profile root.- seed_runnable(&ws.path().join("skills"), "zzcollide7788", "GLOBAL_COLLIDE");- seed_runnable(profile_root.path(), "zzcollide7788", "PROFILE_COLLIDE");-- let get =- |id: &str, root: Option<&std::path::Path>| get_workflow_with_profile(ws.path(), id, root);-- // Owner resolves its profile-local skill.- assert!(- get("zzlocalonly7788", Some(profile_root.path())).is_some(),- "owner must resolve its profile-local skill"- );- // Profile-less session and a different profile cannot resolve it.- assert!(- get("zzlocalonly7788", None).is_none(),- "profile-less session must not resolve a profile-local skill"- );- assert!(- get("zzlocalonly7788", Some(other_root.path())).is_none(),- "a different profile must not resolve another profile's private skill"- );-- // Global-only skill resolves everywhere (with/without a profile root).- assert!(get("zzglobalonly7788", None).is_some());- assert!(get("zzglobalonly7788", Some(profile_root.path())).is_some());- assert!(get("zzglobalonly7788", Some(other_root.path())).is_some());-- // Collision: the owner resolves the profile-local copy; everyone else- // resolves the global copy.- assert_eq!(- resolved_body(&get("zzcollide7788", Some(profile_root.path())).unwrap()),- "---\nname: zzcollide7788\ndescription: zzcollide7788 desc\n---\n\nPROFILE_COLLIDE\n",- "owner must resolve the profile-local copy on collision"- );- assert_eq!(- resolved_body(&get("zzcollide7788", None).unwrap()),- "---\nname: zzcollide7788\ndescription: zzcollide7788 desc\n---\n\nGLOBAL_COLLIDE\n",- "profile-less session resolves the global copy on collision"- );-}--#[test]-fn get_profile_workflow_resolves_distinct_display_name() {- let ws = tempfile::TempDir::new().unwrap();- let profile_root = tempfile::TempDir::new().unwrap();- seed_runnable_with_name(- profile_root.path(),- "mail-helper",- "Inbox Assistant",- "PROFILE_NAME_BODY",- );-- let resolved =- get_workflow_with_profile(ws.path(), "Inbox Assistant", Some(profile_root.path()))- .expect("display name must resolve for the owning profile");- assert_eq!(resolved.definition.id, "mail-helper");- assert!(resolved_body(&resolved).contains("PROFILE_NAME_BODY"));- assert!(get_workflow_with_profile(ws.path(), "Inbox Assistant", None).is_none());-}--#[test]-fn profile_workflow_exact_id_overrides_builtin() {- let ws = tempfile::TempDir::new().unwrap();- let profile_root = tempfile::TempDir::new().unwrap();- seed_runnable(profile_root.path(), "critic", "PROFILE_CRITIC_BODY");-- let resolved = get_workflow_with_profile(ws.path(), "critic", Some(profile_root.path()))- .expect("profile critic resolves");- assert!(resolved_body(&resolved).contains("PROFILE_CRITIC_BODY"));-}-#[test]fn load_skills_reads_runtime_skill_prompt_and_inputs() {let tmp = tempfile::TempDir::new().unwrap();@@ -320,42 +226,25 @@ fn skill_github_config_serializes_lowercase() {}/// One workflow lookup must run at most one full on-disk discovery pass.-///-/// `get_workflow_with_profile` used to discover twice when the id was not an-/// exact runnable slug: once inside `load_workflows_with_profile`, then again-/// to resolve a profile display name back to its slug. Discovery re-reads and-/// re-parses every bundle under every root, so the second pass doubled the cost-/// — and doubled every per-parse deprecation warning with it (#6166, #6155).#[test]fn workflow_lookup_discovers_once() {use super::super::ops_discover::DISCOVERY_CALLS;let ws = tempfile::TempDir::new().unwrap();- let profile_root = tempfile::TempDir::new().unwrap();- seed_runnable_with_name(- profile_root.path(),- "zzcount6166",- "Counted Assistant",- "COUNT_BODY",- );+ seed_runnable(&ws.path().join("skills"), "zzcount6166", "COUNT_BODY");- // Resolution by display name — the path that took the second pass.DISCOVERY_CALLS.with(|c| c.set(0));- let resolved =- get_workflow_with_profile(ws.path(), "Counted Assistant", Some(profile_root.path()))- .expect("display name must still resolve");+ let resolved = get_workflow(ws.path(), "zzcount6166").expect("workflow resolves");assert_eq!(resolved.definition.id, "zzcount6166");assert_eq!(DISCOVERY_CALLS.with(|c| c.get()),1,- "display-name lookup must discover the skills tree once, not twice"+ "lookup must discover the skills tree once");// A miss walks the same fallback and must not discover twice either.DISCOVERY_CALLS.with(|c| c.set(0));- assert!(- get_workflow_with_profile(ws.path(), "zznosuch6166", Some(profile_root.path())).is_none()- );+ assert!(get_workflow(ws.path(), "zznosuch6166").is_none());assert_eq!(DISCOVERY_CALLS.with(|c| c.get()),1,diff --git a/crates/openhuman-core/src/skills/run_log.rs b/crates/openhuman-core/src/skills/run_log.rsindex 9012e3032e..3c18c1691e 100644--- a/crates/openhuman-core/src/skills/run_log.rs+++ b/crates/openhuman-core/src/skills/run_log.rs@@ -138,26 +138,9 @@ pub async fn write_header(inputs: &Value,task_prompt: &str,) -> std::io::Result<()> {- write_header_with_profile(path, workflow_id, run_id, inputs, task_prompt, None).await-}--/// Write a run header attributed to the active profile. Profile-less callers-/// retain the legacy header format through [`write_header`].-pub async fn write_header_with_profile(- path: &Path,- workflow_id: &str,- run_id: &str,- inputs: &Value,- task_prompt: &str,- profile_id: Option<&str>,-) -> std::io::Result<()> {- let profile_line = profile_id- .map(|id| format!("profile_id: {id}\n"))- .unwrap_or_default();let header = format!("==== workflow_run: {skill} ====\n\run_id : {run}\n\- {profile_line}\started: {start} UTC\n\inputs : {inputs}\n\n\--- task prompt ---\n{prompt}\n\n\@@ -307,9 +290,6 @@ pub fn detect_repeated_line(pub struct ScannedRun {pub run_id: String,pub workflow_id: String,- /// Profile that launched the run. `None` denotes a legacy/profile-less run.- #[serde(skip_serializing_if = "Option::is_none")]- pub profile_id: Option<String>,/// Header `started:` timestamp (RFC3339); empty if header was malformed.pub started: String,/// `"DONE"` / `"DEGENERATE"` / `"FAILED"` / `"RUNNING"` (running ⇔ no footer yet).@@ -349,7 +329,6 @@ pub fn scan_runs(workspace: &Path, workflow_id: Option<&str>, limit: usize) -> Vlet mut sid = String::new();let mut rid = String::new();let mut started = String::new();- let mut profile_id: Option<String> = None;let mut status = String::from("RUNNING");let mut duration_ms: Option<u64> = None;let mut finished: Option<String> = None;@@ -383,7 +362,6 @@ pub fn scan_runs(workspace: &Path, workflow_id: Option<&str>, limit: usize) -> Vmatch (label, seen_result) {// Header fields (before --- result ---)("run_id", false) => rid = value.to_string(),- ("profile_id", false) => profile_id = Some(value.to_string()),("started", false) => started = value.to_string(),// Footer fields (after --- result ---)("status", true) => status = value.to_string(),@@ -412,7 +390,6 @@ pub fn scan_runs(workspace: &Path, workflow_id: Option<&str>, limit: usize) -> Vruns.push(ScannedRun {run_id: rid,workflow_id: sid,- profile_id,started,status,duration_ms,diff --git a/crates/openhuman-core/src/skills/runtime/README.md b/crates/openhuman-core/src/skills/runtime/README.mdindex 8941ad34c2..23692621db 100644--- a/crates/openhuman-core/src/skills/runtime/README.md+++ b/crates/openhuman-core/src/skills/runtime/README.md@@ -13,7 +13,7 @@ Responsibilities:- Define the built-in `skill_executor` delegate agent.A run is an `orchestrator` `Agent` built per run-(`Agent::from_config_for_agent_with_profile(&config, "orchestrator", ..)`),+(`Agent::from_config_for_agent(&config, "orchestrator")`),given the skill body as its task prompt, capped at`WORKFLOW_RUN_MAX_ITERATIONS`, and raced against the cancellation tokenregistered in `run_log`. Progress events drain to the run log; the footer@@ -40,7 +40,7 @@ It reuses, rather than duplicates:| --- | --- || `mod.rs` | Facade: gates the real modules behind the `skills` feature, re-exports the run machinery and controller aggregators, or pulls in `stub` || `ops.rs` | `RuntimeRequirement` (`all` / `node` / `python`) and `resolve_runtimes` returning `ResolveRuntimesOutcome` |-| `run_machinery.rs` | `spawn_workflow_run_background[_with_profile]`, `WorkflowRunStarted`, `await_run_outcome` |+| `run_machinery.rs` | `spawn_workflow_run_background`, `WorkflowRunStarted`, `await_run_outcome` || `schemas.rs` | `skill_runtime` controllers: `run`, `cancel`, `recent_runs`, `read_run_log`, `resolve_runtimes`, `schemas` || `tools.rs` | `SkillRuntimeResolveRuntimesTool` (`skill_runtime_resolve_runtimes`), re-exported through `tools/mod.rs` under the `skills` gate || `stub.rs` | Disabled-feature facade: only the two controller aggregators, both returning empty vectors |diff --git a/crates/openhuman-core/src/skills/search.rs b/crates/openhuman-core/src/skills/search.rsindex a6aa3263a5..78dfcf5a4f 100644--- a/crates/openhuman-core/src/skills/search.rs+++ b/crates/openhuman-core/src/skills/search.rs@@ -26,8 +26,7 @@//!//! Ranking is [`crate::util::bm25`], which names nothing from this//! crate. The host-owned half is everything else in this file: which roots are-//! scanned, whether the workspace is trusted, which profile's private skills-//! are in scope, and the per-profile allowlist. That is the split to preserve+//! scanned and whether the workspace is trusted. That is the split to preserve//! if this ever becomes a loadable module — a module can rank, but it cannot be//! the thing that decides whose skills a caller may see.@@ -37,9 +36,8 @@ use std::sync::Arc;use async_trait::async_trait;use serde_json::{json, Value};-use super::ops_discover::{discover_workflows_with_profile, is_workspace_trusted};-use super::ops_types::{Workflow, WorkflowScope};-use super::tools::{skill_allowed, SkillAllowlist};+use super::ops_discover::{discover_workflows, is_workspace_trusted};+use super::ops_types::Workflow;use crate::config::Config;use crate::util::bm25::Bm25Index;use tinytools::{Tool, ToolResult};@@ -120,8 +118,6 @@ fn project(workflow: &Workflow) -> Value {/// Search installed skills by capability.pub struct SkillSearchTool {workspace_dir: PathBuf,- skill_allowlist: SkillAllowlist,- profile_skills_root: Option<PathBuf>,/// Kept whole so saved Flows automations can be listed alongside SKILL.md/// bundles. Search has to see the same catalogue the prompt renders, or/// "find me the thing that does X" answers from half the library.@@ -132,55 +128,22 @@ impl SkillSearchTool {pub fn new(config: Arc<Config>) -> Self {Self {workspace_dir: config.workspace_dir.clone(),- skill_allowlist: None,- profile_skills_root: None,config,}}- /// Scope results to a per-profile allowlist of `dir_name` slugs.- pub fn with_skill_allowlist(mut self, allowlist: SkillAllowlist) -> Self {- self.skill_allowlist = allowlist;- self- }-- /// Include the active profile's private skills.- pub fn with_profile_skills_root(mut self, root: Option<PathBuf>) -> Self {- self.profile_skills_root = root;- self- }-/// The visible corpus for this caller.///- /// Identical filtering to `list_workflows` — deliberately, and this is the- /// part that must not drift: a search that saw one skill more than the list- /// would be a way to discover a skill the profile was scoped away from.+ /// Uses the same discovery roots as `list_workflows`.fn visible(&self) -> Vec<Workflow> {let trusted = is_workspace_trusted(&self.workspace_dir);- let mut workflows = discover_workflows_with_profile(+ let mut workflows = discover_workflows(crate::skills::ops_discover::discovery_home_dir().as_deref(),Some(&self.workspace_dir),- self.profile_skills_root.as_deref(),trusted,);- if self.skill_allowlist.is_some() {- workflows.retain(|w| {- // Builtin and profile-local scopes bypass the allowlist — see- // `tools::is_builtin_skill`. Search must apply exactly the- // filter `list_workflows` applies; a search that saw one skill- // more than the list would be a way around the scoping.- w.scope == WorkflowScope::Builtin- || w.scope == WorkflowScope::Profile- || skill_allowed(&self.skill_allowlist, &w.dir_name)- });- }// Saved Flows automations, appended AFTER the allowlist filter.//- // A profile's skill allowlist is a list of `dir_name` slugs for- // SKILL.md bundles; it has no opinion about flow ids, so running flows- // through it would filter every one of them out on any profile that- // sets an allowlist — silently, and looking exactly like "you have no- // automations". Flow visibility is the flow store's business.#[cfg(feature = "flows")]workflows.extend(crate::flows::catalogue::flow_entries(&self.config));workflowsdiff --git a/crates/openhuman-core/src/skills/stub.rs b/crates/openhuman-core/src/skills/stub.rsindex 8798574256..bdfd178767 100644--- a/crates/openhuman-core/src/skills/stub.rs+++ b/crates/openhuman-core/src/skills/stub.rs@@ -44,18 +44,6 @@ pub fn load_workflow_metadata(_workspace_dir: &Path) -> Vec<Workflow> {Vec::new()}-/// Always empty: with skills compiled out there is nothing to discover, whether-/// or not a profile-local root is supplied. Mirrors-/// [`super::ops_discover::load_workflow_metadata_for_profile`] so the harness's-/// per-profile catalog call site needs no `#[cfg]`.-pub fn load_workflow_metadata_for_profile(- _workspace_dir: &Path,- _profile_skills_root: Option<&Path>,-) -> Vec<Workflow> {- log::debug!("[skills-stub] load_workflow_metadata_for_profile -> [] (skills disabled)");- Vec::new()-}-/// No-op: with skills compiled out nothing can discover a bundled skill, so/// writing one into the workspace would only leave files nothing reads.///diff --git a/crates/openhuman-core/src/skills/tools.rs b/crates/openhuman-core/src/skills/tools.rsindex e5fea24b20..8b39e2817f 100644--- a/crates/openhuman-core/src/skills/tools.rs+++ b/crates/openhuman-core/src/skills/tools.rs@@ -35,7 +35,6 @@ mod read;mod uninstall;mod write;-pub(super) use helpers::{skill_allowed, SkillAllowlist};pub use read::{WorkflowDescribeTool, WorkflowListTool, WorkflowReadResourceTool, WorkflowReadRunLogTool,WorkflowRecentRunsTool,diff --git a/crates/openhuman-core/src/skills/tools/helpers.rs b/crates/openhuman-core/src/skills/tools/helpers.rsindex d575ba1c77..53ce27a52e 100644--- a/crates/openhuman-core/src/skills/tools/helpers.rs+++ b/crates/openhuman-core/src/skills/tools/helpers.rs@@ -1,8 +1,6 @@//! Shared argument-parsing and skill-allowlist helpers for the workflow tools//! in [`super::read`] and [`super::write`].-use std::path::Path;-pub(in crate::skills) fn read_required_str(args: &serde_json::Value,key: &str,@@ -22,49 +20,3 @@ pub(in crate::skills) fn read_workflow_id(args: &serde_json::Value) -> anyhow::R.or_else(|_| read_required_str(args, "skill_id")).map_err(|_| anyhow::anyhow!("missing required string argument `workflow_id`"))}--/// Skill/workflow allowlist applied per agent profile. `None` = all skills are-/// visible (the default). `Some(set)` restricts to the named `dir_name` slugs.-pub(in crate::skills) type SkillAllowlist = Option<std::collections::HashSet<String>>;--/// Whether `dir_name` passes the optional per-profile skill allowlist.-pub(in crate::skills) fn skill_allowed(allowlist: &SkillAllowlist, dir_name: &str) -> bool {- match allowlist {- None => true,- Some(set) => set.contains(dir_name),- }-}--/// Whether `skill_id` names a skill compiled into this binary.-///-/// Builtin bundles are exempt from the per-profile allowlist for the same-/// reason profile-local ones are: the allowlist scopes **user content**, and-/// these are neither the user's nor scoped — they come from a `const` table in-/// this build and one of them (`flow-authoring`) is the reference manual an-/// agent's own system prompt points it at. A profile that narrowed its skills-/// would otherwise leave that agent pointing at a page it is refused.-///-/// This widens nothing a user chose: no RPC and no config can add a row to that-/// table (see `skills::bundled`), so the exempt set is fixed at compile time.-pub(in crate::skills) fn is_builtin_skill(skill_id: &str) -> bool {- super::super::bundled::BUNDLED- .iter()- .any(|s| s.dir_name == skill_id)-}--/// Whether `skill_id` is usable given the profile's allowlist AND its private-/// skills. A profile's own (profile-local) skills are implicitly allowed for-/// their owner — they bypass the `allowed_skills` allowlist, mirroring-/// `list_workflows`. `profile_local_ids` is empty for the profile-less session-/// and other profiles, so this reduces to [`skill_allowed`] there.-pub(in crate::skills) fn skill_allowed_including_profile(- allowlist: &SkillAllowlist,- profile_local_ids: &std::collections::HashSet<String>,- _workspace_dir: &Path,- _profile_skills_root: Option<&Path>,- skill_id: &str,-) -> bool {- is_builtin_skill(skill_id)- || profile_local_ids.contains(skill_id)- || skill_allowed(allowlist, skill_id)-}diff --git a/crates/openhuman-core/src/skills/tools/read.rs b/crates/openhuman-core/src/skills/tools/read.rsindex 818401e9a6..e715d8390e 100644--- a/crates/openhuman-core/src/skills/tools/read.rs+++ b/crates/openhuman-core/src/skills/tools/read.rs@@ -11,25 +11,15 @@ use crate::config::Config;use tinytools::{Tool, ToolResult};use super::super::ops_discover::{- discover_workflows_with_profile, is_workspace_trusted, profile_local_skill_ids,- read_workflow_resource_with_profile,+ discover_workflows, is_workspace_trusted, read_workflow_resource,};-use super::super::ops_types::WorkflowScope;-use super::super::registry::get_workflow_with_profile;+use super::super::registry::get_workflow;use super::super::run_log::{read_run_log_slice, scan_runs};-use super::helpers::{- read_required_str, read_workflow_id, skill_allowed, skill_allowed_including_profile,- SkillAllowlist,-};+use super::helpers::{read_required_str, read_workflow_id};/// List installed skills.pub struct WorkflowListTool {workspace_dir: PathBuf,- skill_allowlist: SkillAllowlist,- /// 2a — the active profile's private skills root- /// (`<workspace>/personalities/<id>/skills/`). `None` for the profile-less- /// session and other profiles, so the listed set is byte-identical to today.- profile_skills_root: Option<PathBuf>,/// User-scope root to scan, when it must not be the real `$HOME`.////// `None` — production — resolves `dirs::home_dir()` at call time, exactly@@ -41,8 +31,6 @@ impl WorkflowListTool {pub fn new(config: Arc<Config>) -> Self {Self {workspace_dir: config.workspace_dir.clone(),- skill_allowlist: None,- profile_skills_root: None,home_dir: None,}}@@ -50,8 +38,8 @@ impl WorkflowListTool {/// Scan `home` as the user scope instead of `dirs::home_dir()`.////// Every other layer of discovery already takes the home directory as a- /// parameter — `discover_workflows_inner`, `discover_workflows_with_profile`- /// and `install_workflow_from_url_with_home` all do — and this tool was the+ /// parameter — `discover_workflows_inner` and+ /// `install_workflow_from_url_with_home` both do — and this tool was the/// one place that resolved it internally, which made it the one place a test/// could not isolate.///@@ -68,22 +56,6 @@ impl WorkflowListTool {self.home_dir = home;self}-- /// Scope the listed workflows to a per-profile allowlist of `dir_name`- /// slugs. `None` leaves all workflows visible.- pub fn with_skill_allowlist(mut self, allowlist: SkillAllowlist) -> Self {- self.skill_allowlist = allowlist;- self- }-- /// Surface the active profile's private skills- /// (`<workspace>/personalities/<id>/skills/`) in this list. Profile-local- /// skills are implicitly allowed for their owner (they bypass the- /// `skill_allowlist`) and win same-name collisions against global skills.- pub fn with_profile_skills_root(mut self, root: Option<PathBuf>) -> Self {- self.profile_skills_root = root;- self- }}#[async_trait]@@ -110,27 +82,7 @@ impl Tool for WorkflowListTool {.clone().or_else(crate::skills::ops_discover::discovery_home_dir);let trusted = is_workspace_trusted(&self.workspace_dir);- let mut workflows = discover_workflows_with_profile(- home.as_deref(),- Some(&self.workspace_dir),- self.profile_skills_root.as_deref(),- trusted,- );- if self.skill_allowlist.is_some() {- let before = workflows.len();- // Profile-local skills are implicitly allowed for their owner — they- // bypass the `allowed_skills` allowlist (which scopes only global- // skills). Keep any skill whose scope is `Profile`.- workflows.retain(|w| {- w.scope == WorkflowScope::Builtin- || w.scope == WorkflowScope::Profile- || skill_allowed(&self.skill_allowlist, &w.dir_name)- });- log::debug!(- "[profiles] list_workflows scoped to profile allowlist: before={before} after={}",- workflows.len()- );- }+ let workflows = discover_workflows(home.as_deref(), Some(&self.workspace_dir), trusted);Ok(ToolResult::success(serde_json::to_string(&json!({"count": workflows.len(),"workflows": workflows,@@ -145,32 +97,14 @@ impl Tool for WorkflowListTool {/// Describe one skill (definition + declared inputs).pub struct WorkflowDescribeTool {workspace_dir: PathBuf,- skill_allowlist: SkillAllowlist,- /// Active profile's private skills root — resolves + implicitly allows the- /// owner's profile-local skills. `None` = byte-identical to today.- profile_skills_root: Option<PathBuf>,}impl WorkflowDescribeTool {pub fn new(config: Arc<Config>) -> Self {Self {workspace_dir: config.workspace_dir.clone(),- skill_allowlist: None,- profile_skills_root: None,}}-- /// Scope describe access to a per-profile allowlist of `dir_name` slugs.- pub fn with_skill_allowlist(mut self, allowlist: SkillAllowlist) -> Self {- self.skill_allowlist = allowlist;- self- }-- /// Resolve (and implicitly allow) the active profile's private skills.- pub fn with_profile_skills_root(mut self, root: Option<PathBuf>) -> Self {- self.profile_skills_root = root;- self- }}#[async_trait]@@ -197,25 +131,8 @@ impl Tool for WorkflowDescribeTool {async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {log::debug!("[tool][workflows] describe invoked");let skill_id = read_workflow_id(&args)?;- let profile_local = profile_local_skill_ids(self.profile_skills_root.as_deref());- if !skill_allowed_including_profile(- &self.skill_allowlist,- &profile_local,- &self.workspace_dir,- self.profile_skills_root.as_deref(),- &skill_id,- ) {- log::debug!("[profiles] describe_workflow blocked by profile allowlist: {skill_id}");- return Ok(ToolResult::error(format!(- "describe_workflow: workflow `{skill_id}` is not available to the active agent profile"- )));- }- let def = get_workflow_with_profile(- &self.workspace_dir,- &skill_id,- self.profile_skills_root.as_deref(),- )- .ok_or_else(|| anyhow::anyhow!("describe_workflow: workflow `{skill_id}` not found"))?;+ let def = get_workflow(&self.workspace_dir, &skill_id)+ .ok_or_else(|| anyhow::anyhow!("describe_workflow: workflow `{skill_id}` not found"))?;Ok(ToolResult::success(serde_json::to_string(&json!({"definition": def.definition,"inputs": def.inputs,@@ -231,34 +148,14 @@ impl Tool for WorkflowDescribeTool {/// Read a bundled resource file from a skill.pub struct WorkflowReadResourceTool {workspace_dir: PathBuf,- skill_allowlist: SkillAllowlist,- /// Active profile's private skills root — resolves + implicitly allows the- /// owner's profile-local skills. `None` = byte-identical to today.- profile_skills_root: Option<PathBuf>,}impl WorkflowReadResourceTool {pub fn new(config: Arc<Config>) -> Self {Self {workspace_dir: config.workspace_dir.clone(),- skill_allowlist: None,- profile_skills_root: None,}}-- /// Scope resource reads to a per-profile allowlist of `dir_name` slugs, so a- /// restricted profile can't exfiltrate the bundled scripts/docs of a- /// workflow outside its skill set.- pub fn with_skill_allowlist(mut self, allowlist: SkillAllowlist) -> Self {- self.skill_allowlist = allowlist;- self- }-- /// Resolve (and implicitly allow) the active profile's private skills.- pub fn with_profile_skills_root(mut self, root: Option<PathBuf>) -> Self {- self.profile_skills_root = root;- self- }}#[async_trait]@@ -288,29 +185,10 @@ impl Tool for WorkflowReadResourceTool {async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {log::debug!("[tool][workflows] read_resource invoked");let skill_id = read_workflow_id(&args)?;- let profile_local = profile_local_skill_ids(self.profile_skills_root.as_deref());- if !skill_allowed_including_profile(- &self.skill_allowlist,- &profile_local,- &self.workspace_dir,- self.profile_skills_root.as_deref(),- &skill_id,- ) {- log::debug!(- "[profiles] read_workflow_resource blocked by profile allowlist: {skill_id}"- );- return Ok(ToolResult::error(format!(- "read_workflow_resource: workflow `{skill_id}` is not available to the active agent profile"- )));- }let relative_path = read_required_str(&args, "relative_path")?;- let content = read_workflow_resource_with_profile(- &self.workspace_dir,- &skill_id,- Path::new(&relative_path),- self.profile_skills_root.as_deref(),- )- .map_err(|e| anyhow::anyhow!("read_workflow_resource: {e}"))?;+ let content =+ read_workflow_resource(&self.workspace_dir, &skill_id, Path::new(&relative_path))+ .map_err(|e| anyhow::anyhow!("read_workflow_resource: {e}"))?;Ok(ToolResult::success(serde_json::to_string(&json!({"workflow_id": skill_id,"relative_path": relative_path,diff --git a/crates/openhuman-core/src/skills/tools_tests.rs b/crates/openhuman-core/src/skills/tools_tests.rsindex 23209a6475..b5c4ed44fd 100644--- a/crates/openhuman-core/src/skills/tools_tests.rs+++ b/crates/openhuman-core/src/skills/tools_tests.rs@@ -5,39 +5,6 @@ fn cfg() -> Arc<Config> {Arc::new(Config::default())}-#[test]-fn skill_allowed_respects_optional_allowlist() {- // None = all skills visible.- assert!(skill_allowed(&None, "deep-research"));- // Some(set) restricts to named dir_name slugs.- let set: std::collections::HashSet<String> =- ["deep-research".to_string()].into_iter().collect();- assert!(skill_allowed(&Some(set.clone()), "deep-research"));- assert!(!skill_allowed(&Some(set), "ship-and-babysit"));- // Empty allowlist blocks everything (profile selected no skills).- assert!(!skill_allowed(- &Some(std::collections::HashSet::new()),- "anything"- ));-}--#[tokio::test]-async fn describe_workflow_blocks_disallowed_skill_before_lookup() {- let allow: std::collections::HashSet<String> =- ["allowed-skill".to_string()].into_iter().collect();- let tool = WorkflowDescribeTool::new(cfg()).with_skill_allowlist(Some(allow));- let res = tool- .execute(json!({ "workflow_id": "blocked-skill" }))- .await- .expect("execute");- assert!(res.is_error, "disallowed skill must return an error result");- let text = serde_json::to_string(&res.content).expect("serialize content");- assert!(- text.contains("not available to the active agent profile"),- "expected profile-allowlist rejection, got: {text}"- );-}-#[test]fn names_and_levels() {let c = cfg();diff --git a/crates/openhuman-core/src/tools/impl/system/mod.rs b/crates/openhuman-core/src/tools/impl/system/mod.rsindex c98485c2c5..1391251dd1 100644--- a/crates/openhuman-core/src/tools/impl/system/mod.rs+++ b/crates/openhuman-core/src/tools/impl/system/mod.rs@@ -65,8 +65,7 @@ pub use workspace_state::WorkspaceStateTool;/// process-global is mutated and concurrent turns cannot race each other. It/// cannot widen the hard invariants either — `is_always_forbidden` and/// `is_workspace_internal_path` are both evaluated *before* any trusted-root-/// shortcut. Cross-profile command scanning-/// ([`check_cross_profile_command`]) is unaffected and still applies.+/// shortcut.////// The root always originates from trusted in-process code (the session/// builder, the sub-agent runner, or the `cwd` RPC parameter) — never from@@ -92,17 +91,3 @@ pub(super) fn security_for_tool_context(}scoped}--/// Apply the dedicated-workspace profile boundary to an arbitrary process-/// command before it is spawned. Process tools do not funnel their runtime file-/// writes through `SecurityPolicy::validate_path`, so shell, Node, and npm must-/// all share this defense-in-depth scan.-pub(super) fn check_cross_profile_command(- security: &SecurityPolicy,- command: &str,- cwd: &Path,- tool: &str,-) -> Result<(), String> {- let _ = (security, command, cwd, tool);- Ok(())-}diff --git a/crates/openhuman-core/src/tools/impl/system/node_exec.rs b/crates/openhuman-core/src/tools/impl/system/node_exec.rsindex 5fe35a1e77..9570b36ff6 100644--- a/crates/openhuman-core/src/tools/impl/system/node_exec.rs+++ b/crates/openhuman-core/src/tools/impl/system/node_exec.rs@@ -211,20 +211,6 @@ impl NodeExecTool {));}let path_policy = super::security_for_tool_context(&self.security, context, "node_exec");- let guard_command = inline_code.clone().unwrap_or_else(|| {- std::iter::once(script_path.as_deref().unwrap_or_default())- .chain(extra_args.iter().map(String::as_str))- .collect::<Vec<_>>()- .join(" ")- });- if let Err(reason) = super::check_cross_profile_command(- &path_policy,- &guard_command,- &path_policy.action_dir,- "node_exec",- ) {- return Ok(ToolResult::error(reason));- }if self.security.is_rate_limited() {return Ok(ToolResult::error("Rate limit exceeded: too many actions in the last hour",diff --git a/crates/openhuman-core/src/tools/impl/system/node_exec_tests.rs b/crates/openhuman-core/src/tools/impl/system/node_exec_tests.rsindex c14dee3319..70a7a6dc69 100644--- a/crates/openhuman-core/src/tools/impl/system/node_exec_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/node_exec_tests.rs@@ -150,47 +150,3 @@ fn resolve_script_path_targets_action_dir_not_workspace_dir() {resolved.display());}--#[tokio::test]-async fn inline_code_cannot_write_to_sibling_profile() {- use crate::agent::host_runtime::NativeRuntime;- use crate::security::policy::ActiveProfileGuard;- use crate::security::AutonomyLevel;-- let temp = tempfile::tempdir().unwrap();- let action_root = temp.path().join("actions");- let alice = action_root.join("profiles/alice");- std::fs::create_dir_all(action_root.join("profiles/bob")).unwrap();- std::fs::create_dir_all(&alice).unwrap();- let security = Arc::new(SecurityPolicy {- autonomy: AutonomyLevel::Full,- workspace_dir: temp.path().join("state"),- action_dir: alice,- workspace_only: false,- active_profile: Some(ActiveProfileGuard {- profile_id: "alice".into(),- action_dir: action_root,- }),- ..SecurityPolicy::default()- });- let bootstrap = Arc::new(NodeBootstrap::new(Arc::new(- crate::config::Config::default(),- )));- let tool = NodeExecTool::new(- security,- Arc::new(NativeRuntime::new()),- bootstrap,- crate::config::RuntimePoolConfig::default(),- temp.path().join("state"),- );-- let result = tool- .execute(json!({- "inline_code": "require('fs').writeFileSync('../bob/loot.txt', 'x')"- }))- .await- .unwrap();-- assert!(result.is_error);- assert!(result.text().contains("Cross-profile access blocked"));-}diff --git a/crates/openhuman-core/src/tools/impl/system/npm_exec.rs b/crates/openhuman-core/src/tools/impl/system/npm_exec.rsindex d72629549b..3173559a6f 100644--- a/crates/openhuman-core/src/tools/impl/system/npm_exec.rs+++ b/crates/openhuman-core/src/tools/impl/system/npm_exec.rs@@ -232,15 +232,6 @@ impl NpmExecTool {Ok(p) => p,Err(msg) => return Ok(ToolResult::error(msg)),};- let guard_command = std::iter::once(subcommand.as_str())- .chain(extra_args.iter().map(String::as_str))- .collect::<Vec<_>>()- .join(" ");- if let Err(reason) =- super::check_cross_profile_command(&path_policy, &guard_command, &cwd, "npm_exec")- {- return Ok(ToolResult::error(reason));- }if self.security.is_rate_limited() {return Ok(ToolResult::error("Rate limit exceeded: too many actions in the last hour",diff --git a/crates/openhuman-core/src/tools/impl/system/npm_exec_tests.rs b/crates/openhuman-core/src/tools/impl/system/npm_exec_tests.rsindex ae345ca109..70ab83a698 100644--- a/crates/openhuman-core/src/tools/impl/system/npm_exec_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/npm_exec_tests.rs@@ -82,86 +82,3 @@ fn safe_env_vars_include_windows_process_essentials() {);}}--#[tokio::test]-async fn args_cannot_target_sibling_profile() {- use crate::agent::host_runtime::NativeRuntime;- use crate::security::policy::ActiveProfileGuard;- use crate::security::AutonomyLevel;-- let temp = tempfile::tempdir().unwrap();- let action_root = temp.path().join("actions");- let alice = action_root.join("profiles/alice");- std::fs::create_dir_all(action_root.join("profiles/bob")).unwrap();- std::fs::create_dir_all(&alice).unwrap();- let security = Arc::new(SecurityPolicy {- autonomy: AutonomyLevel::Full,- workspace_dir: temp.path().join("state"),- action_dir: alice,- workspace_only: false,- active_profile: Some(ActiveProfileGuard {- profile_id: "alice".into(),- action_dir: action_root,- }),- ..SecurityPolicy::default()- });- let bootstrap = Arc::new(NodeBootstrap::new(Arc::new(- crate::config::Config::default(),- )));- let tool = NpmExecTool::new(security, Arc::new(NativeRuntime::new()), bootstrap);-- let result = tool- .execute(json!({- "subcommand": "install",- "args": ["--prefix", "../bob"]- }))- .await- .unwrap();-- assert!(result.is_error);- assert!(result.text().contains("Cross-profile access blocked"));-}--#[cfg(unix)]-#[tokio::test]-async fn symlinked_cwd_cannot_target_sibling_profile() {- use crate::agent::host_runtime::NativeRuntime;- use crate::security::policy::ActiveProfileGuard;- use crate::security::AutonomyLevel;- use std::os::unix::fs::symlink;-- let temp = tempfile::tempdir().unwrap();- let action_root = temp.path().join("actions");- let alice = action_root.join("profiles/alice");- let bob = action_root.join("profiles/bob");- std::fs::create_dir_all(&bob).unwrap();- std::fs::create_dir_all(&alice).unwrap();- symlink(&bob, alice.join("link")).unwrap();- let security = Arc::new(SecurityPolicy {- autonomy: AutonomyLevel::Full,- workspace_dir: temp.path().join("state"),- action_dir: alice,- workspace_only: false,- active_profile: Some(ActiveProfileGuard {- profile_id: "alice".into(),- action_dir: action_root,- }),- ..SecurityPolicy::default()- });- let bootstrap = Arc::new(NodeBootstrap::new(Arc::new(- crate::config::Config::default(),- )));- let tool = NpmExecTool::new(security, Arc::new(NativeRuntime::new()), bootstrap);-- let result = tool- .execute(json!({- "subcommand": "run",- "args": ["build"],- "cwd": "link"- }))- .await- .unwrap();-- assert!(result.is_error);- assert!(result.text().contains("Cross-profile access blocked"));-}diff --git a/crates/openhuman-core/src/tools/impl/system/shell.rs b/crates/openhuman-core/src/tools/impl/system/shell.rsindex 7eb0c33a75..0baeca121c 100644--- a/crates/openhuman-core/src/tools/impl/system/shell.rs+++ b/crates/openhuman-core/src/tools/impl/system/shell.rs@@ -341,19 +341,7 @@ impl ShellTool {return (false, ToolResult::error(reason));}- // Cross-profile write guard (1b), shell call site. File tools enforce- // the same boundary per-path in `SecurityPolicy::validate_path`; shell- // commands never funnel through that, so scan the command's path-shaped- // tokens against the profile's own workspace (its cwd). No-op unless the- // session runs under a dedicated-workspace profile. See- // `profiles::guard::scan_command_for_cross_profile` for the containment- // rationale (the cwd is already rooted at the profile's own dir).let cwd = self.effective_action_dir_for_context(context);- if let Err(reason) =- super::check_cross_profile_command(self.security.as_ref(), command, &cwd, "shell")- {- return (false, ToolResult::error(reason));- }if self.security.is_rate_limited() {return (diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.mdindex c068be4e69..e35b126356 100644--- a/docs/TEST-COVERAGE-MATRIX.md+++ b/docs/TEST-COVERAGE-MATRIX.md@@ -619,13 +619,6 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an| 14.1.6 | Bounded live core-log buffer | RU | `crates/openhuman-core/src/core/logging.rs` | ✅ | Preserves ordering; bounds both line count and individual line length || 14.1.7 | Interactive terminal session (raw mode, streaming) | MS | manual PTY smoke; `docs/RELEASE-MANUAL-SMOKE.md` | 🚫 | Requires a real PTY to verify steering/queue input, overlays, and terminal restoration |-## 15. Agent Profile Homes (multi-agent profiles)--### 15.1 Profile Homes & Isolation--| ID | Feature | Layer | Test path(s) | Status | Notes |-| ------ | -------------------------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------- |-## 16. Embedded Library Harness (`openhuman_embed::Harness`)### 16.1 One-call agent turns for a host processdiff --git a/tests/raw_coverage/agent_orchestration_e2e.rs b/tests/raw_coverage/agent_orchestration_e2e.rsindex 4f1955178c..e9e489b41b 100644--- a/tests/raw_coverage/agent_orchestration_e2e.rs+++ b/tests/raw_coverage/agent_orchestration_e2e.rs@@ -1181,19 +1181,5 @@ async fn agent_experience_controllers_reject_malformed_params() {"dismiss names its required id: {no_id}");- // An unknown profile partition is an error, not an empty result — a typo- // must not read as "this profile has no experiences".- let unknown_profile = h- .err(- 3805,- "openhuman.agent_experience_list",- json!({ "profile_id": "profile-does-not-exist" }),- )- .await;- assert!(- unknown_profile.contains("profile-does-not-exist"),- "an unknown profile is named rather than silently empty: {unknown_profile}"- );-h.join.abort();}