Documentation
¶
Overview ¶
Package evo is Evident Output: a presentation library for CLI state, progress, evidence, changes, plans, messages, actions, and conclusions.
Application code owns execution. Evo owns presentation.
func main() {
evo.Init(evo.Config{Title: "repo"}) // first statement — arms first paint before any I/O
evo.Main(run)
}
func run() error {
evo.Println("Reading configuration")
evo.Task("working tree").Done()
t := evo.Task("fetch")
cmd.Stdout = t.Writer()
cmd.Stderr = t.Writer()
return nil // Block is a presentation outcome, not a Go error
}
Adoption ladder (guess-driven defaults — the naive spelling is the correct one):
- evo.Init(Config) once in main, before any I/O; evo.Main(run) — dry-run wording, empty-case, and exit codes are all owned; run returns only error.
- Print / Printf / Println / Verbose — start as casually as fmt.
- evo.Task(name) for everything — a check/gate resolved directly (Done/Warn/Block/Fail/Skip, no Doing/Progress call) renders as a fact row; work with Doing/Progress or a mutation verb (Add/Delete/Create/Update/Remove/Write/Push/Record/RecordName) shows a spinner while running — the verb picks [planned] vs [changed] from Config.DryRun; no call site ever flips its own tense. name is a printf format whenever args follow it (evo.Task("build %s", ref)); no args leaves name untouched. Define(fn) or a mutation verb submits work; Done is only for already-resolved work with no callback.
- evo.Group(name).Each(items) / evo.Sequence(name).Each(items) for collection progress. Each item is an atomic Task; Define or a mutation verb submits it. The range waits for submitted work before control proceeds. cmd.Stdout = task.Writer() so a talkative child's last line becomes the live doing-text. A failed item Fails that child Task — not a second Task declared inside the loop body for the same item.
- evo.Task(name).Skipped(evo.Reason("...")) / .Kept(evo.Reason("...")) — taxonomy counted and summed, never a bare "skipped N". evo.Reason(name) is a get-or-create lookup on the default instance: the same string at every call site merges into one bucket, so an inline evo.Reason("protected") is always legal — lifting it to a package var is optional, never required for correctness. Individual names render under Config.Verbosity: VerbosityVerbose (see doc there); at the default VerbosityNormal the human line stays the aggregated "! skipped N (...)" count. The names are never dropped — they always live on TaskSnapshot.Skipped/Kept (Output.Snapshot / TaskHandle.Snapshot); the wire JSON document does not carry them.
- evo.Confirm(question, ...) — owns the whole ask-decide-resolve gate (prompt, quiesce, Done/Blocked resolution, exit code). question is verbatim text, not a printf format like Task/Sequence/Reason/Doing/Skip's text — use fmt.Sprintf to build a dynamic question first. Confirm is the one entity-text spelling that stays non-printf (release-gate round 6 finding 4).
- evo.Sequence(name) for named children with derived, auto-lifecycle state.
- task.Fail(summary) / task.Block(summary) are statements — no return value, so a bare call is errcheck-clean. `return task.Failf("schema mismatch: %w", err)` (task declared as evo.Task("validate manifest")) builds and returns one error in a single line: a trailing ": %w"/", %w" splits the formatted text into the rendered summary and an evidence line for the wrapped error; Blockf is the same for Block. The summary states WHAT went wrong, not the task's own name again — the rendered row already carries the task label, so a summary of "validate manifest: %w" would just repeat it back. Warn, and success/skip verbs, stay void too — this is never fluent chaining. Done/Warn/Task/Sequence/Reason/Doing/Skip are printf-variadic themselves (fmt.Sprintf semantics when args follow); there is no separate Donef/Warnf/Taskf/Reasonf/Doingf/ Skipf (C6). Output.Failf stays void rather than mirroring TaskHandle.Failf's *Failure return (release-gate round 4 finding 5): every call site uses it as a bare statement, a returned error would fail errcheck at each of them with no lint-config exception on this repo, and there is no per-call Next chain for an output-level failure to attach to the way TaskHandle.Failf's *Failure attaches to its task (Output.Next already covers the output-level case). Documented asymmetry, not an oversight.
- Config{Debug: evo.DebugConfig{Level: evo.LevelDebug}} selects the journal threshold for Debug/Capture mirrors and the slog bridge. evo.LogLevel is its own type, distinct from stdlib slog.Level — SlogHandler translates between the two internally, but Config.Debug.Level itself never takes a slog.Level value. LevelUnset (the zero value) resolves to LevelInfo; LevelTrace/LevelDebug are the two levels that surface Debug journal lines. Package-level evo.SlogHandler() journals to the default instance, the same default-instance sugar evo.Task/evo.Verbose already offer.
Ordinary surface: evo.Init/evo.Main, Print*, evo.Task/evo.Group/evo.Sequence, Task.Define / mutation verbs / Task.Writer, Task.Fail / Task.Failf / Task.Block / Task.Blockf, evo.Confirm, evo.Reason, slog via SlogHandler (level from Config.Debug.Level).
Advanced surface, for testing and tooling call sites that need a hosted instance instead of the package-level default: Config.Isolated returns an independent *Output that never touches package state; Output.Run(run func(*Output) error) seals it (the hosted counterpart of Main's run func() error, called on the *Output itself instead of the default instance); Config.Options is the raw-Option escape hatch for exact writer/ terminal/clock wiring. Plan/Changes for the would/did split without a Task, session evidence, terminal drivers, and testkit.
Example (BeginnerAPI) ¶
Example_beginnerAPI proves the beginner shape compiles and renders real rows, not an empty // Output: that only proves compile (evo-dialect-axes- report.md axis 2: "the example discards stdout and asserts nothing"). Sequence (declaration order, one Running child at a time) keeps the two child rows deterministic across runs; Group.Each would be correct too but collapses an all-success aggregate into a single summary line.
package main
import (
"bytes"
"fmt"
"io"
evo "github.com/zachbornheimer/evident-output"
)
func main() {
var buf bytes.Buffer
out := evo.Init(evo.Config{Stdout: &buf, Stderr: io.Discard, Plain: true})
check := func(string) error { return nil }
worktrees := out.Sequence("worktrees")
for _, path := range []string{"repo-a", "repo-b"} {
task := worktrees.Task(path)
task.Define(func() error { return check(path) })
}
if err := out.Finish(); err != nil {
fmt.Println(err)
}
fmt.Print(buf.String())
}
Output: ✓ worktrees ✓ repo-a ✓ repo-b
Index ¶
- Constants
- Variables
- func Confirm(question string, opts ...ConfirmOption) bool
- func Delay(d time.Duration) *time.Duration
- func EncodeEventJSON(e Event) ([]byte, error)
- func EncodeJSON(s Snapshot) ([]byte, error)
- func EncodeJSONL(events []Event) ([]byte, error)
- func Fact(name, value string)
- func IsCharDevice(w io.Writer) bool
- func Main(run func() error)
- func MainWith(out *Output, run func(*Output) error)
- func Pluralize(quantity int64, singular string) string
- func Print(args ...any)
- func Printf(format string, args ...any)
- func Println(args ...any)
- func RenderPlain(s Snapshot, opts PlainOptions) ([]byte, error)
- func Run(run func() error) int
- func SetDefault(out *Output)
- func SlogHandler() slog.Handler
- func TruncateNames(names []string, visible int) string
- func Warn(summary string)
- type Action
- type Attachment
- type ChangesSnapshot
- type ColorMode
- type CommandSpec
- type Conclusion
- type ConclusionJSON
- type ConclusionState
- type Config
- type ConfirmOption
- type DebugConfig
- type DebugPaneOption
- type DebugPresentation
- type EffectRecord
- type EntityOption
- type EntityState
- type Event
- type EventJSON
- type Evidence
- type EvidenceOption
- type EvidenceStream
- type FactRecord
- type Failure
- type Field
- type FixedClock
- type Format
- type GlyphProfile
- type GroupHandle
- func (g *GroupHandle) Each(items []string) iter.Seq2[string, *TaskHandle]
- func (g *GroupHandle) Group(name string) *GroupHandle
- func (g *GroupHandle) Sequence(name string) *SequenceHandle
- func (g *GroupHandle) Snapshot() TasksSnapshot
- func (g *GroupHandle) Summary(text string) *GroupHandle
- func (g *GroupHandle) Task(name string) *TaskHandle
- type JSONAction
- type JSONChanges
- type JSONCollection
- type JSONCommand
- type JSONDocument
- type JSONEffectRecord
- type JSONMessage
- type JSONOutputMeta
- type JSONPlan
- type JSONProblem
- type JSONProgress
- type JSONTask
- type LiveSurface
- type LogLevel
- type LogRecord
- type MessageSnapshot
- type MutationOption
- type NoopRedactor
- type Option
- func AlsoWrite(w io.Writer) Option
- func Clock(ts TimeSource) Option
- func DataProjection() Option
- func DebugAddSource() Option
- func DebugHistory() Option
- func DebugLevel(level LogLevel) Option
- func DebugPane(opts ...DebugPaneOption) Option
- func Diagnostics(w io.Writer) Option
- func DryRun() Option
- func ExternalProjection() Option
- func Glyphs(p GlyphProfile) Option
- func MaxEntities(n int) Option
- func MaxEvents(n int) Option
- func MaxFrameRate(framesPerSecond int) Option
- func NoColor() Option
- func Plain() Option
- func Redact(r Redactor) Option
- func ResultStream(w io.Writer) Option
- func Stdin(r io.Reader) Option
- func Strict() Option
- func Terminal(driver TerminalDriver) Option
- func Title(subject string) Option
- func To(w io.Writer) Option
- func VisibilityDelay(delay time.Duration) Option
- func Width(columns int) Option
- type Output
- func (o *Output) Cancel(reason string)
- func (o *Output) Close() error
- func (o *Output) Conclusion() Conclusion
- func (o *Output) Confirm(question string, opts ...ConfirmOption) bool
- func (o *Output) Context() context.Context
- func (o *Output) Err() error
- func (o *Output) Fact(name, value string)
- func (o *Output) Fail(summary string, options ...ProblemOption)
- func (o *Output) Failf(format string, args ...any)
- func (o *Output) Finish() error
- func (o *Output) Group(name string) *GroupHandle
- func (o *Output) Next(actions ...Action)
- func (o *Output) NextCommand(executable string, args ...string)
- func (o *Output) Print(args ...any)
- func (o *Output) Printf(format string, args ...any)
- func (o *Output) Println(args ...any)
- func (o *Output) ResultWriter() io.Writer
- func (o *Output) Run(run func(*Output) error) int
- func (o *Output) Sequence(name string) *SequenceHandle
- func (o *Output) Snapshot() Snapshot
- func (o *Output) Suspend(fn func() error) error
- func (o *Output) Task(name string) *TaskHandle
- func (o *Output) Warn(summary string)
- func (o *Output) Writer() io.Writer
- type PlainOptions
- type PlanSnapshot
- type Printer
- type Problem
- type ProblemOption
- func Code(value string) ProblemOption
- func Count(value int64, unit ...string) ProblemOption
- func Detail(text string) ProblemOption
- func Location(path string, line, column int) ProblemOption
- func Next(action Action) ProblemOption
- func NextCommand(executable string, args ...string) ProblemOption
- func On(subject string) ProblemOption
- type Progress
- type ProgressKind
- type Projection
- type ReasonOption
- type Redactor
- type SequenceHandle
- func (s *SequenceHandle) Each(items []string) iter.Seq2[string, *TaskHandle]
- func (s *SequenceHandle) Group(name string) *GroupHandle
- func (s *SequenceHandle) Sequence(name string) *SequenceHandle
- func (s *SequenceHandle) Snapshot() TasksSnapshot
- func (s *SequenceHandle) Summary(text string) *SequenceHandle
- func (s *SequenceHandle) Task(name string) *TaskHandle
- type Snapshot
- type SourceLocation
- type SystemClock
- type TaskHandle
- func (t *TaskHandle) Add(object string, fn func() error, opts ...MutationOption)
- func (t *TaskHandle) After(preds ...any) *TaskHandle
- func (t *TaskHandle) Block(summary string, options ...ProblemOption)
- func (t *TaskHandle) Blockf(format string, args ...any) *Failure
- func (t *TaskHandle) Bytes(completed, total int64) *TaskHandle
- func (t *TaskHandle) Cancel(reason string)
- func (t *TaskHandle) Context() context.Context
- func (t *TaskHandle) Create(object string, fn func() error, opts ...MutationOption)
- func (t *TaskHandle) Define(fn func() error)
- func (t *TaskHandle) Delete(object string, fn func() error, opts ...MutationOption)
- func (t *TaskHandle) Doing(text string, args ...any) *TaskHandle
- func (t *TaskHandle) Done(args ...any)
- func (t *TaskHandle) Fact(name, value string)
- func (t *TaskHandle) Fail(summary string, options ...ProblemOption)
- func (t *TaskHandle) Failf(format string, args ...any) *Failure
- func (t *TaskHandle) Kept(reason TaxonomyReason)
- func (t *TaskHandle) Next(actions ...Action) *TaskHandle
- func (t *TaskHandle) NextCommand(executable string, args ...string) *TaskHandle
- func (t *TaskHandle) Progress(completed, total int) *TaskHandle
- func (t *TaskHandle) Push(object string, fn func() error, opts ...MutationOption)
- func (t *TaskHandle) Record(verb string, quantity int, object string)
- func (t *TaskHandle) RecordLabel(label string, quantity int, object string)
- func (t *TaskHandle) RecordName(verb, object string)
- func (t *TaskHandle) Remove(object string, fn func() error, opts ...MutationOption)
- func (t *TaskHandle) Skipped(reason TaxonomyReason)
- func (t *TaskHandle) Snapshot() TaskSnapshot
- func (t *TaskHandle) Step(completed, total int, name string) *TaskHandle
- func (t *TaskHandle) Update(object string, fn func() error, opts ...MutationOption)
- func (t *TaskHandle) Wait() error
- func (t *TaskHandle) Warn(summary string)
- func (t *TaskHandle) Write(object string, fn func() error, opts ...MutationOption)
- func (t *TaskHandle) Writer() io.Writer
- type TaskSnapshot
- type TasksSnapshot
- type TaxonomyReason
- type TaxonomyRecord
- type TerminalDriver
- type TimeSource
- type Verbosity
- type Visibility
Examples ¶
Constants ¶
const ( ExitOK = core.ExitOK ExitBlocked = core.ExitBlocked ExitFailed = core.ExitFailed ExitCancelled = core.ExitCancelled )
Default exit codes from architecture §26.
const ( // GlyphsAuto detects the vocabulary from locale and TTY interactivity. GlyphsAuto = txt.GlyphsAuto // GlyphsUnicode forces the Unicode vocabulary regardless of locale. GlyphsUnicode = txt.GlyphsUnicode // GlyphsASCII forces the ASCII vocabulary regardless of locale. GlyphsASCII = txt.GlyphsASCII )
const ( Pending = core.Pending Running = core.Running Done = core.Done Blocked = core.Blocked Failed = core.Failed Skipped = core.Skipped Cancelled = core.Cancelled Empty = core.Empty Incomplete = core.Incomplete // NotStarted marks a group task that never ran because an earlier sibling // already failed or was cancelled — rendered "- <name> not started" and // excluded from the conclusion (the group's verdict comes from the // failed/cancelled sibling, not from its unstarted followers). NotStarted = core.NotStarted )
EntityState values — see the type doc comment above for the naming rationale (no State* prefix on this block).
const ( StateReady = core.StateReady StateChanged = core.StateChanged StateWarning = core.StateWarning StateBlocked = core.StateBlocked StateFailed = core.StateFailed StateCancelled = core.StateCancelled StatePlanned = core.StatePlanned )
ConclusionState values — the trailing "[state]" band a run can end in.
const ( Indeterminate = core.Indeterminate Determinate = core.Determinate BytesKind = core.BytesKind )
ProgressKind values — which measurement a task's Progress reports.
const ( // VisibilityNormal messages always project at VerbosityNormal (C11: // prefixed consistently with VisibilityVerbose — the two enum members // previously disagreed on their own naming convention). VisibilityNormal = core.VisibilityNormal // VisibilityVerbose messages project only when Config.Verbosity is VerbosityVerbose. VisibilityVerbose = core.VisibilityVerbose )
const ( ColorAuto = engine.ColorAuto ColorAlways = engine.ColorAlways ColorNever = engine.ColorNever )
const ( FormatHuman = engine.FormatHuman FormatData = engine.FormatData FormatExternal = engine.FormatExternal )
const ( VerbosityNormal = engine.VerbosityNormal VerbosityVerbose = engine.VerbosityVerbose )
const ( ProjectionHuman = engine.ProjectionHuman ProjectionPlain = engine.ProjectionPlain ProjectionJSON = engine.ProjectionJSON ProjectionJSONL = engine.ProjectionJSONL ProjectionStreamJSON = engine.ProjectionStreamJSON )
const ( LevelUnset = engine.LevelUnset LevelTrace = engine.LevelTrace LevelDebug = engine.LevelDebug LevelInfo = engine.LevelInfo LevelWarn = engine.LevelWarn LevelError = engine.LevelError )
const ( DebugPresentationHistory = engine.DebugPresentationHistory DebugPresentationPane = engine.DebugPresentationPane )
const ( EvidenceStreamCombined = engine.EvidenceStreamCombined EvidenceStreamStdout = engine.EvidenceStreamStdout EvidenceStreamStderr = engine.EvidenceStreamStderr )
const DefaultVisibleNames = engine.DefaultVisibleNames
const EventSchemaVersion = core.EventSchemaVersion
EventSchemaVersion is the durable event schema version. Tracks the 0.2 contract series (pre-1.0 wire format may still evolve).
const JSONSchemaVersion = render.JSONSchemaVersion
JSONSchemaVersion is the final JSON document schema version. Tracks the 0.3 contract series (pre-1.0 wire format may still evolve). Bumped from 0.2: "items" no longer exists as a separate wire kind — the item/task fold means every entity (including a fact-check resolved without ever running) is a "tasks" row (CHANGELOG "Unreleased").
const PublishedRelease = "v0.5.0"
PublishedRelease is the single source of truth for the current published module and MCP pin used in install guidance.
Maintenance class this protects (v0.2.10 hygiene, generalized):
- skills / integrations / README disagree on which tag to install
- MCP config generator falls back to a stale hardcoded tag
- portable docs recommend @latest or a personal-machine clone path
- signed tags ship with stale README pins (next patch, never rewrite history)
When cutting a release:
- Set PublishedRelease to the new tag (e.g. "v0.2.11").
- Run: go run ./scripts/sync-release-pins
- Run: go test . -run VersionDrift
- Tag that commit; do not move prior tags.
version_drift_test.go enforces the portable surface stays synchronized.
Variables ¶
var ( ErrClosed = engine.ErrClosed ErrAlreadyResolved = engine.ErrAlreadyResolved ErrUnresolvedTask = engine.ErrUnresolvedTask ErrInvalidProgress = engine.ErrInvalidProgress ErrProgressRegression = engine.ErrProgressRegression ErrDuplicateKey = engine.ErrDuplicateKey ErrInvalidConfig = engine.ErrInvalidConfig ErrRenderer = engine.ErrRenderer ErrLimitExceeded = engine.ErrLimitExceeded ErrReasonSkipOnly = engine.ErrReasonSkipOnly ErrReasonWrongTask = engine.ErrReasonWrongTask ErrConcurrentRunning = engine.ErrConcurrentRunning ErrDryRunDeclaredLate = engine.ErrDryRunDeclaredLate ErrTerminalWithoutSink = engine.ErrTerminalWithoutSink ErrNotStarted = engine.ErrNotStarted ErrWaitDeadlock = engine.ErrWaitDeadlock )
Functions ¶
func Confirm ¶ added in v0.3.0
func Confirm(question string, opts ...ConfirmOption) bool
Confirm asks question on the default instance and returns whether the user accepted.
func EncodeEventJSON ¶ added in v0.5.0
EncodeEventJSON encodes one journal event as a single JSON object (no newline).
func EncodeJSON ¶
EncodeJSON encodes a snapshot as final JSON (§25.1 / §25.4).
func EncodeJSONL ¶
EncodeJSONL encodes durable events as JSON Lines (§25.2 / §25.4).
func IsCharDevice ¶
func MainWith ¶ added in v0.4.0
MainWith executes run against out and os.Exit's with the conclusion code.
Superseded by Main (default instance) and Output.Run (hosted instance).
func Print ¶ added in v0.3.0
func Print(args ...any)
Print formats like fmt.Sprint and enqueues human-facing text on the default instance.
func Printf ¶ added in v0.3.0
Printf formats like fmt.Sprintf and enqueues human-facing text on the default instance.
func Println ¶ added in v0.3.0
func Println(args ...any)
Println formats like fmt.Sprintln and enqueues a complete line on the default instance.
func RenderPlain ¶
func RenderPlain(s Snapshot, opts PlainOptions) ([]byte, error)
func Run ¶ added in v0.4.0
Run executes run, finishes the default Output, and returns the conclusion exit code.
func SetDefault ¶ added in v0.3.0
func SetDefault(out *Output)
SetDefault installs out as the package-level default Output.
func SlogHandler ¶ added in v0.3.0
SlogHandler returns a slog.Handler journaling to the default instance.
func TruncateNames ¶ added in v0.2.16
Types ¶
type Action ¶
Action is a recommended next step for the user.
Aliased into internal/core alongside the rest of the data model — see Snapshot's doc comment (snapshot.go) for why.
type Attachment ¶ added in v0.3.0
type Attachment = core.Attachment
Attachment is an additional label/value problem attachment.
Named Attachment (not Evidence) because Evidence names the retained process-output sink (see Evidence in capture.go) — this is a single labeled fact attached to a Problem, a different concept from that sink.
type ChangesSnapshot ¶
type ChangesSnapshot = core.ChangesSnapshot
ChangesSnapshot is an immutable changes section.
type CommandSpec ¶
type CommandSpec = core.CommandSpec
CommandSpec is an executable plus argv (never a shell string).
type Conclusion ¶
type Conclusion = core.Conclusion
Conclusion is the multidimensional meaning of a finished command.
Aliased into internal/core alongside the rest of the data model — see Snapshot's doc comment (snapshot.go) for why, and EVIDENT_OUTPUT_ARCHITECTURE_SPEC_v0.5.md §38 for the full layout.
type ConclusionJSON ¶
type ConclusionJSON = render.ConclusionJSON
ConclusionJSON is JSON-friendly conclusion.
type ConclusionState ¶
type ConclusionState = core.ConclusionState
ConclusionState is the human headline for a finished output.
type Config ¶
func DefaultConfig ¶ added in v0.2.0
func DefaultConfig() Config
type ConfirmOption ¶ added in v0.3.0
type ConfirmOption = engine.ConfirmOption
func AssumeYes ¶ added in v0.3.0
func AssumeYes(v bool) ConfirmOption
func ConfirmDetail ¶ added in v0.3.0
func ConfirmDetail(lines ...string) ConfirmOption
func Destructive ¶ added in v0.3.0
func Destructive() ConfirmOption
func PolicyFlag ¶ added in v0.3.0
func PolicyFlag(flag string) ConfirmOption
func PolicyHint ¶ added in v0.3.0
func PolicyHint(command string, args ...string) ConfirmOption
type DebugConfig ¶ added in v0.2.0
type DebugConfig = engine.DebugConfig
type DebugPaneOption ¶
type DebugPaneOption = engine.DebugPaneOption
func NewestFirst ¶
func NewestFirst() DebugPaneOption
func OldestFirst ¶
func OldestFirst() DebugPaneOption
func PaneHeight ¶
func PaneHeight(lines int) DebugPaneOption
func PreserveDebugTail ¶
func PreserveDebugTail() DebugPaneOption
type DebugPresentation ¶
type DebugPresentation = engine.DebugPresentation
type EffectRecord ¶
type EffectRecord = core.EffectRecord
EffectRecord is one semantic change or plan row.
type EntityOption ¶ added in v0.2.3
type EntityOption = engine.EntityOption
func ID ¶ added in v0.2.3
func ID(id string) EntityOption
ID sets a stable machine key. Superseded: Task is name-only.
func StartPhase ¶ added in v0.3.0
func StartPhase(text string) EntityOption
StartPhase sets a task's first doing-text at declare time. Superseded: call Doing.
type EntityState ¶
type EntityState = core.EntityState
EntityState is the lifecycle state of an item or task.
C11 naming sweep: these members stay bare (Done, Failed, Blocked, ...) rather than gaining a State* prefix to match ConclusionState below — prefixing would collide outright with ConclusionState's own StateFailed/ StateBlocked/StateCancelled/StateWarning constants (same package, same identifiers, different types is still a duplicate declaration in Go). Renaming ConclusionState's constants instead would ripple into the JSON wire (schema 0.3, frozen this release) and every existing golden — this is the "document instead" branch the census decision allows.
Aliased into internal/core alongside the rest of the data model — see Snapshot's doc comment (snapshot.go) for why.
type Event ¶
Event is an immutable journal record.
Aliased into internal/core alongside the rest of the data model — see Snapshot's doc comment (snapshot.go) for why.
type EvidenceOption ¶ added in v0.3.0
type EvidenceOption = engine.EvidenceOption
func KeepLastLines ¶ added in v0.1.2
func KeepLastLines(n int) EvidenceOption
func MaxEvidenceBytes ¶ added in v0.3.0
func MaxEvidenceBytes(n int) EvidenceOption
func MirrorToDebug ¶ added in v0.2.2
func MirrorToDebug() EvidenceOption
func MirrorToDiagnostics ¶ added in v0.2.2
func MirrorToDiagnostics() EvidenceOption
type EvidenceStream ¶ added in v0.3.0
type EvidenceStream = engine.EvidenceStream
type FactRecord ¶ added in v0.4.0
FactRecord is a discovered name/value annotation — information, not work (user-13-problems.md Problem 8). Named FactRecord, not Fact, because Fact is the evo.Fact/TaskHandle.Fact verb (EffectRecord sets the naming precedent: the verb keeps the plain name, its stored shape gets Record). See TaskHandle.Fact and Output.Fact.
Aliased into internal/core alongside the rest of the data model — see Snapshot's doc comment (snapshot.go) for why.
type Failure ¶ added in v0.3.0
type Failure struct {
// contains filtered or unexported fields
}
func (*Failure) NextCommand ¶ added in v0.3.0
type FixedClock ¶
type FixedClock = engine.FixedClock
type GlyphProfile ¶ added in v0.3.0
type GlyphProfile = txt.GlyphProfile
GlyphProfile selects which glyph vocabulary state markers render in (evo-rec.md "Tightened glyph vocabulary", rule GLYPH-001: glyph selection via capability profile, cell-width measurement not rune counts).
The zero value, GlyphsAuto, keeps today's Unicode vocabulary off a TTY (a non-interactive stream can't show a human mojibake, so there is nothing to guard against) and on any TTY whose locale already advertises UTF-8. It downgrades to the ASCII vocabulary only on an interactive terminal without UTF-8 locale support — the one case where the status column would otherwise render as mojibake.
Aliased into internal/text (glyph tables and the rendering primitives that select from them live there — see EVIDENT_OUTPUT_ARCHITECTURE_SPEC_v0.5.md §38).
type GroupHandle ¶ added in v0.3.0
type GroupHandle struct {
// contains filtered or unexported fields
}
func Group ¶ added in v0.3.0
func Group(name string) *GroupHandle
func (*GroupHandle) Each ¶ added in v0.5.0
func (g *GroupHandle) Each(items []string) iter.Seq2[string, *TaskHandle]
func (*GroupHandle) Group ¶ added in v0.5.0
func (g *GroupHandle) Group(name string) *GroupHandle
func (*GroupHandle) Sequence ¶ added in v0.5.0
func (g *GroupHandle) Sequence(name string) *SequenceHandle
func (*GroupHandle) Snapshot ¶ added in v0.3.0
func (g *GroupHandle) Snapshot() TasksSnapshot
func (*GroupHandle) Summary ¶ added in v0.3.0
func (g *GroupHandle) Summary(text string) *GroupHandle
func (*GroupHandle) Task ¶ added in v0.3.0
func (g *GroupHandle) Task(name string) *TaskHandle
type JSONCollection ¶
type JSONCollection = render.JSONCollection
JSONCollection is a wire-format task collection with child IDs (§25.1).
type JSONDocument ¶
type JSONDocument = render.JSONDocument
JSONDocument is the final machine projection (§25.1).
Aliased into internal/render alongside the JSON encoding machinery that produces it — see EVIDENT_OUTPUT_ARCHITECTURE_SPEC_v0.5.md §38.
type JSONEffectRecord ¶
type JSONEffectRecord = render.JSONEffectRecord
JSONEffectRecord is a change/plan row.
type JSONMessage ¶ added in v0.2.0
type JSONMessage = render.JSONMessage
JSONMessage is a wire-format user-facing message.
type JSONOutputMeta ¶
type JSONOutputMeta = render.JSONOutputMeta
JSONOutputMeta identifies the output instance.
type JSONProblem ¶
type JSONProblem = render.JSONProblem
JSONProblem is a wire-format problem (no raw Cause by default).
type LiveSurface ¶
type LiveSurface = engine.LiveSurface
type MessageSnapshot ¶ added in v0.2.0
type MessageSnapshot = core.MessageSnapshot
MessageSnapshot is one logical user-facing message in the canonical model.
type MutationOption ¶ added in v0.5.0
type MutationOption = engine.MutationOption
func Affected ¶ added in v0.4.0
func Affected(n int) MutationOption
type NoopRedactor ¶
type NoopRedactor = engine.NoopRedactor
type Option ¶
func Clock ¶
func Clock(ts TimeSource) Option
func DataProjection ¶
func DataProjection() Option
func DebugAddSource ¶ added in v0.3.0
func DebugAddSource() Option
func DebugHistory ¶
func DebugHistory() Option
func DebugLevel ¶
func DebugPane ¶
func DebugPane(opts ...DebugPaneOption) Option
func Diagnostics ¶
func ExternalProjection ¶
func ExternalProjection() Option
func Glyphs ¶ added in v0.3.0
func Glyphs(p GlyphProfile) Option
Glyphs selects the glyph capability profile (default GlyphsAuto).
func MaxEntities ¶
func MaxFrameRate ¶
func ResultStream ¶ added in v0.2.3
func Terminal ¶
func Terminal(driver TerminalDriver) Option
func VisibilityDelay ¶
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output, TaskHandle, and the other presentation handles are wrappers, not aliases: engine test helpers must not appear in go doc or the rec surface.
func Default ¶ added in v0.3.0
func Default() *Output
Default returns the package-level default Output, lazily creating one with a zero Config the first time it's needed.
func Init ¶ added in v0.3.0
Init is the sole Output constructor. It builds an Output from cfg, installs it as the package-level default, and arms first paint — call once, in main, before any I/O.
func (*Output) Conclusion ¶
func (o *Output) Conclusion() Conclusion
func (*Output) Confirm ¶ added in v0.3.0
func (o *Output) Confirm(question string, opts ...ConfirmOption) bool
func (*Output) Fail ¶
func (o *Output) Fail(summary string, options ...ProblemOption)
func (*Output) Group ¶ added in v0.3.0
func (o *Output) Group(name string) *GroupHandle
func (*Output) NextCommand ¶
func (*Output) ResultWriter ¶ added in v0.2.3
func (*Output) Sequence ¶ added in v0.4.0
func (o *Output) Sequence(name string) *SequenceHandle
func (*Output) Task ¶
func (o *Output) Task(name string) *TaskHandle
type PlainOptions ¶
type PlainOptions = engine.PlainOptions
type PlanSnapshot ¶
type PlanSnapshot = core.PlanSnapshot
PlanSnapshot is an immutable plan section.
type Printer ¶ added in v0.2.0
type Printer struct {
// contains filtered or unexported fields
}
type Problem ¶
Problem is structured evidence explaining a negative item or task outcome.
Aliased into internal/core alongside the rest of the data model — see Snapshot's doc comment (snapshot.go) for why.
type ProblemOption ¶
type ProblemOption = engine.ProblemOption
ProblemOption configures a problem constructed by Block/Warn/Fail helpers.
func Count ¶
func Count(value int64, unit ...string) ProblemOption
Count sets a quantity and optional unit.
func Detail ¶
func Detail(text string) ProblemOption
Detail sets user-visible detail text (strings only).
func Location ¶
func Location(path string, line, column int) ProblemOption
Location sets a source location on a Problem (renamed from At — C5: a free-function At collided in name, though not in call syntax, with Output.At(visibility), confusing autocomplete and readers alike).
func NextCommand ¶
func NextCommand(executable string, args ...string) ProblemOption
NextCommand attaches a recommended command action.
type Projection ¶ added in v0.5.0
type Projection = engine.Projection
type ReasonOption ¶ added in v0.3.0
type ReasonOption = engine.ReasonOption
func ForSkip ¶ added in v0.3.0
func ForSkip() ReasonOption
func OnTask ¶ added in v0.3.0
func OnTask(taskName string) ReasonOption
type SequenceHandle ¶ added in v0.4.0
type SequenceHandle struct {
// contains filtered or unexported fields
}
func Sequence ¶ added in v0.4.0
func Sequence(name string) *SequenceHandle
Sequence declares (or, for a repeated name, returns) a self-managing, ordered task container on the default instance.
func (*SequenceHandle) Each ¶ added in v0.5.0
func (s *SequenceHandle) Each(items []string) iter.Seq2[string, *TaskHandle]
func (*SequenceHandle) Group ¶ added in v0.5.0
func (s *SequenceHandle) Group(name string) *GroupHandle
func (*SequenceHandle) Sequence ¶ added in v0.4.0
func (s *SequenceHandle) Sequence(name string) *SequenceHandle
func (*SequenceHandle) Snapshot ¶ added in v0.4.0
func (s *SequenceHandle) Snapshot() TasksSnapshot
func (*SequenceHandle) Summary ¶ added in v0.4.0
func (s *SequenceHandle) Summary(text string) *SequenceHandle
func (*SequenceHandle) Task ¶ added in v0.4.0
func (s *SequenceHandle) Task(name string) *TaskHandle
type Snapshot ¶
Snapshot is an immutable complete presentation state at a version.
Declared as a type alias into internal/core (the repo's data-model package — see EVIDENT_OUTPUT_ARCHITECTURE_SPEC_v0.5.md §38): rendering and evidence-capture machinery import core, never this root package, so the data model has to live where they can reach it without an import cycle back through the behavioral facades (Output, TaskHandle, evidence) that stay declared here. pkg.go.dev cannot expand an aliased type's fields (internal/core is never rendered) — see docs/reference.md for the full field-level reference this doc comment summarizes.
type SourceLocation ¶ added in v0.3.0
type SourceLocation = core.SourceLocation
SourceLocation is a path-based source position. Named SourceLocation (not Location) so the Location(...) ProblemOption constructor below can keep that name without colliding with its own return type.
type SystemClock ¶
type SystemClock = engine.SystemClock
type TaskHandle ¶ added in v0.3.0
type TaskHandle struct {
// contains filtered or unexported fields
}
func Task ¶
func Task(name string) *TaskHandle
Task declares (or, for a repeated name, returns) a Task on the default instance.
func (*TaskHandle) Add ¶ added in v0.3.0
func (t *TaskHandle) Add(object string, fn func() error, opts ...MutationOption)
func (*TaskHandle) After ¶ added in v0.5.0
func (t *TaskHandle) After(preds ...any) *TaskHandle
func (*TaskHandle) Block ¶ added in v0.3.0
func (t *TaskHandle) Block(summary string, options ...ProblemOption)
func (*TaskHandle) Blockf ¶ added in v0.3.0
func (t *TaskHandle) Blockf(format string, args ...any) *Failure
func (*TaskHandle) Bytes ¶ added in v0.3.0
func (t *TaskHandle) Bytes(completed, total int64) *TaskHandle
func (*TaskHandle) Cancel ¶ added in v0.3.0
func (t *TaskHandle) Cancel(reason string)
func (*TaskHandle) Context ¶ added in v0.5.0
func (t *TaskHandle) Context() context.Context
func (*TaskHandle) Create ¶ added in v0.3.0
func (t *TaskHandle) Create(object string, fn func() error, opts ...MutationOption)
func (*TaskHandle) Define ¶ added in v0.5.0
func (t *TaskHandle) Define(fn func() error)
func (*TaskHandle) Delete ¶ added in v0.3.0
func (t *TaskHandle) Delete(object string, fn func() error, opts ...MutationOption)
func (*TaskHandle) Doing ¶ added in v0.4.0
func (t *TaskHandle) Doing(text string, args ...any) *TaskHandle
func (*TaskHandle) Done ¶ added in v0.3.0
func (t *TaskHandle) Done(args ...any)
func (*TaskHandle) Fact ¶ added in v0.4.0
func (t *TaskHandle) Fact(name, value string)
func (*TaskHandle) Fail ¶ added in v0.3.0
func (t *TaskHandle) Fail(summary string, options ...ProblemOption)
func (*TaskHandle) Failf ¶ added in v0.3.0
func (t *TaskHandle) Failf(format string, args ...any) *Failure
func (*TaskHandle) Kept ¶ added in v0.3.0
func (t *TaskHandle) Kept(reason TaxonomyReason)
func (*TaskHandle) Next ¶ added in v0.3.0
func (t *TaskHandle) Next(actions ...Action) *TaskHandle
func (*TaskHandle) NextCommand ¶ added in v0.3.0
func (t *TaskHandle) NextCommand(executable string, args ...string) *TaskHandle
func (*TaskHandle) Progress ¶ added in v0.3.0
func (t *TaskHandle) Progress(completed, total int) *TaskHandle
func (*TaskHandle) Push ¶ added in v0.3.0
func (t *TaskHandle) Push(object string, fn func() error, opts ...MutationOption)
func (*TaskHandle) Record ¶ added in v0.3.0
func (t *TaskHandle) Record(verb string, quantity int, object string)
func (*TaskHandle) RecordLabel ¶ added in v0.3.0
func (t *TaskHandle) RecordLabel(label string, quantity int, object string)
func (*TaskHandle) RecordName ¶ added in v0.3.0
func (t *TaskHandle) RecordName(verb, object string)
func (*TaskHandle) Remove ¶ added in v0.3.0
func (t *TaskHandle) Remove(object string, fn func() error, opts ...MutationOption)
func (*TaskHandle) Skipped ¶ added in v0.3.0
func (t *TaskHandle) Skipped(reason TaxonomyReason)
func (*TaskHandle) Snapshot ¶ added in v0.3.0
func (t *TaskHandle) Snapshot() TaskSnapshot
func (*TaskHandle) Step ¶ added in v0.3.0
func (t *TaskHandle) Step(completed, total int, name string) *TaskHandle
func (*TaskHandle) Update ¶ added in v0.3.0
func (t *TaskHandle) Update(object string, fn func() error, opts ...MutationOption)
func (*TaskHandle) Wait ¶ added in v0.5.0
func (t *TaskHandle) Wait() error
func (*TaskHandle) Warn ¶ added in v0.3.0
func (t *TaskHandle) Warn(summary string)
func (*TaskHandle) Write ¶ added in v0.3.0
func (t *TaskHandle) Write(object string, fn func() error, opts ...MutationOption)
func (*TaskHandle) Writer ¶ added in v0.4.0
func (t *TaskHandle) Writer() io.Writer
type TasksSnapshot ¶
type TasksSnapshot = core.TasksSnapshot
TasksSnapshot is an immutable collection view.
type TaxonomyReason ¶ added in v0.3.0
type TaxonomyReason struct {
// contains filtered or unexported fields
}
func Reason ¶ added in v0.3.0
func Reason(name string) TaxonomyReason
Reason returns a get-or-create taxonomy Reason by name on the default instance.
func (TaxonomyReason) Name ¶ added in v0.3.0
func (r TaxonomyReason) Name() string
type TaxonomyRecord ¶ added in v0.3.0
type TaxonomyRecord = core.TaxonomyRecord
TaxonomyRecord is one accumulated (reason, name) disposition entry — recorded by TaskHandle.Skipped or TaskHandle.Kept, never assembled by hand.
type TerminalDriver ¶
type TerminalDriver = engine.TerminalDriver
type TimeSource ¶
type TimeSource = engine.TimeSource
type Visibility ¶ added in v0.2.0
type Visibility = core.Visibility
Visibility selects whether a message is ordinary or verbose user detail. Zero is VisibilityNormal.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
evident-output
command
Command evident-output provides review/preview/explain CLI parity with MCP tools.
|
Command evident-output provides review/preview/explain CLI parity with MCP tools. |
|
evident-output-mcp
command
Command evident-output-mcp is the stdio MCP server.
|
Command evident-output-mcp is the stdio MCP server. |
|
examples
|
|
|
data-command
command
Command data-command: domain JSON on stdout, human presentation on stderr.
|
Command data-command: domain JSON on stdout, human presentation on stderr. |
|
debug-history
command
Command debug-history demos a short sequential probe.
|
Command debug-history demos a short sequential probe. |
|
debug-pane
command
Command debug-pane demos a sequential audit with an optional blocker.
|
Command debug-pane demos a sequential audit with an optional blocker. |
|
doctor
command
Command doctor is an environment/health check CLI.
|
Command doctor is an environment/health check CLI. |
|
install-pipeline
command
Command install-pipeline demos Tasks, Progress, Capture, and Main.
|
Command install-pipeline demos Tasks, Progress, Capture, and Main. |
|
internal/demo
Package demo is reserved for advanced example utilities.
|
Package demo is reserved for advanced example utilities. |
|
live-progress
command
Command live-progress is the ordinary multi-progress demo (user API only).
|
Command live-progress is the ordinary multi-progress demo (user API only). |
|
migrate
command
Command migrate demonstrates the mutation-verb effect boundary (Add/Create/Write, ...): the same call site records a planned effect under --dry-run (evo.DryRun) or a committed one when it actually runs, and evo derives Changed/Ready/Planned from what happened — the caller never chooses which ledger a mutation lands in.
|
Command migrate demonstrates the mutation-verb effect boundary (Add/Create/Write, ...): the same call site records a planned effect under --dry-run (evo.DryRun) or a committed one when it actually runs, and evo derives Changed/Ready/Planned from what happened — the caller never chooses which ledger a mutation lands in. |
|
print
command
Command print is the first adoption rung: Print/Printf/Println like fmt.
|
Command print is the first adoption rung: Print/Printf/Println like fmt. |
|
repo-status
command
Command repo-status is a realistic "is this repo safe to retire?" check.
|
Command repo-status is a realistic "is this repo safe to retire?" check. |
|
scope-plugin
command
Command scope-plugin demos named Tasks for host and plugin work.
|
Command scope-plugin demos named Tasks for host and plugin work. |
|
terminal-driver
command
Command terminal-driver is an advanced teaching surface: custom TerminalDriver, frame-by-frame logging, and explicit renderer knobs.
|
Command terminal-driver is an advanced teaching surface: custom TerminalDriver, frame-by-frame logging, and explicit renderer knobs. |
|
verbose
command
Command verbose shows Normal vs Verbose message visibility.
|
Command verbose shows Normal vs Verbose message visibility. |
|
internal
|
|
|
agent/adopt
Package adopt inventories non-evo CLI output in an existing codebase and proposes a migration plan keyed to the adoption ladder (Init/Main → Task/Done → effects → facts/warnings → confirm/dry-run).
|
Package adopt inventories non-evo CLI output in an existing codebase and proposes a migration plan keyed to the adoption ladder (Init/Main → Task/Done → effects → facts/warnings → confirm/dry-run). |
|
agent/catalog
Package catalog is the task-oriented guidance catalog for agent assistance.
|
Package catalog is the task-oriented guidance catalog for agent assistance. |
|
agent/harness
Package harness evaluates agent-assistance scenarios (§30.9, MCP-022/049).
|
Package harness evaluates agent-assistance scenarios (§30.9, MCP-022/049). |
|
agent/preview
Package preview generates multi-profile plain previews from snapshots.
|
Package preview generates multi-profile plain previews from snapshots. |
|
agent/review
Package review provides deterministic static review of Evident Output usage.
|
Package review provides deterministic static review of Evident Output usage. |
|
agent/rules
Package rules is the stable review-rule registry (Appendix C namespaces).
|
Package rules is the stable review-rule registry (Appendix C namespaces). |
|
agent/sections
Package sections is the full-docs counterpart to catalog: catalog holds hand-curated, token-budgeted guidance snippets; sections serves the whole authoritative doc corpus (reference, development, MCP wiring, the adoption ladder, and the per-concept guides catalog already owns) through one list/get pair, mirroring the Svelte MCP's list-sections / get-documentation shape.
|
Package sections is the full-docs counterpart to catalog: catalog holds hand-curated, token-budgeted guidance snippets; sections serves the whole authoritative doc corpus (reference, development, MCP wiring, the adoption ladder, and the per-concept guides catalog already owns) through one list/get pair, mirroring the Svelte MCP's list-sections / get-documentation shape. |
|
core
Package core owns evident-output's data model: the immutable, fields-only value types a finished or in-flight run presents (Snapshot, Problem, Conclusion, and peers) plus the pure functions that derive one from another (InferConclusion, SanitizeProblem, ...).
|
Package core owns evident-output's data model: the immutable, fields-only value types a finished or in-flight run presents (Snapshot, Problem, Conclusion, and peers) plus the pure functions that derive one from another (InferConclusion, SanitizeProblem, ...). |
|
modpin
Package modpin parses a go.mod for the evident-output require pin and replace directive so MCP update and the usage-audit share one parser.
|
Package modpin parses a go.mod for the evident-output require pin and replace directive so MCP update and the usage-audit share one parser. |
|
render
Package render is evident-output's presentation machinery: plain, structured (JSON/JSONL), and interactive (live) projection of a internal/core Snapshot.
|
Package render is evident-output's presentation machinery: plain, structured (JSON/JSONL), and interactive (live) projection of a internal/core Snapshot. |
|
text
Package text is repo-owned CLI text machinery: sanitization, terminal cell width measurement, truncation, glyph-safe pluralization/conjugation.
|
Package text is repo-owned CLI text machinery: sanitization, terminal cell width measurement, truncation, glyph-safe pluralization/conjugation. |
|
wireschema
Package wireschema validates a rendered JSON document against evo's own published JSON Schema (schema/output.v1.json) — the facade that makes the schema file an enforced gate instead of prose nobody checks (P8: "today nothing references that file — make it a gate").
|
Package wireschema validates a rendered JSON document against evo's own published JSON Schema (schema/output.v1.json) — the facade that makes the schema file an enforced gate instead of prose nobody checks (P8: "today nothing references that file — make it a gate"). |
|
Package terminal provides production terminal drivers for Evident Output.
|
Package terminal provides production terminal drivers for Evident Output. |
|
Package testkit provides deterministic clocks, screens, and assertions for evo tests.
|
Package testkit provides deterministic clocks, screens, and assertions for evo tests. |
|
tools
|
|
|
gensections
command
Command gensections copies the docs the MCP server's list_sections / get_documentation tools serve into internal/agent/sections/embedded, the only directory go:embed can reach from that package.
|
Command gensections copies the docs the MCP server's list_sections / get_documentation tools serve into internal/agent/sections/embedded, the only directory go:embed can reach from that package. |
|
scripts/evo-usage-audit
command
Command evo-usage-audit scans a Go repository for uses of github.com/zachbornheimer/evident-output (and its subpackages) and prints a markdown usage inventory: one heading per file that uses evo, one fenced code block per top-level declaration that uses it, tagged with how.
|
Command evo-usage-audit scans a Go repository for uses of github.com/zachbornheimer/evident-output (and its subpackages) and prints a markdown usage inventory: one heading per file that uses evo, one fenced code block per top-level declaration that uses it, tagged with how. |
|
scripts/sync-release-pins
command
Command sync-release-pins rewrites install pins on portable surfaces to match evo.PublishedRelease.
|
Command sync-release-pins rewrites install pins on portable surfaces to match evo.PublishedRelease. |
|
scripts/traceability-check
command
Command traceability-check verifies every expected §31 ID is present, and that every .go file TRACEABILITY.md's Test(s) column names still exists (a moved or renamed test file that nobody updated the table for used to pass silently — IDs-present-only checking let the table rot green).
|
Command traceability-check verifies every expected §31 ID is present, and that every .go file TRACEABILITY.md's Test(s) column names still exists (a moved or renamed test file that nobody updated the table for used to pass silently — IDs-present-only checking let the table rot green). |