feat(cross-project): découverte et contact inter-projets — tools MCP idea_project_{list,read_context,list_agents,ask_agent,cancel_agent}, permission contactable par agent + default_contactable persistée dans les templates, routage orchestrator par projectId+agentId — #260 (tests ciblés verts, QA en attente)

This commit is contained in:
2026-09-07 16:31:14 +02:00
parent d7b24ad183
commit 98954986a7
18 changed files with 721 additions and 15 deletions

View File

@ -282,6 +282,7 @@ async fn create_template_starts_at_initial_version() {
default_mcp_tool_policy: Some(McpToolPolicy {
allowed_tools: vec!["idea_template_read".to_owned()],
}),
default_contactable: true,
})
.await
.unwrap();
@ -341,6 +342,7 @@ async fn update_template_bumps_version_and_publishes_event() {
default_agent_name: None,
default_system_permissions: None,
default_mcp_tool_policy: None,
default_contactable: None,
})
.await
.unwrap();
@ -370,6 +372,7 @@ async fn update_unknown_template_is_not_found() {
default_agent_name: None,
default_system_permissions: None,
default_mcp_tool_policy: None,
default_contactable: None,
})
.await
.unwrap_err();
@ -393,6 +396,7 @@ async fn update_template_updates_default_profile_for_future_agents() {
default_mcp_tool_policy: Some(Some(McpToolPolicy {
allowed_tools: vec!["idea_template_read".to_owned()],
})),
default_contactable: Some(true),
})
.await
.unwrap()
@ -411,6 +415,7 @@ async fn update_template_updates_default_profile_for_future_agents() {
allowed_tools: vec!["idea_template_read".to_owned()]
})
);
assert!(updated.default_contactable);
let contexts = FakeContexts::new(vec![]);
let out = CreateAgentFromTemplate::new(
@ -427,6 +432,7 @@ async fn update_template_updates_default_profile_for_future_agents() {
})
.await
.unwrap();
assert!(out.agent.contactable);
assert_eq!(out.agent.name, "Agent Name");
assert_eq!(out.agent.profile_id, pid(42));
@ -486,6 +492,7 @@ async fn create_agent_from_template_projects_template_permission_overrides() {
Some(McpToolPolicy {
allowed_tools: vec!["idea_template_read".to_owned()],
}),
true,
)
.unwrap();
let store = FakeTemplates::with(vec![template]);
@ -512,6 +519,7 @@ async fn create_agent_from_template_projects_template_permission_overrides() {
assert_eq!(out.agent.name, "Backend");
assert_eq!(out.agent.profile_id, pid(7));
assert!(out.agent.contactable);
assert_eq!(
system_permissions.0.lock().unwrap().agents,
vec![AgentSystemPermissionOverride::new(