evidence

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package evidence defines the portable, independently verifiable artifact produced by runeward after an agent run.

Index

Constants

View Source
const Format = "runeward-evidence/v1"

Variables

This section is empty.

Functions

func Verify

func Verify(doc Document) (int, error)

Verify checks the document format, policy digest, event hash chain, and every event signature. It returns the number of verified events.

func Write

func Write(w io.Writer, doc Document) error

Write serializes a document as stable, human-inspectable JSON.

Types

type Document

type Document struct {
	Format          string         `json:"format"`
	GeneratedAt     time.Time      `json:"generated_at"`
	RunewardVersion string         `json:"runeward_version"`
	Policy          PolicySnapshot `json:"policy"`
	Chronicle       ledger.Bundle  `json:"chronicle"`
}

Document combines policy context with the signed Chronicle audit bundle. The embedded ledger public key verifies event integrity; organizations can pin that key out-of-band when they need identity assurance as well.

func New

func New(version, name, source, image, resolved string, findings []Finding, bundle ledger.Bundle) Document

New creates an evidence document and hashes the resolved policy snapshot.

func Read

func Read(r io.Reader) (Document, error)

Read decodes an evidence document.

type Finding

type Finding struct {
	Severity string `json:"severity"`
	Field    string `json:"field"`
	Message  string `json:"message"`
}

Finding is a portable policy-lint finding captured at export time.

type PolicySnapshot

type PolicySnapshot struct {
	Name     string    `json:"name"`
	Source   string    `json:"source,omitempty"`
	Image    string    `json:"image,omitempty"`
	Resolved string    `json:"resolved"`
	SHA256   string    `json:"sha256"`
	Findings []Finding `json:"findings,omitempty"`
}

PolicySnapshot records the resolved, secret-redacted policy that governed a run. SHA256 makes accidental or malicious edits independently detectable.

Jump to

Keyboard shortcuts

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