按已确认需求提供独立安全模型配置、真实探测、正式字典字段评估与原问题译中,持久批次支持只补空白、暂停恢复、有限重试、幂等和逐字段依据。覆盖固定规则、本地语言、组织关联与主表有效看板共用治理侧读模型,保留源生产和冻结历史。 验证:完整 make verify 退出0,702项Go与329项前端通过;默认118项外部/隔离集成明确跳过,另跑完整镜像及组织隔离PG竞态。12并发、输入漂移、过期租约、暂停/恢复及有限重试通过。用户授权的百炼 deepseek-v4.1-flash 完成真实后台与浏览器评估/翻译;552行、16列、11块看板及完整PNG、独立配置页测试/保存、重开恢复和零JS异常通过。仅非业务样本外发,自动处理关闭,原payload不变。 上线前治理库已做导出快照原生备份并真实恢复,60表行数与17个QA表内容哈希一致;不修改DobotAI生产或隧道。本提交时尚未部署,线上验收须独立完成。
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package qaopsquality
|
||||
|
||||
import "knowledge-governance/internal/dobotaiops"
|
||||
|
||||
// Stored master labels remain their original provenance, not synthetic reviews.
|
||||
func ProjectMaster(v View, stored map[string]string, derived dobotaiops.CoverageCheck) View {
|
||||
v.EffectiveSource = "master-effective-fields-v1"
|
||||
if v.State != "reviewed" {
|
||||
v.Effective.Coverage = map[string]string{"是": "covered", "否": "uncovered", "部分覆盖": "partial", "待确认": "pending"}[stored["coverage"]]
|
||||
if v.Effective.Coverage == "" {
|
||||
v.Effective.Coverage = derived.Verdict
|
||||
}
|
||||
v.Effective.Correctness = map[string]string{"是": "correct", "否": "incorrect", "待确认": "pending"}[stored["is_correct"]]
|
||||
}
|
||||
if v.Effective.ProductCategory == "" {
|
||||
v.Effective.ProductCategory = stored["product_category"]
|
||||
}
|
||||
if v.Effective.ProblemType == "" {
|
||||
v.Effective.ProblemType = stored["problem_type"]
|
||||
}
|
||||
if v.Effective.RootCause == "" && v.Effective.Correctness != "correct" {
|
||||
v.Effective.RootCause = stored["root_cause"]
|
||||
}
|
||||
if v.Effective.Correctness == "correct" {
|
||||
v.Effective.RootCause = ""
|
||||
}
|
||||
return v
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package qaopsquality
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"knowledge-governance/internal/dobotaiops"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMasterProjectionUsesStoredLabelsWithoutPretendingTheyAreHumanReviews(t *testing.T) {
|
||||
v := View{State: "unreviewed", Effective: Fields{}}
|
||||
got := ProjectMaster(v, map[string]string{"coverage": "是", "is_correct": "否", "product_category": "MG400", "problem_type": "参数", "root_cause": "结果不清"}, dobotaiops.CheckMasterCoverage("已有资料", true))
|
||||
wire, _ := json.Marshal(got)
|
||||
if !strings.Contains(string(wire), `"effective_source":"master-effective-fields-v1"`) {
|
||||
t.Fatal("master projection has no explicit versioned provenance for strict clients")
|
||||
}
|
||||
if got.Effective.Coverage != "covered" || got.Effective.Correctness != "incorrect" || got.Effective.ProductCategory != "MG400" || got.Effective.ProblemType != "参数" || got.Effective.RootCause != "结果不清" || got.State != "unreviewed" || got.LatestReview != nil {
|
||||
t.Fatalf("lost stored labels or fabricated human review: %+v", got)
|
||||
}
|
||||
}
|
||||
@@ -49,13 +49,14 @@ type Check struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
type View struct {
|
||||
InputHash string `json:"input_hash"`
|
||||
InputEpoch int64 `json:"input_epoch"`
|
||||
Revision int64 `json:"revision"`
|
||||
State string `json:"state"`
|
||||
Automatic Check `json:"automatic"`
|
||||
LatestReview *Review `json:"latest_review"`
|
||||
Effective Fields `json:"effective"`
|
||||
EffectiveSource string `json:"effective_source,omitempty"`
|
||||
InputHash string `json:"input_hash"`
|
||||
InputEpoch int64 `json:"input_epoch"`
|
||||
Revision int64 `json:"revision"`
|
||||
State string `json:"state"`
|
||||
Automatic Check `json:"automatic"`
|
||||
LatestReview *Review `json:"latest_review"`
|
||||
Effective Fields `json:"effective"`
|
||||
}
|
||||
type History struct {
|
||||
Reviews []Review `json:"reviews"`
|
||||
|
||||
Reference in New Issue
Block a user