From 32db56c0dffdc19ef6640c9174ea294329b50080 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 11 Sep 2026 16:38:14 -0400 Subject: [PATCH] fix(394): the co_surfaces test could no longer fail, so it was repaired not relaxed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last run left one failure, and it was the useful kind: the partner ARRIVED (the scoping fix in 9c5ab1d worked) but carried no `via`, because it came through the ordinary query rather than being dragged in by the edge. The assertion was about to be read as "the edge is broken". It was not. The edge was never exercised: since 394 an untagged rule in a subscribed rulebook applies on its own, so the partner was already applicable and there was nothing left for `co_surfaces` to do. The test had quietly stopped testing anything — passing the first assertion for a reason unrelated to the mechanism it names. Rule 167's case exactly, so the fix is to restore its ability to fail rather than to soften the assertion. The partner is now TAGGED to an area this project does not work in, which puts it out of reach of everything except the edge, and the test asserts that unreachability before drawing the relation. If the edge ever stops dragging partners in, this fails again — which it could not have done a commit ago. The neighbouring suppression test keeps an UNTAGGED partner, deliberately and now explicitly: that one is about a suppression outranking an edge, so its partner should be reachable by every route, not none. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011cPyzNnegXHr5iRMzzy5KJ --- tests/test_integration_rule_surfacing.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_integration_rule_surfacing.py b/tests/test_integration_rule_surfacing.py index cf1302e..1825954 100644 --- a/tests/test_integration_rule_surfacing.py +++ b/tests/test_integration_rule_surfacing.py @@ -118,6 +118,19 @@ async def test_co_surfaces_drags_in_the_half_that_would_have_been_missed(world): "A name decides nothing.", when_to_apply="when naming a build", ) + # TAGGED TO AN AREA THIS PROJECT DOES NOT WORK IN, which is what makes the + # test able to fail at all. Since milestone 394 an UNTAGGED rule in a + # subscribed rulebook applies on its own, so an untagged partner arrives + # through the ordinary query and the edge is never exercised — the + # assertion below passed while proving nothing, which is how this was + # noticed. Tagging it puts it out of reach of everything except the edge. + area = await canonical_svc.find_by_name("CI & Release") + assert area is not None, "migration 0087 seeds the standard vocabulary" + await rulebooks_svc.set_rule_systems(partner.id, world["owner"], [area.id]) + assert "Version names are labels" not in await _titles(world), ( + "the partner must be unreachable on its own, or this test cannot fail" + ) + await rulebooks_svc.add_rule_relation( world["owner"], world["plain"], partner.id, "co_surfaces", note="they fail together", @@ -132,6 +145,9 @@ async def test_co_surfaces_drags_in_the_half_that_would_have_been_missed(world): async def test_a_suppression_outranks_an_edge(world): """The edge says these belong together; the suppression says this project does not want that one. An explicit decision beats an inferred one.""" + # Untagged on purpose, unlike the partner above: this test is about the + # SUPPRESSION winning, so the partner should be one that would otherwise + # arrive by every available route — the ordinary query AND the edge. partner = await rulebooks_svc.create_rule( world["topic"], world["owner"], "Muted partner", "Should not arrive.", )