localcompletion

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 27 Imported by: 0

Documentation

Overview

Package localcompletion coordinates a caller-owned local workflow. Its receipts are observations, never harness attestation or semantic authority.

Index

Constants

View Source
const (
	MaxPlanBytes = 64 << 10
)

Variables

This section is empty.

Functions

func HashSession

func HashSession(raw string) string

func ReadPlan

func ReadPlan(name string) ([]byte, error)

ReadPlan reads one bounded regular caller-owned input. Errors contain no rejected plan body or filesystem path.

func SessionKey

func SessionKey(explicit string) (string, error)

Types

type Check

type Check struct {
	ID                       string   `json:"id"`
	Argv                     []string `json:"argv"`
	TimeoutSeconds           int      `json:"timeoutSeconds"`
	AllowCemSidecarOnlyReuse bool     `json:"allowCemSidecarOnlyReuse"`
}

type CheckObservation

type CheckObservation struct {
	ID             string   `json:"id"`
	Qualified      bool     `json:"qualified"`
	Argv           []string `json:"argv"`
	TestedCommit   string   `json:"testedCommit,omitempty"`
	CurrentTarget  string   `json:"currentTarget"`
	Exit           int      `json:"exit"`
	TimedOut       bool     `json:"timedOut"`
	Cancelled      bool     `json:"cancelled"`
	SecretScreened bool     `json:"secretScreened"`
	Stdout         string   `json:"stdout,omitempty"`
	Stderr         string   `json:"stderr,omitempty"`
}

type Evaluation

type Evaluation struct {
	Lifecycle       string             `json:"lifecycle"`
	Satisfied       bool               `json:"satisfied"`
	Unmet           []string           `json:"unmet"`
	Base            string             `json:"base,omitempty"`
	Target          string             `json:"target,omitempty"`
	PlanDigest      string             `json:"planDigest,omitempty"`
	Intents         []string           `json:"intents"`
	IntentPointers  []IntentPointer    `json:"intentPointers"`
	ReportSetDigest string             `json:"reportSetDigest,omitempty"`
	Reports         []string           `json:"reports,omitempty"`
	NextActions     [][]string         `json:"nextActions,omitempty"`
	Checks          []CheckObservation `json:"checks,omitempty"`
	Plan            *Plan              `json:"plan,omitempty"`
	Evidence        []EvidenceWorklist `json:"evidence,omitempty"`
}

func Begin

func Begin(ctx context.Context, root, key string, raw []byte) (Evaluation, error)

func Cancel

func Cancel(ctx context.Context, root, key string) (Evaluation, error)

func Evaluate

func Evaluate(ctx context.Context, root, key string) (Evaluation, error)

func Finish

func Finish(ctx context.Context, root, key string, command PublicCommand) (Evaluation, error)

func Review

func Review(ctx context.Context, root, key, reportDigest string) (Evaluation, error)

func Verify

func Verify(ctx context.Context, root, key, checkID string) (Evaluation, error)

type EvidenceWorklist

type EvidenceWorklist struct {
	Tool     string `json:"tool"`
	Map      string `json:"map"`
	Code     string `json:"code,omitempty"`
	Worklist []any  `json:"worklist"`
	Omitted  int    `json:"omitted"`
}

type IntentPointer

type IntentPointer struct {
	Path     string `json:"path"`
	Revision string `json:"revision"`
	BlobHash string `json:"blob_hash"`
}

type Plan

type Plan struct {
	Base    string   `json:"base"`
	Intents []string `json:"intents"`
	Checks  []Check  `json:"checks"`
}

type PublicCommand

type PublicCommand func(context.Context, string, []string, io.Writer, io.Writer) int

PublicCommand invokes the existing CEM/OCM entrypoints, without a shell or reinterpretation of their evidence semantics.

Jump to

Keyboard shortcuts

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