iomgaa
e9073bfdc2
feat(tree): expose build_async and accept injected API semaphore
...
Core algorithms #1/#2/#3 unchanged: only entry wrapping and semaphore
source switch (injected vs self-built); build logic untouched.
- rename _build_async to public build_async (body unchanged)
- __init__ accepts keyword-only api_semaphore for cross-video sharing
- default path (no injection) is verbatim-equivalent to previous code
2026-07-11 11:14:45 -04:00
iomgaa
d3be9b1322
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 >
2026-07-09 11:57:41 -04:00
iomgaa
79761852df
feat(tree): VideoTreeBuilder 保真 #1 #2 #3 + 复杂度重构
...
- 从 reference/video_tree_trm/video_tree_builder.py (994行) 迁移
- 保真算法 #1 : L2 轴心建树策略 (asyncio.gather 链式并发)
- 保真算法 #2 : VLM 批量帧描述 + JSON fallback (_L3_BATCH_SIZE=5)
- 保真算法 #3 : 断点续跑 (progress.json + L1 中间 JSON)
- 新增: VLMProvider/LLMProvider Protocol 替代 LLMClient
- 新增: 结构化 JSON 输出 → L1Card/L2Card/L3Card
- 新增: L2 代表帧复用 L3 帧 (_sample_representative_frames)
- 新增: 字幕注入 + Voronoi 分配
- 重构: 提取 _load_resume_state/_assemble_roots 降低 _build_async 复杂度 D(21)→C(14)
- 44 个单元测试全部通过
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-07-07 02:17:50 -04:00