test(review): 把 5 处既有瑕疵锁成 *_known_gap 用例

让既有瑕疵可见,而不是被当成正确行为;改 1~3(确定性检查前置/结论结构化/
证据交叉校验)时可据此判断行为是否被改变。

- bbox_to_window 含非数值 → ValueError(上游只判长度)
- summarize / extract_issues 硬下标 f['frame'] → KeyError
- annotate 的 created 无去重(同 handle 产生重复批注)
- extract_issues 单行 ```json[...]``` 围栏剥离失败 → []
- result_json 文本 'null' → None(与「无 text 返回 default」语义易混)
This commit is contained in:
gjm committed 2026-10-14 19:09:56 +08:00
1 parent fa2d01aad2
commit daccc734bf
4 files changed
+51

No files matched your search

+15
View File
@@ -120,6 +120,21 @@ def test_annotate_handles_multiple_created_entities():
assert created == ["N1", "N2"]
def test_annotate_created_not_deduped_known_gap():
"""已知瑕疵:同一 handle 出现两次会创建两条批注(created 无去重,仅 highlighted 去重)。"""
ctx = make_ctx(client=build_client())
created, highlighted = annotate(
ctx,
[
{"handle": "A", "severity": "high", "message": "第一次"},
{"handle": "A", "severity": "high", "message": "第二次"},
],
log=lambda *a: None,
)
assert created == ["NEW1", "NEW1"] # 重复批注(期望去重)
assert highlighted == ["A"] # 高亮已去重
def test_annotate_propagates_protocol_error_on_detail():
ctx = make_ctx(client=FakeMcpClient(responses={"get_entity_detail": McpError(-32602, "bad")}))
# annotate 只兜 add_leader/highlight 的错;detail 的协议错误会向上冒泡(现状行为)