record

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SchemaVersion = "1.0"

Variables

This section is empty.

Functions

func ComputeHash

func ComputeHash(r *Record) (string, error)

func Validate

func Validate(r *Record) error

Types

type Controls

type Controls struct {
	PermissionsEnforced bool              `json:"permissions_enforced"`
	ApprovedScope       string            `json:"approved_scope,omitempty"`
	WithinScope         *bool             `json:"within_scope,omitempty"`
	GuardrailsActive    []GuardrailStatus `json:"guardrails_active,omitempty"`
	HumanOversight      *HumanOversight   `json:"human_oversight,omitempty"`
}

type GuardrailStatus

type GuardrailStatus struct {
	Name      string `json:"name"`
	Status    string `json:"status"`
	Triggered bool   `json:"triggered"`
}

type HumanOversight

type HumanOversight struct {
	ApprovalRequired bool   `json:"approval_required"`
	LastReview       string `json:"last_review,omitempty"`
	Reviewer         string `json:"reviewer,omitempty"`
}

type Integrity

type Integrity struct {
	RecordHash         string `json:"record_hash"`
	PreviousRecordHash string `json:"previous_record_hash,omitempty"`
	SigningKeyID       string `json:"signing_key_id,omitempty"`
	Signature          string `json:"signature,omitempty"`
}

type Record

type Record struct {
	RecordID      string         `json:"record_id"`
	RecordVersion string         `json:"record_version"`
	Timestamp     time.Time      `json:"timestamp"`
	Source        string         `json:"source"`
	SourceProduct string         `json:"source_product"`
	AgentID       string         `json:"agent_id,omitempty"`
	RecordType    string         `json:"record_type"`
	Event         map[string]any `json:"event"`
	Controls      Controls       `json:"controls"`
	Metadata      map[string]any `json:"metadata,omitempty"`
	Integrity     Integrity      `json:"integrity"`
}

func Clone

func Clone(r *Record) *Record

func New

func New(opts RecordOpts) (*Record, error)

type RecordOpts

type RecordOpts struct {
	RecordVersion string
	Timestamp     time.Time
	Source        string
	SourceProduct string
	AgentID       string
	Type          string
	Event         map[string]any
	Controls      Controls
	Metadata      map[string]any
}

Jump to

Keyboard shortcuts

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