Skip to content

Abuse cases, each with the test that proves it ​

Work item issue-557, testing-plan activity T8. Run on 2026-11-30 in the work item's checkout, with THE_LOOP_INSTANCE, THE_LOOP_WORK_ITEM and THE_LOOP_CLI_CONFIG unset.

Command ​

sh
cd cli && uv run python -m pytest -q -k "abuse or quiz_taken or banner"
text
431 passed, 7745 deselected in 11.81s

The table ​

Every abuse case of requirements.md § Security considerations, the mechanism from design.md § Security design, and the negative test. All pass.

#Abuse caseMechanismTest
1an unauthorized reply moves a gatethe handler never calls the graph; a comment with a second keyword is not an open commandtest_quiz_taken_integration.py::test_webhook_abuse_a_stranger_cannot_move_a_gate, …::test_webhook_a_reviewer_who_is_not_authorized_is_recorded_and_gates_nothing, test_quiz_taken_keyword.py::test_keyword_with_a_second_keyword_is_not_an_open_command
2an unauthorized tickedit-history attribution, unchangedthe quiz-gates scenario (test_pdlc_e2e_integration.py::test_the_spec_quiz_gate_obeys_only_an_authorized_tick_on_the_current_spec)
3extra text in the replythe signal has no body; the record and the writer take no text…::test_webhook_the_signal_carries_no_comment_text, …::test_poller_a_strangers_reply_becomes_a_signal_without_its_text, test_quiz_taken.py::test_store_holds_logins_and_times_and_nothing_else, test_quiz_banner.py::test_the_banner_module_takes_no_comment_text
4many accounts replyone row per login, 20 extra rows, a write only on a differencetest_quiz_banner.py::test_rows_repliers_who_were_never_asked_are_bounded, …::test_refresh_many_strangers_cost_one_write_each_and_a_bounded_table, test_quiz_taken_integration.py::test_webhook_a_second_reply_from_the_same_person_writes_nothing
5forged markersexactly one marker pair or no write; the fallback comment is found by stored id and edited only while it is the-loop's owntest_quiz_banner.py::test_place_refuses_markers_it_cannot_be_sure_of (6 cases), …::test_refresh_falls_back_to_a_comment_on_malformed_markers, …::test_refresh_never_edits_a_comment_that_is_not_its_own
6a login outside the grammarrefused before it is recorded or renderedtest_quiz_taken.py::test_store_refuses_anything_that_is_not_a_login (12 cases), test_quiz_banner.py::test_rows_drop_anything_that_is_not_a_login, test_quiz_taken_integration.py::test_webhook_abuse_a_login_outside_the_grammar_is_never_written (5 cases)
7markup in the spec or the diffthe page renders one JSON block as textui/check.md: hostile strings rendered as text, no element created from a string, hostile strings never executed, in 8 page-and-theme combinations
8a reply on an unrelated pull requestthe delivering-pull-request check comes first…::test_webhook_abuse_a_reply_on_a_pull_request_that_delivers_nothing_does_nothing
9the-loop's own comment, or a commenter GitHub does not confirmthe self-authored check; the comment is read back by id…::test_webhook_abuse_the_loops_own_comment_is_never_a_reply, …::test_poller_the_loops_own_comment_is_never_a_reply, …::test_webhook_abuse_a_sender_github_does_not_confirm_is_not_recorded (4 cases), …::test_webhook_abuse_a_comment_github_cannot_be_asked_about_is_not_recorded

Checks beyond the listed cases ​

WhatTest
a comment id from a webhook that is not a number never reaches a URLtest_quiz_banner_ops.py::test_a_comment_id_that_is_not_a_number_never_reaches_a_url
the keyword may not be spelled like a control keywordtest_quiz_taken_keyword.py::test_keyword_may_not_be_spelled_like_a_control_keyword
a link that is not a plain https URL, or a location that is not a repository path, is not printed in the bannertest_quiz_banner.py::test_render_drops_a_link_that_is_not_a_plain_https_url
a quiz record may not name a page in another repository, or a path with a parent-directory segmenttest_quiz.py::test_quiz_published_agrees_with_the_gate_on_what_a_location_is (12 cases)
a quiz-taken comment on a new work item cannot keep it from startingtest_quiz_taken_integration.py::test_poller_abuse_a_reply_cannot_keep_a_work_item_from_starting
a round, and so a reply, exists only on a pull request that carries the quiz commenttest_quiz_integration.py::test_a_round_starts_only_where_the_quiz_comment_was_posted
the instruction that keeps </script> inert names the escape sequencetest_quiz.py::test_the_escape_rule_is_spelled_out_wherever_the_agent_is_told_to_fill_the_block

Released under the MIT License.