fischer-agentkit/tests/unit/experts
Chiguyong c60e96ac32 fix(bitable/team): U3 — Residual P2 findings (DR-1/3/4/5 + #2/#3)
U3 修复 8 项 P2 design review 与 streaming 残留问题:

DR-1 SQL 注入防御 — repository.py 添加 _validate_field_id UUID 校验,
拒绝非 UUID 字符串进入 jsonb_set path 与 WHERE 子句的字符串插值。
ceiling 注释标明仅覆盖 field_id,其余 SQL 结构由 service 层枚举白名单守护。

DR-3 design token 契约 — 新增 bitable-tokens.test.ts (31 tests),
解析 CSS :root 块并断言所有 --bitable-* token 在 :root 定义,
防止 token 被硬编码到组件外或遗漏定义。

DR-4 TOCTOU 修复 — repository.delete_view_if_not_last 用
SELECT ... FOR UPDATE 单事务原子化 check + delete,
消除 list_views → count → delete 三步分离的竞态。
service.delete_view 委托原子方法,失败抛 LastViewDeletionError。

DR-5 _update_field 静默失败 — type 参数被 Pydantic extra=ignore
静默丢弃,用户以为改了类型实际无效。显式返回
UNSUPPORTED_FIELD_TYPE_CHANGE 错误,避免静默失败的 UX 陷阱。

#2 team_synthesis 孤儿 milestone — 补 error + cancelled 路径测试,
验证内层 except 广播终结事件后 re-raise,外层 except 捕获后 fallback。

#3 synthesis_id 去重附身 — chatStream.ts 移除
|| m.synthesis_id === undefined 兜底匹配,避免新 milestone
附身到上一次孤儿 streaming 占位。

测试:DR-1 (7) + DR-4 repo (3) + DR-4 service (3) + DR-5 (2) +
#2 (2) + #8 frontend (31) = 48 项通过;U2 无回归 (29 项)。
2026-07-06 03:48:14 +08:00
..
__init__.py feat: Expert Team Mode — plan-execute collaboration with conversation UI 2026-06-14 22:20:14 +08:00
_helpers.py test: fix async generator mock for U3 streaming orchestrator 2026-07-02 22:52:10 +08:00
test_board_backtest.py feat: 私董会讨论模式 + 回测集成 + WS持久化修复 2026-06-17 23:52:53 +08:00
test_board_orchestrator.py test: fix async generator mock for U3 streaming orchestrator 2026-07-02 22:52:10 +08:00
test_board_router.py feat: 企业级客户端-服务端架构 + 代码审查修复 2026-06-20 06:48:18 +08:00
test_board_team.py refactor: remove all emoji from agentkit 2026-07-02 01:33:28 +08:00
test_config.py refactor: remove all emoji from agentkit 2026-07-02 01:33:28 +08:00
test_divergence_detection.py feat(experts): U3 分歧检测 + 方案评审辩论自动触发 2026-06-24 11:09:53 +08:00
test_expert.py refactor: remove all emoji from agentkit 2026-07-02 01:33:28 +08:00
test_orchestrator_debate.py feat(experts): U4 用户干预通道 + 手动辩论触发 2026-06-24 12:17:09 +08:00
test_phase_executor_streaming.py fix(experts): resolve residual review findings from PR #13 2026-07-01 13:26:19 +08:00
test_plan.py feat(experts): U1 协作契约数据模型 + Lead 生成契约 2026-06-24 13:44:50 +08:00
test_pm_collaboration.py test: fix async generator mock for U3 streaming orchestrator 2026-07-02 22:52:10 +08:00
test_registry.py refactor: remove all emoji from agentkit 2026-07-02 01:33:28 +08:00
test_router.py feat(experts): U7 新增 5 个编程专家模板 + dev_team 团队模板 + ExpertTeamRouter 模板展开 2026-06-18 01:50:43 +08:00
test_team.py feat(experts):重写 TeamOrchestrator 为流水线模式 + TeamStatus.PLANNING 2026-06-18 01:39:22 +08:00
test_team_intervention.py feat(experts): U4 用户干预通道 + 手动辩论触发 2026-06-24 12:17:09 +08:00
test_team_orchestrator.py fix(bitable/team): U3 — Residual P2 findings (DR-1/3/4/5 + #2/#3) 2026-07-06 03:48:14 +08:00