principles

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package principles loads the worker-type taxonomy (determinism × effectfulness) from the embedded principles.yaml. This embedded copy is the authoritative vocabulary used to validate component metadata at runtime; a sync test guards it against the human-facing copy at the repository root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Raw

func Raw() []byte

Raw returns the embedded principles.yaml bytes (used by `create workspace`).

Types

type Combo

type Combo struct {
	Pure    bool
	Effects []string
}

Combo is one allowed effectfulness value: either pure, or a non-empty set of effects.

type Spec

type Spec struct {
	Determinisms  []string // e.g. ["deterministic", "non_deterministic"]
	Effects       []string // e.g. ["input_effect", "output_effect"]
	Effectfulness []Combo  // the canonical allowed effectfulness combinations
}

Spec is the parsed worker-type vocabulary.

func Default

func Default() (*Spec, error)

Default returns the spec parsed from the embedded principles.yaml.

func Parse

func Parse(data []byte) (*Spec, error)

Parse builds a Spec from principles.yaml content.

func (*Spec) ValidDeterminism

func (s *Spec) ValidDeterminism(d string) bool

ValidDeterminism reports whether d is an allowed determinism value.

func (*Spec) ValidEffect

func (s *Spec) ValidEffect(e string) bool

ValidEffect reports whether e is an allowed effect value.

func (*Spec) ValidEffectfulness

func (s *Spec) ValidEffectfulness(pure bool, effects []string) bool

ValidEffectfulness reports whether the given pure/effects pair is one of the canonical effectfulness combinations.

Jump to

Keyboard shortcuts

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