fischer-agentkit/tests/unit/bitable
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(bitable): add bitable companion service with full P0-P2 fixes 2026-06-25 01:09:59 +08:00
conftest.py feat(bitable): add bitable companion service with full P0-P2 fixes 2026-06-25 01:09:59 +08:00
test_attachment.py feat(bitable): 多维表格文件层 + 默认字段 + 表内字段操作 + ce-code-review 修复 (Stage 1) 2026-06-29 04:07:45 +08:00
test_bitable_tool.py fix(bitable/team): U3 — Residual P2 findings (DR-1/3/4/5 + #2/#3) 2026-07-06 03:48:14 +08:00
test_cli.py feat(bitable): add bitable companion service with full P0-P2 fixes 2026-06-25 01:09:59 +08:00
test_conditional_formatting.py feat(bitable): U5 R4 grouping (max 3 fields) + conditional formatting (7 operators) 2026-07-03 22:33:18 +08:00
test_db.py feat(bitable): 多维表格文件层 + 默认字段 + 表内字段操作 + ce-code-review 修复 (Stage 1) 2026-06-29 04:07:45 +08:00
test_default_fields.py feat(bitable): 多维表格文件层 + 默认字段 + 表内字段操作 + ce-code-review 修复 (Stage 1) 2026-06-29 04:07:45 +08:00
test_file_crud.py refactor: remove all emoji from agentkit 2026-07-02 01:33:28 +08:00
test_formula_engine.py feat(bitable): add bitable companion service with full P0-P2 fixes 2026-06-25 01:09:59 +08:00
test_formula_parser.py feat(bitable): add bitable companion service with full P0-P2 fixes 2026-06-25 01:09:59 +08:00
test_grouping.py feat(bitable): U5 R4 grouping (max 3 fields) + conditional formatting (7 operators) 2026-07-03 22:33:18 +08:00
test_ingestion_excel.py feat(bitable): add bitable companion service with full P0-P2 fixes 2026-06-25 01:09:59 +08:00
test_models.py feat(bitable): add bitable companion service with full P0-P2 fixes 2026-06-25 01:09:59 +08:00
test_recalc.py feat(bitable): add bitable companion service with full P0-P2 fixes 2026-06-25 01:09:59 +08:00
test_repository.py fix(bitable/team): U3 — Residual P2 findings (DR-1/3/4/5 + #2/#3) 2026-07-06 03:48:14 +08:00
test_routes.py feat(bitable): U6 R15a BitableTool 4 new actions + DELETE /views endpoint 2026-07-03 23:13:46 +08:00
test_service.py fix(bitable/team): U3 — Residual P2 findings (DR-1/3/4/5 + #2/#3) 2026-07-06 03:48:14 +08:00