fix(845): each read-back extraction dies with its own message, and the no-creator refusal stops asserting a cause

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019zUmJZHhVP7kXg5DV237TW
This commit is contained in:
2026-08-30 03:38:47 +02:00
co-authored by Claude Opus 5
parent 785edbe6e6
commit 09dcfe76fb
+14 -4
View File
@@ -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