feat(agents): repo-context-aware classifier/scoper + dynamic label vocabulary - #9
Merged
Conversation
…cabulary Adds a new `read_repo_file` tool the classifier and scoper agents can call to ground themselves in repo-specific context (CLAUDE.md, README.md, CONTRIBUTING.md, or the source file an issue links to). File contents are truncated to 16 KB to keep prompt size bounded. The label_proposer now picks from the labels that actually exist in the target repo, fetched once at startup via `gakudan_tickets_github:list_labels/1` and cached in persistent_term. If the fetch fails, the agent falls back to its previous built-in vocabulary with a warning log. A new `refresh_repo_labels/0` lets operators re-fetch from a remote shell without restarting the app. The conventions for `claude-try` and `needs-info` are now phrased conditionally on those labels actually existing in the repo's inventory, since we no longer pretend they are universal. gakudan_tickets_github is bumped to the feat/get-file-and-list-labels branch pending v0.1.2 release. Will swap to the tag once upstream PR merges. 5 new test cases (20 total): - 3 for triagebot_repo_context_tool (spec shape + input rejection) - 2 for label_proposer (prompt-rendering with/without labels) Existing agent tests updated to reflect new tools list.
🔴 Code Coverage — 15%31 of 207 lines covered. ✅ ELP LintNo diagnostics. |
The repo-context tooling (get_file/2,3, list_labels/1) shipped in Taure/gakudan_tickets_github v0.1.2. Swapping the temporary branch pin for the proper tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves triage quality by giving the agents two new sources of grounding:
read_repo_filetool theclassifierandscopercan call to consultCLAUDE.md,README.md, or the source file an issue links to. Contents are truncated to 16 KB to keep prompt size bounded.gakudan_tickets_github:list_labels/1and threaded into thelabel_proposer's system prompt. If the fetch fails the agent falls back to its previous built-in vocabulary with a warning log. Atriagebot_config:refresh_repo_labels/0lets operators re-fetch from a remote shell without a restart.Motivation
Before this PR the five agents had zero awareness of the repo they were triaging. The
classifierhad to guess what kind of project it was looking at; thelabel_proposerproposed labels from a hardcoded list (sogood-first-issuecould end up on a repo that doesn't define it). Now they triage with eyes open.This is the first half of the v0.1.8 "make triage actually smart" line of work. The companion PR for the upstream tooling is Taure/gakudan_tickets_github#3.
Files
src/tools/triagebot_repo_context_tool.erl(gakudan tool behaviour)test/triagebot_repo_context_tool_SUITE.erl(3 cases)src/agents/triagebot_classifier.erl: add tool, add one paragraph to system promptsrc/agents/triagebot_scoper.erl: add tool, add one paragraph to system promptsrc/agents/triagebot_label_proposer.erl: dynamic prompt built fromtriagebot_config:repo_labels/0with conditionalclaude-try/needs-infosemanticssrc/triagebot_config.erl: fetch labels at setup, addrepo_labels/0+refresh_repo_labels/0test/triagebot_agents_SUITE.erl: refresh expected tool lists + 2 new cases for prompt-with-labels / prompt-without-labelsrebar.config: pingakudan_tickets_githubtofeat/get-file-and-list-labels(will swap to{tag, "v0.1.2"}once upstream PR fix(nova): add bootstrap_application + json_lib (unbreaks boot) #3 merges)README.md: update agent + tool inventoryTest plan
rebar3 fmt --checkrebar3 xrefrebar3 dialyzer(clean)rebar3 ct(20/20, was 15)gakudan_tickets_githubv0.1.2 ships: bump the pin to the tag, re-run CI, merge hereCLAUDE.mdbefore answering (visible in the gakudan turn telemetry as atool_callevent)