From 09dcfe76fb994d048060cdee3fb8193ec7791ab4 Mon Sep 17 00:00:00 2001 From: Timothy Date: Sat, 29 Aug 2026 23:11:32 +0200 Subject: [PATCH] fix(845): each read-back extraction dies with its own message, and the no-creator refusal stops asserting a cause MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Probed, not reasoned: a `creator` arriving as a STRING rather than an object makes jq exit 5 ("Cannot index string with string"). That already failed closed — the abort lands before the comment — but with only jq's stderr, which never says a status was left standing on the head. Each extraction now carries its own message. The no-creator refusal said the status "is how a status posted by an ACTIONS token appears". Three shapes reach that branch (`creator` absent, null, or an empty login) and only one of them is an Actions token, so the message now states the fact first and offers the cause as the likely one rather than the established one. fixes #845 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_019zUmJZHhVP7kXg5DV237TW --- scripts/post-review-verdict.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/post-review-verdict.sh b/scripts/post-review-verdict.sh index 5d02a471b..28ecdfa84 100755 --- a/scripts/post-review-verdict.sh +++ b/scripts/post-review-verdict.sh @@ -301,9 +301,16 @@ fi # so the two stay wrong or right together. `.state` is accepted as a fallback only so a server that # spells it the other way degrades to working rather than to a deadlock; it is never a second source # of truth, because the value still has to EQUAL the state this run posted. -readback_state=$(printf '%s' "$readback_entry" | jq -r '(.status // .state) // ""') -readback_desc=$(printf '%s' "$readback_entry" | jq -r '.description // ""') -readback_creator=$(printf '%s' "$readback_entry" | jq -r '.creator.login // ""') +# Each extraction carries its own `|| die`. Without one they still fail closed — a jq error under +# `set -e` aborts the script before the comment — but with only jq's own stderr, which does not say +# that a status was left standing on the head. `.creator` arriving as a STRING rather than an object +# is the shape that reaches this (probed: jq exits 5, "Cannot index string with string"). +readback_state=$(printf '%s' "$readback_entry" | jq -r '(.status // .state) // ""') \ + || die "the '$STATUS_CONTEXT' status was posted on $short but its state could not be read from the response — no comment was written." +readback_desc=$(printf '%s' "$readback_entry" | jq -r '.description // ""') \ + || die "the '$STATUS_CONTEXT' status was posted on $short but its description could not be read from the response — no comment was written." +readback_creator=$(printf '%s' "$readback_entry" | jq -r '.creator.login // ""') \ + || die "the '$STATUS_CONTEXT' status was posted on $short but its creator could not be read from the response — no comment was written. The verdict is UNPROVEN, not necessarily wrong." # A row carrying NEITHER key is a SHAPE problem, not an overwrite. Kept separate because a refusal # that states a cause which did not happen is its own defect class in this repo (#859): "something # overwrote it" would send the reader looking for a race that never occurred. @@ -318,7 +325,10 @@ if [ "$readback_state" != "$state" ] || [ "$readback_desc" != "$status_desc" ]; die "the '$STATUS_CONTEXT' status standing on $short is not the one just written (state '$readback_state', description '$readback_desc') — something overwrote it, so this verdict is not in force. No comment was written. Re-review the current head and run this again." fi if [ -z "$readback_creator" ]; then - die "the '$STATUS_CONTEXT' status on $short reads back with no creator, which is how a status posted by an ACTIONS token appears. The gate never inherits one of those as a reviewer verdict (ersatztv#742), so this verdict would be silently re-derived. No comment was written. Post it with a reviewer's own credential." + # States the fact first and the likely cause second. `creator` absent, null, or carrying an empty + # login all land here; an ACTIONS-token status is the one that actually occurs, but saying it IS + # one would assert a cause this response cannot establish. + die "the '$STATUS_CONTEXT' status on $short reads back with no attributable creator (absent, null, or an empty login). A status POSTed by an ACTIONS token reads exactly this way, and the gate never inherits one as a reviewer verdict (ersatztv#742), so this verdict would be silently re-derived. No comment was written. Post it with a reviewer's own credential." fi # Explicit capture rather than `if ! etv_h10_reviewers_contains ...`, so the THIRD outcome cannot be # folded into the second. The function answers 0 member / 1 not-a-member / 2 cannot-tell, and an