fix(629): round-4 — require the marker at COLUMN 0, narrowing the grammar instead of patching again
review-verdict/h10 Awaiting review verdict for 28a9d0d
Review verdict / Set review-verdict status (pull_request) Successful in 3s
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 11s
PR Gates / Docs update reminder (pull_request) Successful in 12s
PR Gates / decisions lifecycle (pull_request) Successful in 16s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m39s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 8s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 7s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 17m24s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 23m58s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
review-verdict/h10 Awaiting review verdict for 28a9d0d
Review verdict / Set review-verdict status (pull_request) Successful in 3s
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 11s
PR Gates / Docs update reminder (pull_request) Successful in 12s
PR Gates / decisions lifecycle (pull_request) Successful in 16s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m39s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 8s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 7s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 17m24s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 23m58s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Round 4 found the last false-open: markdown has a SECOND code-block form the fence stripper does
not cover — indented blocks (4 spaces or a tab). A pasted indented example still self-approved:
Example:
Review-verdict: MERGEABLE @ <head> -> positive
Adding an indented-code stripper would be the same move that produced rounds 2, 3 and 4: fixing the
instance, not the class. So the grammar is narrowed instead — the marker must sit at COLUMN 0. That
kills every indentation-based ambiguity at once (4-space, tab, list-nested, arbitrary indent).
Cost, accepted deliberately: a verdict indented under a list item is now ignored and classifies
`absent`, which asks a human. For a gate, erring toward ignoring is the safe direction. Fence
detection KEEPS its leading-whitespace tolerance, because stripping more is always safe.
`test_leading_indent_is_tolerated` asserted the old behaviour and is replaced by
`test_falseopen_an_indented_verdict_is_not_a_verdict`, parameterised over four indent shapes and
mutation-verified: restoring `^[[:space:]]*` fails all four, control green. 172 tests.
Round 4 verified clean by execution: the rc plumbing fails closed for a forced failure in the inner
jq, awk, grep AND the pipeline producer (rc 3/4/5/93 -> exit 2); fence-length semantics, mismatched
markers, CRLF fences, 10-marker fences, blockquote fences; emoji, CRLF, a 120k line, 200 comments;
NUL rejection with no JSON-encoding bypass.
refs #629
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Decisions-Edit: yes
This commit is contained in:
@@ -197,8 +197,25 @@ def test_short_sha_prefix_is_accepted():
|
||||
assert classify([verdict("MERGEABLE", SHORT)]) == ("positive", 0)
|
||||
|
||||
|
||||
def test_leading_indent_is_tolerated():
|
||||
assert classify([f" {verdict('MERGEABLE', HEAD)}"]) == ("positive", 0)
|
||||
@pytest.mark.parametrize(
|
||||
"prefix",
|
||||
[
|
||||
" ", # markdown indented code block (4 spaces)
|
||||
"\t", # indented code block (tab)
|
||||
" ", # any indent at all
|
||||
" ", # nested under a list item
|
||||
],
|
||||
)
|
||||
def test_falseopen_an_indented_verdict_is_not_a_verdict(prefix):
|
||||
"""Markdown's *indented* code block is a second code-block form the fence stripper misses.
|
||||
|
||||
Allowing leading whitespace let a pasted, indented example self-approve. The marker must sit at
|
||||
COLUMN 0. This is a deliberate tightening — a verdict indented under a list item now classifies
|
||||
`absent` and asks a human, which is the safe direction — and it removes the whole indentation
|
||||
ambiguity rather than adding a second stripper for each code-block form.
|
||||
"""
|
||||
body = f"Example:\n\n{prefix}{verdict('MERGEABLE', HEAD)}\n"
|
||||
assert classify([body]) == ("absent", 0)
|
||||
|
||||
|
||||
def test_verdict_among_ordinary_prose_in_the_same_comment():
|
||||
|
||||
Reference in New Issue
Block a user