Ajoute created_by sur IssueIndexEntry/TicketSummaryDto + filtre createdBy (#5), et les use cases BulkUpdateIssueStatus/Priority + BulkDeleteIssues avec les DTO/outils MCP idea_ticket_bulk_* associés (#6). NON VERT : BulkDeleteIssues::execute référence BatchIssueResult::deleted(), constructeur pas encore ajouté à BatchIssueResult (seuls ok/err existent) -> `cargo check` échoue (E0599 dans application::issues::mod). Reste à DevBackend avant toute QA/merge. Branché sur feature/sdk-integration (dépend du commit #2 dans orchestrator/mcp/server.rs et tools.rs) ; à rebaser sur develop une fois feature/sdk-integration mergé. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use domain::{
|
||||
AgentIssueRef, AgentIssueRole, Issue, IssueActor, IssueId, IssueListFilter,
|
||||
AgentId, AgentIssueRef, AgentIssueRole, Issue, IssueActor, IssueId, IssueListFilter,
|
||||
IssueNumberAllocator, IssuePriority, IssueRef, IssueStatus, IssueStore, IssueStoreError,
|
||||
MarkdownDoc, ProjectPath, SprintId,
|
||||
};
|
||||
@ -184,6 +184,60 @@ async fn issue_store_lists_by_index_filters_with_empty_or_and_and_semantics() {
|
||||
assert_eq!(by_status_and_priority[0].title, "Beta");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn issue_store_filters_by_created_by_from_index() {
|
||||
let tmp = TempDir::new();
|
||||
let root = tmp.root();
|
||||
let store = FsIssueStore::new();
|
||||
let agent_id = AgentId::new_random();
|
||||
store
|
||||
.create(&root, &issue(&root, 1, "User ticket"))
|
||||
.await
|
||||
.unwrap();
|
||||
let agent_ticket = Issue::new(
|
||||
IssueId::new_random(),
|
||||
domain::IssueNumber::new(2).unwrap(),
|
||||
"Agent ticket",
|
||||
MarkdownDoc::new("Initial description"),
|
||||
IssueStatus::Open,
|
||||
IssuePriority::High,
|
||||
MarkdownDoc::new("Initial carnet"),
|
||||
Vec::new(),
|
||||
Vec::new(),
|
||||
IssueActor::Agent { agent_id },
|
||||
1_000,
|
||||
)
|
||||
.unwrap();
|
||||
store.create(&root, &agent_ticket).await.unwrap();
|
||||
|
||||
let by_user = store
|
||||
.list(
|
||||
&root,
|
||||
IssueListFilter {
|
||||
created_by: Some(IssueActor::User),
|
||||
..IssueListFilter::default()
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
let by_agent = store
|
||||
.list(
|
||||
&root,
|
||||
IssueListFilter {
|
||||
created_by: Some(IssueActor::Agent { agent_id }),
|
||||
..IssueListFilter::default()
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(by_user.len(), 1);
|
||||
assert_eq!(by_user[0].title, "User ticket");
|
||||
assert_eq!(by_agent.len(), 1);
|
||||
assert_eq!(by_agent[0].title, "Agent ticket");
|
||||
assert_eq!(by_agent[0].created_by, IssueActor::Agent { agent_id });
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn issue_store_text_filter_matches_exact_ref_or_number_without_numeric_substring() {
|
||||
let tmp = TempDir::new();
|
||||
|
||||
@ -749,6 +749,8 @@ async fn tools_list_advertises_the_idea_tools_with_schemas() {
|
||||
"idea_ticket_update",
|
||||
"idea_ticket_update_status",
|
||||
"idea_ticket_update_priority",
|
||||
"idea_ticket_bulk_update_status",
|
||||
"idea_ticket_bulk_update_priority",
|
||||
"idea_ticket_read_carnet",
|
||||
"idea_ticket_update_carnet",
|
||||
"idea_ticket_link",
|
||||
@ -767,11 +769,11 @@ async fn tools_list_advertises_the_idea_tools_with_schemas() {
|
||||
);
|
||||
}
|
||||
assert!(!names.contains(&"idea_reply"));
|
||||
assert_eq!(
|
||||
tools.len(),
|
||||
31,
|
||||
"exactly the thirty-one exposed idea_* tools; got {names:?}"
|
||||
);
|
||||
assert_eq!(
|
||||
tools.len(),
|
||||
33,
|
||||
"exactly the thirty-three exposed idea_* tools; got {names:?}"
|
||||
);
|
||||
|
||||
// Every tool advertises an object input schema.
|
||||
for t in tools {
|
||||
@ -1361,11 +1363,21 @@ async fn bounded_ticket_mutation_tools_reject_other_issue_before_ticket_provider
|
||||
),
|
||||
(
|
||||
23,
|
||||
"idea_ticket_bulk_update_status",
|
||||
json!({ "refs": ["#7", "#8"], "status": "closed" }),
|
||||
),
|
||||
(
|
||||
24,
|
||||
"idea_ticket_bulk_update_priority",
|
||||
json!({ "refs": ["#8"], "priority": "high" }),
|
||||
),
|
||||
(
|
||||
25,
|
||||
"idea_ticket_link",
|
||||
json!({ "ref": "#8", "targetRef": "#9", "kind": "blocks", "expectedVersion": 1 }),
|
||||
),
|
||||
(
|
||||
24,
|
||||
26,
|
||||
"idea_ticket_unlink",
|
||||
json!({ "ref": "#8", "targetRef": "#9", "kind": "blocks", "expectedVersion": 1 }),
|
||||
),
|
||||
@ -1422,11 +1434,21 @@ async fn bounded_ticket_mutation_tools_allow_bound_issue_to_reach_ticket_provide
|
||||
),
|
||||
(
|
||||
33,
|
||||
"idea_ticket_bulk_update_status",
|
||||
json!({ "refs": ["#7"], "status": "closed" }),
|
||||
),
|
||||
(
|
||||
34,
|
||||
"idea_ticket_bulk_update_priority",
|
||||
json!({ "refs": ["#7"], "priority": "high" }),
|
||||
),
|
||||
(
|
||||
35,
|
||||
"idea_ticket_link",
|
||||
json!({ "ref": "#7", "targetRef": "#9", "kind": "blocks", "expectedVersion": 1 }),
|
||||
),
|
||||
(
|
||||
34,
|
||||
36,
|
||||
"idea_ticket_unlink",
|
||||
json!({ "ref": "#7", "targetRef": "#9", "kind": "blocks", "expectedVersion": 1 }),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user