Milestone 639 step 2: typed rules, one delivery order, per-delivery records, triggers, lifecycle #224

Merged
bvandeusen merged 5 commits from dev into main 2026-11-22 18:51:03 -05:00
Showing only changes of commit 7df478550f - Show all commits
+8 -1
View File
@@ -721,7 +721,8 @@ def test_the_hook_and_the_route_agree_on_every_parameter_name():
sent = set(re.findall(r"[?&]([a-z_]+)=", hook))
# `root` and `cwd`: where the command runs, so the paths it
# names can be made repo-relative for the rulings arm.
assert sent == {"tool", "command", "exclude_rule_ids", "root", "cwd"}, sent
# `session_id`: which session the lines go to, for the delivery record.
assert sent == {"tool", "command", "exclude_rule_ids", "root", "cwd", "session_id"}, sent
# The project-scope key is the shared helper's to choose: the hook
# splices in `grimoire_scope_query`'s output, which is `repo=` inside a git
@@ -763,6 +764,12 @@ def test_the_hook_and_the_route_agree_on_every_parameter_name():
assert f'request.args.get("{arg}")' in handler, (
f"the hook sends {arg!r} and the route never reads it"
)
# The session is bound for every plugin route at once, before the handler.
binder = route.split("async def _bind_delivery_session")[1].split("\n@plugin_bp")[0]
assert "@plugin_bp.before_request" in route.split("async def _bind_delivery_session")[0][-80:]
assert 'request.args.get("session_id")' in binder, (
"the hook sends session_id and no route reads it"
)
# ── The CALL log is unconditional; the SURFACING log is not ───────────