Help us shape the future of Go! Take the 2026 Go Developer Survey

evidence

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package evidence is the append-only audit log for the self-optimization loop (SPEC-ADDITIONS §18.6). It copies skillsaw/store's idiom — append-only, validate-on-write, a malformed line is a hard error (corruption is surfaced, never swallowed) — but records JSON lines with adh columns binding a gate decision to its arc, stage, and scores. Read and Append are pure over io; the file open/append lives in the command shell.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(w io.Writer, records ...Record) error

Append writes records as JSON lines to w. A record with an unknown status is rejected before anything is written for it (validate on write).

Types

type Record

type Record struct {
	Timestamp  string  `json:"timestamp"`
	Arc        string  `json:"arc,omitempty"`
	Stage      string  `json:"stage,omitempty"`
	GateAction string  `json:"gate_action,omitempty"`
	OldScore   float64 `json:"old_score"`
	NewScore   float64 `json:"new_score"`
	Status     Status  `json:"status"`
	Note       string  `json:"note,omitempty"`
}

Record is one evidence line: a gate decision bound to its arc, stage, and the scores that produced it.

func Read

func Read(rd io.Reader) ([]Record, error)

Read parses records from a JSONL reader. Blank lines are skipped; a malformed line is a hard error (EINVALID) rather than a silent skip, so a corrupt log is surfaced, never swallowed.

type Status

type Status string

Status is a record outcome.

const (
	StatusBaseline Status = "baseline"
	StatusKeep     Status = "keep"
	StatusRevert   Status = "revert"
	StatusError    Status = "error"
)

Status values are the per-cycle outcomes recorded in the log.

Jump to

Keyboard shortcuts

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