propose

package
v0.15.1 Latest Latest
Warning

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

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

Documentation

Overview

Package propose turns what a candidate missed in a contest into one change to the skill's prose.

It is given the missed expectations and the judge's evidence, and never the task prompts, the suite or the workspace. A proposer that cannot read a task cannot write a change tailored to one, which is the whole overfitting defence — there is no held-out split here, because one proposal validated once cannot compound the way an iterating loop does.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoLosses = fmt.Errorf("propose: this candidate recorded no loss, so there is nothing to work from")

ErrNoLosses reports a candidate with nothing to work from. Inventing an improvement with no evidence is the edit this command exists to replace.

Functions

func Prompt

func Prompt(in Input) string

Prompt is exported so a test can assert what the model is told — above all, that no task prompt reaches it.

Types

type Change

type Change struct {
	Path string `json:"path"`
	Body string `json:"body"`
}

Change is one file's proposed new contents.

type File

type File struct {
	// Path is relative to the bundle root, e.g. "SKILL.md".
	Path string
	Body string
}

File is one prose file from the bundle, as it stands.

type Input

type Input struct {
	Skill string
	// Files are the bundle's prose. A contest compares whole bundles, so a
	// skill often loses a task because a reference is wrong.
	Files []File
	// Losses are every recorded loss of one candidate, addressed together: a
	// skill is prose read as a whole, so five edits to five missed
	// expectations are one rewrite, not five proposals.
	Losses []Loss
	// Description is the spec's description when the skill has a stored spec.
	// Empty when it has none.
	Description string
}

Input is one proposal request.

type Loss

type Loss struct {
	TaskID   string
	Missed   []string
	Evidence string
}

Loss is one task a candidate failed. TaskID identifies it for a reader; the prompt sent to the model carries the expectations and the evidence only.

type Result

type Result struct {
	Changes []Change `json:"changes"`
	// Description is the spec's new description, empty when unchanged or when
	// the skill has no spec.
	Description string `json:"description"`
	// Rationale is one short paragraph a reader weighs the diff against.
	Rationale string `json:"rationale"`
}

Result is what the model proposed.

func Run

func Run(ctx context.Context, gw llm.Gateway, in Input) (*Result, error)

Run asks for one change addressing every loss.

Jump to

Keyboard shortcuts

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