codes

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package codes defines the typed descriptor for kernel error/finding codes that carry their structural class intrinsically (D-0011). A legality-pertinent code declares itself as a Code value with ClassLegality; the class is a property of the code value, so the closed legality set is enumerable from the declarations themselves — no parallel allowlist or central registry can drift from it.

The package is a leaf: it imports nothing from the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class int

Class names the structural category a kernel code belongs to. It distinguishes verb-time legality refusals (named by illegal spec cells) from integrity findings that report tree/state inconsistency.

const (
	// ClassStructural marks integrity findings: frontmatter shape, id
	// collision, ref resolution, provenance, contract verification. The
	// zero value, so a bare code defaults to structural.
	ClassStructural Class = iota
	// ClassLegality marks verb-time FSM / precondition refusals named by
	// illegal spec cells (e.g. an FSM transition the kind forbids).
	ClassLegality
	// ClassBranchChoreography marks findings that police ADR-0010's
	// branch model: commits must ride the branch their active scope
	// names (the scope's aiwf-branch: trailer). The class exists as
	// a distinct kernel-layer carve-out per ADR-0011 (layer-4 branch
	// choreography) so consumers can enumerate the branch-policing
	// findings independently of structural integrity or legality.
	// M-0106 introduces the first member (isolation-escape).
	ClassBranchChoreography
)

type Code

type Code struct {
	// ID is the stable, machine-readable code string.
	ID string
	// Class is the code's structural category.
	Class Class
}

Code is a typed kernel-code descriptor: a stable string ID paired with the structural Class it belongs to. The ID is what message and JSON consumers see (unchanged from the bare-string era); the Class is the marker the legality enumeration derives from.

Jump to

Keyboard shortcuts

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