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

harnesscheck

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 harnesscheck is the pure harness-integrity self-check (SPEC-ADDITIONS §10.4): given the loaded context store, tool registry, loop registry, and NFR specs, it reports whether the harness is intact and internally consistent — every registry is structurally valid, unit ids are unique, and the cross- references between the pieces resolve (a routed unit's integrity check names a declared §13 tool). It performs no I/O; the command loads the inputs and calls Check, so "is the whole harness consistent?" answers deterministically.

Index

Constants

View Source
const (
	KindToolRegistry      = "tool_registry"      // the §13 registry is structurally invalid
	KindLoopRegistry      = "loop_registry"      // the §15 registry is structurally invalid
	KindUnitFields        = "unit_fields"        // a context unit is missing its id or kind
	KindDuplicateUnit     = "duplicate_unit"     // two units answer to the same id
	KindNFRSpec           = "nfr_spec"           // an NFR spec is not well-formed Planguage
	KindDanglingIntegrity = "dangling_integrity" // a unit's integrity check names no declared tool
	KindDanglingSupersede = "dangling_supersede" // a unit's superseded_by names no existing unit
	KindInvalidTrust      = "invalid_trust"      // a unit's trust tier is outside the taxonomy
	KindDanglingSource    = "dangling_source"    // a unit's provenance source path does not resolve
	KindUnverifiedClaim   = "unverified_claim"   // a unit's claim quote is not found in its cited source
	KindInvalidKPI        = "invalid_kpi"        // a unit declares a malformed KPI (§16/§18)
	KindNoGuards          = "no_guards"          // NFR specs exist and none is a guard (§10.5)
	KindDanglingCommand   = "dangling_command"   // a unit's prose names a command that does not resolve
	KindUnclaimedKind     = "unclaimed_kind"     // no declared tool adjudicates a finding kind (§13.2)
)

Problem kinds — a stable machine token per defect class, so an agent branches on the kind rather than the prose.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	Units []contextstore.Unit
	Tools toolreg.Registry
	Loops loop.Registry
	Specs []nfr.Spec
}

Inputs bundles the loaded harness state Check reasons over.

type Problem

type Problem struct {
	Kind   string `json:"kind"`
	Ref    string `json:"ref,omitempty"`
	Detail string `json:"detail"`
}

Problem is one harness-integrity defect: its machine kind, the referent it concerns (a unit or spec id, empty for a whole-registry defect), and a human detail.

func Check

func Check(in *Inputs) []Problem

Check runs the deterministic harness-integrity self-check and returns every problem it finds, in a stable order (by kind, then ref, then detail). An empty result means the harness is intact. It is pure.

Jump to

Keyboard shortcuts

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