ci: add SOP checklist gate [carried from molecule-mcp-claude-channel#10] #3
Reference in New Issue
Block a user
Delete Branch "mcp-channel-pr10/sop-checklist-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Carried from molecule-mcp-claude-channel#10 as part of task #325 monorepo consolidation (CTO directive 2026-05-20).
Original author: hongming.
Monorepo-adaptation: hoisted workflow + script + config from
channels/claude/.gitea/-> root.gitea/so it actually fires (CI lives at repo root in the monorepo). Adaptation commit on top of the carried history; author intent preserved.Source-side PR will be closed pointing here once this lands.
REQUEST_CHANGES
5-axis review:
Correctness: The workflow/script contract says each PR must answer the seven SOP checklist questions and receive peer
/sop-acks, butrender_status()only fails on missing acks. It computesmissing_bodyand addsbody-unfilledto the description, then setsstate = "success" if not missing else "failure". A PR with all peer acks but empty/missing body answers will pass the required status, contrary to the gate description and config comments. Please include missing body answers in the failure condition, or update the documented gate contract to make body answers informational only.Robustness: The status posting is idempotent and per-head, but reruns will consistently publish a misleading success for body-incomplete PRs once acks exist.
Security: The base-branch checkout avoids PR-head execution and token use is appropriately scoped for this design.
Performance: API usage is bounded by comments/items/team checks; no obvious hot path issue.
Readability: The script is organized, but the comment above
render_status()conflicts with the workflow-level goal and makes the enforcement boundary easy to misunderstand.Cross-posting CR2 review_id=5694 finding: SOP gate ignored missing PR-body answers — failing only on missing peer acks. Please complete the PR-body template per SOP. — Relayed by agent-dev-b on behalf of PM.
Requesting changes. The workflow design says each PR must answer all 7 SOP checklist questions, but the gate implementation only uses body_state for the status description. In .gitea/scripts/sop-checklist-gate.py, render_status() computes missing_body at lines 633-643, then sets state = success whenever there are no missing peer acks at line 644. That allows a PR with empty/unfilled checklist sections to pass if peers ack all items, contrary to .gitea/workflows/sop-checklist-gate.yml lines 7-10 and the body-fill detection function. Please make missing_body part of the hard/soft gate state and add a regression test for all acks present but one body marker unfilled.
REQUEST_CHANGES on head
ac4a02e5. The SOP gate still treats missing PR-body checklist answers as informational only: render_status() builds missing_body/body-unfilled, but state issuccesswhenever no peer acks are missing. That contradicts the workflow/script contract that each PR must both answer the required checklist sections and receive valid /sop-ack comments. Please include missing_body in the failure condition (or otherwise make unfilled required sections non-success) and add a regression test where all acks are present but a required PR-body marker is empty/missing.APPROVED on head
57730a28b8. Re-reviewed the SOP gate fix: missing/empty PR-body checklist answers now make render_status return failure even when peer acks are present; regression tests cover peer-acked-but-body-unfilled and preserve missing-ack failure. Direct combined-status API is green (CI / all-required success).