diff --git a/crates/application/tests/orchestrator_service.rs b/crates/application/tests/orchestrator_service.rs index d3aa309..d0bc0d4 100644 --- a/crates/application/tests/orchestrator_service.rs +++ b/crates/application/tests/orchestrator_service.rs @@ -22,11 +22,13 @@ use domain::markdown::MarkdownDoc; use domain::ports::{ AgentContextStore, AgentRuntime, ContextInjectionPlan, DirEntry, EventBus, EventStream, ExitStatus, FileSystem, FsError, IdGenerator, OutputStream, PreparedContext, ProfileStore, - PtyError, PtyHandle, PtyPort, RemotePath, RuntimeError, SpawnSpec, StoreError, + PtyError, PtyHandle, PtyPort, RemotePath, RuntimeError, SkillStore, SpawnSpec, StoreError, }; +use domain::ids::SkillId; use domain::profile::{AgentProfile, ContextInjection}; use domain::project::{Project, ProjectPath}; use domain::remote::RemoteRef; +use domain::skill::{Skill, SkillScope}; use domain::{OrchestratorCommand, OrchestratorRequest, PtySize, SessionId}; use uuid::Uuid; @@ -152,6 +154,35 @@ impl ProfileStore for FakeProfiles { } } +// Empty skill store: the orchestrator tests spawn agents with no assigned skills. +#[derive(Default)] +struct FakeSkills; +#[async_trait] +impl SkillStore for FakeSkills { + async fn list(&self, _scope: SkillScope, _root: &ProjectPath) -> Result, StoreError> { + Ok(Vec::new()) + } + async fn get( + &self, + _scope: SkillScope, + _root: &ProjectPath, + _id: SkillId, + ) -> Result { + Err(StoreError::NotFound) + } + async fn save(&self, _skill: &Skill, _root: &ProjectPath) -> Result<(), StoreError> { + Ok(()) + } + async fn delete( + &self, + _scope: SkillScope, + _root: &ProjectPath, + _id: SkillId, + ) -> Result<(), StoreError> { + Ok(()) + } +} + struct FakeRuntime; impl AgentRuntime for FakeRuntime { fn detect(&self, _profile: &AgentProfile) -> Result { @@ -337,6 +368,7 @@ fn fixture(contexts: FakeContexts) -> Fixture { Arc::new(FakeRuntime), Arc::new(FakeFs), Arc::new(pty.clone()), + Arc::new(FakeSkills), Arc::clone(&sessions), Arc::new(bus.clone()), )); diff --git a/crates/infrastructure/tests/orchestrator_watcher.rs b/crates/infrastructure/tests/orchestrator_watcher.rs index c803b94..5d0e3a9 100644 --- a/crates/infrastructure/tests/orchestrator_watcher.rs +++ b/crates/infrastructure/tests/orchestrator_watcher.rs @@ -21,11 +21,13 @@ use domain::markdown::MarkdownDoc; use domain::ports::{ AgentContextStore, AgentRuntime, ContextInjectionPlan, DirEntry, EventBus, EventStream, ExitStatus, FileSystem, FsError, IdGenerator, OutputStream, PreparedContext, ProfileStore, - PtyError, PtyHandle, PtyPort, RemotePath, RuntimeError, SpawnSpec, StoreError, + PtyError, PtyHandle, PtyPort, RemotePath, RuntimeError, SkillStore, SpawnSpec, StoreError, }; +use domain::ids::SkillId; use domain::profile::{AgentProfile, ContextInjection}; use domain::project::{Project, ProjectPath}; use domain::remote::RemoteRef; +use domain::skill::{Skill, SkillScope}; use domain::{PtySize, SessionId}; use uuid::Uuid; @@ -142,6 +144,35 @@ impl ProfileStore for FakeProfiles { } } +// Empty skill store: the watcher tests spawn agents with no assigned skills. +#[derive(Default)] +struct FakeSkills; +#[async_trait] +impl SkillStore for FakeSkills { + async fn list(&self, _scope: SkillScope, _root: &ProjectPath) -> Result, StoreError> { + Ok(Vec::new()) + } + async fn get( + &self, + _scope: SkillScope, + _root: &ProjectPath, + _id: SkillId, + ) -> Result { + Err(StoreError::NotFound) + } + async fn save(&self, _skill: &Skill, _root: &ProjectPath) -> Result<(), StoreError> { + Ok(()) + } + async fn delete( + &self, + _scope: SkillScope, + _root: &ProjectPath, + _id: SkillId, + ) -> Result<(), StoreError> { + Ok(()) + } +} + struct FakeRuntime; impl AgentRuntime for FakeRuntime { fn detect(&self, _p: &AgentProfile) -> Result { @@ -267,6 +298,7 @@ fn build_service(contexts: FakeContexts) -> Arc { Arc::new(FakeRuntime), Arc::new(FakeFs), Arc::new(FakePty), + Arc::new(FakeSkills), Arc::clone(&sessions), bus.clone(), ));