Skip to content

chore(#20): upgrade validate-branch-name + validate-pr-create from warning to blocker#28

Merged
atlas-apex merged 1 commit into
mainfrom
feature/GH-20-warning-to-blocker
Apr 12, 2026
Merged

chore(#20): upgrade validate-branch-name + validate-pr-create from warning to blocker#28
atlas-apex merged 1 commit into
mainfrom
feature/GH-20-warning-to-blocker

Conversation

@atlas-apex

Copy link
Copy Markdown
Collaborator

Summary

Upgrades validate-branch-name.sh and validate-pr-create.sh from warning (exit 0) to blocker (exit 2) when validation fails. Breaking change — users who got used to pushing with non-conforming branch names or creating PRs with malformed titles will now be blocked.

This is the final step in the rule-mechanization audit: the warnings were "prose in disguise" — the harness ran them but their output was silently ignorable. The first real test run of ApexStack confirmed this: warnings were dropped under pressure.

Closes #20

Changes

  • validate-branch-name.sh — non-conforming branch names rejected at push time with a rename suggestion (exit 2 instead of exit 0). Allowlist for main/master/develop unchanged.
  • validate-pr-create.sh — malformed PR titles, missing glossary sections, and missing branch ticket IDs rejected at PR creation time (exit 2 instead of exit 0). The issue-existence check from [Feat] anti-hallucination hooks — verify ticket existence at PR and commit time #14 was already a blocker and is unchanged.
  • CLAUDE.md — migration note in Quality Rules: "Branch names and PR titles are enforced, not warned — as of 2026-04-12."
  • .claude/hooks/README.md — Pre-existing Hooks table updated from "Warns" to "Blocks" for both hooks.
  • docs/agdr/AgDR-0002-warning-to-blocker-upgrade.md — decision record comparing 3 options (upgrade both, keep warnings, configurable severity), chosen: upgrade both.

Smoke tests

  • validate-branch-name.sh: allows conforming current branch (exit 0)
  • validate-pr-create.sh: blocks malformed title (exit 2)
  • validate-pr-create.sh: allows valid title + glossary (exit 0)

Glossary

Term Definition
Warning-only hook A hook that prints to stderr but exits 0, allowing the operation to proceed. Functionally equivalent to prose advice — the harness runs it but the output is ignorable.
Blocker hook A hook that exits 2, cancelling the tool call. The operation cannot proceed until the issue is fixed.
AgDR-0002 The decision record for this upgrade. Compares upgrade / keep-warnings / configurable-severity options.

Test plan

🤖 Generated with Claude Code

…rning to blocker

The rule-mechanization audit (#13, AgDR-0001) found that warning-only
hooks are "prose in disguise" — the harness runs them but their output
is silently ignorable. The first real test run of ApexStack confirmed
this: warnings were dropped under pressure, which is the incident that
started the entire #11/#14/#13 enforcement session.

Both hooks now exit 2 (block) instead of exit 0 (warn) when validation
fails. This is a behavior-visible breaking change:

- validate-branch-name.sh: non-conforming branch names are rejected
  at push time with a rename suggestion instead of a warning.
- validate-pr-create.sh: malformed PR titles, missing glossary
  sections, and missing branch ticket IDs are rejected at PR creation
  time instead of warned. The issue-existence check (added in #14)
  was already a blocker and is unchanged.

Supporting changes:
- CLAUDE.md adds a migration note in Quality Rules section
- hooks/README.md updates the Pre-existing Hooks table from "Warns"
  to "Blocks" for both hooks
- AgDR-0002 records the decision with three options considered
  (upgrade, keep warnings, configurable severity) and rationale

Closes #20

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #28

Commit: 4dbb0031a2f87ca87f5a912d833fcbe29219a7f8

Summary

Upgrades two validation hooks from warning (exit 0) to blocker (exit 2). Straightforward behavioral change with AgDR, migration note, and actionable error messages.

Checklist Results

  • N/A Architecture & DDD: not applicable (shell scripts)
  • ✅ Code Quality: exit codes correct, error messages helpful, rename suggestion included
  • N/A Testing: smoke tests documented in PR; no unit test framework for shell hooks
  • ✅ Security: no secrets, no new attack surface
  • ✅ Performance: no impact
  • ✅ PR Description & Glossary: present and clear
  • ✅ Technical Decisions (AgDR): AgDR-0002 linked and covers the decision

Issues Found

None.

Suggestions

None.

Verdict

APPROVED (via comment — same-org repo)


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: 4dbb0031a2f87ca87f5a912d833fcbe29219a7f8

@atlas-apex atlas-apex merged commit d48e301 into main Apr 12, 2026
3 of 4 checks passed
Dr-kersho added a commit to Dr-kersho/apexyard that referenced this pull request May 20, 2026
…roadmap

Co-authored-by: Cursor <cursoragent@cursor.com>
@me2resh me2resh deleted the feature/GH-20-warning-to-blocker branch June 5, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] upgrade validate-branch-name + validate-pr-create format checks from warning to blocker

2 participants