Phase 3: AI Governance Audit Implementation — Branch Validation & Template Routing - #2586
Phase 3: AI Governance Audit Implementation — Branch Validation & Template Routing#2586ashleyshaw wants to merge 17 commits into
Conversation
- Tests all 34 allowed branch type prefixes
- Validates rejection of forbidden prefixes (claude/, copilot/, openai/)
- Enforces format pattern {type}/{scope}-{title}
- Tests edge cases: null, undefined, special characters, dashes
- Includes real-world valid and invalid branch name examples
- Tests consistency with CLAUDE.md repository rules
- All 39 tests passing with proper type extraction from regex groups
Closes #2544
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Add audit/ and codex/ types (complete 34-type set) - Document forbidden AI agent prefixes: claude/, copilot/, openai/ - Explain fallback routing for forbidden prefixes to default PR template - Update all regex patterns and labeler config with new types - Add PR template routing table and fallback logic explanation - Clarify enforcement and governance rationale for AI agents Closes #2545 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Routes codex/ branches to pr_docs.md template - Completes routing map for all 34 allowed branch types - Ensures fallback routing works for all type prefixes - Relates to Issue #2546 (template routing completion) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Added documentation for __tests__/validate-branch-names.test.js - Updated frontmatter (version 1.0.0 → 1.1.0, last_updated: 2026-08-30) - Updated description to include branch naming governance validation - Added branch-governance tag to reflect new test coverage - Fixes README frontmatter validation failure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
…ADME - Added accTitle for screen reader compatibility - Added accDescr with comprehensive diagram description - Fixes Mermaid accessibility validation check Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Updated Mermaid diagram to use YAML config syntax for accTitle and accDescr - Ensures accessibility validation compatibility with current Mermaid version - Maintains diagram styling and structure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Tests all 34 allowed branch type prefixes
- Validates rejection of forbidden prefixes (claude/, copilot/, openai/)
- Enforces format pattern {type}/{scope}-{title}
- Tests edge cases: null, undefined, special characters, dashes
- Includes real-world valid and invalid branch name examples
- Tests consistency with CLAUDE.md repository rules
- All 39 tests passing with proper type extraction from regex groups
Closes #2544
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Add audit/ and codex/ types (complete 34-type set) - Document forbidden AI agent prefixes: claude/, copilot/, openai/ - Explain fallback routing for forbidden prefixes to default PR template - Update all regex patterns and labeler config with new types - Add PR template routing table and fallback logic explanation - Clarify enforcement and governance rationale for AI agents Closes #2545 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Routes codex/ branches to pr_docs.md template - Completes routing map for all 34 allowed branch types - Ensures fallback routing works for all type prefixes - Relates to Issue #2546 (template routing completion) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Added documentation for __tests__/validate-branch-names.test.js - Updated frontmatter (version 1.0.0 → 1.1.0, last_updated: 2026-08-30) - Updated description to include branch naming governance validation - Added branch-governance tag to reflect new test coverage - Fixes README frontmatter validation failure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
…ADME - Added accTitle for screen reader compatibility - Added accDescr with comprehensive diagram description - Fixes Mermaid accessibility validation check Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Updated Mermaid diagram to use YAML config syntax for accTitle and accDescr - Ensures accessibility validation compatibility with current Mermaid version - Maintains diagram styling and structure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
…debug logging Fixed ReferenceError where debug code was trying to reference undefined BRANCH_PATTERN variable. Replaced with correct pattern names: BRANCH_PATTERN_STANDARD, BRANCH_PATTERN_RELEASE_SEMVER, and BRANCH_PATTERN_RELEASE_STANDARD to enable proper debug output without crashing the validator. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…ANCH_PATTERN alias fix The remote version already included a better fix for the undefined BRANCH_PATTERN reference by adding it as an alias: const BRANCH_PATTERN = BRANCH_PATTERN_STANDARD; This allows the debug code and existing code to work without modification.
❌ Branch Name Validation FailedThe branch name Required Format
Allowed Branch Types
Valid Examples
Invalid Examples
SolutionRename your branch to follow the pattern and update the PR. For more information, see docs/BRANCHING_STRATEGY.md. |
|
✅ Template check passed after update. Thanks for fixing the PR description. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Complete Phase 3 of the AI Governance Audit Implementation with comprehensive branch name validation, PR template routing configuration, and governance documentation.
Linked issues
Addresses the following issues:
Key Changes
1. Branch Name Validation
Validator Script (
scripts/validation/validate-branch-name.cjs):BRANCH_PATTERNreference in debug loggingconst BRANCH_PATTERN = BRANCH_PATTERN_STANDARD;alias for backward compatibilityrelease/v1.2.3)Jest Test Suite (
scripts/validation/__tests__/validate-branch-names.test.js):2. PR Template Configuration
Config File (
.github/PULL_REQUEST_TEMPLATE/config.yml):PR Template Updates:
3. Governance Documentation
CLAUDE.mdwith expanded branch naming rules4. GitHub Actions Workflow
.github/workflows/branch-name-validation.yml):Changelog
Added
Fixed
BRANCH_PATTERNreference in validator debug loggingChanged
Testing & Validation
audit/governance-audit-implementationVerification Checklist
{type}/{scope}-{title})Global DoD Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr