Take a wider place for a gate's place only when the role names no place elsewhere, so London; Europe stays in London and Aarhus; Denmark does not meet Copenhagen

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-05 09:53:25 +02:00
1 parent 8c3c51dd9f
commit 9da9bd7942
2 files changed
+57 -19

No files matched your search

+24
View File
@@ -417,6 +417,30 @@ def test_a_region_that_holds_the_agents_places_is_no_evidence_against(
assert oresund not in {r.uid for r in store.roles(places=["country:DK"])}
def test_a_wider_place_beside_a_place_elsewhere_is_no_match(
store: Store, config: Config, fake: FakeEmbedder) -> None:
"""Europe alone is no evidence against Denmark; `London; Europe` is in
London, and `Aarhus; Denmark` is not in Copenhagen."""
europe = role(store, "1", place="Europe", remote="onsite")
london = role(store, "2", place="London; Europe", remote="onsite")
aarhus = role(store, "3", place="Aarhus; Denmark", remote="onsite")
denmark = role(store, "4", place="Denmark", remote="onsite")
by_country = store.save_agent("Denmark", "", [
Gate(field="country", values=["DK"], mode="any")])
by_town = store.save_agent("Copenhagen", "", [
Gate(field="place", values=["copenhagen"], mode="any")])
run(config, store, score.run_score)
scores = store.scores(by_country.id)
assert scores[europe][1] == "" and scores[aarhus][1] == "" and scores[denmark][1] == ""
assert scores[london] == (0.0, "none of country DK")
scores = store.scores(by_town.id)
assert scores[europe][1] == "" and scores[denmark][1] == ""
assert scores[london] == (0.0, "none of place copenhagen")
assert scores[aarhus] == (0.0, "none of place copenhagen")
def test_a_country_that_holds_the_agents_town_is_no_match_for_a_role_placed_elsewhere(
store: Store, config: Config, fake: FakeEmbedder) -> None:
"""Sweden holds Malmö, yet a role in Stockholm is evidence against it."""