review

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package review is the agent's pull-request reviewer: the standing instruction it works from, and the exact authority it holds while it works.

A reviewer is not a new kind of run. It is the ordinary tool-using loop pointed at a narrow toolset, so this package registers no driver of its own. What makes a reviewer a reviewer is the pair below: the instruction that tells it what a finding is, and the grant that decides what it may do. Both are values, so both can be read, diffed, and asserted on in a test.

The grant is the interesting half. A reviewer may fetch a pull request, comment on it, and submit a verdict. It may not run a command, read the working tree, write a file, or delegate to a child run, because those actions are absent from the grant and the dispatch waist refuses an action the grant does not name. That refusal is structural: it holds whatever the model is talked into asking for.

This directory, archetypes/, is the home of the archetypes Flynn ships: each package is one authored agent (its instruction and its authority) built on the Agent kind that internal/archetype defines. The engine lives there; the content lives here.

The grant only binds once a caller puts it on the context. An unbound context is permissive by design, the zero-config default of package capability, so assembling a reviewer without binding its grant produces an unconstrained run that looks identical from the outside. Bind it, and assert the refusal.

Index

Constants

View Source
const ArchetypeName = "reviewer"

ArchetypeName is the reviewer's name as a stored Agent resource.

View Source
const SystemPrompt = `` /* 5567-byte string literal not displayed */

SystemPrompt is the reviewer's standing instruction.

It is written against one failure mode. A model asked to review a diff will find something to say about every hunk, because saying nothing feels like failing the task. The result is a wall of observations that buries the one comment that mattered, and a reviewer nobody reads. So the instruction is mostly about what not to post: no finding without a file, a line, and a concrete failure it causes. The tool enforces the same rule, and refuses a finding that lacks one.

Variables

This section is empty.

Functions

func Archetype

func Archetype(model string) archetype.Spec

Archetype returns the reviewer as an Agent resource spec: the standing prompt, the exact authority, the loop, and the model. Storing it as a resource is what makes a reviewer's authority readable after the fact, rather than a property of whichever code path happened to assemble the run.

The loop is the general-purpose tool-using one. A review is a conversation that calls tools and stops, which is what that loop already is; a bespoke review loop would differ from it only in name.

An empty model defers to the host's configured model, so a reviewer can run on a frontier model or a local one without touching this spec. Package harness adapts the scaffolding to whichever it gets.

func Capabilities

func Capabilities() []string

Capabilities returns the action names a reviewer is granted, in sorted order. The caller receives a copy, so a mutation cannot widen a reviewer's authority through the returned slice.

func Grant

func Grant() capability.Grant

Grant returns the capability grant a reviewer runs under. Bind it onto the run's context with capability.Into, or the dispatch waist has no policy to consult and admits everything.

func Tools

func Tools(cfg github.Config) ([]mission.Tool, error)

Tools builds the reviewer's toolset against one repository. The names it exposes are exactly the capabilities the grant names; a tool the grant omits is refused at the waist even though the toolset offers it, and a capability with no tool behind it can never be exercised. TestCapabilitiesMatchTheToolset pins them together.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL