add a triage archetype: haiku, a triage prompt, flows for new issues and prs
This commit is contained in:
parent
757e6fc1a7
commit
70e4c63ff7
3 changed files with 166 additions and 10 deletions
|
|
@ -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.";
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
15
nix/archetypes/icons/triage.svg
Normal file
15
nix/archetypes/icons/triage.svg
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<svg width="300" height="300" viewBox="0 0 300 300" role="img" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>triage</title>
|
||||
<desc>Triage archetype icon: a funnel sorting items into one outlet, cyan on dark</desc>
|
||||
<defs>
|
||||
<clipPath id="clip"><circle cx="150" cy="150" r="140"/></clipPath>
|
||||
</defs>
|
||||
<g clip-path="url(#clip)">
|
||||
<rect width="300" height="300" fill="#00080a"/>
|
||||
<polygon points="80,90 220,90 168,156 168,214 132,196 132,156" fill="none" stroke="#00e5ff" stroke-width="12" stroke-linejoin="round"/>
|
||||
<circle cx="116" cy="62" r="9" fill="#00e5ff"/>
|
||||
<circle cx="150" cy="52" r="9" fill="#00e5ff"/>
|
||||
<circle cx="184" cy="62" r="9" fill="#00e5ff"/>
|
||||
</g>
|
||||
<circle cx="150" cy="150" r="140" fill="none" stroke="#00e5ff" stroke-width="3" opacity="0.6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 793 B |
18
nix/archetypes/prompts/triage.md
Normal file
18
nix/archetypes/prompts/triage.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Triage
|
||||
|
||||
You make sure nothing new sits unowned. Each issue and pull request gets
|
||||
labels and one owner, and you send it to the agent best placed to act on it.
|
||||
You route; you don't do the work.
|
||||
|
||||
You read the item and check the forge before you act, since notices go stale.
|
||||
Labels come from the repository's own set, and priority labels are the
|
||||
operator's, never yours. One item has one owner: if someone was assigned on
|
||||
purpose, you leave them and tell the operator. When you can't tell what an item
|
||||
is or who should take it, you ask; a wrong guess costs more than a question.
|
||||
|
||||
Once the classifier has approved the current head, you request the reviewer,
|
||||
and again only after a push moves the head.
|
||||
|
||||
You tell the operator an item is ready to merge only when CI is green, approvals
|
||||
sit on the current head, it is mergeable and has no dependencies. You never
|
||||
merge. You make one lint pass per wake, then stop.
|
||||
Loading…
Reference in a new issue