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

lesson

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: 4 Imported by: 0

Documentation

Overview

Package lesson turns recurring corrections into promotions to a durable owner (SPEC-ADDITIONS §11): it distills failures into governing classes and routes each to its smallest owner. Promoting to an executable owner is human-gated.

Index

Constants

View Source
const MinStrata = 2

MinStrata is how many distinct time strata (year-month) a failure class must recur across before it may be promoted (§11 temporal gate): promotion accretes a durable control, so it requires a pattern sustained across time, not a single-stratum burst — the same independence axis the routing-miss gate applies (§10.3).

Variables

This section is empty.

Functions

func Slug

func Slug(class string) string

Slug turns a class into a filename-safe kebab id (lowercase alphanumerics joined by single dashes).

Types

type Lesson

type Lesson struct {
	Class     string
	Instances []string
}

Lesson is a governing failure class and the instances that motivated it.

func Distill

func Distill(failures []string) []Lesson

Distill groups failure notes by their governing class — the text before the first ':' — so a class that recurs becomes one candidate lesson. The result is sorted by class for stable output.

func (Lesson) Render

func (l Lesson) Render(o Owner) string

Render produces the durable content for promoting the lesson to owner o (pure; the caller writes it). A decision is an ADR skeleton (§12) — the recurring class is the forcing context, the decision and its Easier/Harder trade-offs are left for a human to complete; any other materializing owner is avoid-this-class guidance carrying the recorded instances as evidence.

type Owner

type Owner string

Owner is the durable place a lesson lands.

const (
	OwnerContext   Owner = "context"
	OwnerSkill     Owner = "skill"
	OwnerDoc       Owner = "doc"
	OwnerDecision  Owner = "decision"
	OwnerCheck     Owner = "check"
	OwnerInvariant Owner = "invariant"
	OwnerType      Owner = "type"
)

Owner values, from reversible (context) to executable (check/invariant/type).

func (Owner) Kind

func (o Owner) Kind() string

Kind is the §10 context-unit kind a materialized owner writes.

func (Owner) Materializes

func (o Owner) Materializes() bool

Materializes reports whether promoting to o produces a routable §10 context unit the harness writes directly — the reversible content owners. A skill and the executable owners (check/invariant/type) need separate authoring, so they gate but are not auto-written.

func (Owner) RequiresApproval

func (o Owner) RequiresApproval() bool

RequiresApproval reports whether promoting to o changes an executable control (check, invariant, or type) and therefore needs human approval (§11.2).

func (Owner) Valid

func (o Owner) Valid() bool

Valid reports whether o is a known durable owner.

Jump to

Keyboard shortcuts

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