context

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ManifestVersion = "1"

Variables

This section is empty.

Functions

func CheckBudget added in v0.3.0

func CheckBudget(manifest Manifest, maxTokens int) error

func EstimateNoLLM added in v0.3.0

func EstimateNoLLM(text string) int

func EstimateText added in v0.3.0

func EstimateText(text string) int

func ManifestBudget added in v0.3.0

func ManifestBudget(manifest Manifest) int

func ModeForTask added in v0.3.0

func ModeForTask(task core.TaskRow) string

func RenderHUD added in v0.3.0

func RenderHUD(m Manifest) string

RenderHUD formats an already-built Manifest as a human-readable operator view: a table of load items with byte size and estimated token cost, a total row, and the spec's mode/tier line. It is a pure projection of the Manifest — no new estimation, no LLM, no I/O (ADR-8). The token total equals the value the --json surface serializes (manifest.EstimatedTokens), so the two renders never diverge numerically (RH.3).

func ValidateManifest added in v0.3.0

func ValidateManifest(raw []byte) error

Types

type Item added in v0.3.0

type Item struct {
	Kind            string `json:"kind"`
	Path            string `json:"path,omitempty"`
	TaskID          string `json:"task_id,omitempty"`
	Mode            string `json:"mode,omitempty"`
	EstimatedTokens int    `json:"estimated_tokens"`
}

type Manifest added in v0.3.0

type Manifest struct {
	Version         string   `json:"version"`
	Mode            string   `json:"mode"`
	Slug            string   `json:"slug"`
	TaskID          string   `json:"task_id"`
	Items           []Item   `json:"items"`
	Notes           []string `json:"notes,omitempty"`
	EstimatedTokens int      `json:"estimated_tokens"`
}

func BuildManifest added in v0.3.0

func BuildManifest(root, slug string, tasks []core.TaskRow, taskID string, maxTokens int) (Manifest, error)

BuildManifest assembles the context references for one task. The steering constitution and memory (R4.3) enter as references + modes, never inlined content, bounded against maxTokens: when over budget, memory drops before steering (constitution wins), deterministically, with a note. maxTokens <= 0 disables budget enforcement.

Jump to

Keyboard shortcuts

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