Help us shape the future of Go! Take the 2026 Go Developer Survey

compile

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package compile turns a declared organisation specification into a concrete, resolved specification and an effective manifest (§4.2, §4.6, §6.1).

Template merge rules (§4.2):

  • A template may extend one other template; cycles are rejected.
  • Scalars (parameters, roles) are overridden by the more derived definition.
  • Ordered instruction lists are concatenated base-first, preserving declared order; a reference that appears twice keeps its first position.
  • Keyed permission records (shared_memory) merge by key. The same key with different operations is an ambiguous conflict and is rejected, because permission grants must remain explicit.

Index

Constants

This section is empty.

Variables

View Source
var MemoryOperations = []string{"read", "search", "write", "revise", "archive", "publish", "history"}

MemoryOperations are the operations a grant may name on a memory store.

View Source
var PersonalMemoryOperations = []string{"read", "search", "write", "revise", "archive", "publish", "history"}

Personal-memory operations implicitly granted to the seat that selects the store (§5.2).

View Source
var WorkspaceOperations = []string{"read", "write"}

WorkspaceOperations are the operations a grant may name on a shared workspace.

Functions

This section is empty.

Types

type BackendInfo

type BackendInfo struct {
	Features []string
}

type Capability

type Capability struct {
	Resource   string   `json:"resource"` // memory:<k>, connection:<k>, workspace:<k>
	Operations []string `json:"operations"`
	Targets    []string `json:"targets,omitempty"`
	Sources    []string `json:"sources"` // grant:<k>, implicit:personal_memory, team:<k>/shared_memory, ...
}

Capability is one entry in a seat's resolved capability manifest (§5.2).

type Catalog

type Catalog struct {
	Harnesses    map[string]HarnessInfo
	Backends     map[string]BackendInfo
	Connectors   map[string]ConnectorInfo
	IdlePolicies map[string]string // idle policy -> required backend feature
}

Catalog describes the adapters and backends this platform release supports. Compatibility validation (§4.4) checks declarations against it; unsupported combinations fail explicitly rather than falling back to weaker behaviour.

func DefaultCatalog

func DefaultCatalog() Catalog

DefaultCatalog is the catalog of the first release.

type ConnectorInfo

type ConnectorInfo struct {
	// Operations a grant may name on a connection of this adapter.
	Operations []string
	// Kind is communication, tracker or model.
	Kind string
	// ManagedOwnership means the adapter can create and own external resources.
	ManagedOwnership bool
}

type Errors

type Errors []FieldError

Errors is a list of validation failures, sorted by path.

func (Errors) Error

func (e Errors) Error() string

type FieldError

type FieldError struct {
	Path    string `json:"path"`
	Message string `json:"message"`
}

FieldError is a validation failure at a specification path.

func (FieldError) Error

func (e FieldError) Error() string

type HarnessInfo

type HarnessInfo struct {
	Capabilities []string
	// NeedsModel means the harness requires a model connection.
	NeedsModel bool
}

type InstructionSource

type InstructionSource struct {
	Ref   string `json:"ref"`
	Scope string `json:"scope"` // organisation, team:<key>, role, seat
	Order int    `json:"order"`
}

InstructionSource records one entry of a seat's ordered instruction manifest (§4.3).

type Manifest

type Manifest struct {
	SchemaVersion   string                  `json:"schema_version"`
	DefaultsVersion int                     `json:"defaults_version"`
	Spec            spec.OrganizationSpec   `json:"spec"`
	Seats           map[string]SeatManifest `json:"seats"`
	// TemplateLineage maps team key to the template chain it was resolved from, base first.
	TemplateLineage map[string][]string `json:"template_lineage,omitempty"`
	Digest          string              `json:"digest"`
}

Manifest is the effective, resolved organisation.

func Compile

func Compile(in spec.OrganizationSpec, cat Catalog) (*Manifest, error)

Compile validates and resolves an organisation specification.

type RouteEdge

type RouteEdge struct {
	Seat   string   `json:"seat"`
	Reply  bool     `json:"reply"`
	Routes []string `json:"routes"`
}

RouteEdge is a permitted message direction from the seat that owns it.

type SeatManifest

type SeatManifest struct {
	Key              string                `json:"key"`
	DisplayName      string                `json:"display_name"`
	RoleRef          string                `json:"role_ref"`
	Teams            []string              `json:"teams,omitempty"`
	HarnessProfile   string                `json:"harness_profile"`
	ExecutionProfile string                `json:"execution_profile"`
	SandboxProfile   string                `json:"sandbox_profile"`
	Harness          spec.HarnessProfile   `json:"harness"`
	Execution        spec.ExecutionProfile `json:"execution"`
	Sandbox          spec.SandboxProfile   `json:"sandbox"`
	PersonalMemory   string                `json:"personal_memory,omitempty"`
	Workspace        spec.WorkspaceBinding `json:"workspace"`
	Instructions     []InstructionSource   `json:"instructions"`
	Capabilities     []Capability          `json:"capabilities"`
	SendTo           []RouteEdge           `json:"send_to,omitempty"`
	ReceiveFrom      []RouteEdge           `json:"receive_from,omitempty"`
	ChannelBindings  []string              `json:"channel_bindings,omitempty"`
	AdoptFrom        string                `json:"adopt_from,omitempty"`
	IsRepresentative bool                  `json:"is_representative"`
	ConfigRevision   string                `json:"config_revision"`
}

SeatManifest is the effective configuration of one seat.

Jump to

Keyboard shortcuts

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