Skip to content

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

Open
hyperpolymath wants to merge 1 commit into
mainfrom
automated/label-tooling
Open

feat(labels): estate label tooling + auto-triage for new issues#78
hyperpolymath wants to merge 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

Warning

Review limit reached

Next included review available in 27 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b1907ea5-4e74-48b6-803b-7487642ef819

📥 Commits

Reviewing files that changed from the base of the PR and between 9343e19 and 3204819.

📒 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

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

Gitar is working

Gitar

@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.

@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

This PR introduces a robust jq-based label classification and triage system. While the implementation aligns with the architectural requirement to avoid Python and external actions, several critical issues must be addressed before merging.

Notably, although Codacy analysis indicates the PR is 'up to standards', all six required test scenarios identified to verify the triage logic and sync behavior are missing. Furthermore, the triage workflow and the core JQ script are identified as high-complexity files with no test coverage, increasing the risk of regressions in regex handling or label application. A significant logic bug regarding word splitting in Bash was also identified, which will cause failures when handling labels containing spaces (e.g., 'good first issue'). Finally, the .github/workflows/actions.lock file mentioned in the PR description is missing from the diff.

About this PR

  • The PR description refers to a parity test suite that exists elsewhere. Given the complexity of the regex logic in the JQ classifier, this test suite or equivalent unit tests should be integrated into the repository to validate the classification logic locally.
  • The generator scripts mentioned in the headers of label-classifier.json and labels.json are not included in this PR. To ensure maintainability, these scripts should be part of the repository so the generated artifacts can be updated as the canonical label set evolves.
1 comment outside of the diff
.github/workflows/actions.lock

line 1 🟡 MEDIUM RISK
The changes to .github/workflows/actions.lock mentioned in the PR description are missing from the diff. Please ensure this file is included to maintain the security posture of the workflows.

Test suggestions

  • Missing: Verify that a title prefix (e.g., 'feat:') results in the correct type label ('enhancement').
  • Missing: Verify that bracket tags (e.g., '[p0]') are correctly mapped to priority labels.
  • Missing: Verify that the classifier returns no labels if the issue already has a label in the same 'max-1' tier (e.g., already has a 'bug' label).
  • Missing: Verify that the label sync workflow creates missing labels defined in labels.json.
  • Missing: Verify that the label sync workflow skips updates for labels defined in the 'frozen' list.
  • Missing: Verify that the triage workflow remains silent and exits 0 when no confident classification is found.
  • Missing: Implement unit tests for the complex regex construction logic in kwrx within .github/scripts/classify-issue.jq.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Missing: Verify that a title prefix (e.g., 'feat:') results in the correct type label ('enhancement').
2. Missing: Verify that bracket tags (e.g., '[p0]') are correctly mapped to priority labels.
3. Missing: Verify that the classifier returns no labels if the issue already has a label in the same 'max-1' tier (e.g., already has a 'bug' label).
4. Missing: Verify that the label sync workflow creates missing labels defined in labels.json.
5. Missing: Verify that the label sync workflow skips updates for labels defined in the 'frozen' list.
6. Missing: Verify that the triage workflow remains silent and exits 0 when no confident classification is found.
7. Missing: Implement unit tests for the complex regex construction logic in `kwrx` within .github/scripts/classify-issue.jq.

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

Comment thread .github/workflows/label-triage.yml Outdated

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

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

Word splitting will break if a label contains spaces (e.g., 'good first issue'). This is a high-risk area given the complexity of the triage workflow. Use an array to collect arguments instead:

Suggested change
$(printf -- '--add-label %q ' "${apply[@]}") \
args=()
for label in "${apply[@]}"; do args+=("--add-label" "$label"); done
gh issue edit "$NUM" -R "$GITHUB_REPOSITORY" "${args[@]}" \

frozen=0
for f in "${FROZEN[@]}"; do [ "$f" = "$name" ] && frozen=1 && break; done

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.

🟡 MEDIUM RISK

Suggestion: Spawning awk in a loop creates significant overhead in a fleet-wide workflow. Try running the following prompt in your coding agent:

In .github/workflows/labels.yml, optimize the label lookup logic by parsing the existing TSV variable into a Bash associative array (declare -A) once before the loop, then look up labels by key inside the loop to avoid spawning awk subshells.

# (`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.

⚪ LOW RISK

Suggestion: The regex construction logic in kwrx is quite complex and critical for the triage system. Consider adding unit tests for this specific function to ensure that the inflection-tolerant matching doesn't regress.

Try running the following prompt in your IDE agent:

Create a standalone shell script that runs jq against classify-issue.jq with a set of test cases (mock issue titles and expected keywords) to verify the regex boundary logic.

Comment thread .github/workflows/labels.yml Outdated
&& updated=$((updated+1))
fi
fi
sleep 0.4

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: Move the sleep command inside the if blocks for gh label create and gh label edit so it only runs when a write API call is actually made, rather than pausing on every iteration.

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 1f4b0ae to 3204819 Compare August 27, 2026 17:22
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