fix:stalled 分類同步 agents#47——assignee 交付報告待確認改判 waiting-outside
與 agents 86f570a(PR alterminal/agents#48)同語義:最後一則 assignee 留言符合交付報告特徵(結構訊號:逐項查核/驗收結果、彙總 verdict、內文 含「完成定義」段落時簡式交付語也算;∧ 交棒訊號:回報/關閉他件 #N、 或請/可由/待他人確認關閉)時,assignee-idle 改判 waiting-outside。 兩訊號同時命中才翻轉:認領/進度/預告式留言(無交棒對象)保持 assignee-idle,不製造「認領後棄置永不被催」的新死角。 驗證:TestIsDeliveryReport(8 案例,與 gitea.py 離線驗證同集)+ TestScanStalledDeliveryReport(stalled 整合:交付報告翻轉、認領不翻轉) +全套 go test 綠;live A/B 對安裝版二進位:bear#52 assignee-idle → waiting-outside,bear#39 parent-tracking 不變。
This commit is contained in:
@@ -595,3 +595,39 @@ func TestRound1(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestScanStalledDeliveryReport(agents #47):assignee 最後留言為交付報告
|
||||
// (結構訊號+交棒訊號)→ waiting-outside,不是 assignee-idle;
|
||||
// 同型認領留言(無交棒)維持 assignee-idle——修正不製造新死角。
|
||||
func TestScanStalledDeliveryReport(t *testing.T) {
|
||||
now := at(0)
|
||||
defBody := "## 完成定義\n- 逐項回報查核結果至此 issue;\n- 全數通過 → 回報 #39 並由 #39 assignee 關閉"
|
||||
src := &fakeSource{
|
||||
orgs: []string{"alterminal"},
|
||||
repos: map[string][]Repo{"alterminal": repoWith("bear", true)},
|
||||
issues: map[string]map[int64]Issue{
|
||||
"alterminal/bear": {
|
||||
5: {Number: 5, Title: "驗收", State: "open", Body: defBody, CreatedAt: iso(-600), UpdatedAt: iso(-300), Assignees: []User{{UserName: "queena"}}, Repository: &Repository{FullName: "alterminal/bear"}},
|
||||
6: {Number: 6, Title: "認領中", State: "open", Body: defBody, CreatedAt: iso(-600), UpdatedAt: iso(-300), Assignees: []User{{UserName: "dan"}}, Repository: &Repository{FullName: "alterminal/bear"}},
|
||||
},
|
||||
},
|
||||
comments: map[string][]Comment{
|
||||
"alterminal/bear/5": {{User: &User{UserName: "queena"}, CreatedAt: iso(-300), Body: "## 查核結果\n結論:四項全數通過。回報 #39:可由 @ceo 關閉。"}},
|
||||
"alterminal/bear/6": {{User: &User{UserName: "dan"}, CreatedAt: iso(-300), Body: "認領。完成後逐項回報結果至此。"}},
|
||||
},
|
||||
}
|
||||
got, err := ScanStalled(src, "admin", 4.0, now)
|
||||
if err != nil {
|
||||
t.Fatalf("ScanStalled: %v", err)
|
||||
}
|
||||
byNumber := map[int64]Item{}
|
||||
for _, it := range got {
|
||||
byNumber[it.Number] = it
|
||||
}
|
||||
if it, ok := byNumber[5]; !ok || it.Reason != "waiting-outside" {
|
||||
t.Errorf("issue 5(交付報告)reason 應為 waiting-outside,got %+v", it)
|
||||
}
|
||||
if it, ok := byNumber[6]; !ok || it.Reason != "assignee-idle" {
|
||||
t.Errorf("issue 6(認領留言)reason 應為 assignee-idle,got %+v", it)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user