fix: persist coverage reference count

This commit is contained in:
姚章浩
2026-07-22 12:19:53 +08:00
parent a6569ee4bf
commit 913a65b16d
7 changed files with 34 additions and 5 deletions
@@ -50,7 +50,7 @@ func TestCoverageRepoInsertsIntoCoverageDecisions(t *testing.T) {
requiredCols := []string{
"id", "tenant_key", "channel", "turn_id",
"evaluator_version", "verdict", "reason_code", "top_score",
"evaluator_version", "verdict", "reason_code", "reference_count", "top_score",
}
upper := strings.ToUpper(found)
for _, col := range requiredCols {
@@ -174,6 +174,9 @@ func TestCoverageRepoSavesTenantChannelTurnScope(t *testing.T) {
if !strings.Contains(src, "d.TenantKey") || !strings.Contains(src, "d.Channel") || !strings.Contains(src, "d.TurnID") {
t.Error("SaveCoverageDecision must use d.TenantKey, d.Channel, d.TurnID for tenant/channel/turn scope")
}
if !strings.Contains(src, "d.ReferenceCount") {
t.Error("SaveCoverageDecision must persist d.ReferenceCount")
}
}
func TestCoverageRepoNilSafe(t *testing.T) {