[bug-yhg8dqypwmar] fix(check-naming): require scoped titles #10

Merged
architect merged 3 commits from architect/bug-yhg8dqypwmar/require-conventional-titles into main 2026-08-27 18:54:18 +00:00
3 changed files with 10 additions and 5 deletions
Showing only changes of commit 0789210d4e - Show all commits
+6 -3
View File
3
@@ -73,9 +73,12 @@ The check validates four things for every non-break-glass Agent PR:
Unknown roles, missing `bug-` segment, uppercase bug-ids, and empty
kebab descriptions all produce a `FAIL[check-naming]` log line.
2. **Title form** — for a `role/bug` branch the title must start with
`[bug-<id>] `. For a `chore` branch the title must have no `[bug-id]`
prefix. If both carry a bug-id they must match.
2. **Title form** — for a `role/bug` branch the title must be
`[bug-<id>] type(scope): description`. The type starts with a lowercase
letter and the type and one-component scope contain only lowercase letters,
digits, and hyphens. An optional `!` may follow the scope, and the description
must contain a non-whitespace character. For a `chore` branch the title must
have no `[bug-id]` prefix. If both carry a bug-id they must match.
3. **Tracking and attribution** — on Bug-backed work, `## Tracking` contains both the literal
`Fixes bug-<id>` automation token and the matching navigable
+2 -2
View File
@@ -125,12 +125,12 @@ if [ "${BRANCH_KIND}" = "role-bug" ]; then
if [ -z "${TITLE_BUG}" ]; then
echo "FAIL[check-naming]: title must lead with [${BRANCH_BUG}]"
echo " have: ${TITLE}"
echo " want: [${BRANCH_BUG}] ${TITLE}"
echo " want: [${BRANCH_BUG}] fix(scope): description"
FAILED=1
elif [ "${TITLE_BUG}" != "${BRANCH_BUG}" ]; then
echo "FAIL[check-naming]: bug-id mismatch — branch carries '${BRANCH_BUG}' but title carries '${TITLE_BUG}'"
FAILED=1
elif ! printf '%s\n' "${TITLE}" | grep -qE "^\\[${BRANCH_BUG}\\] [a-z][a-z0-9-]*\\([a-z0-9][a-z0-9-]*\\)!?: .+"; then
elif ! printf '%s\n' "${TITLE}" | grep -qE "^\\[${BRANCH_BUG}\\] [a-z][a-z0-9-]*\\([a-z0-9][a-z0-9-]*\\)!?: .*[^[:space:]]$"; then
Outdated
Review

You enter Fix resize; lines 125–128 tell you to change it to [bug-x7k2m9] Fix resize, which this new branch rejects on the next run. Make the first diagnostic show a valid scoped title, so recovery takes one edit and one rerun.

You enter `Fix resize`; lines 125–128 tell you to change it to `[bug-x7k2m9] Fix resize`, which this new branch rejects on the next run. Make the first diagnostic show a valid scoped title, so recovery takes one edit and one rerun.
Outdated
Review

You submit [bug-x7k2m9] fix(hub): and this regex accepts the spaces after : as a description; I reproduced exit 0. Require at least one non-whitespace description character and cover the empty/whitespace case.

You submit `[bug-x7k2m9] fix(hub): ` and this regex accepts the spaces after `: ` as a description; I reproduced exit 0. Require at least one non-whitespace description character and cover the empty/whitespace case.
echo "FAIL[check-naming]: Bug-backed title must use '[${BRANCH_BUG}] type(scope): description'"
FAILED=1
fi
+2
View File
@@ -127,6 +127,8 @@ check "role/bug Conventional title" 0 "dev/bug-x7k2m9/fix-resize" "[bug-
check "role/bug plain title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] Fix resize" "dev"
check "role/bug missing scope" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix: fix resize" "dev"
check "role/bug path scope" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub/bugs): fix resize" "dev"
check "role/bug empty description" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): " "dev"
check "role/bug whitespace description" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): " "dev"
check "chore Conventional title" 0 "chore/bump-deps" "chore(deps): bump deps" "dev"
# fail: invalid branch forms