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
-11
View File
@@ -25,14 +25,3 @@ def test_system_handlers_callable():
assert callable(getattr(routes, name))
def test_service_functions_take_user_id():
"""Routes must call systems services with user_id — verify the contract."""
from grimoire.services import systems as svc
for fn_name in (
"create_system", "list_systems", "get_system", "update_system",
"delete_system", "list_records_for_system", "list_issues",
"open_issue_counts_by_system",
):
fn = getattr(svc, fn_name)
assert callable(fn)
assert "user_id" in inspect.signature(fn).parameters