feat: 规则级合规检查→适配率报告不再虚报100%

之前: CapabilityRegistry仅检查coarse-grained能力名(requires列表)
→ 所有DSL报100%即使有27条规则未实现

现在: 二层报告
- 能力适配率: 7/7(100%) ← 之前唯一指标
- 规则合规检查: ⚠ 9条规则引擎无法完全执行 ← 新增
  • 番型「将一色」(16)引擎无识别逻辑→0分
  • 番型「杠上开花/海底捞月/抢杠胡」事件番型无识别逻辑
  • fu_flag过水机制未实现

检查维度:
- 番型识别(21种已知pattern vs DSL fan_types)
- 番型条件字符串(hand_contains_wildcard等)
- wildcard behavior(substitute唯一支持)
- fu_flag过水机制
- pre_hooks(已知3种)
- scoring.mode(fan_table唯一支持)
This commit is contained in:
xiaoou
2026-07-04 20:38:35 +08:00
parent b038d5e2da
commit 237a6dc0ad
2 changed files with 60 additions and 0 deletions

View File

@ -40,6 +40,16 @@ try
var (r, m, pct) = caps.ComputeCoverage(rules.Requires);
string status = pct == 100 ? "✅" : "⚠";
Console.WriteLine($"{status} DSL 适配率: {m}/{r} ({pct}%) — {rules.Game.Name}");
// Rule-level compliance check (finer granularity than capability check)
var warnings = caps.ValidateRuleCompliance(rules);
if (warnings.Count > 0)
{
Console.WriteLine($" ⚠ {warnings.Count} 条规则引擎无法完全执行:");
foreach (var w in warnings)
Console.WriteLine($" • {w}");
}
if (pct < 100)
{
var missing = rules.Requires.Where(req => !caps.Has(req));