From 8c642e78811b2d115c49c13ed1a0edb7a7f34eb1 Mon Sep 17 00:00:00 2001 From: iomgaa Date: Mon, 10 Aug 2026 22:56:02 -0400 Subject: [PATCH] =?UTF-8?q?test(contract):=20=E6=8C=89=20Codex=20=E5=AE=A1?= =?UTF-8?q?=E6=9F=A5=E6=94=B9=E6=8E=89=E4=BA=94=E6=9D=A1=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E5=9E=8B=E6=B5=8B=E8=AF=95=E7=9A=84=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 它们函数体是空的,名字却承诺了一个行为,读起来像「这条已经验过了」——而契约套件是新适配器 的准入标准,下游跑一遍看见绿的会以为自己那一条被验过。名字改成说清楚断言在哪一层, 函数体那段解释保持不动。 Codex 另报「测试 docstring 里出现 GovDoc 是业务词汇」,不采纳:§1.1 那道扫描挡的是领域词 (公文、超声、招标),说明一条测试被哪个消费者的需求逼出来不构成业务假设,仓库里这类引用 本来就有十几处。 Co-Authored-By: Claude Opus 5 (1M context) --- tests/contract/test_action_executor.py | 2 +- tests/contract/test_event_sink.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/contract/test_action_executor.py b/tests/contract/test_action_executor.py index eba5c84..6d6e136 100644 --- a/tests/contract/test_action_executor.py +++ b/tests/contract/test_action_executor.py @@ -85,7 +85,7 @@ def test_status_trigger_conditions_are_asserted_against_the_library_not_here(): """ -def test_who_supplies_the_observation_when_the_action_is_rejected(): +def test_the_observation_substitution_is_asserted_in_the_library_not_here(): """动作被拒绝时那段观察由库合成(`design/0007` 决策二),而判定发生在库这一侧。 执行器照常填自己的 `observation`——它不该知道库会不会采用,也不必知道:那段文本仍然 diff --git a/tests/contract/test_event_sink.py b/tests/contract/test_event_sink.py index 4e713b1..4623b40 100644 --- a/tests/contract/test_event_sink.py +++ b/tests/contract/test_event_sink.py @@ -20,7 +20,7 @@ async def test_emit_accepts_an_event(event_sink, records): await event_sink.emit(records.event()) -def test_a_sink_is_allowed_to_raise_on_delivery_failure(): +def test_a_raising_sink_is_compliant_so_this_layer_asserts_nothing(): """**这一层不断言「emit 不抛」——一个后端连不上时抛异常的出口是合规实现。** 契约写的是「投递失败由**库**捕获、记日志、把失败计数加一,然后继续跑」,所以要断言的 @@ -33,7 +33,7 @@ def test_a_sink_is_allowed_to_raise_on_delivery_failure(): """ -def test_failure_is_not_re_emitted_through_the_same_sink(): +def test_the_no_re_emission_guarantee_is_asserted_in_the_library_not_here(): """投递失败不再转成一条事件从同一个出口发出去(`design/0013` 决策七)。 那会自我喂食:一个持续失败的出口会让失败处理路径变成递归,而递归的表现是进程卡住或 @@ -45,7 +45,7 @@ def test_failure_is_not_re_emitted_through_the_same_sink(): """ -def test_audit_events_do_not_carry_the_model_output_the_store_does(): +def test_the_audit_trail_is_asserted_against_the_log_not_here(): """审计纪律由存储承担,不由事件流承担(`design/0013` 决策二)。 GovDoc 有一条硬纪律:agent 的原始输出、修复后的输出、恢复来源全程留痕,禁止静默修复。