mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-06 21:11:50 +08:00
feat(findings): reduce duplicate-confirmation noise with grouped suggestions and ranked candidates
- Prompt: evidenced endpoint/handler/param differences justify independent; suggest only with concrete shared points - Review acceptance: merged no longer blocked by unified report - Suggestions: 2..N member groups, one-click group confirm with per-member exclusion, related cards cleared - Candidates: score/tier/hit_reasons ranking, low-score kept paginated
This commit is contained in:
1 parent
620ca5d96c
commit
00ec84d14e
11 files changed
+532
-105
No files matched your search
@@ -43,7 +43,7 @@ func TestUnifiedFindingReportRejectsIncompleteAndTruncated(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFindingCaseReviewCompletionRequiresReadsAndFreshReport(t *testing.T) {
|
||||
func TestFindingCaseReviewCompletionRequiresReadsNotUnifiedReport(t *testing.T) {
|
||||
s, task, ids := testCaseServer(t)
|
||||
runs, err := s.m.pg.CreateFindingCaseReviews(t.Context(), map[int64][]int64{task: ids})
|
||||
if err != nil {
|
||||
@@ -71,15 +71,9 @@ func TestFindingCaseReviewCompletionRequiresReadsAndFreshReport(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := s.saveFindingReviewConclusion(ctx, conv, a); err == nil {
|
||||
t.Fatal("missing unified report accepted")
|
||||
}
|
||||
c, _ := s.m.pg.GetFindingCase(cid)
|
||||
if err := s.m.pg.UpdateFindingCaseReport(ctx, cid, c.Version, "orders", completeFindingReviewReport, "high", "verified impact"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// A merged verdict no longer waits for the unified report; the folder shows it as pending.
|
||||
if err := s.saveFindingReviewConclusion(ctx, conv, a); err != nil {
|
||||
t.Fatal(err)
|
||||
t.Fatalf("merge blocked by missing unified report: %v", err)
|
||||
}
|
||||
if err := s.validateFindingReviewCompletion(conv); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -90,8 +84,14 @@ func TestFindingCaseReviewCompletionRequiresReadsAndFreshReport(t *testing.T) {
|
||||
if _, err := s.m.pg.Exec(`UPDATE findings SET evidence='new proof' WHERE id=$1`, ids[0]); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := s.validateFindingReviewCompletion(conv); err != nil {
|
||||
t.Fatalf("stale unified report should not fail a merged review: %v", err)
|
||||
}
|
||||
if err := s.m.pg.RemoveFindingCaseMember(ctx, cid, ids[0], "different cause"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := s.validateFindingReviewCompletion(conv); err == nil {
|
||||
t.Fatal("stale group reported completed")
|
||||
t.Fatal("merged verdict accepted after the record left the folder")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ func TestFindingCaseReviewSuggestionNeedsSavedSuggestion(t *testing.T) {
|
||||
if err := s.saveFindingReviewConclusion(ctx, conv, a); err == nil {
|
||||
t.Fatal("unpersisted suggestion accepted")
|
||||
}
|
||||
if _, err := s.m.pg.SuggestFindingCase(ctx, task, ids[0], ids[1], "orders", "common component unknown"); err != nil {
|
||||
if _, err := s.m.pg.SuggestFindingCase(ctx, task, []int64{ids[0], ids[1]}, "orders", "common component unknown"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := s.saveFindingReviewConclusion(ctx, conv, a); err != nil {
|
||||
|
||||
Reference in new issue
Block a user