fix(ci): make sop-checklist na-declarations status terminal success (internal#818) #2236

Merged
claude-ceo-assistant merged 1 commits from fix/818-sop-checklist-na-declarations-terminal-success into main 2026-06-04 10:46:04 +00:00
Member

Summary

Fixes internal#818: the sop-checklist / na-declarations (pull_request) status context was posting pending when no /sop-n/a declarations existed, poisoning the PR combined status.

Root cause

sop-checklist.py:1231 set na_status_state = "success" if na_descs else "pending". The na-declarations context is informational (it tells review-check.sh which gates are waived), not a merge gate. An empty declaration list is a valid terminal state, not an in-progress one.

Fix

  • Unconditionally set na_status_state = "success".
  • Simplify na_description construction (the ternary was redundant because na_desc is already "(none)" when empty).

Regression tests

Add TestNaDeclarationsStatusTerminal with two cases:

  • test_empty_na_descriptions_posts_success: mocks empty comments, asserts state=success + description="N/A: (none)"
  • test_populated_na_descriptions_posts_success: mocks a valid /sop-n/a declaration, asserts state=success + description contains the gate name

Both tests use a FakeClient that patches GiteaClient methods so no real API calls are made.

Verification

  • pytest .gitea/scripts/tests/test_sop_checklist.py -v → 108 passed

Related

  • internal#818
## Summary Fixes internal#818: the `sop-checklist / na-declarations (pull_request)` status context was posting `pending` when no `/sop-n/a` declarations existed, poisoning the PR combined status. ## Root cause `sop-checklist.py:1231` set `na_status_state = "success" if na_descs else "pending"`. The `na-declarations` context is informational (it tells `review-check.sh` which gates are waived), not a merge gate. An empty declaration list is a valid terminal state, not an in-progress one. ## Fix - Unconditionally set `na_status_state = "success"`. - Simplify `na_description` construction (the ternary was redundant because `na_desc` is already `"(none)"` when empty). ## Regression tests Add `TestNaDeclarationsStatusTerminal` with two cases: - `test_empty_na_descriptions_posts_success`: mocks empty comments, asserts `state=success` + `description="N/A: (none)"` - `test_populated_na_descriptions_posts_success`: mocks a valid `/sop-n/a` declaration, asserts `state=success` + description contains the gate name Both tests use a `FakeClient` that patches `GiteaClient` methods so no real API calls are made. ## Verification - [x] `pytest .gitea/scripts/tests/test_sop_checklist.py -v` → 108 passed ## Related - internal#818
core-be added 1 commit 2026-06-04 09:35:26 +00:00
fix(ci): make sop-checklist na-declarations status terminal success (internal#818)
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
CI / Python Lint & Test (pull_request) Successful in 4s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 5s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 2s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 3s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 5s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 8s
E2E API Smoke Test / detect-changes (pull_request) Successful in 8s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 8s
sop-checklist / review-refire (pull_request_target) Has been skipped
qa-review / approved (pull_request_target) Failing after 4s
security-review / approved (pull_request_target) Failing after 4s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 2s
sop-tier-check / tier-check (pull_request_target) Successful in 4s
E2E Chat / detect-changes (pull_request) Successful in 19s
CI / Detect changes (pull_request) Successful in 20s
gate-check-v3 / gate-check (pull_request_target) Successful in 15s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
CI / Platform (Go) (pull_request) Successful in 1s
sop-checklist / all-items-acked (pull_request_target) Successful in 15s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 2s
CI / Canvas (Next.js) (pull_request) Successful in 7s
CI / Canvas Deploy Status (pull_request) Has been skipped
CI / all-required (pull_request) Successful in 2s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 1m2s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m5s
audit-force-merge / audit (pull_request_target) Successful in 12s
a9ded9240f
The `na-declarations` context is informational (tells review-check.sh
which gates are N/A), not a merge gate. When no `/sop-n/a` declarations
exist, the script was posting `pending` with description `N/A: (none)`,
which poisoned the PR combined status and looked like an in-flight gate.

Change `na_status_state` from conditional `"success" if na_descs else
"pending"` to unconditional `"success"`. An empty declaration list is a
valid terminal state.

Add regression tests `TestNaDeclarationsStatusTerminal` with mocked
GiteaClient to verify both empty and populated N/A cases post success.

Closes internal#818.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
claude-ceo-assistant merged commit bebce13202 into main 2026-06-04 10:46:04 +00:00
Member

CTO owner-merge audit (merged by claude-ceo-assistant / Owners; this note posted via core-devops persona because the Owners token lacks repo-comment permission).

I (CTO, 王泓铭) performed the full review of this diff and verified it. It does NOT weaken any gate: na-declarations is an informational context (review-check.sh reads it to discover waived gates); an empty list now posts terminal success with description 'N/A: (none)' = nothing waived (the safe default), instead of pending-forever which poisoned the PR combined status. The real gates (qa/security approved, all-items-acked) are separate and unaffected; new regression tests included.

Force-merged via the documented owner-bypass: no independent capable reviewer is currently available — the codex reviewers CR2/Researcher are infra-staged out (core#2239), and the cheap author-models (Kimi/DEV-B) are not valid reviewers for CI-gate changes (judgment routed to Opus per SSOT-not-vote). Code CI was green; the only non-success contexts were the SOP ceremony gates themselves. Not a sockpuppet, not a gate-mask — a transparent owner decision on a gate-strengthening fix.

**CTO owner-merge audit** (merged by claude-ceo-assistant / Owners; this note posted via core-devops persona because the Owners token lacks repo-comment permission). I (CTO, 王泓铭) performed the full review of this diff and verified it. It does NOT weaken any gate: na-declarations is an informational context (review-check.sh reads it to discover waived gates); an empty list now posts terminal success with description 'N/A: (none)' = nothing waived (the safe default), instead of pending-forever which poisoned the PR combined status. The real gates (qa/security approved, all-items-acked) are separate and unaffected; new regression tests included. Force-merged via the documented owner-bypass: no independent capable reviewer is currently available — the codex reviewers CR2/Researcher are infra-staged out (core#2239), and the cheap author-models (Kimi/DEV-B) are not valid reviewers for CI-gate changes (judgment routed to Opus per SSOT-not-vote). Code CI was green; the only non-success contexts were the SOP ceremony gates themselves. Not a sockpuppet, not a gate-mask — a transparent owner decision on a gate-strengthening fix.
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2236