feat(8205): a System with rulings and no file patterns is flagged
CI & Build / TypeScript typecheck (push) Canceled after 0s
CI & Build / Plugin hooks (push) Canceled after 0s
CI & Build / Python lint (push) Canceled after 0s
CI & Build / Python tests (push) Canceled after 0s
CI & Build / integration (push) Canceled after 0s
CI & Build / Build & push image (push) Canceled after 0s

Its rulings reach no session: delivery is by path_patterns alone. enter_project
carries rulings_undelivered (absent when none) with the fix call, the Systems
list reads ruling_count, and the System card says so with a button to name
its files. A System without rulings is not flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-28 17:49:24 -05:00
co-authored by Claude Opus 5.5
parent 98a959de4f
commit 3e87df6c84
6 changed files with 104 additions and 0 deletions
+32
View File
@@ -239,3 +239,35 @@ async def test_a_write_with_no_prior_art_still_carries_its_areas_rulings():
args, kwargs = rulings.call_args
assert args[2] == ["src/a.py"]
assert kwargs["seen"] == [9] and kwargs["source"] == "rulings_write_path"
# ── a System whose rulings reach nobody ───────────────────────────────────
def _system(sid, *, description, patterns):
return SimpleNamespace(id=sid, name=f"Area {sid}", description=description,
path_patterns=patterns)
RULED = "What it does.\n\n## Rulings\n\n- **One decision** (operator, a date).\n- **Another.**\n"
def test_a_system_with_rulings_and_no_files_is_named_as_undelivered():
systems = [
_system(1, description=RULED, patterns=[]),
# Files named: its rulings are delivered on them.
_system(2, description=RULED, patterns=["src/area/**"]),
# No rulings: nothing to deliver, so nothing to flag.
_system(3, description="What it does.", patterns=[]),
]
assert sr.undelivered(systems) == [{"id": 1, "name": "Area 1", "rulings": 2}]
def test_enter_project_carries_the_flag_only_when_a_system_needs_it():
from grimoire.mcp.tools.projects import _rulings_undelivered
flagged = _rulings_undelivered([_system(1, description=RULED, patterns=[])])
assert flagged["rulings_undelivered"]["systems"] == [{"id": 1, "name": "Area 1", "rulings": 2}]
assert "update_system" in flagged["rulings_undelivered"]["fix"]
# Absent, not empty, when every ruled System names its files.
assert _rulings_undelivered([_system(2, description=RULED, patterns=["src/**"])]) == {}