Documentation
¶
Overview ¶
Package roles defines the agent roles as data: a mission, an ordered task, an exit condition, and a shared set of bounds. Adding or tuning a role is editing text here, not writing engine code.
Index ¶
- Constants
- Variables
- func Assemble(def RoleDef, iss domain.Issue, gateCmd string) string
- func AssembleDescribe(iss domain.Issue, artifactPath string) string
- func AssembleFix(fb domain.ReviewFeedback, gateCmd string) string
- func AssembleReview(iss domain.Issue, artifactPath string) string
- type RoleDef
Constants ¶
const Bounds = `` /* 520-byte string literal not displayed */
Bounds are the hard rules every role runs under. They are stated to the model here AND enforced out of band by the PR guard, because the Phase 0 spikes showed a model will route around a prompt instruction to reach a green gate: it edited the Makefile (S3-B) and deleted a test (S4). The prompt is a request; the guard is the control. This wording is product-defining and is the thing most worth reviewing by hand.
Variables ¶
var Describer = RoleDef{ Role: domain.RoleDescriber, Mission: "Describe the pending change in this working tree for the pull-request body. Do not edit code.", Steps: []string{ "Read the issue and the pending change (for example `git status` and `git diff`).", "Write a short prose walkthrough of what the change does and why.", "Group the changed files into semantic areas and give each a one-line summary.", "If the change alters a runtime flow, express the primary flow as one or two mermaid sequenceDiagram blocks; for a change with no interesting flow, use an empty diagrams list.", "Write the result as JSON to the artifact file path given below, creating its directory if needed.", }, Exit: "The artifact file exists and contains valid JSON matching the schema.", }
Describer reads the pending change and writes the description artifact. It never edits code; its only output is one JSON file inside the scratch directory, which the commit step deletes before staging.
var Fixer = RoleDef{ Role: domain.RoleFixer, Mission: "Address the reviewer's requested changes on this pull request.", Steps: []string{ "Read each requested change and the code it refers to in the working tree.", "Make the smallest change that addresses each point the reviewer raised.", "Run the gate command and read its output.", "If the gate fails, use its output to guide the next change, then repeat.", }, Exit: "The gate command exits zero and every requested change is addressed or explained.", }
Fixer edits an open pull request to address a human's requested changes, then runs the gate. Its input is review feedback, not an issue.
var Implementer = RoleDef{ Role: domain.RoleImplementer, Mission: "Implement the change described in the issue.", Steps: []string{ "Read the issue and the relevant code in the working tree.", "Make the smallest change that satisfies the issue.", "Run the gate command and read its output.", "If the gate fails, use its output to guide the next change, then repeat.", }, Exit: "The gate command exits zero.", }
Implementer edits code until the gate passes.
var Reviewer = RoleDef{ Role: domain.RoleReviewer, Mission: "Review the proposed change against the issue. Do not edit code.", Steps: []string{ "Read the issue and the diff on the current branch.", "Judge whether the change correctly and safely resolves the issue.", "Report a verdict: pass, or fail with specific, actionable findings.", }, Exit: "A verdict has been recorded.", }
Reviewer judges a diff and never edits.
Functions ¶
func Assemble ¶
Assemble builds the full prompt for a role, given the issue and the gate command. The issue text is untrusted input (anyone who can file an issue writes it), so it is delimited and explicitly marked as data, never as instructions. This delimiting is a structural mitigation; it does not by itself guarantee the model ignores injected instructions, which is why triggering is also gated on the labeler's identity elsewhere.
func AssembleDescribe ¶
AssembleDescribe builds the describer prompt. The issue text is delimited as data exactly as in Assemble, because it is the same injection channel.
func AssembleFix ¶
func AssembleFix(fb domain.ReviewFeedback, gateCmd string) string
AssembleFix builds the fixer prompt from the review feedback and the gate command. Like Assemble, the human-authored feedback is delimited and marked as data, never as instructions, because it is an injection channel just as an issue body is.