Skip to content
Merged
66 changes: 65 additions & 1 deletion .github/workflows/scripts/check-review-execution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,75 @@ review_text_file="$(mktemp)"
# the reader cannot see. A single-verdict transcript (the common case, and
# the gha#173 wrap-up-after-verdict shape) selects exactly that one block,
# unchanged.
# gha#805: the gha#710 widening has a failure mode of its own. A reviewer that
# REDRAFTS its final message -- re-running an instrument between drafts, each
# draft a complete review with its own `### Verdict` heading and
# structured-review-data block -- produced three verdict-bearing blocks, and
# the span rule concatenated all three (measured on Morrison-Lab/ai-config#2966,
# run 33594599768: three `## Review` headings, three verdicts, two
# Stopping-Point lines in one comment). The two shapes are told apart by the
# HEADING form: a complete draft carries `### Verdict` (or any `#` heading
# naming it), while the gha#710 follow-up tail writes a line-start `Verdict:`
# line (verdict-split-across-blocks.json, block 2), which $vidx matches and
# this does not. So when more than one block carries a verdict HEADING, the
# span starts at the LAST such block: the earlier drafts were superseded by
# their author, and the tail after the last draft is still kept. One heading
# (the gha#710 shape, and the common case) leaves the span rule exactly as it
# was.
#
# A heading is AUTHORED only outside a fenced code block and outside a
# blockquote. This corpus quotes the literal heading constantly -- CLAUDE.md,
# this file, every fixture, and a review OF this file -- so a later block that
# merely shows the heading shape in a fence, or blockquotes the previous
# verdict for context, must not read as a fresh draft: with the bare regex it
# did, and the span then started at the quotation and dropped the entire real
# review (gha#808 review). That is the failure gha#710 exists to prevent, and
# it is worse than the concatenation this fixes. A fence closes only on a run
# of the SAME character at least as long as the opener (CommonMark, and what
# strip-non-invoking-markup.sh implements); a first draft closed on any
# fence line, so a backtick fence containing a tilde line "closed" early and
# its heading counted (gha#808 review round 1). An unclosed fence runs to the
# end of its block, again per CommonMark: a redraft whose own code sample is
# never closed hides its own heading from this test, exactly as GitHub would
# hide it from the reader, and the block then falls back to the gha#710 span
# rule. That is malformed input rendered faithfully, not a case to special-
# case, since ignoring unclosed fences would re-admit the quoted-heading drop.
# The third literal construct, an INDENTED code block, needs no state at all:
# a heading may be indented by at most three spaces (CommonMark), so a line
# at four columns or a tab is never a heading, whether it is code or a lazy
# paragraph continuation. The heading test says {0,3} rather than [ \t]* for
# exactly that reason (gha#808 review round 3, which reproduced the drop with
# indentation instead of a fence).
jq -r '
def authored_heading:
( split("\n")
| reduce .[] as $l ({fence: "", flen: 0, out: []};
# Spaces only in the indentation allowance: a tab is four columns in
# CommonMark, so a tab-led fence line is indented code, not a fence
# (Copilot on gha#808).
( [ $l | capture("^ {0,3}(?<run>`{3,}|~{3,})(?<rest>.*)$") ] | first ) as $f
| if $f != null and .fence == ""
then .fence = ($f.run[0:1]) | .flen = ($f.run | length)
# A closer carries nothing but whitespace after its run; a run
# followed by text is fence content (CommonMark; the info-string
# form is legal only on an opener). gha#808 review round 2.
elif $f != null and ($f.run[0:1]) == .fence and ($f.run | length) >= .flen
and ($f.rest | test("^[ \\t]*$"))
then .fence = "" | .flen = 0
elif .fence != "" or ($l | test("^[ \\t]*>")) then .
else .out += [$l] end)
| .out | join("\n") )
# One to six hashes, then at least one space or tab: seven hashes, or
# hashes run into the word, are paragraph text in CommonMark (Copilot on
# gha#808). The awk invariant in run-fixture-tests.sh mirrors both limits.
| test("(?im)^ {0,3}#{1,6}[ \\t]+verdict\\b");
. as $blocks
| [ range(0; $blocks | length)
| select($blocks[.] | test("(?im)^[\\s>*_#-]*verdict\\b")) ] as $vidx
| if ($vidx | length) > 1
| [ $vidx[] | select($blocks[.] | authored_heading) ] as $hidx
| if ($hidx | length) > 1
then $blocks[($hidx | last):(($vidx | last) + 1)] | join("\n\n")
elif ($vidx | length) > 1
then $blocks[($vidx | first):(($vidx | last) + 1)] | join("\n\n")
elif ($vidx | length) == 1
then $blocks[$vidx | first]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"type": "system",
"subtype": "init"
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe iota-pass first draft of the analysis.\n\n### Verdict\n\n**Ready for merge.**\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe iota-pass second draft, whose tab-led backtick line is indented code and opens no fence:\n\n\t```\n\n### Verdict\n\n**Ready for merge.**\n"
}
]
}
},
{
"type": "result",
"subtype": "success",
"is_error": false,
"num_turns": 9,
"duration_ms": 120000,
"total_cost_usd": 1.46,
"permission_denials_count": 0,
"permission_denials": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[
{
"type": "system",
"subtype": "init"
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe change is sound. First draft names the alpha-pass fixture table.\n\n### Verdict\n\n**Ready for merge.**\n\n<!-- review-data:\n{\"schema\": \"1.1\", \"verdict\": \"ready\", \"draft\": 1}\n-->\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "Confirmed via the authoritative instrument: exit 1, five in-progress bullets, no failures. My content verdict stands unchanged."
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe change is sound. Second draft names the beta-pass fixture table.\n\n### Verdict\n\n**Ready for merge.**\n\n<!-- review-data:\n{\"schema\": \"1.1\", \"verdict\": \"ready\", \"draft\": 2}\n-->\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe change is sound. Third draft names the gamma-pass fixture table.\n\n### Verdict\n\n**Ready for merge.**\n\n<!-- review-data:\n{\"schema\": \"1.1\", \"verdict\": \"ready\", \"draft\": 3}\n-->\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "Instrument re-run after the third draft: still exit 0, the delta-pass tail is retained.\n\nVerdict: Ready for merge."
}
]
}
},
{
"type": "result",
"subtype": "success",
"is_error": false,
"num_turns": 9,
"duration_ms": 120000,
"total_cost_usd": 2.34,
"permission_denials_count": 0,
"permission_denials": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"type": "system",
"subtype": "init"
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe theta-pass analysis of the diff: sound, and the fixture discriminates.\n\n### Verdict\n\n**Ready for merge.**\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "For reference, the heading shape as an indented code sample:\n\n ### Verdict\n\nand a paragraph continuation that is not code:\nsome prose\n ### Verdict continued on an indented line\n\nNeither is a new verdict."
}
]
}
},
{
"type": "result",
"subtype": "success",
"is_error": false,
"num_turns": 9,
"duration_ms": 120000,
"total_cost_usd": 1.45,
"permission_denials_count": 0,
"permission_denials": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"type": "system",
"subtype": "init"
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe zeta-pass analysis of the diff: sound, and the fixture discriminates.\n\n### Verdict\n\n**Ready for merge.**\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "The stripper's own test table shows the shape:\n\n```\n~~~\n### Verdict\n~~~\n```\n\nThat is documentation, not a new verdict."
}
]
}
},
{
"type": "result",
"subtype": "success",
"is_error": false,
"num_turns": 9,
"duration_ms": 120000,
"total_cost_usd": 1.43,
"permission_denials_count": 0,
"permission_denials": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"type": "system",
"subtype": "init"
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe epsilon-pass analysis of the diff: the guard change is sound and the fixture discriminates.\n\n### Verdict\n\n**Ready for merge.**\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "For the record, the heading shape the extractor keys on looks like this:\n\n```\n### Verdict\n```\n\nand the previous round said:\n\n> ### Verdict\n> Needs more work.\n\n### Verdicts of prior rounds\n\n####### Verdict\n\n###Verdict\n\nNeither of those is a new verdict; the one above stands."
}
]
}
},
{
"type": "result",
"subtype": "success",
"is_error": false,
"num_turns": 9,
"duration_ms": 120000,
"total_cost_usd": 1.42,
"permission_denials_count": 0,
"permission_denials": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"type": "system",
"subtype": "init"
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe kappa-pass analysis of the diff: sound, and the fixture discriminates.\n\n### Verdict\n\n**Ready for merge.**\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "The shape, with a tab-led backtick line inside a real fence (fence content, not a closer):\n\n```\n\t```\n### Verdict\n```\n\nThat is documentation, not a new verdict."
}
]
}
},
{
"type": "result",
"subtype": "success",
"is_error": false,
"num_turns": 9,
"duration_ms": 120000,
"total_cost_usd": 1.47,
"permission_denials_count": 0,
"permission_denials": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"type": "system",
"subtype": "init"
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "## Review\n\nThe eta-pass analysis of the diff: sound, and the fixture discriminates.\n\n### Verdict\n\n**Ready for merge.**\n"
}
]
}
},
{
"type": "assistant",
"message": {
"content": [
{
"type": "text",
"text": "The shape, with a line that looks like a closer but is not:\n\n```\nfoo\n```not-a-closer\n### Verdict\n```\n\nThat is documentation, not a new verdict."
}
]
}
},
{
"type": "result",
"subtype": "success",
"is_error": false,
"num_turns": 9,
"duration_ms": 120000,
"total_cost_usd": 1.44,
"permission_denials_count": 0,
"permission_denials": []
}
]
Loading
Loading