devloop

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package devloop measures whether a coding agent, dropped into a fresh GoFastr scaffold with an edit-and-check task, develops under `gofastr dev` (rebuild on save, browser reload) or falls back to `go run .` / a hand-launched binary and restarts after every edit.

The prompt names no command. Whatever loop the agent picks, it found in the scaffold's own guidance, so a failing trial is a guidance gap.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	RepoRoot  string
	RunDir    string
	Runs      int
	Model     string
	ClaudeBin string
	Timeout   time.Duration
}

Options configures a run.

type Report

type Report struct {
	Model     string  `json:"model"`
	Trials    []Trial `json:"trials"`
	Passed    int     `json:"passed"`
	TasksDone int     `json:"tasks_done"`
}

Report is the aggregate written to results.json and RESULTS.md.

func Regrade

func Regrade(ctx context.Context, runDir string) (Report, error)

Regrade re-runs grading over an existing run directory without launching agents.

func Run

func Run(ctx context.Context, opts Options) (Report, error)

Run scaffolds, drives and grades opts.Runs independent trials.

type Signals

type Signals struct {
	// DevLaunches counts agent-started `gofastr dev` processes: the larger
	// of the shim log (catches scripts) and the transcript (catches a
	// call through an absolute path that skips the shim).
	DevLaunches int `json:"dev_launches"`
	// GoRuns and BinaryLaunches are the bypasses: starting the app in a
	// way that never sets GOFASTR_DEV=1, so nothing reloads.
	GoRuns         []string `json:"go_runs,omitempty"`
	BinaryLaunches []string `json:"binary_launches,omitempty"`
	// DevRebuilds counts the builds `gofastr dev` ran beyond the first
	// one per launch: each is the watcher picking up an edit.
	DevRebuilds int `json:"dev_rebuilds"`
	// CallsBeforeDev is how many tool calls the agent made before its
	// first `gofastr dev` launch (-1: it never launched one), and Lookups
	// are the ones that went looking for how to run the app: an agents/
	// doc, `gofastr --help`, `gofastr docs`. Guidance that puts the dev
	// loop where the agent reads first shows up here, not in the
	// verdict: a model that finds the command after a search still passes.
	CallsBeforeDev int      `json:"calls_before_dev"`
	Lookups        []string `json:"lookups,omitempty"`
	// Commands is every shell command, for auditing a verdict by hand.
	Commands []string `json:"commands,omitempty"`
}

Signals is the behavioral evidence for one trial.

type Trial

type Trial struct {
	Index    int      `json:"index"`
	Signals  Signals  `json:"signals"`
	Verdict  Verdict  `json:"verdict"`
	CostUSD  float64  `json:"cost_usd"`
	Duration float64  `json:"duration_seconds"`
	Issues   []string `json:"technical_issues,omitempty"`
	Final    string   `json:"final_message,omitempty"`
}

Trial is one agent run and its grade.

type Verdict

type Verdict struct {
	Pass         bool     `json:"pass"`
	Failures     []string `json:"failures,omitempty"`
	TaskDone     bool     `json:"task_done"`
	TaskFailures []string `json:"task_failures,omitempty"`
}

Verdict is the call for one trial. Pass is the dev-loop verdict, the thing this eval measures, and the only one that sets the exit code. TaskDone is whether the finished app has the three changes: a model that guesses a field the component does not have fails the task, not the dev loop, and the report keeps the two apart.

Jump to

Keyboard shortcuts

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