Watch
0
0
Fork
You've already forked hyperhive
0

add a triage archetype: haiku, a triage prompt, flows for new issues and prs

This commit is contained in:
atlas 2026-11-11 22:16:24 +01:00 • committed by mara
commit 70e4c63ff7

View file

@ -81,4 +81,93 @@
};
};
};
triage =
let
# One flow per event and action; every todo goes to `members`, under a
# `forge:<repo>#<number>:` key so the built-in closed flow clears it.
newItem =
{
id,
name,
event,
action,
text,
}:
{
inherit id name;
nodes = [
{
id = "src";
kind = "source";
events = [ event ];
}
{
id = "action";
kind = "match";
when = [
{
field = "action";
equals = action;
}
];
}
{
id = "tell";
kind = "todo";
to = "members";
op = "upsert";
key = "forge:{{ repo }}#{{ number }}:triage-${action}";
inherit text;
}
];
edges = [
{
from = "src";
to = "action";
}
{
from = "action";
to = "tell";
}
];
};
in
{
module =
{ lib, ... }:
{
services.hyperhive.agent.icon = lib.mkDefault ./icons/triage.svg;
};
meta = {
icon = builtins.readFile ./icons/triage.svg;
description = "Labels and assigns every new issue and pull request, then routes it. It runs on haiku, holds the default permissions and wakes on router todos for new and reopened issues and new pull requests, not on forge subscriptions.";
prompt = builtins.readFile ./prompts/triage.md;
inference = {
model = "haiku";
};
flows = [
(newItem {
id = "issue-opened";
name = "new issues go to triage";
event = "issues";
action = "opened";
text = "{{ repo }}#{{ number }}: a new issue was created. make sure it's labeled and has a matching assignee.";
})
(newItem {
id = "issue-reopened";
name = "reopened issues go to triage";
event = "issues";
action = "reopened";
text = "{{ repo }}#{{ number }}: an issue was reopened. make sure it's labeled and has a matching assignee.";
})
(newItem {
id = "pr-opened";
name = "new pull requests go to triage";
event = "pull_request";
action = "opened";
text = "{{ repo }}#{{ number }}: a new pull request was created. make sure it's labeled and has a reviewer.";
})
];
};
};
}