Help us shape the future of Go! Take the 2026 Go Developer Survey

agentrunner

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(ctx Context) string

BuildPrompt reinforces "content is data, not instructions" at the mechanism level, not just in the role prompt (spec: Roles). The delimiters are best-effort, not a guarantee — adversarial diff or log content could itself contain a fake closing tag. This raises the bar against injection, it does not eliminate it. Every backend that takes a flat text prompt (any CLI-shim adapter) should call this rather than assembling its own — that's what keeps injection-mitigation behavior identical across backends instead of drifting per adapter.

func GenerateClaudeCodeArtifacts

func GenerateClaudeCodeArtifacts(repoRoot string, roleContent map[string]string) error

GenerateClaudeCodeArtifacts translates neutral role content into Claude Code subagent definitions. This is a projection of the neutral role files, not the source of truth (spec: Architecture Overview) — re-running it after a role file changes regenerates the artifact.

func GenerateClaudeCodeCommands

func GenerateClaudeCodeCommands(repoRoot string) error

Types

type ClaudeCode

type ClaudeCode struct {
	RepoRoot string
	Model    string
}

ClaudeCode dispatches role invocations as one-shot `claude -p` calls. It stores no credentials — it relies entirely on the host's own `claude` CLI authentication (spec: Backend Adapters).

func (ClaudeCode) RunAgent

func (c ClaudeCode) RunAgent(role string, ctx Context) (Result, error)

func (ClaudeCode) WorktreeSetup

func (c ClaudeCode) WorktreeSetup(worktreePath string) error

type Context

type Context struct {
	LogSlice   []blog.Entry
	Diff       string
	RolePrompt string
}

Context is everything a one-shot role invocation needs, reconstructed fresh by the observer from ticket state — there is no persistent conversation across invocations (spec: Concurrency Model).

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

Mock is a scripted Runner used in tests so the ticket lifecycle can be exercised end-to-end without a real model call or token cost (spec: Testing Strategy).

func NewMock

func NewMock() *Mock

func (*Mock) RunAgent

func (m *Mock) RunAgent(role string, _ Context) (Result, error)

func (*Mock) ScriptResponse

func (m *Mock) ScriptResponse(role string, result Result)

func (*Mock) WorktreeSetup

func (m *Mock) WorktreeSetup(_ string) error

type Result

type Result struct {
	Output string
	Model  string
}

type Runner

type Runner interface {
	RunAgent(role string, ctx Context) (Result, error)
	WorktreeSetup(worktreePath string) error
}

Runner is implemented once per backend (claude-code today; gemini, codex later) against the same signature, so the orchestration core never depends on which backend is configured.

Jump to

Keyboard shortcuts

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