Skip to content

feat(agents): repo-context-aware classifier/scoper + dynamic label vocabulary - #9

Merged
Taure merged 2 commits into
mainfrom
feat/repo-context-aware-agents
May 24, 2026
Merged

feat(agents): repo-context-aware classifier/scoper + dynamic label vocabulary#9
Taure merged 2 commits into
mainfrom
feat/repo-context-aware-agents

Conversation

@Taure

@Taure Taure commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

Improves triage quality by giving the agents two new sources of grounding:

  1. A read_repo_file tool the classifier and scoper can call to consult CLAUDE.md, README.md, or the source file an issue links to. Contents are truncated to 16 KB to keep prompt size bounded.
  2. The repo's actual label taxonomy is fetched once at startup via gakudan_tickets_github:list_labels/1 and threaded into the label_proposer's system prompt. If the fetch fails the agent falls back to its previous built-in vocabulary with a warning log. A triagebot_config:refresh_repo_labels/0 lets 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 classifier had to guess what kind of project it was looking at; the label_proposer proposed labels from a hardcoded list (so good-first-issue could 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

  • New: src/tools/triagebot_repo_context_tool.erl (gakudan tool behaviour)
  • New: test/triagebot_repo_context_tool_SUITE.erl (3 cases)
  • src/agents/triagebot_classifier.erl: add tool, add one paragraph to system prompt
  • src/agents/triagebot_scoper.erl: add tool, add one paragraph to system prompt
  • src/agents/triagebot_label_proposer.erl: dynamic prompt built from triagebot_config:repo_labels/0 with conditional claude-try/needs-info semantics
  • src/triagebot_config.erl: fetch labels at setup, add repo_labels/0 + refresh_repo_labels/0
  • test/triagebot_agents_SUITE.erl: refresh expected tool lists + 2 new cases for prompt-with-labels / prompt-without-labels
  • rebar.config: pin gakudan_tickets_github to feat/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 inventory

Test plan

  • rebar3 fmt --check
  • rebar3 xref
  • rebar3 dialyzer (clean)
  • rebar3 ct (20/20, was 15)
  • Once upstream gakudan_tickets_github v0.1.2 ships: bump the pin to the tag, re-run CI, merge here
  • After deploy: trigger triage on a new issue and confirm the classifier reads CLAUDE.md before answering (visible in the gakudan turn telemetry as a tool_call event)

…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.
@github-actions

github-actions Bot commented May 24, 2026

Copy link
Copy Markdown

🔴 Code Coverage — 15%

31 of 207 lines covered.


✅ ELP Lint

No 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.
@Taure
Taure merged commit 90a4d00 into main May 24, 2026
16 checks passed
@Taure
Taure deleted the feat/repo-context-aware-agents branch May 24, 2026 10:48
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