askjob

package
v0.207.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package askjob turns a one-line question plus a file list into a FULL delegation contract — the whole of offload_ask's contribution.

Why it exists: measured organic adoption of agent_delegate is ~0, and the cause is arithmetic, not discipline. At the moment of deciding, authoring a contract (goal + context + output_schema + a non-parrot acceptance check) costs far more than opening the files and reading them. Three rounds of steering pressure — prose rules, a nudge hook, a blocking gate — moved that number not at all, because none of them changed the cost. This does: question + paths in, {answer, evidence} out.

The hard part is acceptance, and it is the only reason this package is more than a struct literal. A caller-free check must still be GROUNDED — anchored to content that appears ONLY in the supplied files — or it becomes exactly the PARROT-PASSABLE / UNGROUNDED pathology delegate.LintAcceptance exists to catch, the cross-seat retry silently never fires, and an echoed question reads back as a verified answer. So the anchor is mined from the files themselves, excluded against the FULL BUILT GOAL (not just the question — the goal's own boilerplate carries long words, and the lint measures against the goal), and when no distinctive anchor survives we REFUSE with a typed error rather than emit a check that would pass garbage. delegate.LintAcceptance returning zero warnings on a realistic file is this package's real acceptance test.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoAnchor means no token distinctive enough to ground an acceptance check was
	// found — every candidate was too short, or already appears in the goal.
	ErrNoAnchor = errors.New("askjob: no grounded anchor found in the supplied files")
	// ErrNoQuestion means the caller sent no question. Typed like the rest so a
	// surface can branch on it rather than string-matching a reason.
	ErrNoQuestion = errors.New("askjob: question is required")
	// ErrNoPaths means there is nothing to ground against. A question with no files is
	// agent_run's shape (it searches for its own files), not this one's.
	ErrNoPaths = errors.New("askjob: at least one path is required")
	// ErrTooManyPaths / ErrContextTooLarge are the wire caps, refused HERE with the
	// numbers and the fix rather than left to Validate's post-hoc message.
	ErrTooManyPaths    = errors.New("askjob: too many paths")
	ErrContextTooLarge = errors.New("askjob: attached files exceed the context cap")
)

Typed refusals. Every one of them is a REFUSAL BY DESIGN: the caller gets a named reason and does the work itself, which is strictly better than a contract that runs and verifies nothing (ErrNoAnchor) or one that dies downstream inside Validate with a message naming neither the file nor the fix (the cap errors).

Functions

func BuildContract

func BuildContract(question string, paths []string, readRoot string) (core.AgentContract, error)

BuildContract assembles a complete, validated, remote-eligible contract from a question and a file list. readRoot confines every read; empty means the process working dir.

The ORDER matters and is the correction to the brief: the goal is built BEFORE the anchor is mined, because the anchor's disqualifier is the goal, not the question.

Types

This section is empty.

Jump to

Keyboard shortcuts

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