test(8249): the caller-scoping contract is a property of the services, not four lists of names

Review of the signature-flagged tests:
- Four route files each listed service names by hand and checked each takes
  user_id. A new service without the caller passed them, and a renamed one
  failed them. They become one test over services/{design_systems,systems,
  rulebooks,snippets}.py: every public coroutine takes user_id, except eight
  named with the reason each needs none, and an exception for a function that
  is gone or now takes the caller fails too.
- test_routes_trash was four existence checks: blueprint name, registered,
  handlers callable, the service surface, delete's parameter names. It
  becomes one check that the three trash routes are on the app; what they do
  is proven by test_services_trash and test_mcp_tool_trash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 07:06:32 -05:00
co-authored by Claude Opus 5.5
parent f4f036c8a7
commit 5d764ecf2f
6 changed files with 69 additions and 86 deletions
-13
View File
@@ -26,19 +26,6 @@ def test_snippet_handlers_callable():
assert callable(getattr(routes, name))
def test_service_functions_take_user_id():
"""Routes must call snippet services with user_id — verify the contract."""
from grimoire.services import snippets as svc
for fn_name in (
"create_snippet", "list_snippets", "get_snippet", "update_snippet",
"delete_snippet", "merge_snippets", "record_verification",
"unmerge_snippet",
):
fn = getattr(svc, fn_name)
assert callable(fn)
assert "user_id" in inspect.signature(fn).parameters
def test_agent_and_web_surfaces_stay_at_parity():
"""The MCP tools and the REST routes are two callers of one service; a
capability on one has to exist on the other. Two doors maintained