scale

package
v5.52.21 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 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 scale is the installation-shaped fixture the scale budgets run on: 87 MCPServers (84 of them session-authenticated, in five families with an instanceArg, on 28 installations; three in-house servers without authentication), 18 distinct capability documents shared by the family members, 282 workflows referencing their tools, and 450 sessions each authenticated to every session-authenticated server -- the shape of a production installation, with every name invented.

The generator is the source of truth (Fixture); the committed YAML files are its rendering for the test harness (pre_configuration.yaml, loaded by `pre_configuration.fixture: scale`) and for review (sessions.yaml). `go generate ./internal/testing/fixtures/scale/` rewrites both; a test fails when they drift from the generator.

Nothing in the fixture comes from an installation: installations are named after minerals, hostnames end in .invalid, tool names are generic verbs over the family's nouns, workflow names are verb-object-qualifier combinations, people are numbered.

Index

Constants

View Source
const Name = "scale"

Name is the fixture's name in pre_configuration.fixture.

Variables

View Source
var PreConfigurationYAML []byte

PreConfigurationYAML is the fixture rendered as the harness's pre_configuration fragment (RenderPreConfiguration), what `pre_configuration.fixture: scale` loads.

View Source
var SessionsYAML []byte

SessionsYAML is the fixture's session records (RenderSessions).

Functions

func ExposedToolName

func ExposedToolName(s Server, tool string) string

ExposedToolName is exposedToolName for callers outside the package.

func RenderPreConfiguration

func RenderPreConfiguration(f *Fixture) ([]byte, error)

RenderPreConfiguration renders the fixture as the pre_configuration fragment the harness loads through `pre_configuration.fixture: scale`: the two mock authorization servers, the broker trusting the fleet issuer, every server as a mock with its tools, every workflow. The capability documents are written once under `documents` and referenced by YAML alias from the servers that offer them, so the file is proportional to the distinct documents, like the store the fixture is about.

func RenderSessions

func RenderSessions(f *Fixture) ([]byte, error)

RenderSessions renders the session records.

Types

type Arg

type Arg struct {
	Name, Type, Description string
	Required                bool
}

Arg is one workflow argument.

type Document

type Document struct {
	Name  string
	Tools []Tool
}

Document is one capability document: the tools a server offers.

type Fixture

type Fixture struct {
	// Servers are the MCPServer definitions, in-house servers last.
	Servers []Server
	// Documents are the distinct capability documents (tool lists) the
	// session-authenticated servers offer; a family member points at one by
	// name. Sessions reference them, never copy them.
	Documents []Document
	// Workflows reference the servers' tools.
	Workflows []Workflow
	// Sessions are the session records: every session is authenticated to
	// every session-authenticated server.
	Sessions []Session

	// MusterOAuthServer names the mock authorization server that is muster's
	// own; FleetIssuer the one whose tokens the forwardToken servers trust
	// (the tokens a scenario mints to open a session).
	MusterOAuthServer, FleetIssuer string
}

Fixture is the typed fixture: what the generator produces and what the budgets in internal/aggregator run on. The harness reads the same shape from its YAML rendering.

func Get

func Get() *Fixture

Get returns the fixture, generated once per process. The generator is deterministic: the same shape and seed give the same fixture, and the committed YAML is its rendering (TestFixtureFilesAreCurrent proves it).

func (*Fixture) DocumentByName

func (f *Fixture) DocumentByName(name string) (Document, bool)

DocumentByName returns the named document.

func (*Fixture) SessionAuthServers

func (f *Fixture) SessionAuthServers() []Server

SessionAuthServers returns the servers that require per-session authentication -- the ones every session of the fixture is authenticated to.

func (*Fixture) Shape

func (f *Fixture) Shape() Shape

Shape returns the fixture's headline numbers.

type Property

type Property struct {
	Name, Description string
}

Property is one input schema property.

type Server

type Server struct {
	Name string
	// Installation the server runs on; empty for an in-house server.
	Installation string
	// Family and InstanceArg group the server with its siblings on the other
	// installations; empty for an in-house server.
	Family, InstanceArg string
	// Document names the capability document the server offers.
	Document string
	// SessionAuth: the server requires per-session authentication (a
	// forwardToken server here); false for an in-house server whose tools
	// every session sees.
	SessionAuth bool
}

Server is one MCPServer definition.

func (Server) URL

func (s Server) URL() string

URL is the server's invented endpoint, for the in-process budgets (the harness gives every server a mock's address instead).

type Session

type Session struct {
	ID      string
	Subject string
}

Session is one session record.

type Shape

type Shape struct {
	Servers, SessionAuthServers, Families, Installations int
	// Documents counts every distinct tool list; SessionDocuments the ones
	// the session-authenticated servers offer -- what the capability store
	// holds, once each, for every session.
	Documents, SessionDocuments int
	Workflows, Sessions         int
}

Shape is the fixture's headline numbers, for reports and assertions.

type Step

type Step struct {
	ID   string
	Tool string
	// Args are the step's arguments in declaration order (values may be
	// templates over the workflow's input).
	Args []StepArg
}

Step is one workflow step.

type StepArg

type StepArg struct {
	Name, Value string
}

StepArg is one step argument.

type Tool

type Tool struct {
	Name        string
	Description string
	// Properties are the tool's input schema properties, name -> description;
	// every property is a string.
	Properties []Property
	// Required lists the required properties.
	Required []string
	// ReadOnly is the tool's readOnlyHint annotation.
	ReadOnly bool
}

Tool is one tool of a document.

type Workflow

type Workflow struct {
	Name        string
	Description string
	Labels      map[string]string
	// Args are the workflow's arguments in declaration order.
	Args  []Arg
	Steps []Step
}

Workflow is one workflow definition.

Directories

Path Synopsis
Command gen rewrites the scale fixture's YAML files from the generator, so `go generate ./internal/testing/fixtures/scale/` is the one way to change the committed fixture.
Command gen rewrites the scale fixture's YAML files from the generator, so `go generate ./internal/testing/fixtures/scale/` is the one way to change the committed fixture.

Jump to

Keyboard shortcuts

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