Watch
0
0
Fork
You've already forked hyperhive
0

review classifier: it reads the PR's title and description, and a rule on closing keywords

The controller reads the PR's title and description with the rest of it and
puts both in the run's shared context, ahead of the commits. An empty
description reads as `(none)`. `TryOut` carries them as optional fields, so a
controller that sends none still gets its run answered.

New rule `closes-only-finished-issues`: a description that carries a closing
keyword for an issue and also says the PR leaves part of it undone is a
violation, because the keyword closes the issue when the PR merges.
This commit is contained in:
argus 2026-11-23 00:49:11 +01:00 • committed by mara
commit 8a0615ccfc

View file

@ -81,8 +81,8 @@ as a reviewer on a PR starts a run:
2. The controller reads the PR and the repo's rules from the default branch,
and hands the run to the classifier service as one queue request on
`$SWARM.review-classifier.try-out`, the subject a try-out uses.
3. The classifier runs every classification against the PR's commits and
diff.
3. The classifier runs every classification against the PR's title,
description, commits and diff.
4. The controller posts the result on the PR as the service account's
review, on the commit it read.
@ -364,8 +364,10 @@ comment saying so.
Every classification in a run sees the same context, in the same order:
1. a short system prompt
2. the PR's commits, each with its full message
3. the full diff
2. the PR's title and description, as its author wrote them (`(none)` where
there is no description)
3. the PR's commits, each with its full message
4. the full diff
Only the last part differs per classification: that classification's
description and the task to classify the PR against it. The identical prefix
@ -385,11 +387,11 @@ a single merge base (the head merges the base branch in), when reading a
changed file fails, or when the wide diff is over 256 KiB. The review then says
so, with the reason.
On the API key runtime the commits and diff are one content block of the user
message and the question another, with a cache breakpoint at the end of the
first. The cache writes an entry only where a breakpoint is, and `claude` sets
one only after the last block, so that breakpoint is what lets the next
question read the commits and diff from the cache. The PR stays in the user
On the API key runtime the title, description, commits and diff are one content
block of the user message and the question another, with a cache breakpoint at
the end of the first. The cache writes an entry only where a breakpoint is, and
`claude` sets one only after the last block, so that breakpoint is what lets the
next question read the PR from the cache. The PR stays in the user
message rather than the system prompt, which tells the model to judge it as
data. A shared context shorter than the model's minimum cacheable length is
not cached at all.
@ -759,8 +761,8 @@ These get settled, and filled in here, as the work reaches them:
- **Diff-leaves-swarm policy.** On the API key and ACP runtimes the diff
goes to a third-party provider. Which repos may use which runtime, and
whether anything gets redacted.
- **Prompt injection.** A PR's diff and commit messages are model input, so
a PR can try to talk the classifier into approving it.
- **Prompt injection.** A PR's title, description, diff and commit messages
are model input, so a PR can try to talk the classifier into approving it.
- **Subscription credential.** Where in bao the subscription runtime's login
lives. The service account's forge token is at
`secret/swarm/services/review-classifier/forge/token`.