Skip to content

feat(labels): estate label tooling + auto-triage for new issues - #79

Merged
hyperpolymath merged 1 commit into
mainfrom
automated/label-tooling
Aug 27, 2026
Merged

feat(labels): estate label tooling + auto-triage for new issues#79
hyperpolymath merged 1 commit into
mainfrom
automated/label-tooling

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Ships the canonical label set and the classifier that labels newly-filed issues.

Additive only — never removes a label, never overrides a human's classification, silent when unsure, never fails an issue.

Also adds this repo's two new workflows to .github/workflows/actions.lock as []. That lock is keyed by workflow path and refuses any workflow it does not list — a startup_failure, which produces no check run and is therefore silent. gh actions-lock cannot add these: it records action versions, and both workflows deliberately use none.

See docs/LABELS.adoc in hyperpolymath/.git-private-farm.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6bdebc4e-fb25-4a16-891d-5ccaae9e5525

📥 Commits

Reviewing files that changed from the base of the PR and between db02674 and 72e6559.

⛔ Files ignored due to path filters (1)
  • .github/workflows/actions.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/label-classifier.json
  • .github/labels.json
  • .github/scripts/classify-issue.jq
  • .github/workflows/label-triage.yml
  • .github/workflows/labels.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (32)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: scan / gitleaks
  • GitHub Check: scan / shell-secrets
  • GitHub Check: scan / rust-secrets
  • GitHub Check: governance / Workflow security linter
  • GitHub Check: governance / Licence consistency
  • GitHub Check: governance / Guix packaging policy (Nix retired)
  • GitHub Check: governance / Check Workflow Staleness
  • GitHub Check: governance / Debt ratchet
  • GitHub Check: governance / Exemption ratchet
  • GitHub Check: governance / Trusted-base reduction policy
  • GitHub Check: governance / Well-Known (RFC 9116 + RSR)
  • GitHub Check: governance / Allowlist Preflight
  • GitHub Check: governance / Security policy checks
  • GitHub Check: governance / Language / package anti-pattern policy
  • GitHub Check: governance / Code quality + docs
  • GitHub Check: scan / Hypatia Neurosymbolic Analysis
  • GitHub Check: check
  • GitHub Check: Validate A2ML manifests
  • GitHub Check: Empty-linter (invisible characters)
  • GitHub Check: Validate K9 contracts
  • GitHub Check: analyze (javascript-typescript, none)
  • GitHub Check: Groove manifest check
  • GitHub Check: frontend-test
  • GitHub Check: backend-test
  • GitHub Check: Check for Banned Languages
  • GitHub Check: analytics-test
  • GitHub Check: lint-workflows
  • GitHub Check: Check Required Files
  • GitHub Check: sync
  • GitHub Check: deploy-now
  • GitHub Check: lint-workflows
🧰 Additional context used
🪛 zizmor (1.29.0)
.github/workflows/label-triage.yml

[error] 43-43: overly broad permissions (excessive-permissions): issues: write is overly broad at the workflow level

(excessive-permissions)


[warning] 43-43: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[info] 47-47: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 33-40: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)

.github/workflows/labels.yml

[error] 29-29: overly broad permissions (excessive-permissions): issues: write is overly broad at the workflow level

(excessive-permissions)


[warning] 29-29: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[info] 33-33: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 20-26: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)


📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added automatic classification and labelling for newly opened, reopened, or manually selected issues.
    • Introduced a standardised catalogue of repository labels with descriptions, colours, and categories.
    • Added scheduled and on-demand synchronisation to keep repository labels aligned with the catalogue.
    • Existing labels are preserved, with protected labels excluded from automatic updates.

Walkthrough

Adds a generated label catalogue, classifier rules, a jq-based issue classifier, an issue triage workflow, and a workflow that synchronises repository labels.

Changes

Label automation

Layer / File(s) Summary
Label taxonomy and classifier rules
.github/label-classifier.json, .github/labels.json
Defines 37 canonical labels, classification mappings, tier limits, frozen labels, and precedence rules.
Issue classification logic
.github/scripts/classify-issue.jq
Parses titles, detects signals, enforces tier limits, excludes existing labels, and emits valid suggestions.
Issue triage workflow
.github/workflows/label-triage.yml
Classifies opened, reopened, or manually selected issues and applies valid additive labels.
Canonical label synchronisation
.github/workflows/labels.yml
Creates missing labels, updates non-frozen label drift, skips frozen labels, and reports results.

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

Merge Risk: ⚪ Minimal · up to 72e65

This additive label tooling change has no identified current correctness, security, availability, or deployment issue; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant IssueEvent
  participant label-triage.yml
  participant classify-issue.jq
  participant GitHubIssuesAPI
  IssueEvent->>label-triage.yml: trigger issue classification
  label-triage.yml->>GitHubIssuesAPI: fetch issue title and existing labels
  label-triage.yml->>classify-issue.jq: provide classifier rules and issue data
  classify-issue.jq->>label-triage.yml: return canonical label suggestions
  label-triage.yml->>GitHubIssuesAPI: apply accepted labels
Loading

Poem

A rabbit sorts labels in a neat little row

Rules catch the title and signals that show
Frozen tags stay still, while new ones take flight
jq picks the labels with precedence right
Workflows sync colours by day and by night
The issue board thumps with a tidy delight

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the main changes: label tooling and automatic triage for new issues.
Description check ✅ Passed The description is directly related to the changes. It explains the canonical label set, additive-only classifier behaviour, workflows, and lock-file update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (5 skipped: 5 unsupported.)


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.

@gitar-bot

gitar-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

The PR introduces a zero-dependency label management and triage system. While Codacy results indicate the code is up to standards, the review identified several technical risks and policy discrepancies that should be addressed before merging.

The core issue classification engine in .github/scripts/classify-issue.jq is considered high-risk due to its complexity and the lack of local automated tests. This script uses sophisticated regex patterns that are prone to regression without a dedicated test suite. Furthermore, the triage workflow contains a medium-severity bug related to shell word splitting that could cause the system to fail when processing labels with spaces. Finally, there is a contradiction between the PR's stated ban on Python and internal comments referencing Python-based parity tests, which requires clarification for governance compliance.

About this PR

  • The issue classification logic lacks accompanying automated tests within this PR. Given the potential for false positives in regex-based triage, a local test suite is recommended to prevent regressions.
  • The internal documentation in classify-issue.jq references a Python-based parity test (tests/test-classifier-parity.py). This contradicts the stated PR intent and estate-wide policy banning Python. If local testing is required, it should be implemented using permitted tools (e.g., shell/jq).

Test suggestions

  • Classification of issue titles using conventional commit prefixes (e.g., 'feat:', 'fix:')
  • Classification of issue titles using bracket tags (e.g., '[security]', '[estate]')
  • Verification that the classifier does not add a 'type' label if one is already present on the issue
  • Label sync workflow creates new labels defined in the canonical labels.json
  • Label sync workflow updates color and description for existing labels not in the 'frozen' list
  • Label sync workflow skips modifications for any label listed in the 'frozen' array
  • Create a local shell/jq test suite for .github/scripts/classify-issue.jq
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Classification of issue titles using conventional commit prefixes (e.g., 'feat:', 'fix:')
2. Classification of issue titles using bracket tags (e.g., '[security]', '[estate]')
3. Verification that the classifier does not add a 'type' label if one is already present on the issue
4. Label sync workflow creates new labels defined in the canonical labels.json
5. Label sync workflow updates color and description for existing labels not in the 'frozen' list
6. Label sync workflow skips modifications for any label listed in the 'frozen' array
7. Create a local shell/jq test suite for .github/scripts/classify-issue.jq

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

printf 'applying: %s\n' "${apply[*]}"
gh issue edit "$NUM" -R "$GITHUB_REPOSITORY" \
$(printf -- '--add-label %q ' "${apply[@]}") \
|| echo "label apply failed - not failing the run"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

The command substitution will undergo word splitting, which breaks label names containing spaces (e.g., 'good first issue'). Use a Bash array to safely collect and pass the arguments to gh issue edit.

# (`port` + `ion` = "portion", and `port` is a live keyword). They are enabled
# only for shapes that are unambiguously truncated stems -- `-at`
# (instantiat, investigat, adjudicat) and `-ment` (document, implement).
def kwrx($kw):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

Suggestion: The classification logic is sophisticated, particularly the kwrx function. Since parity tests are external, there is a risk of regressions. Recommendation: Create a local test suite (shell script) using jq to run the classifier against mock titles like 'clean up' and 'automation'.

for f in "${FROZEN[@]}"; do [ "$f" = "$name" ] && frozen=1 && break; done
if [ "$frozen" -eq 1 ]; then skipped=$((skipped+1)); continue; fi

cur=$(printf '%s\n' "$existing" | awk -F'\t' -v n="$name" '$1==n{print;exit}')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW RISK

Suggestion: Searching through existing labels using an awk process inside a loop is inefficient. For larger label sets, consider loading the existing labels into a Bash associative array once for O(1) lookups.

# rules are already JSON.
#
# The canonical implementation remains scripts/label-classify.py in the hub,
# which never runs in CI. tests/test-classifier-parity.py asserts this file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW RISK

Nitpick: The documentation references a Python test file (tests/test-classifier-parity.py) for parity, but the PR description and code comments state that Python is strictly banned in the estate. Clarify the discrepancy in policy enforcement.

@hyperpolymath
hyperpolymath force-pushed the automated/label-tooling branch from 6dca64e to 38ddb95 Compare August 27, 2026 14:29
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

Ships the canonical label set and the classifier that labels newly-filed
issues. Additive only: it never removes a label, never overrides a human's
classification, stays silent when unsure, and never fails an issue.

Also adds this repo's two new workflows to .github/workflows/actions.lock as
'[]'. That lock is keyed by workflow path and refuses any workflow it does not
list -- a startup_failure, which produces no check run and is therefore silent.
`gh actions-lock` cannot add these: it records action versions, and both
workflows deliberately use no actions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hyperpolymath
hyperpolymath force-pushed the automated/label-tooling branch from 38ddb95 to 72e6559 Compare August 27, 2026 17:14
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 9046ff0 into main Aug 27, 2026
31 of 40 checks passed
@hyperpolymath
hyperpolymath deleted the automated/label-tooling branch August 27, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant