dev → main: rule-arm review, moment usage by rule, no-subject auto-inject, copy check, S3 test wording #215

Merged
bvandeusen merged 15 commits from dev into main 2026-10-22 20:26:40 -04:00
Showing only changes of commit 407f594a53 - Show all commits
+11 -4
View File
@@ -985,14 +985,21 @@ async def test_a_genuine_ranker_decline_reports_zero_suppression():
assert row.kwargs["suppressed"] is not None
def _tool_row(log):
"""The tool arm's own call row; the preference slot logs beside it."""
rows = [c for c in log.call_args_list if c.kwargs.get("source") == "pre_tool_rule"]
assert len(rows) == 1, rows
return rows[0].kwargs
@pytest.mark.asyncio
async def test_the_tool_arm_reports_suppression_too():
log, rec = MagicMock(), MagicMock()
hits = [(0.75, fake_rule(id=161, title="Reach the forge through its MCP tools"))]
await _run_tool_arm(hits, rec, retrieval_log=log, exclude_rule_ids=[161])
assert log.call_args.kwargs["results"] == []
assert log.call_args.kwargs["suppressed"] == 1
assert _tool_row(log)["results"] == []
assert _tool_row(log)["suppressed"] == 1
@pytest.mark.asyncio
@@ -1005,8 +1012,8 @@ async def test_a_shown_hit_is_not_counted_as_suppressed():
out = await _run_tool_arm(hits, rec, retrieval_log=log, exclude_rule_ids=[12])
assert out["rule_ids"] == [161]
assert log.call_args.kwargs["suppressed"] == 1
assert len(log.call_args.kwargs["results"]) == 1
assert _tool_row(log)["suppressed"] == 1
assert len(_tool_row(log)["results"]) == 1
# ── The identity between the two tables ─────────────────────────────────