09b2c1dce5
build / build (push) Successful in 1m17s
修正筛选入口位置:五项条件在表头就地选择,保持完整集筛选与无感续载。 统一固定规则:未覆盖一律待确认,原问答/人工模型证据不改写,已覆盖仍保留点踩优先。 验证:行为红绿、前端/Go全套及隔离PostgreSQL全mirror竞态通过;完整本地门禁与原生备份真实恢复通过。
51 lines
2.1 KiB
Go
51 lines
2.1 KiB
Go
package qaopsquality
|
|
|
|
import (
|
|
"knowledge-governance/internal/dobotaiops"
|
|
"reflect"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestUncoveredMasterCorrectnessIsAlwaysPendingWithoutRewritingEvidence(t *testing.T) {
|
|
for _, source := range []string{"stored", "review", "inline"} {
|
|
for _, value := range []string{"", "是", "否", "待确认"} {
|
|
for _, down := range []int{0, 1} {
|
|
t.Run(source+value+string(rune('0'+down)), func(t *testing.T) {
|
|
stored := map[string]string{"coverage": "否", "is_correct": value, "product_category": "MG400"}
|
|
edits := map[string]string{}
|
|
view := View{}
|
|
if source == "review" {
|
|
f := Fields{Coverage: "uncovered", Correctness: map[string]string{"是": "correct", "否": "incorrect", "待确认": "pending"}[value], ProductCategory: "MG400"}
|
|
view = View{State: "reviewed", Effective: f, LatestReview: &Review{Revision: 3, Fields: f}}
|
|
}
|
|
if source == "inline" {
|
|
edits["is_correct"] = value
|
|
}
|
|
original := stored["is_correct"]
|
|
var evidence Fields
|
|
if view.LatestReview != nil {
|
|
evidence = view.LatestReview.Fields
|
|
}
|
|
got := ProjectMasterWithEdits(view, stored, dobotaiops.CoverageCheck{Verdict: "uncovered"}, edits, dobotaiops.RecordFeedback{Down: int64(down)})
|
|
if got.Effective.Correctness != "pending" || got.Effective.Coverage != "uncovered" || got.FeedbackRule != "" {
|
|
t.Fatalf("uncovered retained an assessed correctness: %+v", got.Effective)
|
|
}
|
|
if stored["is_correct"] != original || (view.LatestReview != nil && !reflect.DeepEqual(evidence, view.LatestReview.Fields)) {
|
|
t.Fatal("historical provenance changed")
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestUncoveredReviewCannotPersistAssessedCorrectness(t *testing.T) {
|
|
for _, value := range []string{"correct", "incorrect"} {
|
|
q := SaveRequest{InputHash: strings.Repeat("a", 64), InputEpoch: 1, Nonce: strings.Repeat("n", 32), Fields: Fields{Coverage: "uncovered", Correctness: value}, Reason: "fixture valid review reason"}
|
|
if Validate(q) == nil {
|
|
t.Fatal("uncovered review accepted binary correctness")
|
|
}
|
|
}
|
|
}
|