From 92e38ff17be46f5c11a95044cb995dc44189ab2b Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 21 Aug 2026 11:26:01 -0400 Subject: [PATCH] test(routes): the prior-art contract guards read the handler plus its _project_scope helper (area 5 follow-up) Co-Authored-By: Claude Fable 5 --- tests/test_write_path_trigger.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_write_path_trigger.py b/tests/test_write_path_trigger.py index ed0ea75..fa9a905 100644 --- a/tests/test_write_path_trigger.py +++ b/tests/test_write_path_trigger.py @@ -764,7 +764,11 @@ def test_route_reads_every_arg_the_hook_sends(): import inspect from scribe.routes import plugin as routes - src = inspect.getsource(routes.write_path_prior_art) + # The handler plus the query-scope helper it delegates repo/project_id + # to — the contract is what the ROUTE MODULE reads, wherever it reads it. + src = inspect.getsource(routes.write_path_prior_art) + inspect.getsource( + routes._project_scope + ) for arg in ("path", "code", "repo", "project_id", "exclude_ids", "exclude_sync_ids", "shapes"): assert f'request.args.get("{arg}"' in src, f"route ignores {arg}" @@ -782,7 +786,9 @@ def test_route_resolves_repo_to_a_project_not_to_a_location_filter(): import inspect from scribe.routes import plugin as routes - src = inspect.getsource(routes.write_path_prior_art) + src = inspect.getsource(routes.write_path_prior_art) + inspect.getsource( + routes._project_scope + ) assert "resolve_project" in src assert "repo=repo" not in src