From af5edd5c3ff92a4d1819b0be3c70c25b6c6eb39a Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 2 Dec 2026 16:49:53 -0500 Subject: [PATCH] test(8249): the prior-art and moment contract tests count the session binder as a reader of session_id They subtracted session_id from what the hook sent, and their failure message still listed it. The binder that runs before every plugin route reads it, so it is passed to route_query_args beside the handler and the scope helper. Co-Authored-By: Claude Opus 5.5 --- tests/test_moment_delivery.py | 4 ++-- tests/test_write_path_trigger.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_moment_delivery.py b/tests/test_moment_delivery.py index fa5884e3..c80b000b 100644 --- a/tests/test_moment_delivery.py +++ b/tests/test_moment_delivery.py @@ -360,8 +360,8 @@ def test_the_route_reads_every_name_the_hook_sends(tmp_path): last = [e for e in seen if e["_path"] == "/api/plugin/moment"][-1] sent = {k for k in last if not k.startswith("_")} assert {"exclude_rule_ids", "held_rule_ids", "shapes_seen"} <= sent, sent - read = route_query_args(routes.moment, routes._project_scope) - assert sent - {"session_id"} <= read, f"the route ignores {sorted(sent - read)}" + read = route_query_args(routes.moment, routes._project_scope, routes._bind_delivery_session) + assert sent <= read, f"the route ignores {sorted(sent - read)}" assert {"tool_name", "tool_input"} <= set(json.loads(last["_body"])) diff --git a/tests/test_write_path_trigger.py b/tests/test_write_path_trigger.py index b71be78c..2279d18a 100644 --- a/tests/test_write_path_trigger.py +++ b/tests/test_write_path_trigger.py @@ -972,8 +972,9 @@ def test_route_reads_every_arg_the_hook_sends(tmp_path): # Every ledger the hook keeps went out, so this run exercised the whole query. assert {"path", "code", "repo", "shapes", "exclude_ids", "exclude_sync_ids", "exclude_rule_ids", "exclude_derive", "held_rule_ids", "seen_ruling_systems"} <= sent, sent - read = route_query_args(routes.write_path_prior_art, routes._project_scope) - assert sent - {"session_id"} <= read, f"the route ignores {sorted(sent - read)}" + read = route_query_args(routes.write_path_prior_art, routes._project_scope, + routes._bind_delivery_session) + assert sent <= read, f"the route ignores {sorted(sent - read)}" # project_id is the other scope key the hook can send (from a project marker). assert "project_id" in read