Skip to content

Phase 1: Stop New Label Prefix Violations (Governance Documentation) - #2474

Merged
ashleyshaw merged 3 commits into
developfrom
docs/label-prefix-governance-k9e0xd
Aug 30, 2026
Merged

Phase 1: Stop New Label Prefix Violations (Governance Documentation)#2474
ashleyshaw merged 3 commits into
developfrom
docs/label-prefix-governance-k9e0xd

Conversation

@ashleyshaw

@ashleyshaw ashleyshaw commented Aug 29, 2026

Copy link
Copy Markdown
Member

Linked issues

Relates to #2283 (Epic: Phase 1 - Stop New Label Prefix Violations)

Changelog

Added

  • New "Label Creation Rules (CRITICAL)" section in CLAUDE.md with valid/invalid examples
  • New "Label Creation Governance (CRITICAL)" section in AGENTS.md with programmatic issue creation guidance
  • Explicit validation checklist for canonical label usage
  • References to label validation script and canonical label sources

Changed

  • CLAUDE.md: Added governance documentation for label creation
  • AGENTS.md: Added implementation guidance for AI agents creating issues

Fixed

  • (No bug fixes in this PR)

Removed

  • (No removals in this PR)

Milestone

Phase 1: Label Prefix Enforcement - Governance & Documentation


Risk Assessment

Risk Level: Low

Potential Impact:

  • Documentation-only changes; no code logic modifications
  • Establishes baseline governance rules for future compliance
  • No breaking changes to existing workflows or automation

Mitigation Steps:

  • Changes are purely documentation; no runtime impact
  • Reviewed against existing labeling system implementation
  • Aligns with existing .github/scripts/validation/validate-labels-before-creation.cjs script

How to Test

Prerequisites

  • Repository cloned and on develop branch

Test Steps

  1. Review CLAUDE.md changes:

    • Verify new "Label Creation Rules (CRITICAL)" section is present after "Key Conventions"
    • Confirm valid/invalid label examples are clearly formatted
    • Check that references point to correct files
  2. Review AGENTS.md changes:

    • Verify new "Label Creation Governance (CRITICAL)" section is present after "Contribution Guidelines & Indexes"
    • Confirm bash examples show correct vs incorrect label formats
    • Check validation checklist is clear
  3. Verify markdown validation:
    ```bash
    npm run lint:md CLAUDE.md AGENTS.md
    ```
    Expected: 0 errors

Expected Results

  • Both files validate without errors
  • Documentation clearly communicates canonical label requirement
  • Examples are accurate and helpful for developers

Edge Cases to Verify

  • Markdown linting passes
  • No broken links to referenced files
  • Examples accurately reflect actual label taxonomy

Checklist (Global DoD / PR)

  • All AC met and demonstrated (governance documentation added)
  • Tests added/updated (documentation; no code changes required)
  • Accessibility checklist completed (documentation only, no UI changes)
    • Semantic HTML verified
    • Links verified
    • Readability verified
  • Docs/readme/changelog updated (governance documentation is the update)
  • Security checklist completed:
    • No secrets or sensitive data introduced
    • OWASP risks reviewed (none identified for documentation)
  • Code/design reviews - documentation aligns with existing validation script
  • CI green; linked issues closed; release notes prepared
  • Risk assessment completed above
  • Testing instructions provided above

References


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added an automated tool to audit issue labels, identify non-standard labels, and suggest or apply canonical replacements.
    • Supports dry-run previews, targeted issue ranges, live updates, and summary reports.
  • Documentation

    • Added guidance for label governance, including required label prefixes, validation steps, usage examples, and manual-review recommendations.
    • Expanded references and contributor guidance for maintaining consistent labels.

…forcement)

This commit adds explicit governance rules for label creation to prevent
new non-canonical label violations. Labels MUST use required family prefixes
(type:, status:, priority:, area:, meta:).

Changes:
- CLAUDE.md: New 'Label Creation Rules (CRITICAL)' section with valid/invalid examples
- AGENTS.md: New 'Label Creation Governance (CRITICAL)' section for programmatic issue creation

Reference: .github/projects/active/label-prefix-enforcement-2026-08-05/
Resolves: Issue #2283 Phase 1 (Stop New Label Prefix Violations)
@ashleyshaw ashleyshaw added migrate:priority:critical Production/launch-blocking migrate:status:needs-review Awaiting code review migrate:type:documentation Documentation area:labels Label governance and routing labels Aug 29, 2026 — with Claude
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: a8aaccac-c52f-49a1-be80-769a45b168cc

📥 Commits

Reviewing files that changed from the base of the PR and between 7cbe1f4 and b91a560.

📒 Files selected for processing (4)
  • AGENTS.md
  • CLAUDE.md
  • scripts/agents/includes/BARE_LABEL_FIXER_README.md
  • scripts/agents/includes/bare-label-fixer.js

📝 Walkthrough

Walkthrough

The changes document canonical label governance and add a Node.js agent that audits GitHub issues, plans bare-label replacements or removals, optionally applies updates, and saves a JSON report.

Changes

Label governance and remediation

Layer / File(s) Summary
Canonical label governance
AGENTS.md, CLAUDE.md
Documents prefixed-label requirements, validation steps, canonical sources, and the label-prefix audit reference.
Agent configuration and issue discovery
scripts/agents/includes/bare-label-fixer.js, scripts/agents/includes/BARE_LABEL_FIXER_README.md
Defines label mappings, parses CLI and environment options, loads canonical labels, discovers matching issues, and documents usage and output behavior.
Label updates and reporting
scripts/agents/includes/bare-label-fixer.js
Calculates changes, applies removals and additions outside dry-run mode, reports results, saves timestamped JSON output, and handles unrecoverable failures.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant bareLabelFixer
  participant GitHubIssuesAPI
  participant JSONReport
  bareLabelFixer->>GitHubIssuesAPI: Discover issues with configured bare labels
  GitHubIssuesAPI-->>bareLabelFixer: Return issues and current labels
  bareLabelFixer->>GitHubIssuesAPI: Remove bare labels and add mapped labels
  GitHubIssuesAPI-->>bareLabelFixer: Return update results
  bareLabelFixer->>JSONReport: Save timestamped remediation report
Loading

Suggested reviewers: lightspeedwp, claude

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/label-prefix-governance-k9e0xd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2474

CI Status:success
Files changed: 2

Recommendations

  • Ready to proceed pending human review

@mergify

mergify Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Governance Issues

❌ Milestone Issue

No milestone assigned. Please select a milestone from the right sidebar.


View PR Governance Check

Implements automated auditing and fixing of bare labels (e.g., 'bug', 'feature',
'documentation') to their proper prefixed equivalents (e.g., 'type:bug',
'type:feature', 'type:documentation').

Features:
- Comprehensive bare label detection across repository
- Configurable issue number range filtering
- Dry-run mode for safe verification
- Detailed reporting of changes
- High-confidence auto-mapping with manual review fallback

Phase 2: Stop New Label Prefix Violations - Fix Existing Issues
Relates to #2283

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JsQ2HQ1m9uzKD8bEQhN9xp
@github-actions

Copy link
Copy Markdown
Contributor

📄 README Validation

❌ One or more README checks failed.

Check Result
❌ Frontmatter Failed
✅ Structure Passed

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2474

CI Status:success
Files changed: 4

Recommendations

  • Ready to proceed pending human review

@ashleyshaw
ashleyshaw enabled auto-merge August 30, 2026 02:04
@ashleyshaw
ashleyshaw merged commit 7e8a291 into develop Aug 30, 2026
20 of 39 checks passed
@ashleyshaw
ashleyshaw deleted the docs/label-prefix-governance-k9e0xd branch August 30, 2026 02:51
@github-actions

Copy link
Copy Markdown
Contributor

❌ Branch Name Validation Failed

The branch name docs/label-prefix-governance-k9e0xd does not follow the LightSpeed branching strategy.

Required Format

{type}/{scope}-{short-title}
  • type: one of the allowed prefixes (lowercase)
  • scope: lowercase, hyphens only (no underscores or uppercase)
  • title: lowercase, hyphens only (no underscores or uppercase)

Allowed Branch Types

feat, fix, hotfix, release, refactor, chore, docs, test, perf, ci, build, deps, security, revert, research, design, a11y, ux, i18n, ops, proto, ds, api, schema, telemetry, content, seo, config, migrate, qa, uat, audit, codex

Valid Examples

  • feat/branch-naming-enforcement
  • fix/validation-script-bug
  • chore/update-dependencies
  • docs/branching-strategy-guide
  • hotfix/critical-security-patch

Invalid Examples

  • claude/my-branch (type "claude" not allowed)
  • Feature/MyBranch (uppercase not allowed)
  • fix-bug (missing type prefix)
  • feat/my_feature (underscores not allowed)
  • feat/MyFeature (uppercase not allowed)

Solution

Rename your branch to follow the pattern and update the PR.

For more information, see docs/BRANCHING_STRATEGY.md.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2474

CI Status:pending
Files changed: 4

Recommendations

  • CI checks not green

@github-actions

Copy link
Copy Markdown
Contributor

Milestone Allocation


ashleyshaw pushed a commit that referenced this pull request Sep 1, 2026
…ements

Implements all 5 priority improvements from CI/CD validation audit:

1. Add blocking PR label validation to pr-validation.yml
   - Load canonical labels from labels.yml
   - Detect bare (non-prefixed) labels on PR
   - Fail check if bare labels found
   - Provide actionable error messages

2. Create new issue label validation workflow (validate-issue-labels.yml)
   - Triggers on issue opened/edited/labeled/unlabeled
   - Detects bare labels on issues
   - Posts warning comment with canonical label guidance
   - Skips bot-authored issues (dependabot, renovate)

3. Enhance labeling-governance.yml with bare label detection
   - Add new detect-bare-labels job
   - Runs on PR and issue events
   - Logs warnings for bare labels found
   - Complements automatic labeling with detection

4. Setup scheduled bare label remediation (weekly)
   - Add schedule trigger to remediate-bare-labels.yml
   - Runs every Monday at 08:00 UTC
   - Enables automatic weekly scanning and reporting
   - Maintains manual dispatch option

5. Add PR template validation for required structure and labels
   - Create validate-pr-template-structure.cjs script
   - Validates required sections (Linked issues, Changelog, etc.)
   - Checks for canonical label references in template
   - Add to pr-validation.yml workflow

Validation stack now includes:
- Automated label assignment (labeler.yml - all canonical)
- Template validation (check-template-labels.js)
- PR label validation (pr-validation.yml - blocks bare labels)
- Issue label validation (validate-issue-labels.yml - warns on bare)
- Bare label detection (labeling-governance.yml - logs findings)
- Scheduled remediation (remediate-bare-labels.yml - weekly)

Relates to #2474 (Phase 1: Governance)
Relates to #2524 (Phase 2: Remediation)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZBSsykLxBKFqa5Hxq8xKh
ashleyshaw pushed a commit that referenced this pull request Sep 2, 2026
…ements

Implements all 5 priority improvements from CI/CD validation audit:

1. Add blocking PR label validation to pr-validation.yml
   - Load canonical labels from labels.yml
   - Detect bare (non-prefixed) labels on PR
   - Fail check if bare labels found
   - Provide actionable error messages

2. Create new issue label validation workflow (validate-issue-labels.yml)
   - Triggers on issue opened/edited/labeled/unlabeled
   - Detects bare labels on issues
   - Posts warning comment with canonical label guidance
   - Skips bot-authored issues (dependabot, renovate)

3. Enhance labeling-governance.yml with bare label detection
   - Add new detect-bare-labels job
   - Runs on PR and issue events
   - Logs warnings for bare labels found
   - Complements automatic labeling with detection

4. Setup scheduled bare label remediation (weekly)
   - Add schedule trigger to remediate-bare-labels.yml
   - Runs every Monday at 08:00 UTC
   - Enables automatic weekly scanning and reporting
   - Maintains manual dispatch option

5. Add PR template validation for required structure and labels
   - Create validate-pr-template-structure.cjs script
   - Validates required sections (Linked issues, Changelog, etc.)
   - Checks for canonical label references in template
   - Add to pr-validation.yml workflow

Validation stack now includes:
- Automated label assignment (labeler.yml - all canonical)
- Template validation (check-template-labels.js)
- PR label validation (pr-validation.yml - blocks bare labels)
- Issue label validation (validate-issue-labels.yml - warns on bare)
- Bare label detection (labeling-governance.yml - logs findings)
- Scheduled remediation (remediate-bare-labels.yml - weekly)

Relates to #2474 (Phase 1: Governance)
Relates to #2524 (Phase 2: Remediation)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZBSsykLxBKFqa5Hxq8xKh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:labels Label governance and routing migrate:priority:critical Production/launch-blocking migrate:status:needs-review Awaiting code review migrate:type:documentation Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants