From c09fc7250006b865714e8e2db22edaa235a57b69 Mon Sep 17 00:00:00 2001 From: Evelyn Chen Date: Thu, 27 Aug 2026 18:19:05 +0000 Subject: [PATCH 1/2] Reject Conventional Commit PR titles Authored-By: Codex (GPT-5) --- README.md | 4 +++- check.sh | 6 ++++++ tests/run | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 080ab96..9edc299 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,9 @@ The check validates four things for every non-break-glass Agent PR: 2. **Title form** — for a `role/bug` branch the title must start with `[bug-] `. For a `chore` branch the title must have no `[bug-id]` - prefix. If both carry a bug-id they must match. + prefix. If both carry a bug-id they must match. The description is a + plain-language imperative; Conventional Commit forms such as `fix(scope):` + are rejected. 3. **Tracking and attribution** — on Bug-backed work, `## Tracking` contains both the literal `Fixes bug-` automation token and the matching navigable diff --git a/check.sh b/check.sh index ed81cea..6d3abb6 100755 --- a/check.sh +++ b/check.sh @@ -121,6 +121,12 @@ if echo "${TITLE}" | grep -qE "^\[bug-[a-z0-9]+\] ."; then TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[(bug-[a-z0-9]+)\].*|\1|') fi +TITLE_DESCRIPTION=$(printf '%s\n' "${TITLE}" | sed -E 's/^\[bug-[a-z0-9]+\] //') +if printf '%s\n' "${TITLE_DESCRIPTION}" | grep -qE '^[[:alnum:]-]+(\([^)]*\))?!?:[[:space:]]'; then + echo "FAIL[check-naming]: title must use a plain-language imperative without Conventional Commit syntax" + FAILED=1 +fi + if [ "${BRANCH_KIND}" = "role-bug" ]; then if [ -z "${TITLE_BUG}" ]; then echo "FAIL[check-naming]: title must lead with [${BRANCH_BUG}]" diff --git a/tests/run b/tests/run index 1ca7d5a..ad9ec4a 100755 --- a/tests/run +++ b/tests/run @@ -123,8 +123,9 @@ check "bug-id mismatch" 1 "dev/bug-x7k2m9/fix-resize" "[bug- # fail: chore branch with [bug-id] title prefix check "chore with bug-id title" 1 "chore/bump-deps" "[bug-abc123] Bump deps" "dev" -check "role/bug Conventional title" 0 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): fix resize" "dev" -check "chore Conventional title" 0 "chore/bump-deps" "chore(deps): bump deps" "dev" +check "role/bug Conventional title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): fix resize" "dev" +check "chore Conventional title" 1 "chore/bump-deps" "chore(deps): bump deps" "dev" +check "role/bug breaking title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix!: break resize" "dev" # fail: invalid branch forms check "invalid — no role prefix" 1 "feature/foo-bar" "Add feature" "dev" -- 2.54.0 From 1fba1e06b236d315ed46fea4f3ff63a128a18c00 Mon Sep 17 00:00:00 2001 From: Evelyn Chen Date: Thu, 27 Aug 2026 18:24:37 +0000 Subject: [PATCH 2/2] Normalize Bug title whitespace Authored-By: Codex (GPT-5) --- check.sh | 2 +- tests/run | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/check.sh b/check.sh index 6d3abb6..388ddc3 100755 --- a/check.sh +++ b/check.sh @@ -121,7 +121,7 @@ if echo "${TITLE}" | grep -qE "^\[bug-[a-z0-9]+\] ."; then TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[(bug-[a-z0-9]+)\].*|\1|') fi -TITLE_DESCRIPTION=$(printf '%s\n' "${TITLE}" | sed -E 's/^\[bug-[a-z0-9]+\] //') +TITLE_DESCRIPTION=$(printf '%s\n' "${TITLE}" | sed -E 's/^\[bug-[a-z0-9]+\][[:space:]]+//') if printf '%s\n' "${TITLE_DESCRIPTION}" | grep -qE '^[[:alnum:]-]+(\([^)]*\))?!?:[[:space:]]'; then echo "FAIL[check-naming]: title must use a plain-language imperative without Conventional Commit syntax" FAILED=1 diff --git a/tests/run b/tests/run index ad9ec4a..8ccc05b 100755 --- a/tests/run +++ b/tests/run @@ -124,6 +124,7 @@ check "bug-id mismatch" 1 "dev/bug-x7k2m9/fix-resize" "[bug- # fail: chore branch with [bug-id] title prefix check "chore with bug-id title" 1 "chore/bump-deps" "[bug-abc123] Bump deps" "dev" check "role/bug Conventional title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): fix resize" "dev" +check "role/bug Conventional title gap" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): fix resize" "dev" check "chore Conventional title" 1 "chore/bump-deps" "chore(deps): bump deps" "dev" check "role/bug breaking title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix!: break resize" "dev" -- 2.54.0