check

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package check implements the four record-layer checks behind nova-check. Each function returns (result, failures, error): failures mean the check ran and said NO (exit 1 at the CLI); a non-nil error means the check could not run at all (exit 2). See SPEC.md for what each check asserts and, as importantly, what it deliberately does not.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attest

func Attest(home, manifest string) (Attestation, []Failure, error)

Attest verifies that every file listed in the manifest exists under home, is a regular file, and is non-empty, and computes the boot attestation: file count, total bytes, and a SHA-256 binding paths, order, and contents. Any failure leaves the attestation zero-valued; a partial self must not produce a pasteable line.

Types

type Attestation

type Attestation struct {
	Files  int
	Bytes  int64
	SHA256 string
}

Attestation is the successful result of Attest: what a full boot read.

type BrokenLink struct {
	File   string // path of the containing .md file, relative to the scanned dir
	Line   int    // 1-based line number; 0 when the whole file is the finding
	Target string // the link target as written; empty when the whole file is the finding
	Reason string
}

BrokenLink is one relative markdown link that does not resolve — or, when Line is 0 and Target is empty, one whole .md file that could not be read.

func Links(dir string) (mdFiles, checked int, broken []BrokenLink, err error)

Links walks dir for .md files (skipping .git) and verifies that every relative inline link target resolves to an existing file or directory inside the tree. It returns the number of markdown files seen, the number of relative links checked, and every broken link found.

type Failure

type Failure struct {
	Subject string
	Reason  string
}

Failure is one named NO from a check: the subject that failed and why.

func Kernel

func Kernel(file string, maxBytes int64) (measured int64, failures []Failure, err error)

Kernel enforces a size budget on the kernel file. maxBytes must be positive; there is no default budget and zero does not mean unlimited. A missing kernel and an empty kernel are both failures, not errors: the check ran, and the answer is NO.

func NoCode

func NoCode(dir string) (scanned int, findings []Failure, err error)

NoCode walks dir (skipping .git) and reports every regular file that is code by extension or has an executable bit set. A self repo holds prose; machinery lives elsewhere. scanned counts the regular files examined.

Jump to

Keyboard shortcuts

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