verifycli

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package verifycli implements the `agent-receipts verify` subcommand: validate a stored chain's signatures and hash links using a daemon-written SQLite store and the daemon-published public key. It opens the database read-only (sdk/go/store.OpenReadOnly) so it is safe to run while the daemon is the active writer, and it does not require the daemon socket to be reachable — independent verifiability is not gated on daemon availability (issue #236, Section 4).

Logic lives here, away from cmd/agent-receipts/main.go, so tests can drive the subcommand directly with arbitrary args / captured I/O without shelling out to a built binary.

Index

Constants

View Source
const (
	ExitOK         = 0 // chain verified
	ExitChainBad   = 1 // chain failed verification
	ExitUsageError = 2 // bad flags / unreadable DB or key file
)

Exit codes are part of the CLI contract — scripts and CI checks pivot on them. Keep these stable.

Variables

This section is empty.

Functions

func Run

func Run(args []string, stdout, stderr io.Writer, envLookup func(string) string) int

Run executes the verify subcommand with the given args (sans the program name and "verify" subcommand token), writing human-readable output to stdout and diagnostics to stderr. Returns one of the Exit* constants; cmd/agent-receipts/main.go forwards it to os.Exit.

envLookup is split out so tests can inject a deterministic environment without touching the real process env. Pass os.Getenv for the production caller.

Types

This section is empty.

Jump to

Keyboard shortcuts

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