app

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Overview

This file is where the run's records go: the stage and step records the run reports to codeaf, and the run's own log of every record and bus payload for the tests that read one.

This file is the pipeline driver: budget, run base and workspace preparation around the solo run in solo.go.

This file is one run as codeaf starts it: what senior-dev's own command line used to do between parsing its flags and printing its terminal event, with codeaf's host in place of stdout and codeaf's model API in place of a key.

This file adapts the model backend, tool registry, durable session store and bus into the single `turn` the solo run drives.

Linux spelling of the stat ctime field read by durable_sessions.go's projection mark.

Index

Constants

View Source
const (
	// StepBrief is reading the spec the brief was written down as.
	StepBrief = "brief"
	// StepExplore is reading, searching and running commands before the first
	// change to a project file.
	StepExplore = "explore"
	// StepPin is writing down the command that shows the work passes.
	StepPin = "pin"
	// StepChecklist is listing the request's requirements, and ticking them.
	StepChecklist = "checklist"
	// StepImplement is every change to a project file, and whatever the model
	// reads or runs once it has made one.
	StepImplement = "implement"
	// StepSubmit is the submit tool, and anything after an accepted submit.
	StepSubmit = "submit"
	// StepVerify is senior-dev running the project's own build and tests itself,
	// with no model: after the hand-in, and when it checks the tree mid-run.
	StepVerify = "verify"
)

The steps of senior-dev's own process, as a `step` record names the one an action served. They are the parts of the one model context the run instruction lays out (solo_prompt.go) — read the spec, explore, pin a check, list the requirements, implement, submit — and the independent check the run makes of the tree itself afterwards.

THEY ARE A REPORT, NEVER A PLAN. Inside the model context the order is the model's own: it may explore after it has pinned, and write its checklist last. A step id says which part of the process an action serves, so an id recurs whenever the model comes back to that part; nothing here moves the model from one to the next, and nothing the model sees depends on them.

ONE SOURCE OF TRUTH: these constants are the ids on the wire, the classifier below answers only them, and senior-dev's page words are keyed by them (internal/seniordev's actions.go).

View Source
const DefaultHighModels = "" /* 195-byte string literal not displayed */

DefaultHighModels is the pool the coder routes on when the command line names none: `--high` on `codeaf senior-dev run`. Each entry is a model on the service codeaf's model API speaks for, and senior-dev's own router picks among them call by call (internal/seniordev/router/adaptive); codeaf's funnel then serves the call the router picked.

View Source
const DefaultVariant = string(effort.High)

DefaultVariant is the reasoning effort every coder call asks for when the command line names none: `--variant` on `codeaf senior-dev run`. senior-dev is handed the long, many-sided work, and a coder left to each model's own default thought as little as the model's makers chose for a chat. It is a rung of codeaf's one ladder (internal/effort), and the summaries a long run writes of its own history send none ([turnCall.Summary]).

Variables

View Source
var Stages = []string{
	"bootstrap",
	"run-contract",
	"intake",
	"landing",
	"implement",
	"agent-runtime",
	"compaction-capacity",
	"compaction",
	"router-cancellation",
	"model-switch",
	"submit",
	"verification",
	"ship",
	"patch-summary",
	"agent-summary",
}

Stages are the stages a run reports, in the order a run first reaches them: the `hello` codeaf draws the whole track from before the run has walked it.

THE LIST IS CLOSED, and a test holds it to the source: every stage the run can emit is here, and nothing is here that it cannot emit (stages_test.go). compaction-capacity, compaction, router-cancellation and model-switch happen inside a model turn — when a rejection pins a window, the history is compacted, a call is withdrawn or the coder moves to another model — so they sit where the turns are.

Steps is every step id, in the order a run first reaches them when its model works through the process as the instruction lays it out.

Functions

func CrewModel

func CrewModel(id string) string

CrewModel is a crew seat's model as a pool entry: the id filed under the service codeaf's model API speaks for, which is how every pool entry is spelled (DefaultHighModels). An id already filed there is left alone.

func ParseVariant

func ParseVariant(word string) (string, bool)

ParseVariant reads a `--variant` word on codeaf's one ladder (internal/effort): a rung is sent as it is spelled, and `none`, `auto`, `off` or nothing send no `reasoning` at all, so the model thinks however it thinks. A word that is neither is refused rather than sent for a provider to reject call after call.

func RestoredFrom

func RestoredFrom(source string) string

RestoredFrom names a restore's source the way a person would: the ending's observation says it here, and senior-dev's page says it with the same words (internal/seniordev's actions.go).

func Run

func Run(ctx context.Context, host delegate.Host, options Options, notes io.Writer) delegate.Ending

Run runs senior-dev once in the host's workspace and answers how it ended. It reports its stages and finished steps through host as it goes; the hello before it and the terminal after it are the caller's, which is the one place every ending reaches, a panic's included. notes is where its lines for a person go: stderr, which codeaf keeps beside the task.

func VariantWords

func VariantWords() string

VariantWords is every word ParseVariant takes, for the sentence that refuses one it does not.

Types

type Options

type Options struct {
	// Goal is the brief, exactly as it was given. It is written to
	// .senior-dev/spec.md byte for byte and read back from there, so nothing
	// between the person and the model paraphrases it.
	Goal string
	// High, Low and Frontier are the model pools, comma-separated; an empty Low
	// or Frontier routes on High.
	High     string
	Low      string
	Frontier string
	// Variant is the reasoning effort of the coder's calls, sent as
	// `reasoning.effort`: a rung of internal/effort, or "none" for no
	// `reasoning` at all ([ParseVariant]). Empty sends none too; the command
	// line's own default is [DefaultVariant].
	Variant string
	// InPlace edits the folder without git: no commits, no refs, and the run's
	// checkpoints kept outside it.
	InPlace bool
	// Crew says the pools came from the crew of the conversation that started
	// the run (`--crew`), not from a person typing them: a model the catalog
	// cannot size is dropped with a note, and a --high left empty routes on
	// [DefaultHighModels] ([crewPools]).
	Crew bool
	// Asked says the --high pool is the models the person asked for (`--asked`).
	// It is kept whole under Crew: every one of them must be sizable, and the
	// run refuses before its first call, naming the one that is not
	// ([askedRefusal]).
	Asked bool
}

Options is what one run is asked to do.

Jump to

Keyboard shortcuts

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