From 7309d612abf9c9893944cb018963ee95899c994c Mon Sep 17 00:00:00 2001 From: don-petry <36422719+don-petry@users.noreply.github.com> Date: Sat, 10 Oct 2026 21:23:38 +0000 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20implement=20issue=20#1286=20?= =?UTF-8?q?=E2=80=94=20persona-mention=20router=20skips=20any=20PR=20whose?= =?UTF-8?q?=20body=20quotes=20'\n## Summary\nautomated PR' + [ "$status" -eq 0 ] +} + +@test "pm_is_agent_authored_body ignores leading blank lines and indentation" { + run pm_is_agent_authored_body $'\n\n \n\nbody' + [ "$status" -eq 0 ] + run pm_is_agent_authored_body $' \t\nbody' + [ "$status" -eq 0 ] + run pm_is_agent_authored_body $'\r\n\r\nbody' + [ "$status" -eq 0 ] +} + +@test "pm_is_agent_authored_body does not match a marker quoted mid-body in prose" { + run pm_is_agent_authored_body $'## Summary\n\nThe `` marker is unchanged.' + [ "$status" -eq 1 ] +} + +@test "pm_is_agent_authored_body does not match a marker inside a later fenced code block" { + run pm_is_agent_authored_body $'## Summary\n\n```\n\n```' + [ "$status" -eq 1 ] +} + +@test "pm_is_agent_authored_body does not match an empty or blank body" { + run pm_is_agent_authored_body '' + [ "$status" -eq 1 ] + run pm_is_agent_authored_body $'\n \n' + [ "$status" -eq 1 ] +} + @test "pm_is_bot_actor recognises the agent identities" { run pm_is_bot_actor donpetry-bot [ "$status" -eq 0 ] @@ -716,6 +751,16 @@ runtime: [ "$status" -eq 1 ] } +@test "pm_pr_should_route allows a trusted human's PR that QUOTES the marker on a later line (#1286)" { + run pm_pr_should_route don-petry don-petry OWNER $'## Summary\n\nThe `` marker is unchanged.' + [ "$status" -eq 0 ] +} + +@test "pm_pr_should_route blocks a PR whose body leads with the marker after blank lines (axis 2)" { + run pm_pr_should_route don-petry don-petry OWNER $'\n\n\nautomated PR' + [ "$status" -eq 1 ] +} + @test "pm_pr_should_route blocks a PR from an author below the default floor" { run pm_pr_should_route drive-by drive-by CONTRIBUTOR "PR body" [ "$status" -eq 1 ] From 2b49cae9397282d6bfdada4f533dbd7b9b0ff7c2 Mon Sep 17 00:00:00 2001 From: don-petry <36422719+don-petry@users.noreply.github.com> Date: Sat, 10 Oct 2026 22:11:22 +0000 Subject: [PATCH 2/4] docs(tests): add comment explaining how tests verify workflow's startsWith() condition Anchor the pull_request pre-filter tests to the workflow expression !startsWith(github.event.pull_request.body, '