feat(repair): regenerator + supplement 防御修复 + 迁移脚本

- 新增 app/tree/repair/regenerator.py(VLM 重生成 + 级联修复)
- supplement.py: deduplicate_field str() 防御 + inject_value strip
- patch.py: ruff format 格式化
- repair_trees.sh: conda source 激活修复
- 新增 migrate_from_trm4.sh 迁移工具
- enhance/__init__.py → repair/__init__.py 重命名

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-09 07:53:59 -04:00
parent ace0738546
commit 45403b23b4
7 changed files with 891 additions and 15 deletions
+4 -3
View File
@@ -84,10 +84,11 @@ def deduplicate_field(values: list[str]) -> list[str]:
seen: set[str] = set()
result: list[str] = []
for v in values:
key = v.strip().lower()
s = str(v).strip()
key = s.lower()
if key and key not in seen:
seen.add(key)
result.append(v)
result.append(s)
return result
@@ -278,7 +279,7 @@ def apply_injections(index: TreeIndex, injections: list[dict[str, Any]]) -> Supp
stats.facts_skipped += 1
continue
inject_value = instr.get("inject_value", "")
inject_value = str(instr.get("inject_value", "")).strip()
if not inject_value:
stats.facts_skipped += 1
continue