architecture

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package architecture makes interaction-architecture experiments explicit.

Cascade, Omni, and duplex are not model species here. A cell is the resolved composition of independently selected ownership and capabilities plus the identities of the components that produced it. The P/T/C/N level is a treatment label; validation and pairing use the complete structure.

Index

Constants

View Source
const ManifestVersion = 4
View Source
const PinsVersion = 2
View Source
const ResultVersion = 4

Variables

This section is empty.

Functions

func ReadStatus

func ReadStatus(path string) (binding.Status, error)

ReadStatus strictly reads a post-handshake runtime status captured through the protocol rather than reconstructed from launch flags.

func WriteCell

func WriteCell(path string, cell Cell) error

WriteCell writes one authored cell as an intermediate, reviewable artifact.

func WriteManifest

func WriteManifest(path string, manifest Manifest) error

WriteManifest writes a validated experiment manifest.

Types

type ActHandoff

type ActHandoff string

ActHandoff says how a selected act reaches the machinery that performs it.

const (
	HandoffNone       ActHandoff = "none"
	HandoffDirect     ActHandoff = "direct"
	HandoffTyped      ActHandoff = "typed"
	HandoffTranslated ActHandoff = "translated"
)

type Architecture

type Architecture struct {
	// Definition is the immutable project-level architecture revision this
	// deployment realises. The rest of the fields bind that structural
	// definition to exact models, adapters, policies, and experimental evidence.
	Definition      projectarch.Definition    `json:"definition"`
	Level           Level                     `json:"level"`
	RuntimeBinding  string                    `json:"runtime_binding"`
	Profile         string                    `json:"profile"`
	Foreground      ModelIdentity             `json:"foreground"`
	Perception      ModelIdentity             `json:"perception,omitempty"`
	Speech          ModelIdentity             `json:"speech,omitempty"`
	SpeakerIdentity ModelIdentity             `json:"speaker_identity,omitempty"`
	VisualNarrator  ModelIdentity             `json:"visual_narrator,omitempty"`
	Slow            ModelIdentity             `json:"slow"`
	Ownership       binding.Ownership         `json:"ownership"`
	Capabilities    binding.StackCapabilities `json:"capabilities"`
	Policies        interaction.Report        `json:"policies"`
	Observers       []string                  `json:"observers"`
	Interaction     InteractionIdentity       `json:"interaction"`
	ToolAuthority   binding.ToolStatus        `json:"tool_authority"`
}

Architecture is one fully resolved composition. RuntimeBinding is only an evidence label; no behavior is inferred from it.

func (Architecture) Validate

func (architecture Architecture) Validate() error

Validate checks one resolved architecture from first principles.

type Availability

type Availability string

Availability distinguishes a runnable cell from a desired cell whose model boundary cannot currently realize the declared selection. Keeping the latter in the manifest prevents the experiment matrix from silently shrinking to whatever happened to work.

const (
	AvailabilityRunnable    Availability = "runnable"
	AvailabilityUnavailable Availability = "unavailable"
)

type Cell

type Cell struct {
	Name              string       `json:"name"`
	Availability      Availability `json:"availability"`
	UnavailableReason string       `json:"unavailable_reason,omitempty"`
	Architecture      Architecture `json:"architecture"`
	// Execution is independent of the P/T/C/N architecture description. It
	// proves which executable graph realised that description for benchmark
	// tasks, rather than treating a binding label as execution evidence.
	Execution bench.ExecutionRequirement `json:"execution,omitzero"`
}

Cell names one architecture in an experiment manifest.

func BuildCell

func BuildCell(
	name string, definition projectarch.Definition, status binding.Status, pins Pins,
) (Cell, error)

BuildCell combines one immutable architecture definition, one live status, and one immutable deployment pin set. No source is allowed to stand in for another: definitions provide structure, status provides negotiated reality, and pins provide artifact identities.

func ReadCell

func ReadCell(path string) (Cell, error)

ReadCell strictly reads one authored architecture cell.

func (Cell) MeasurementCell

func (cell Cell) MeasurementCell() bench.Cell

MeasurementCell is the compact cell used by the generic benchmark report. The architecture artifact carries the structure this F52 level cannot.

func (Cell) ValidateObserved

func (cell Cell) ValidateObserved(status binding.Status) error

ValidateObserved checks that a live session resolved to the declared cell.

type Claim

type Claim string

Claim says what a valid comparison can support.

const (
	ClaimArchitecture Claim = "architecture-only"
	ClaimSystem       Claim = "system"
)

type Comparison

type Comparison struct {
	Measurement bench.Comparison `json:"measurement"`
	Claim       Claim            `json:"claim,omitempty"`
	Reportable  bool             `json:"reportable"`
	Differences []string         `json:"non_treatment_differences,omitempty"`
	Refusal     string           `json:"refusal,omitempty"`
}

Comparison distinguishes a controlled architecture ablation from a useful but confounded system comparison.

func Pair

func Pair(baseline, variant Result) Comparison

Pair compares two architecture results. P/T, T/C, and T/N count as architecture evidence only when every non-treatment field is identical.

type EvidenceIdentity

type EvidenceIdentity struct {
	Source       EvidenceSource                          `json:"source"`
	Capabilities binding.InteractionEvidenceCapabilities `json:"capabilities"`
	Recognizer   ModelIdentity                           `json:"recognizer,omitempty"`
}

EvidenceIdentity describes what the interaction policy sees. Source names the broad representation for compatibility; Capabilities is the exact selected vector and is the experiment authority. Recognizer is required for transcript evidence and absent for native multimodal evidence.

type EvidenceSource

type EvidenceSource string

EvidenceSource names the representation available to the interaction decider. It is deliberately not inferred from the model name.

const (
	EvidenceAcousticPredicates EvidenceSource = "acoustic-predicates"
	EvidenceTranscript         EvidenceSource = "transcript"
	EvidenceNativeMultimodal   EvidenceSource = "native-multimodal"
)

type InteractionIdentity

type InteractionIdentity struct {
	PolicyName                string                     `json:"policy_name,omitempty"`
	Model                     ModelIdentity              `json:"model,omitempty"`
	InstructionRevision       string                     `json:"instruction_revision,omitempty"`
	DecisionTimeoutMS         int                        `json:"decision_timeout_ms,omitempty"`
	Evidence                  EvidenceIdentity           `json:"evidence"`
	Protocol                  ProtocolIdentity           `json:"protocol"`
	NativeSuppressionContract string                     `json:"native_suppression_contract,omitempty"`
	Control                   binding.InteractionControl `json:"control"`
}

InteractionIdentity is every treatment-specific detail needed to reproduce the selection. PolicyName is the live interaction.Report spelling; Model is the endpoint identity behind it.

type Level

type Level string

Level names the interaction treatment, not the foreground model family. C is an explicit composition of P and T with one arbitration contract; it is not a fourth model species.

const (
	LevelPredicates Level = "predicates"
	LevelTextPolicy Level = "text-policy"
	LevelComposed   Level = "composed-policy"
	LevelNative     Level = "native"
)

type Manifest

type Manifest struct {
	Version         int    `json:"version"`
	Name            string `json:"name"`
	Suite           string `json:"suite"`
	FixtureRevision string `json:"fixture_revision"`
	Cells           []Cell `json:"cells"`
}

Manifest is a versioned experiment definition shared by every cell in a controlled comparison.

func Read

func Read(path string) (Manifest, error)

Read decodes and validates a manifest.

func (Manifest) Cell

func (manifest Manifest) Cell(name string) (Cell, error)

Cell returns one named cell.

func (Manifest) ID

func (manifest Manifest) ID() string

ID is the complete manifest fingerprint.

func (Manifest) Validate

func (manifest Manifest) Validate() error

Validate rejects manifests that omit a confounder the comparison needs.

type ModelIdentity

type ModelIdentity struct {
	Provider        string `json:"provider"`
	Model           string `json:"model"`
	Revision        string `json:"revision"`
	AdapterRevision string `json:"adapter_revision,omitempty"`
	RuntimeID       string `json:"runtime_id,omitempty"`
}

ModelIdentity is an immutable identity, plus the spelling a live runtime uses when that spelling is not simply provider/model.

type Observation

type Observation struct {
	TaskID string         `json:"task_id"`
	Status binding.Status `json:"status"`
}

Observation binds one task to the runtime status negotiated for its live session. Intended configuration and observed configuration are retained separately so a label cannot substitute for what actually ran.

type Pins

type Pins struct {
	Version               int           `json:"version"`
	Foreground            ModelIdentity `json:"foreground"`
	Perception            ModelIdentity `json:"perception,omitempty"`
	Speech                ModelIdentity `json:"speech,omitempty"`
	Slow                  ModelIdentity `json:"slow"`
	InteractionPolicy     ModelIdentity `json:"interaction_policy,omitempty"`
	InteractionRecognizer ModelIdentity `json:"interaction_recognizer,omitempty"`
	SpeakerIdentity       ModelIdentity `json:"speaker_identity,omitempty"`
	VisualNarrator        ModelIdentity `json:"visual_narrator,omitempty"`
	InstructionRevision   string        `json:"interaction_instruction_revision,omitempty"`
}

Pins supplies immutable deployment identities that a live protocol status cannot discover honestly. It contains no endpoint, credential, or launch option: status remains authoritative for what ran, while pins identify the model and instruction artifacts behind those runtime spellings.

func ReadPins

func ReadPins(path string) (Pins, error)

ReadPins strictly reads one immutable deployment pin set.

type ProtocolIdentity

type ProtocolIdentity struct {
	Transport string     `json:"transport"`
	Version   int        `json:"version,omitempty"`
	Handoff   ActHandoff `json:"handoff"`
}

ProtocolIdentity describes the control boundary. Transport is "in-process" when no process boundary exists and "sidecar" when acts cross one.

type Result

type Result struct {
	Version         int               `json:"version"`
	Experiment      string            `json:"experiment"`
	ManifestID      string            `json:"manifest_id"`
	FixtureRevision string            `json:"fixture_revision"`
	Cell            Cell              `json:"architecture_cell"`
	Measurement     bench.Result      `json:"measurement"`
	Observed        []Observation     `json:"observed"`
	Records         []json.RawMessage `json:"records,omitempty"`
}

Result is a scenario/benchmark cell plus its structured architecture identity and raw suite records.

func NewResult

func NewResult(manifest Manifest, cell Cell, expected int) Result

NewResult starts one architecture-aware cell.

func ReadResult

func ReadResult(path string) (Result, error)

ReadResult decodes an artifact without treating a refusal as a parse error. A partial, dirty-tree, or immediately preceding schema run must remain inspectable; Reportable and Pair are the authorities on which claims it may support. Version 2 predates exact evidence vectors and can never become reportable under current rules, but rejecting it at read time would erase the diagnostic history which motivated those rules. Version 3 added exact evidence but predates exact controller/arbitration attestation, so it is likewise inspectable and non-reportable under version 4.

func (*Result) Finish

func (result *Result) Finish()

Finish derives the generic benchmark summary.

func (Result) Reportable

func (result Result) Reportable() error

Reportable enforces both the generic benchmark rules and architecture attestation for every expected task.

func (Result) Write

func (result Result) Write(path string) error

Write saves a complete artifact.

Jump to

Keyboard shortcuts

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