feat: 实现 AI 规格候选匹配与审计 (#201)

This commit is contained in:
chengma
2026-08-14 10:08:32 +08:00
parent 2f51126e1d
commit aac289a4d3
15 changed files with 1200 additions and 25 deletions
+28 -8
View File
@@ -370,14 +370,22 @@ type ShopChannelAlias struct {
//
// 附带好处:A 的映射还留着。A 补货换回去时,之前的匹配成果直接复用。
type SpecMapping struct {
ShopeeGoodsID string
SpecKey string // 由 spec.SpecKey 生成,存和查必须使用同一实现
SpecRaw string // 保存当时的顺运宝原文,供人工核对
PddGoodsID string // 这条映射属于哪个 PDD 商品
PddOptionKey string // 规范化后的组合键,见 service.OptionKey
PddOptions string // 原始 options 对象 JSON,显示用
MappedAt string
MappedBy string
ShopeeGoodsID string
SpecKey string // 由 spec.SpecKey 生成,存和查必须使用同一实现
SpecRaw string // 保存当时的顺运宝原文,供人工核对
PddGoodsID string // 这条映射属于哪个 PDD 商品
PddOptionKey string // 规范化后的组合键,见 service.OptionKey
PddOptions string // 原始 options 对象 JSON,显示用
MappedAt string
MappedBy string
Source string
SourceProviderID string
SourceModel string
ConfidenceBPS int
ConfidenceSet bool
SourceReason string
SourceVersion string
ContextVersion string
}
type SpecMappingDecision struct {
@@ -387,6 +395,18 @@ type SpecMappingDecision struct {
DecidedBy, DecidedAt string
}
// AISpecMatchDecision 是不含完整提示词、模型响应和订单信息的 AI 规格匹配审计。
type AISpecMatchDecision struct {
ShopeeGoodsID, SpecKey, PddGoodsID string
ContextVersion, RulesVersion, PromptVersion string
ProviderID, ProviderName, Model, ConfigFingerprint string
CandidatesJSON, ChosenCandidateID, ChosenOptionKey string
ConfidenceBPS int
ConfidenceSet bool
Outcome, Reason, ConflictDimensionsJSON, MissingDimensionsJSON string
DecidedBy, DecidedAt string
}
// ---------- 任务 ----------
// TaskType 区分采集任务和采购任务。