refactor(tree): subtitle 迁入 L3Card/L2Card + 建树管线修正
- L3Card/L2Card 新增 subtitle: str 字段(L1Card 不加) - L3Node 移除 subtitle 字段(数据迁入 Card) - assign_subtitles_voronoi 改写 Card.subtitle + L2 聚合 - _collect_card_strings 增加 skip_fields 排除 subtitle - _node_full_text/_node_anchored_text 保持 字幕:/[sN] 语义 - get_subtitle 读 Card.subtitle(L2/L3) - verify.py/synthesizer.py: l3.subtitle → l3.card.subtitle - 迁移脚本 tools/migrate_subtitle_to_card.py(幂等,300 棵树已迁移) - 9→6 个测试文件适配(3 个无需改动) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+5
-4
@@ -97,8 +97,8 @@ def _collect_l3_text(l2_node: L2Node) -> str:
|
||||
for l3 in l2_node.children:
|
||||
parts.append(l3.card.frame_summary)
|
||||
parts.extend(l3.card.visible_text)
|
||||
if l3.subtitle:
|
||||
parts.append(l3.subtitle)
|
||||
if l3.card.subtitle:
|
||||
parts.append(l3.card.subtitle)
|
||||
return "\n".join(parts)
|
||||
|
||||
|
||||
@@ -139,8 +139,8 @@ def _collect_descendant_text_corpus(l1_node: L1Node) -> str:
|
||||
for l3 in l2.children:
|
||||
parts.append(l3.card.frame_summary)
|
||||
parts.extend(l3.card.visible_text)
|
||||
if l3.subtitle:
|
||||
parts.append(l3.subtitle)
|
||||
if l3.card.subtitle:
|
||||
parts.append(l3.card.subtitle)
|
||||
return "\n".join(parts)
|
||||
|
||||
|
||||
@@ -221,6 +221,7 @@ def _verify_l2(l2: L2Node, stats: VerifyStats) -> None:
|
||||
visible_text=kept_vt,
|
||||
spatial_relations=old_card.spatial_relations,
|
||||
state_changes=old_card.state_changes,
|
||||
subtitle=old_card.subtitle,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user