wip
This commit is contained in:
@@ -86,8 +86,13 @@ namespace AnotherReplayReader.Utils
|
||||
public static AIValidationResult Empty { get; } =
|
||||
new(AIMachineReadableClaims.Empty, ImmutableArray<AIValidationIssue>.Empty);
|
||||
|
||||
// 除 Info 外,任何需要模型修正/降级的验证问题都触发一次隐藏修订;
|
||||
// 一次修订后仍遗留的问题只记录,不再循环请求。
|
||||
public bool RequiresRevision =>
|
||||
Issues.Any(i => i.Severity is AIValidationSeverity.Contradiction or AIValidationSeverity.Fatal);
|
||||
Issues.Any(i => i.Severity is AIValidationSeverity.Contradiction
|
||||
or AIValidationSeverity.Fatal
|
||||
or AIValidationSeverity.Warning
|
||||
or AIValidationSeverity.WeakEvidence);
|
||||
|
||||
public bool HasIssues => !Issues.IsEmpty;
|
||||
}
|
||||
@@ -118,6 +123,10 @@ namespace AnotherReplayReader.Utils
|
||||
var claims = ParseClaims(jsonBlocks, issues);
|
||||
if (claims is null)
|
||||
{
|
||||
issues.Add(new AIValidationIssue(
|
||||
AIValidationSeverity.Fatal,
|
||||
AIValidationIssueKind.InvalidMachineReadableClaims,
|
||||
"所有机器可读声明块都无法解析,当前输出不可用于自动验证。"));
|
||||
return new AIValidationResult(AIMachineReadableClaims.Empty, issues.ToImmutable());
|
||||
}
|
||||
|
||||
@@ -514,6 +523,13 @@ namespace AnotherReplayReader.Utils
|
||||
continue;
|
||||
}
|
||||
|
||||
// 只有“基地车/主基地”这类同时具备 pack/unpack 的实体才存在 MCV vs 矿车的歧义;
|
||||
// 矿车本身只有 unpack,不应被这条规则误伤。
|
||||
if (!LooksLikeUnpackAmbiguousUnit(claim.Claim))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
issues.Add(new AIValidationIssue(
|
||||
AIValidationSeverity.WeakEvidence,
|
||||
AIValidationIssueKind.MissingAlternative,
|
||||
@@ -522,6 +538,30 @@ namespace AnotherReplayReader.Utils
|
||||
}
|
||||
}
|
||||
|
||||
private static bool LooksLikeUnpackAmbiguousUnit(string claimText)
|
||||
{
|
||||
if (claimText.IndexOf("MCV", StringComparison.OrdinalIgnoreCase) >= 0
|
||||
|| claimText.IndexOf("基地车", StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var structured = StructuredKnowledge.Instance;
|
||||
if (structured is not null)
|
||||
{
|
||||
foreach (var entity in structured.EntitiesWithTag(KnowledgeTag.Pack))
|
||||
{
|
||||
if (claimText.IndexOf(entity.AssetName, StringComparison.OrdinalIgnoreCase) >= 0
|
||||
|| (!string.IsNullOrWhiteSpace(entity.DisplayName)
|
||||
&& claimText.IndexOf(entity.DisplayName, StringComparison.OrdinalIgnoreCase) >= 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void ValidateTimelineConsistency(
|
||||
AIMachineReadableClaims claims,
|
||||
ReplayFactIndex factIndex,
|
||||
|
||||
Reference in New Issue
Block a user