fix: 高密度テスト52/52通過 + SPACES figurative constant FP fix

COBOL技術者による高密度テスト(52 tests)実装:

発見・修正されたバグ:
1. WS-KEY = SPACES の figurative constant 比較が FP 原因
   - _matches_key_comparison に figurative constant除外を追加
   - 構造検知の信号4でも SPACES/ZERO 等を除外
   - structural_matching で単一ファイルプログラムを除外

2. simple_vs_two_stage が常に単純マッチングを返していた
   - 実証拠なしでも0.5で返す → 他の分類を汚染
   - 修正: file_count>=2 + IF + 比較証拠がない場合は unknown

3. simple_vs_two_stageテストを現実に合わせて更新

回帰: 767 passed(0 new failures)
高密度テスト: 52/52 PASS
This commit is contained in:
NB-076
2026-06-21 17:04:48 +08:00
parent ecf3c1cd61
commit a784c6974a
4 changed files with 49 additions and 12 deletions
+4 -4
View File
@@ -163,11 +163,11 @@ def test_simple_vs_two_stage_two_stage():
def test_simple_vs_two_stage_simple():
"""顺序 OPEN → 简单匹配(低确信度:非 OPEN-CLOSE-OPEN 不代表一定是匹配程序"""
features = {"open_pattern": "sequential"}
"""顺序 OPEN 无匹配证据 → unknown(2.2+ 不再胡乱判定为単純マッチング"""
features = {"open_pattern": "sequential", "file_count": 0}
result = resolve_simple_vs_two_stage(features)
assert result["resolved_type"] == "単純マッチング"
assert result["confidence"] >= 0.40
assert result["resolved_type"] == "unknown"
assert result["confidence"] == 0.0
# ═══════════════════════════════════════════════════════════════════════════