baseline

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package baseline implements org known-good profiles and package diffing — the deterministic mechanism behind every *_CHANGED and UNEXPECTED_* detection ("unexpected relative to what?").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RuleForChange

func RuleForChange(c Change) string

RuleForChange maps a drift item to its detection rule ID.

Types

type Baseline

type Baseline struct {
	CreatedUTC    string            `json:"created_utc"`
	SourceCaseID  string            `json:"source_case_id"`
	SourcePackage string            `json:"source_package_hashes,omitempty"`
	Artifacts     map[string]string `json:"artifacts"`   // logical_path -> sha256
	Rules         map[string]string `json:"rules"`       // logical_path -> collector rule id
	MCPServers    []string          `json:"mcp_servers"` // declared MCP server names
}

Baseline is a known-good snapshot of agent configuration state.

func Load

func Load(path string) (*Baseline, error)

Load reads a baseline JSON file.

func Snapshot

func Snapshot(pkgDir string) (*Baseline, error)

Snapshot extracts the baseline-relevant state from a sealed package.

func (*Baseline) Save

func (b *Baseline) Save(path string) error

Save writes a baseline JSON file.

type Change

type Change struct {
	Kind        string // ADDED | REMOVED | MODIFIED | UNEXPECTED_MCP_SERVER
	LogicalPath string
	Rule        string
	Detail      string
}

Change is one drift item between a baseline and a package.

func Check

func Check(pkgDir string, base *Baseline) ([]Change, error)

Check compares a package against a baseline.

func Diff

func Diff(pkgA, pkgB string) ([]Change, error)

Diff compares two sealed packages (config-relevant artifacts).

Jump to

Keyboard shortcuts

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