diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 3b8e0f038..6049ad2f2 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -146,7 +146,13 @@ jobs: # As above: an empty pattern would match every branch name and turn # this job into a silent pass. - : "${BRANCH_PATTERN:=^(feature|bug|hotfix)-[1-9][0-9]*(-[a-z0-9]+)*$}" + # decisions/0022: a shape check, not an identifier check. + # Traceability moved to Validate Issue Link. Either + # - with an optional slug, which stays the + # recommended form, or / over the + # decisions/0003 Conventional Commits types plus + # feature, bug and hotfix. + : "${BRANCH_PATTERN:=^((feature|bug|hotfix)-[1-9][0-9]*(-[a-z0-9]+)*|(feat|fix|perf|refactor|docs|test|build|ci|style|chore|revert|feature|bug|hotfix)/[a-z0-9]+(-[a-z0-9]+)*)$}" if echo "$BRANCH" | grep -qE "$AUTOMATION_BRANCH_PATTERN" || \ { [ "$REPOSITORY" = "z-shell/zi" ] && [ "$BRANCH" = "next" ]; }; then diff --git a/AGENTS.md b/AGENTS.md index d2a1b6c09..93a03318a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -74,6 +74,7 @@ When working in z-shell repositories, optimize for: - **Commits and PR titles:** Conventional Commits. See `decisions/0003-conventional-commits.md`. - **Commit trailers:** `Co-authored-by` crediting a real human, including the PR author crediting themselves, is fine. Never credit a bot, AI agent, or automation as a co-author. `z-shell/.github` and `z-shell/zi` enforce this in CI. Other repositories remain author-enforced until their own verified caller is live; do not infer enforcement from organization policy alone. - **Branch selection:** Follow `decisions/0019-trunk-on-main-default.md` and verify the live state of the owning repository; `zi` is the named persistent-integration exception. +- **Issue traceability:** Per `decisions/0022-issue-traceability-on-pull-requests.md`, every pull request closes or references an issue, or carries the `meta:no-issue` label a maintainer applies. Branch names carry a type shape; the issue identifier in a branch name is recommended, not required. - **Worktrees:** Treat `git worktree list --porcelain` as the authoritative inventory. Use the owning repository's declared helper and stable worktree root; do not create worktrees in `/tmp` or another ad hoc location. Do not use a linked superproject checkout for work that needs initialized submodules. Follow `runbooks/worktrees.md`. - **Documentation placement:** keep long-form docs in the wiki when practical; keep repo-local docs focused on policy, workflow, and source-adjacent guidance. - **Workflow files:** follow the org workflow conventions and keep permissions explicit, actions pinned, and concurrency defined. diff --git a/decisions/0019-trunk-on-main-default.md b/decisions/0019-trunk-on-main-default.md index 3c669a790..eb04cdc2c 100644 --- a/decisions/0019-trunk-on-main-default.md +++ b/decisions/0019-trunk-on-main-default.md @@ -40,6 +40,11 @@ The decision was re-evaluated in Use trunk-based development on `main` as the organization default: +> **Amended by `decisions/0022-issue-traceability-on-pull-requests.md`.** +> The issue identifier below is no longer mandatory. Traceability is +> enforced on the pull request instead, and the branch check verifies a +> type shape. The identifier form remains valid and recommended. + - branch short-lived `feature-`, `bug-`, `hotfix-`, and dependency-update branches from current `main`; - open pull requests into `main`; diff --git a/scripts/test-commit-lint-policy.sh b/scripts/test-commit-lint-policy.sh index 11d8042b8..dadd9f2ef 100755 --- a/scripts/test-commit-lint-policy.sh +++ b/scripts/test-commit-lint-policy.sh @@ -154,9 +154,18 @@ check_branch_cases() { assert_branch codex/learning-capture-publication allow assert_branch next allow + # decisions/0022 relaxed this to a shape check, so a Conventional Commits + # type prefix now passes without an identifier. + assert_branch fix/labeler-audit-reject-malformed allow + assert_branch docs/adr-0022-rollout allow + assert_branch chore/tidy-workflows allow + assert_branch feature/no-identifier allow + + # 'code' is not in the decisions/0003 type set, so it is still rejected. assert_branch code/promotion-precondition-ancestry reject - assert_branch fix/labeler-audit-reject-malformed reject assert_branch ss-o-govern-plugin-standard reject + assert_branch fix/Bad-Caps reject + assert_branch fix/ reject assert_branch feature-0 reject assert_branch feature- reject assert_branch feature-505- reject