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:
RuoJi6 committed 2026-10-24 20:01:37 +08:00
1 parent 620ca5d96c
commit 00ec84d14e
11 files changed
+532 -105

No files matched your search

+11
View File
@@ -1488,6 +1488,17 @@ CREATE TABLE IF NOT EXISTS finding_case_suggestions (
UNIQUE(left_id,right_id),
CHECK(left_id < right_id)
);
ALTER TABLE finding_case_suggestions DROP CONSTRAINT IF EXISTS finding_case_suggestions_left_id_right_id_key;
CREATE TABLE IF NOT EXISTS finding_case_suggestion_members (
suggestion_id BIGINT NOT NULL REFERENCES finding_case_suggestions(id) ON DELETE CASCADE,
finding_id BIGINT NOT NULL REFERENCES findings(id) ON DELETE CASCADE,
PRIMARY KEY(suggestion_id,finding_id)
);
CREATE INDEX IF NOT EXISTS finding_case_suggestion_members_finding_idx ON finding_case_suggestion_members(finding_id);
INSERT INTO finding_case_suggestion_members(suggestion_id,finding_id)
SELECT id,left_id FROM finding_case_suggestions ON CONFLICT DO NOTHING;
INSERT INTO finding_case_suggestion_members(suggestion_id,finding_id)
SELECT id,right_id FROM finding_case_suggestions ON CONFLICT DO NOTHING;
-- Rejected/detached pairs are a durable human veto, also checked on group unions.
CREATE TABLE IF NOT EXISTS finding_case_blocks (
left_id BIGINT NOT NULL REFERENCES findings(id) ON DELETE CASCADE,