Skip to content

feat: feed repo triage context to every agent - #15

Merged
Taure merged 1 commit into
mainfrom
feat/repo-triage-context
May 28, 2026
Merged

feat: feed repo triage context to every agent#15
Taure merged 1 commit into
mainfrom
feat/repo-triage-context

Conversation

@Taure

@Taure Taure commented May 28, 2026

Copy link
Copy Markdown
Owner

What

Every triage run now gets a shared repository-context preamble before the issue, so the agents decide with project-specific rules and richer signal instead of generic hard-coded prompts.

The preamble carries three things:

  1. Triage policy - a file read at startup that teaches the agents how this project triages (category meanings, severity rubric, label usage, escalation, scope guardrails). Ships in the release at priv/TRIAGE.md, overridable via TRIAGEBOT_POLICY_PATH, hot-reloadable via triagebot_config:refresh_triage_policy/0. Missing file is fine - agents fall back to built-in defaults. The bundled policy is tuned for the gakudan repo (single-node-by-design scope guardrail, ADR/semver-locked-callback awareness, security escalation).
  2. Label taxonomy - the repo's actual labels + descriptions, now seen by every agent (was only injected into label_proposer). Classifier and scoper now reason in the repo's real vocabulary.
  3. Enriched issue - the high-signal GitHub fields format_input was dropping: author_association (first-timer vs maintainer), reactions/upvotes, comment count, milestone, assignees.

How

  • triagebot_config: read the policy file at startup into persistent_term; triage_policy/0 + refresh_triage_policy/0. Default path resolves via code:priv_dir/1 so it ships with the release (no dependence on a .github/ dir at runtime).
  • New triagebot_context module owns input building (policy + labels + enriched ticket). Moving the label rendering here removed the duplicate copy from label_proposer.
  • label_proposer slimmed to read labels from the shared context; classifier/scoper got one-line nudges to follow the policy and contributor signal.

Tests / checks

  • rebar3 ct - 32 pass (new triagebot_context_SUITE, reworked the two label-prompt tests into context tests).
  • rebar3 fmt --check, rebar3 xref, rebar3 dialyzer, elp lint, rebar3 ex_doc - all clean.
  • eqwalizer: the project's pre-existing elp contractivity crash (reproduces on untouched modules; enable-elp-eqwalize: false in CI) - not affected by this change.

Prepend a shared repository-context preamble to every triage run so the
agents decide with project-specific rules and richer signal instead of
generic hard-coded prompts.

- triagebot_config: read a triage-policy file at startup into
  persistent_term (bundled priv/TRIAGE.md, overridable via
  TRIAGEBOT_POLICY_PATH); triage_policy/0 + refresh_triage_policy/0.
- triagebot_context: builds the run input (policy + label taxonomy +
  the issue enriched with author_association, reactions, comments,
  milestone, assignees from the raw GitHub payload). The label taxonomy
  now reaches every agent, not just the label_proposer.
- slim triagebot_label_proposer to read labels from the shared context;
  nudge classifier + scoper to follow the policy and contributor signal.
- priv/TRIAGE.md: starter policy tuned for the gakudan repo.
@github-actions

Copy link
Copy Markdown

🔴 Code Coverage — 28.5%

79 of 277 lines covered.


✅ ELP Lint

No diagnostics.

@Taure
Taure merged commit 8c5bd1e into main May 28, 2026
16 checks passed
@Taure
Taure deleted the feat/repo-triage-context branch May 28, 2026 05:23
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