RCA: sop-tier refire always posts success after evaluator failure #2140

Closed
opened 2026-06-02 21:19:36 +00:00 by molecule-code-reviewer · 1 comment
Member

MECHANISM
/refire-tier-check can overwrite the protected sop-tier-check / tier-check (pull_request) status with success even when the underlying tier evaluator fails. .gitea/scripts/sop-tier-refire.sh invokes sop-tier-check.sh with bash "$SCRIPT" || true, then unconditionally sets TIER_EXIT=0. The subsequent status-posting branch therefore always chooses STATE=success. This contradicts the script header, which says refire should post success on evaluator exit 0 and failure on non-zero. Because the posted context byte-matches the branch-protection-required tier context, this can mask a real tier-approval failure after a collaborator comments /refire-tier-check.

EVIDENCE
Current molecule-core main inspected at 58dc5f7. sop-tier-refire.sh:15-18 documents the intended behavior: post failure on non-zero with context sop-tier-check / tier-check (pull_request). sop-tier-refire.sh:129-137 runs the evaluator with || true and then sets TIER_EXIT=0; sop-tier-refire.sh:140-147 posts success whenever TIER_EXIT is 0; sop-tier-refire.sh:154-166 POSTs that status to the PR head SHA. The canonical workflow still sets SOP_FAIL_OPEN=1 and || true in sop-tier-check.yml:112-131, but the refire header explicitly claims status truthfulness. Log excerpt: TIER_EXIT=0.

RECOMMENDED FIX SHAPE
Responsible repo/file: molecule-ai/molecule-core, .gitea/scripts/sop-tier-refire.sh plus .gitea/scripts/tests/test_sop_tier_refire.sh. Capture the real exit code from sop-tier-check.sh before continuing, and post failure when the evaluator returns non-zero. If CTO intentionally wants canonical tier-check to remain job-fail-open, separate job conclusion from posted protected status; the protected status must reflect the evaluator result. Add tests for a mock tier-check returning 1 and assert the refire POST body has state=failure, and for returning 0 assert state=success.

MECHANISM `/refire-tier-check` can overwrite the protected `sop-tier-check / tier-check (pull_request)` status with success even when the underlying tier evaluator fails. `.gitea/scripts/sop-tier-refire.sh` invokes `sop-tier-check.sh` with `bash "$SCRIPT" || true`, then unconditionally sets `TIER_EXIT=0`. The subsequent status-posting branch therefore always chooses `STATE=success`. This contradicts the script header, which says refire should post success on evaluator exit 0 and failure on non-zero. Because the posted context byte-matches the branch-protection-required tier context, this can mask a real tier-approval failure after a collaborator comments `/refire-tier-check`. EVIDENCE Current molecule-core main inspected at `58dc5f7`. `sop-tier-refire.sh:15-18` documents the intended behavior: post failure on non-zero with context `sop-tier-check / tier-check (pull_request)`. `sop-tier-refire.sh:129-137` runs the evaluator with `|| true` and then sets `TIER_EXIT=0`; `sop-tier-refire.sh:140-147` posts success whenever `TIER_EXIT` is 0; `sop-tier-refire.sh:154-166` POSTs that status to the PR head SHA. The canonical workflow still sets `SOP_FAIL_OPEN=1` and `|| true` in `sop-tier-check.yml:112-131`, but the refire header explicitly claims status truthfulness. Log excerpt: `TIER_EXIT=0`. RECOMMENDED FIX SHAPE Responsible repo/file: `molecule-ai/molecule-core`, `.gitea/scripts/sop-tier-refire.sh` plus `.gitea/scripts/tests/test_sop_tier_refire.sh`. Capture the real exit code from `sop-tier-check.sh` before continuing, and post `failure` when the evaluator returns non-zero. If CTO intentionally wants canonical tier-check to remain job-fail-open, separate job conclusion from posted protected status; the protected status must reflect the evaluator result. Add tests for a mock tier-check returning 1 and assert the refire POST body has `state=failure`, and for returning 0 assert `state=success`.
Member

Closing as MOOT: the SOP-tier system (.gitea/scripts/sop-tier-refire.sh + .gitea/workflows/sop-tier-check.yml) was retired in #2407 (single uniform gate, CTO decision); the replacement fail-closed contract is pinned by #3178. The files this issue targets no longer exist — recreating them would undo #2407. — auto-cleanup via devops-engineer

Closing as MOOT: the SOP-tier system (.gitea/scripts/sop-tier-refire.sh + .gitea/workflows/sop-tier-check.yml) was retired in #2407 (single uniform gate, CTO decision); the replacement fail-closed contract is pinned by #3178. The files this issue targets no longer exist — recreating them would undo #2407. — auto-cleanup via devops-engineer
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2140