diff --git a/runtime/gates/gates.go b/runtime/gates/gates.go index 0049f63..7543d4a 100644 --- a/runtime/gates/gates.go +++ b/runtime/gates/gates.go @@ -39,10 +39,11 @@ type ArtifactRef struct { } var ( - artIDRe = regexp.MustCompile(`art_[0-9a-f]{12}`) - fileClaimRe = regexp.MustCompile(`(?s)(?:已生成|已保存|已导出|已写入).{0,120}?\.(?:docx|xlsx|pptx|pdf|png|jpe?g|csv|md|txt|json)\b`) - softClaimRe = regexp.MustCompile(`(?s)(?:文件|文档|工件).{0,40}?已(?:正常)?(?:生成|登记|保存|导出|写入)`) - forgedCallRe = regexp.MustCompile(`\[(?:调用工具|工具结果|产出工件) `) + // ArtifactIDPattern 是工件编号的文本形态(门禁与宿主的引用提取共用)。 + ArtifactIDPattern = regexp.MustCompile(`art_[0-9a-f]{12}`) + fileClaimRe = regexp.MustCompile(`(?s)(?:已生成|已保存|已导出|已写入).{0,120}?\.(?:docx|xlsx|pptx|pdf|png|jpe?g|csv|md|txt|json)\b`) + softClaimRe = regexp.MustCompile(`(?s)(?:文件|文档|工件).{0,40}?已(?:正常)?(?:生成|登记|保存|导出|写入)`) + forgedCallRe = regexp.MustCompile(`\[(?:调用工具|工具结果|产出工件) `) ) // ClaimGate 判断终轮正文是否在没有对应工件的情况下声称交付。 @@ -62,7 +63,7 @@ func ClaimGate(body string, produced []ArtifactRef, lookup ArtifactLookup) (bool } } knownExisting := false - for _, id := range artIDRe.FindAllString(body, -1) { + for _, id := range ArtifactIDPattern.FindAllString(body, -1) { if producedIDs[id] { continue }