lab

package
v0.121.0-rc.8 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 138 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

Index

Constants

View Source
const (
	// ModelsTestModelOllama is ~400 MB from the Ollama registry.
	ModelsTestModelOllama = "qwen2.5:0.5b"
	// ModelsTestModelLemonade is the smallest FastFlowLM (NPU) model of
	// Lemonade's catalog carrying the tool-calling label (3.1 GB); the
	// smaller *-FLM models cannot call tools.
	ModelsTestModelLemonade = "qwen3-4b-FLM"
	// ModelsTestModelLMStudio is an LM Studio hub reference (~2 GB), so the
	// download resolves the variant that fits the host — GGUF on Linux and
	// NVIDIA, MLX on Apple silicon.
	ModelsTestModelLMStudio = "ibm/granite-4-micro"
)

The proof's default model per backend — every one small and tool-calling capable, which a kagent agent turn requires: agents send tool schemas with every request, and a model without them fails each turn with "does not support tools" (smollm2:135m pulls fine and then does exactly that).

View Source
const (
	SubstrateStepReadyTimeout  = 10 * time.Minute
	SubstrateStepRetakeTimeout = 10 * time.Minute
)

The waits of the proof: the golden boot and the re-take are a golden boot each (minutes on a cold worker), the workers' roll onto the new image a pod start per worker.

View Source
const (
	// SubstrateTunnelClientTimeout is the client's timeout on the gRPC-shaped
	// call: the router's wait for the actor's SETTINGS frame ends only with it
	// on a relay that keeps the tunnel open.
	SubstrateTunnelClientTimeout = 30 * time.Second
	// SubstrateTunnelPromptly is how soon the call must fail to have failed
	// at once: the tunnel ended with the actor's connection.
	SubstrateTunnelPromptly = 5 * time.Second
	// SubstrateTunnelReadyTimeout bounds the golden boot, the actor's resume
	// and its route reaching the router.
	SubstrateTunnelReadyTimeout = 5 * time.Minute
)

The waits of the proof.

View Source
const (

	// WorkspaceGrantSecretName and workspaceGrantSecretKey are the Secret in
	// the platform namespace the manager reads its signing key from, and the
	// entry that holds it.
	WorkspaceGrantSecretName = "workspace-manager-grant" // #nosec G101 -- Secret NAME, not a credential

	WorkspaceTokenExchangeSecretName = "workspace-manager-token-exchange" // #nosec G101 -- Secret NAME, not a credential

)
View Source
const AnthropicKeyEnv = "ANTHROPIC_API_KEY"

AnthropicKeyEnv is where the lab reads the Anthropic API key from at deploy time when agentlab.yaml records no source. Unlike the lab's throwaway passwords, this is a real credential: it never enters agentlab.yaml or the rendered state/ files — it travels host environment -> Kubernetes Secret only, and the consumers (the kagent ModelConfig, Backstage's ai-chat) reference the Secret.

View Source
const BeekeeperCentralVersionDefault = "v0.80.0-rc.5"

BeekeeperCentralVersionDefault is the first beekeeper release whose local binary reaches the central instance.

View Source
const BeekeeperDecisionsVersionDefault = "v0.152.4"

BeekeeperDecisionsVersionDefault is the beekeeper release the proof passes against: it puts decisions to people through klaus-gateway, each naming the thread its answer is recorded on, and lets their guide converse with them there.

View Source
const BeekeeperSubscriptionsVersionDefault = "v0.149.3"

BeekeeperSubscriptionsVersionDefault is a beekeeper release whose serve offers its state as subscribable resources.

View Source
const CodexHostModelName = "codex-host"

CodexHostModelName is the ModelConfig, and extraModels entry, configure wires a codex host model as.

View Source
const DefaultCodingReadyTimeout = 10 * time.Minute

DefaultCodingReadyTimeout bounds each boot and wait of the proof.

View Source
const (

	// DefaultEgressOrigin is the origin the agent declares: a host no
	// compiled destination of the platform names.
	DefaultEgressOrigin = "https://example.com"
)
View Source
const DefaultEgressReadyTimeout = 10 * time.Minute

DefaultEgressReadyTimeout bounds the agent's boot.

View Source
const DefaultServingReadyTimeout = 20 * time.Minute

DefaultServingReadyTimeout bounds the serve: the storage-initializer's download of the weights (~1 GiB from the Hugging Face Hub) and the CPU runtime's start (the model loaded, the server answering /health).

View Source
const DefaultVMManagerTestVMTimeout = 6 * time.Minute

DefaultVMManagerTestVMTimeout is the proof's default VM boot budget: the installer boot (~12 s) plus the installed boot to READY=1 (11-15 s) with room for a cold host; vm-manager's own ceilings are 5 m and 4 m.

View Source
const DefaultWorkspacesMeasureRuns = 5

DefaultWorkspacesMeasureRuns is how many runs the measurement makes.

View Source
const DefaultWorkspacesReadyTimeout = 5 * time.Minute

DefaultWorkspacesReadyTimeout is the proof's default wait.

View Source
const GitHubTokenEnv = "GITHUB_TOKEN" // #nosec G101 -- env var NAME, not a credential

GitHubTokenEnv is the env var name the consumers read the GitHub token under: the key of the Secret below. agentlab itself never reads a variable of this name — the token reaches the lab only through githubToken.source, placed by the secret tooling, so its value never passes through agentlab or the session that runs it.

View Source
const (
	KagentStepReadyTimeout = 10 * time.Minute
)

The waits of the proof: the golden boot before the step, the controller's roll onto the stepped release.

View Source
const (

	// MockLLMModelConfig is the kagent ModelConfig on the mockllm, and
	// mockLLMSecret its key's Secret (a placeholder: the mock checks a
	// key's presence only).
	MockLLMModelConfig = "agentlab-mockllm"
)
View Source
const ServingPresetName = servingPresetName

ServingPresetName is the lab preset's name, for the configure summary.

View Source
const SkillsTestReadyTimeout = 10 * time.Minute

SkillsTestReadyTimeout bounds the golden boot by default: the runtime image into Substrate's layer cache, the actor's start, the skill fetch, the snapshot — minutes on a cold lab, and a boot that is being denied egress retries forever, so the wait has to end somewhere.

View Source
const StateDir = "state"

StateDir is where rendered manifests land, for inspection and for kubectl/helm to consume. Gitignored; regenerated on every command.

View Source
const WorkspacesPartGitLab = "gitlab"

WorkspacesPartGitLab is the GitLab part of workspaces-test.

View Source
const WorkspacesStorageClass = workspacesStorageClass

WorkspacesStorageClass is the class for the configure summary.

Variables

View Source
var CodexHostModels = []CodexHostModel{
	{ID: "qwen3-coder:30b", GiB: 21},
	{ID: "gpt-oss:20b", GiB: 16},
}

CodexHostModels are the host models for a codex proof, preferred first: qwen3-coder 30b-a3b at Q4_K_M reaches the sandbox turn, credentials and DNS stages; gpt-oss-20b at its MXFP4 weights answers some Responses API calls with a server error on Ollama.

View Source
var DefaultLoginAudiences = []string{config.KubernetesClientID}

DefaultLoginAudiences is `login`'s audience without --audience.

View Source
var MusterMetaTools = []string{"list_tools", "describe_tool", "list_core_tools", "filter_tools", "call_tool", "list_resources", "describe_resource", "get_resource", "list_prompts", "describe_prompt", "get_prompt"}

MusterMetaTools are muster's meta-tools, the selection a platform coding agent binds.

View Source
var WorkspacesParts = []string{WorkspacesPartGitLab}

WorkspacesParts are the parts `workspaces-test --part` takes.

Functions

func A2ATest added in v0.37.0

func A2ATest(cfg *config.Config, email string, opts A2ATestOptions) error

A2ATest is the headless proof described at the top of this file.

func AdoptInstalledChart added in v0.85.0

func AdoptInstalledChart(cfg *config.Config) (*installedChart, error)

AdoptInstalledChart writes the chart in place into agentlab.yaml's pin — `agentlab configure --adopt-chart`, the restore step for a config put back apart from its cluster: afterwards the config says what runs, and a platform run changes nothing. Refused when the lab is not running or holds no platform release, and for a chart directory's build, whose version is a placeholder nothing can pin. Returns the chart adopted.

func AgentsGitOpsTest added in v0.86.0

func AgentsGitOpsTest(cfg *config.Config, email string) error

AgentsGitOpsTest is the headless proof that an agent applied from git is GitOps-owned, as the portal sees it: the platform's agent-manager composes the release, the proof applies it with the Flux labels and agent-manager reports it managed: gitops; validate_agent of a change refuses mode apply with gitops_owned and mode commit as unsupported, update_agent with gitops_owned, the live release untouched. Leaves nothing behind.

func AgentsTest added in v0.14.0

func AgentsTest(cfg *config.Config, email string) error

AgentsTest is the headless proof that agent-manager acts as the signed-in user and writes the Generic chart 1.x contract, through the platform path only (Dex id_token -> muster -> call_tool x_agent-manager_*): get_info reports identity caller on the 1.x chart and the platform Harness; the admin's create -> ready -> turn -> update -> refreshSkills -> delete round trip succeeds with requestedBy set — the HelmRelease written by agent-manager (its field manager, values.toolset the anchor, the skill pinned to a commit) next to the OCIRepository on the chart line agent-manager declares (its --agent-chart-semver), the installed chart on that line, the render an AgentTemplate carrying the display-name and icon-url annotations and its skill, the Agent pairing it with the platform Harness, Ready, the per-agent RemoteMCPServer carrying the toolset header; get_agent_status agrees with the Agent's status for ready and for an Agent on a Harness that does not exist; a viewers-group user's create is refused by the kind apiserver as User "oidc:viewer@lab.local" (the view role writes no HelmReleases); and the agent-manager ServiceAccount holds nothing beyond API discovery. Leaves nothing behind.

func ApplyCodexHostModel added in v0.111.0

func ApplyCodexHostModel(cfg *config.Config, d *Discovery, requested bool) (config.ExtraModel, bool)

ApplyCodexHostModel adds the discovered codex host model to cfg's extraModels when the person asked for it (requested), the lab renders the codex Harness and no entry speaks the Responses API yet; an entry of the person's own wins. It returns the entry added, ok false when none was.

func ApplyDex

func ApplyDex(cfg *config.Config) error

ApplyDex renders manifests with the input checksum stamped into the pod template, applies them, and waits for the rollout. The checksum covers the rendered manifest AND the served cert, so editing the config or regenerating certs rolls the pod, while an unchanged re-apply is a pure no-op (no throwaway ReplicaSet). The GitHub connector renders once its client Secret is in place (githubsignin.go), its version in the render, so placing or rotating the client secret rolls the pod too. Shared by Up, `agentlab platform` and `agentlab reload`.

func BackstageTest

func BackstageTest(cfg *config.Config, emails []string, opts BackstageTestOptions) error

BackstageTest drives the full Backstage <-> Dex sign-in headlessly for each user, reports the identity Backstage resolved, proves the Giant Swarm muster plugin can reach muster with that user's forwarded token, and then drives the Dev Portal's Agent Platform pages on kagent API v2 the way a person does (backstagetest_agents.go): the wizard's create path through agent-manager as the person, the agents list per user, a streamed and a resumed conversation, HITL and Stop, the detail page's edit, skills update and delete — and with managed models the Models page's model-manager read and write through the same muster hop (backstagetest_models.go). With opts.Agent the Agent Platform half runs against that existing agent instead (proveExistingAgent).

func BeekeeperCentralTest added in v0.76.0

func BeekeeperCentralTest(cfg *config.Config, opts BeekeeperCentralTestOptions) error

BeekeeperCentralTest is the headless proof of the central resources in the local beekeeper.

func BeekeeperDecisionsTest added in v0.74.0

func BeekeeperDecisionsTest(cfg *config.Config, opts BeekeeperDecisionsTestOptions) error

BeekeeperDecisionsTest is the headless proof of beekeeper's decisions.

func BeekeeperSubscriptionsTest added in v0.121.0

func BeekeeperSubscriptionsTest(cfg *config.Config, opts BeekeeperSubscriptionsTestOptions) error

BeekeeperSubscriptionsTest is the headless proof of resource subscriptions relayed per user by muster.

func BrowserLogin

func BrowserLogin(cfg *config.Config) error

BrowserLogin runs the real OIDC authorization-code flow: opens the browser on Dex's own login screen, catches the callback on a fixed local port (pre-registered in Dex's redirectURIs, so it cannot be random), exchanges the code for tokens and writes kubeconfig.oidc.

This is the flow to show a client — they see the Dex login page and type credentials for a user that exists nowhere but this cluster.

func CodexHostModelIDs added in v0.114.3

func CodexHostModelIDs() string

CodexHostModelIDs names CodexHostModels with the memory each needs, for the --codex-host-model help and messages.

func CodingTest added in v0.97.0

func CodingTest(cfg *config.Config, opts CodingTestOptions) error

CodingTest is the coding agents proof (the stages above).

func DecisionsTest added in v0.70.0

func DecisionsTest(cfg *config.Config, email string, opts DecisionsTestOptions) error

DecisionsTest is the headless proof of klaus-gateway's decisions.

func DeleteSession added in v0.107.0

func DeleteSession(cfg *config.Config, email, sessionID string) error

DeleteSession is `agentlab turn --session <id> --delete`: the lab user deletes a Session kept by an earlier `turn --keep`, as its creator, the way a turn's own cleanup does — DeleteSession, retried while the Session's runtime work settles — which releases its actor and snapshot.

func Down

func Down(cfg *config.Config) error

Down destroys the kind cluster. Certs are kept: the CA is only worth regenerating deliberately (agentlab certs --force), and keeping it means an immediate `agentlab up` reuses the same trust chain.

func DropProofState added in v0.113.0

func DropProofState(cfg *config.Config) []string

DropProofState puts agentlab.yaml back on the released platform, the restore step before a lab is handed on: the overlays (platform.valuesFiles), the dev images, a chart directory, the dev channel with the dev build it pinned, and a local guest image all go. It returns one line per dropped setting, none when the config had none.

func EgressTest added in v0.110.0

func EgressTest(cfg *config.Config, opts EgressTestOptions) error

EgressTest is the egress proof (the stages above).

func EnsureWorkspaceGrantKey added in v0.93.0

func EnsureWorkspaceGrantKey() (string, error)

EnsureWorkspaceGrantKey generates the lab's grant signing key once and returns its path; an existing key is kept, so grants and the published key id stay stable across installs.

func GenCerts

func GenCerts(domain string, force bool) error

GenCerts mints the lab CA and the Dex server certificate under certs/. Existing files are kept while they match the configuration and policy; only what must change is re-minted, and `--force` re-mints everything.

The CA carries X.509 name constraints — permitted DNS subtrees for the platform domain, localhost and the Dex in-cluster names, permitted IP range 127.0.0.0/8 — so once `agentlab trust` installs it, a leaked CA key still cannot sign for the web at large. Non-critical for old-verifier compatibility; Go, OpenSSL, Chrome, Firefox and macOS enforce them regardless. The constraints pin the domain, so a platform.domain change re-mints the CA: the trust step must be repeated, and a running cluster's apiserver keeps the replaced CA until the cluster is recreated.

The Dex server cert carries both IP:127.0.0.1 and DNS:localhost in its SAN — the issuer URL uses the *name* (muster rejects issuers whose host parses as a loopback IP; a name that merely resolves to one passes).

func IsDevBuild added in v0.83.0

func IsDevBuild(version string) bool

IsDevBuild reports whether a chart version is a dev build of some branch — what the dev channel resolves to, or a tag pinned by hand in platform.chartVersion — as opposed to a release.

func KagentStepTest added in v0.114.0

func KagentStepTest(cfg *config.Config, email string, opts KagentStepOptions) error

KagentStepTest is `agentlab kagent-step-test`. The verdict is one PASS line per step and, on a failure, one FAIL line naming what failed — the step, the resume, the turn, the suspend or the delete — with its cause.

func KlausGatewayTest added in v0.39.0

func KlausGatewayTest(cfg *config.Config, email string, opts KlausGatewayTestOptions) error

KlausGatewayTest is the headless Swarmgeist proof: klaus-gateway against the lab's kagent API v2 controller through the edge, driven through its Slack adapter as the signed-in user.

func LogComponents

func LogComponents() []string

LogComponents lists what Logs accepts, for cobra's ValidArgs.

func Login

func Login(cfg *config.Config, email, password string, audiences []string) error

Login performs the headless password-grant login for audiences (default DefaultLoginAudiences), writes the raw id_token to .token and, when the token carries the apiserver's audience, a token-only kubeconfig to kubeconfig.oidc, and prints the token claims.

func Logs

func Logs(cfg *config.Config, component string) error

Logs tails the given component's logs (`kubectl logs -f` of its pods, through the embedded client against the lab cluster whatever the shell's kubeconfig says) until every stream ends or the user interrupts with Ctrl-C, which ends the command cleanly.

func MinPublishablePort added in v0.17.4

func MinPublishablePort() int

MinPublishablePort is the lowest host port the container engine can publish. Docker's daemon binds as root, so every port is available to it. Rootless podman publishes from the invoking user's network namespace, where the kernel refuses everything below net.ipv4.ip_unprivileged_port_start — the lab's default gateway port 443 among them.

func ModelsGatewayHost added in v0.52.0

func ModelsGatewayHost(cfg *config.Config) string

ModelsGatewayHost is modelsGatewayHost for the configure summary.

func ModelsTest added in v0.11.0

func ModelsTest(cfg *config.Config, email string, opts ModelsTestOptions) error

ModelsTest is the headless end-to-end proof of managed models on ONE of the configured backends, through the platform path only: model-manager's x_model-manager_* tools through muster with a lab user's Dex token (and muster's 401 without one), then list -> pull with observable progress -> the auto-created kagent ModelConfig (native keyless Ollama provider on ollama, OpenAI provider against Lemonade's /api/v1 or LM Studio's /v1, carrying the backend label) Accepted -> a kagent agent turn against it -> the tools muster aggregates -> unload -> the teardown the server supports. Every request names the backend — the one model-manager fronting all servers resolves by it.

On a server that deletes over its API the teardown is a delete (gone from the host, the ModelConfig gone) and the run leaves nothing behind. On lmstudio LM Studio serves no delete, so the run proves the unsupported refusal and unwires instead, and says in its closing note that the model stays downloaded — the one proof that leaves something behind, by design.

func ModelsTestModelDefaults added in v0.29.0

func ModelsTestModelDefaults() string

ModelsTestModelDefaults words the per-backend defaults for `--model`'s help text, so the flag cannot drift from the table.

func ModelsTestModelFor added in v0.16.0

func ModelsTestModelFor(backend string) string

ModelsTestModelFor is the default proof model of a backend.

func NoteChartUnderTest added in v0.85.0

func NoteChartUnderTest(cfg *config.Config) (*installedChart, error)

NoteChartUnderTest opens a proof with the chart it runs against — the one in place, read from the cluster, never agentlab.yaml's pin — and warns of a drift between the two with both versions, so a verdict never claims a release that is not under test. Returns the chart in place, nil when none is installed (the proof then fails on its own first contact, by name).

func Open added in v0.32.0

func Open(cfg *config.Config, target string) error

Open hands one lab URL to the OS opener and prints it. Refuses when the target is disabled in agentlab.yaml, when the cluster is not running or when the target does not answer yet — a plain fact beats an error page in the browser — and offers `agentlab trust` first while the lab CA is untrusted.

func OpenBrowser

func OpenBrowser(url string)

OpenBrowser hands a URL (or, on macOS/Linux, any path) to the OS opener. Fire-and-forget: a browser that fails to open is an inconvenience, not an error the flow can act on — every caller prints the URL as well.

func OpenTargets added in v0.32.0

func OpenTargets() []string

OpenTargets lists what Open accepts, for cobra's ValidArgs.

func PlatformDown

func PlatformDown(cfg *config.Config) error

PlatformDown removes the agent platform and the observability releases, leaving Dex and the cluster alone. The order is the chart's: the lab's own mcp-prometheus HelmRelease goes first while helm-controller still runs (a clean uninstall of its release), then the waited uninstall of the platform through the embedded Helm runs the chart's pre-delete hooks — delete the component HelmReleases and wait for their releases to be uninstalled, then delete the FluxInstance and wait for the operator to remove Flux with its CRDs, which takes every remaining HelmRelease object (the agents' too) with it — before Helm removes the operator and the identities. Nothing is left with a finalizer nobody processes, so the namespaces delete promptly. The prometheus-operator CRDs and the four Flux Operator CRDs stay — Helm never removes a chart's crds/, and re-installs are unaffected.

func PlatformTest

func PlatformTest(cfg *config.Config, email string) error

PlatformTest is the headless end-to-end proof: Dex login -> muster (OAuth-protected) -> the Kubernetes MCP -> the kind apiserver.

Uses the Dex password grant with client_id=muster, which yields an id_token with aud=muster. muster accepts it directly because `muster` is listed under oauth.server.trustedAudiences. Claude Code instead does the full browser authorization-code flow; this is the CI-friendly shortcut.

The proof runs in stages (proofStages): each named, timed and judged, the summary before the verdict. Nothing the lab's state cannot prove is left out silently — a missing fixture user, a release that is not there, a read that failed fail the stage — and the stages agentlab.yaml leaves without a subject (agents or observability off, the 3.x line) are listed as skipped with that reason.

func PlatformUp

func PlatformUp(cfg *config.Config, offers Offers) error

PlatformUp installs the Giant Swarm agent platform into the lab cluster and wires it to the lab Dex.

The platform is the agent-platform meta chart — the same chart every Giant Swarm management cluster runs — in its LAB SHAPE: the chart brings its own Flux engine (components.flux.enabled, the flux-engine subchart: Flux Operator + one FluxInstance with source- and helm-controller), so `helm install` yields a running platform on a cluster with no Flux; and the chart does NOT manage itself (gitops.self.enabled: false). Self-management would have the bundled helm-controller adopt this release and follow the PUBLISHED chart's version range — the lab installs unreleased charts (platform.chartPath) and dev images, which that HelmRelease would replace with the release it finds in the registry. So Helm keeps owning the release: this function is the one writer (an idempotent upgrade-or-install through the embedded Helm, no post-renderer, no --force-conflicts), and the release is the Helm CLI's too — `helm upgrade` from a shell stays the lab's day-2 tool.

func Pods added in v0.62.0

func Pods(cfg *config.Config, namespace string) error

Pods lists the lab's pods — every namespace, or only namespace — through the embedded client, in the shape of `kubectl get pods -A`: the look at the lab that needs no kubectl. A lab that is not running is refused with the fact and `agentlab up`, not a stack of client-go errors.

func PolexTest added in v0.120.0

func PolexTest(cfg *config.Config, opts PolexTestOptions) error

PolexTest is the standalone proof: the chart's PolicyExceptions dry-run against the lab's Kyverno, one line per exception, then the verdict.

func PrintLabs added in v0.62.0

func PrintLabs(w io.Writer, listed []ListedLab, asJSON bool) error

PrintLabs writes the list for a person, one block per lab, or as JSON.

func PrintStatus added in v0.83.0

func PrintStatus(w io.Writer, s *Status, asJSON bool) error

PrintStatus writes the status for a person, in the shape of `list`'s block, or as JSON.

func RenderAll

func RenderAll(cfg *config.Config) error

RenderAll renders every manifest into state/ for inspection. The stamped manifest (dex) needs the certs, so they are generated first if missing. The extra models include the statically wired host models when the host servers answer (best effort: the platform run is where a failure counts).

func RequireLabCerts added in v0.86.1

func RequireLabCerts(cfg *config.Config) error

RequireLabCerts refuses a lab directory that has no certs/ while its cluster exists: the cluster was made from certs that live in the lab's own directory (the registered one, under the state directory ~/.local/state/<lab> for a leased lab), so a checkout whose agentlab.yaml merely names that clusterName reports the lab and then fails on the first certificate it reads. The refusal names the lab's directory and --lab.

func ResetDevBuildPin added in v0.83.0

func ResetDevBuildPin(cfg *config.Config) string

ResetDevBuildPin returns a config that left the dev channel to a release: a chartVersion that is a dev build — what the resolver wrote while the branch was followed — gives way to the default pin, so the next platform run installs a release rather than the build the branch left behind. A release pinned by hand stays. Reports the version it replaced, "" when it replaced none.

func ResolveChartVersion added in v0.27.0

func ResolveChartVersion(cfg *config.Config) (changed bool, err error)

ResolveChartVersion follows platform.chartBranch: it lists the chart repository's tags, picks the branch's newest dev build and writes it into cfg.Platform.ChartVersion, reporting whether that changed the config (the caller saves). A pinned lab (platform.chartPinned) keeps its recorded version; the stable channel (no chartBranch) is left alone. No build of the branch is a refusal with the two ways out: wait for the branch's publish, or pin a tag by hand.

func ServeFakeSlack added in v0.56.0

func ServeFakeSlack(ctx context.Context, addr string, emails []string) error

ServeFakeSlack serves the fake Slack Web API on addr until ctx ends: `agentlab slack-fake`, what the proof runs in a container on the kind network. emails are the people's `<slack user id>=<e-mail>` pairs users.info answers.

func ServeMockLLM added in v0.114.0

func ServeMockLLM(ctx context.Context, listen, mcpServer string, watch []string) error

ServeMockLLM serves the script for the MCP tools on mcpServer on listen until ctx ends, recording which of the watch names each request carries.

func ServeSkillHost added in v0.88.0

func ServeSkillHost(ctx context.Context, addr string) error

ServeSkillHost runs the fixture on addr until ctx ends: the repository is created on start, the required Authorization read from the environment.

func ServingTest added in v0.52.0

func ServingTest(cfg *config.Config, email string, opts ServingTestOptions) error

ServingTest runs the proof as the user.

func SetPlatform added in v0.72.0

func SetPlatform(cfg *config.Config)

SetPlatform registers the platform domain for the loopback dialer and the CA bundle for the lab's clients (labCertPool).

func SkillsTest added in v0.31.0

func SkillsTest(cfg *config.Config, email string, opts SkillsTestOptions) error

SkillsTest is the headless proof that a Go ADK AgentTemplate with a git skill pinned to a full commit boots under Substrate and uses the skill in a turn as the signed-in user; on a failed golden boot it prints the evidence. The template is written below the agent chart on purpose — a raw AgentTemplate, so a private fixture's credentialRef and the control boot stay possible; the same skill through agent-manager and the chart is agents-test's.

func SubstrateStepTest added in v0.94.0

func SubstrateStepTest(cfg *config.Config, email string, opts SubstrateStepOptions) error

SubstrateStepTest is `agentlab substrate-step-test`. The verdict is one PASS or FAIL line per step with its cause, under the summary of the stages; a failure returns the stage that failed.

func SubstrateTunnelTest added in v0.107.0

func SubstrateTunnelTest(cfg *config.Config, opts SubstrateTunnelOptions) error

SubstrateTunnelTest is `agentlab substrate-tunnel-test`. The verdict is one PASS line per check and a FAIL line with the cause, under the summary of the stages.

func SystemTrusted

func SystemTrusted() bool

SystemTrusted reports whether the lab CA on disk is in the system trust store — the probe behind the `up` hints and the TUI trust row. Never installs anything.

func TenantsTest added in v0.110.0

func TenantsTest(cfg *config.Config, emails []string, opts TenantsTestOptions) error

TenantsTest is the headless proof of agent-manager's tenant reconciler (giantswarm/agent-manager#71) and the chart's tenants.organizations.enabled (platform.tenants): two namespaces labelled giantswarm.io/organization, one person bound to agent-platform:editor in each, agent-manager's REST API called as each person with their Dex token, and the steps of giantswarm/agentlab#739 — only the always-kept objects before an agent; the other organization's create refused and the first agent's copies; the worker admitted and a turn on credentials read from the agent's own namespace; the same in the second organization; the workers held against a cluster-admin, the network policy copies and the credential provider's grants where the lab has them; the last delete removing the copies. In between, with both organizations' agents up, the edge (steps E, tenantstest_edge.go) and Slack (steps S, tenantstest_slack.go) halves of giantswarm/agentlab#166: the kagent controller's RBAC authorizer judging two tenant users bound by their token's group; then muster's MCP servers per tenant (steps M, tenantstest_muster.go) and the Dev Portal's routes as each person (steps P, tenantstest_portal.go). Leaves nothing behind.

func Test

func Test(cfg *config.Config) error

Test is the end-to-end RBAC proof: every configured user gets a real token from Dex and a set of `auth can-i` assertions (SelfSubjectAccessReviews as that user, token only) driven purely by the `groups` claim in the id_token.

func ToolsetsTest added in v0.19.0

func ToolsetsTest(cfg *config.Config, email string, opts ToolsetsTestOptions) error

ToolsetsTest is the headless end-to-end proof of declared toolsets against the released components in the lab. See the file comment for what it covers; it prints one PASS line per claim and leaves nothing behind.

func Trust

func Trust(cfg *config.Config) error

Trust installs the lab CA into the system trust store (one sudo prompt) and, when NSS tooling is available, into the Firefox/Chromium NSS profiles. Reversible: `agentlab untrust` removes exactly what this installed.

func Turn added in v0.40.0

func Turn(cfg *config.Config, email, template, harness, prompt, sessionID, decide, reason, eventsFile, shareWith string, shareTTL time.Duration, keep, suspend bool) error

Turn is `agentlab turn`: one conversation with an agent as a lab user, the way the surfaces drive it — the person's Dex id_token on the kagent controller's gRPC route through the edge. With no template it prints the roster the person sees (ListAgents as that person, or the gRPC status when the controller refuses). With a template and a prompt it creates a Session of the Agent that pairs the template with a Harness — the Agent named after the template, or with harness set the one pairing the template with that Harness — streams one turn, prints the answer and the terminal task state, and deletes the session — unless keep is set, which leaves the session for a later turn, or sessionID names one to continue — after suspending it to the snapshot store first when suspend is set, so the turn proves the restore. A turn that pauses for tool approval prints the request and stops, unless decide is "approve" or "reject": then every request is answered that way until the task settles.

func Untrust

func Untrust(cfg *config.Config) error

Untrust removes the lab CA — and any predecessor a re-mint stashed — from the system store and the NSS profiles. certs/ stays on disk, so a later `agentlab trust` reinstalls the same CA. (`agentlab down` never touches the trust stores; this is the only removal path.)

func Up

func Up(cfg *config.Config, offers Offers) error

Up brings up the whole lab: certs, kind cluster, Dex, RBAC, an end-to-end OIDC verification, and then the components the configuration enables — the agent platform (the default; it is what the lab tests) and Backstage.

func VMManagerTest added in v0.43.0

func VMManagerTest(cfg *config.Config, email string, opts VMManagerTestOptions) error

VMManagerTest is the headless proof of the vm-manager wiring: the platform's VM provisioner as a pod of the node, registered with muster by its chart, reached as the signed-in person.

The identity boundary first, against the pod's Service from inside the cluster (a probe pod, the way muster dials it): vm-manager without a token answers 401 — a vm-manager running anonymously (oauth off) would make every forwarded identity meaningless, and the proof fails on it — and with the person's Dex id_token it answers the capability report, validated against the lab Dex through the chart's global.identity wiring. Then through muster: the x_vm-manager_* tools are aggregated with their annotations intact (get_host read-only, delete_vm destructive), get_host, list_images and list_networks answer as the person, and the MCPServer CR carries the agent-platform tool group and reads Connected. Then, unless --skip-vm, the lifecycle through muster: create_vm on the newest image, the states followed with get_vm until ready (the installer boot, the installed boot, READY=1 over vsock), the attestation verdicts read when the image's policy has golden values, the console tailed, and delete_vm leaving nothing behind. A host that is not ready (get_host's `missing`) or has no image skips the lifecycle with the reason.

func WorkspaceAppCallback added in v0.113.0

func WorkspaceAppCallback(cfg *config.Config) string

WorkspaceAppCallback is the callback URL every instance's App or OAuth application registers: muster's proxy callback, where the person grants it (workspacemustergrant.go).

func WorkspacesMeasure added in v0.101.0

func WorkspacesMeasure(opts WorkspacesMeasureOptions) error

WorkspacesMeasure runs the measurement and writes its report.

func WorkspacesNode added in v0.88.0

func WorkspacesNode(cfg *config.Config) string

WorkspacesNode is the node the NFS server and the driver's controller run on: the control plane, whose disk holds the export. The node plugin runs on every node, so the actors' workers may be anywhere.

func WorkspacesTest added in v0.88.0

func WorkspacesTest(cfg *config.Config, opts WorkspacesTestOptions) error

WorkspacesTest is the headless workspaces proof: the storage in place -> a read-write-many claim of the class bound -> a bare mirror with an executable and a symbolic link seeded on it -> two pods on their own session sub-paths, each with a shared clone of the mirror, the modes and links intact, the mirrors mount refusing writes, nothing of the other session visible -> a read-only mount of the whole volume refusing writes -> the controller endpoint refused without Substrate's client certificate -> two actors through ate-api-server on the volume at their own session directories (workspacesactors.go) -> unless StorageOnly, a claude Session admitted on the volume with a workspace grant running one headless turn (workspacesharness.go) -> everything removed, the volume's directory gone from the export.

Types

type A2ATestOptions added in v0.37.0

type A2ATestOptions struct {
	// ReadyTimeout bounds the fixture agent's golden boot.
	ReadyTimeout time.Duration
}

A2ATestOptions are the flags of `agentlab a2a-test`.

type BackstageTestOptions added in v0.115.0

type BackstageTestOptions struct {
	// Agent is an existing agent as <namespace>/<name>: the run creates and
	// deletes no agent of its own and proves the roster and the chat on it.
	Agent string
}

BackstageTestOptions are the flags of `agentlab backstage-test`.

type BeekeeperCentralTestOptions added in v0.76.0

type BeekeeperCentralTestOptions struct {
	// Version is the beekeeper release whose image and CRDs run (default
	// BeekeeperCentralVersionDefault); Binary, a local static linux build,
	// takes precedence for serve and the two machines — the proof of a branch.
	Version string
	Binary  string
	// Port is beekeeper serve's in the node's network, Port+1 its
	// Postgres'. Default 18093.
	Port   int
	RunDir string
	// Chart, a beekeeper chart directory or oci:// reference (at Version),
	// runs serve in the lab cluster from the chart instead of on the host,
	// as an installation runs it (beekeepercentralchart.go); Binary then
	// runs the two machines only.
	Chart string
}

BeekeeperCentralTestOptions tunes the beekeeper central proof.

type BeekeeperDecisionsTestOptions added in v0.74.0

type BeekeeperDecisionsTestOptions struct {
	// Version is the beekeeper release whose image and CRDs run (default
	// BeekeeperDecisionsVersionDefault); Binary, a local linux build mounted
	// into that image, takes precedence — the proof of a branch.
	Version string
	Binary  string
	// LocalBeekeeper, a beekeeper build for the host, runs the person's own
	// machine for step 9: its standby watch and a background Claude Code
	// session as their guide (claude on PATH, on its smallest model).
	LocalBeekeeper string
	// GuideOnly runs the guide's conversation steps (6 to 9) without the
	// decisions (1 to 5).
	GuideOnly bool
	// The gateway: Port is its endpoints' in the node's network, Port+1
	// its admin endpoints, Port+3 beekeeper serve's, Port+4 its Postgres'.
	// Default the lab's own block, gatewayTestPort. GatewayBinary is not
	// used: the gateway runs in the
	// node's network, as a container.
	DecisionsTestOptions
}

BeekeeperDecisionsTestOptions tunes the beekeeper decisions proof.

type BeekeeperSubscriptionsTestOptions added in v0.121.0

type BeekeeperSubscriptionsTestOptions struct {
	// Version is the beekeeper release whose image and CRDs run (default
	// BeekeeperSubscriptionsVersionDefault); Binary, a local static linux
	// build, runs as serve instead.
	Version string
	Binary  string
	// Port is beekeeper serve's in the node's network, Port+1 its
	// Postgres'. Default 18095.
	Port   int
	RunDir string
}

BeekeeperSubscriptionsTestOptions tunes the beekeeper subscriptions proof.

type CodexHostModel added in v0.111.0

type CodexHostModel struct {
	// ID is the model's Ollama tag.
	ID string
	// GiB is what the model needs in memory, its weights and a turn's
	// context: the model-server budget a codex proof on it asks for.
	GiB int
}

CodexHostModel is a host model for a codex proof, with the memory it needs loaded.

type CodingTestOptions added in v0.97.0

type CodingTestOptions struct {
	// Email is the lab user the agents are created by and the turns sent
	// as; empty is the admin.
	Email string
	// ReadyTimeout bounds each agent's boot and each wait outside a turn.
	ReadyTimeout time.Duration
	// TurnTimeout bounds each turn; zero is the budget of the model the
	// agent runs on (hostModelTurnTimeout on a host model server's model,
	// hostedModelTurnTimeout otherwise).
	TurnTimeout time.Duration
	// Harness is the coding Harness the proof runs on, one of the runtimes
	// the lab renders (platform.coding.harnesses); empty is claude.
	Harness string
	// ModelConfig is the kagent ModelConfig the agent runs on; empty is
	// the in-cluster mockllm on codex (MockLLMModelConfig), else
	// agent-manager's default one.
	ModelConfig string
	// MockLLMBinary is the agentlab binary the mockllm's container runs;
	// empty is this one.
	MockLLMBinary string
	// MusterTools is the agent's tool selection on its muster binding
	// (the Generic chart's muster.tools), as a platform agent selects
	// muster's meta-tools; MusterMetaTools names all of them. Empty binds
	// muster without a selection.
	MusterTools []string
}

CodingTestOptions tunes the coding agents proof.

type DecisionsTestOptions added in v0.70.0

type DecisionsTestOptions struct {
	// GatewayImage is the klaus-gateway image run on the host's network
	// (default the release the lab's klaus-gateway component runs, as for
	// klaus-gateway-test; every release from 4.1.0 serves POST /decisions and
	// POST /conversations); GatewayBinary, a local build, takes precedence —
	// the proof of a branch.
	GatewayImage  string
	GatewayBinary string
	// Port is the host port of the gateway's endpoints; the admin endpoints
	// take Port+1, the fake Slack Web API Port+2. Default the lab's own block,
	// gatewayTestPort.
	Port int
	// RunDir holds the stores, the keys and the gateway's log; empty picks
	// a temporary directory removed at the end.
	RunDir string
}

DecisionsTestOptions tunes the decisions proof.

type Discovery added in v0.15.0

type Discovery struct {
	Tools        []ToolVersion
	AnthropicKey bool
	// KeySource is the reference agentlab.yaml records for the Anthropic key
	// (aiKey.source), "" when none; SecretTool the version of the tooling
	// that places it (secretTool, anthropic.go), "" when it is not on PATH or
	// does not answer — probed only while a source is recorded.
	KeySource  string
	SecretTool string
	// GitHubTokenSource is the reference recorded for the GitHub token
	// (githubToken.source), "" when none.
	GitHubTokenSource string
	// GitHubApp is the skills GitHub App recorded (githubApp, completed from
	// the workspaces App), zero when none.
	GitHubApp config.GitHubApp
	// WorkspacesGitHubApp: the workspaces GitHub App's id and private key
	// source are recorded, so its installation id alone makes it the skills
	// App.
	WorkspacesGitHubApp bool
	ClusterExists       bool
	ClusterPorts        map[int]bool
	KindGateway         string
	Servers             []HostServer
	FLM                 *FLMServer
	// KVMMissing names the KVM devices this machine lacks (vmmanager.go):
	// empty when the platform's VM provisioner can run as a pod of the node.
	KVMMissing []string
}

Discovery is what `agentlab configure` learns about this machine before it writes agentlab.yaml — on every run, not only the first, so the file follows the host: the one tool `agentlab up` shells out to (the container engine) next to what the binary embeds (kind with the node image it boots, Helm, the Kubernetes client), whether this configuration's kind cluster exists (and which host ports it publishes, so they never count as conflicts), the kind docker network's gateway (the address pods reach the host on), the model servers answering on their default ports with their downloaded models, a standalone FastFlowLM server (report-only), and where the Anthropic key comes from.

func Discover added in v0.15.0

func Discover(cfg *config.Config) *Discovery

Discover probes this machine. Nothing here needs the cluster; every probe is loopback or a local CLI and degrades to "not found".

func (*Discovery) Backends added in v0.15.0

func (d *Discovery) Backends() []string

Backends lists the backends the configuration should carry, in canonical order: the servers that answer AND that pods can reach.

A server pods cannot reach is no use to model-manager, which runs in one. Reachable means on the kind gateway OR on the runtime's host alias, so a runtime in a VM enrolls its servers like a native one.

Unknown reachability still enrolls: Probed is false while there is no node to probe from — a fresh machine, or after `agentlab down`, which leaves the kind network behind but no container to dial from — and a lab that has not booted yet must still be configurable. Only an explicit "no" is left out, and Report says so where it says the rest.

func (*Discovery) CodexHostModel added in v0.111.0

func (d *Discovery) CodexHostModel() (config.ExtraModel, bool)

CodexHostModel is the extraModels entry for the first of CodexHostModels the host's Ollama has downloaded and can call tools with: the OpenAI provider on Ollama's /v1 and its Responses API, keyless, reached by the name pods resolve the host to. ok is false when Ollama is not found, pods cannot reach it, or it has none of them.

func (*Discovery) KVMReady added in v0.44.0

func (d *Discovery) KVMReady() bool

KVMReady reports whether this machine has the KVM devices the platform's VM provisioner needs as a pod of the node — what platform.vmManager.enabled is refused without.

func (*Discovery) ModelServersHint added in v0.15.0

func (d *Discovery) ModelServersHint() string

ModelServersHint names the servers found for the configure form, and says which of them the answer cannot enrol. Listing a server the form is about to drop reads as a promise the configuration does not keep — the confirm says "Found: X" and X never reaches platform.modelManager.backends.

func (*Discovery) PodHostFor added in v0.42.4

func (d *Discovery) PodHostFor(backend string) string

PodHostFor is the host pods reach a backend's server on, "" when the discovery could not establish one.

func (*Discovery) Preflight added in v0.23.6

func (d *Discovery) Preflight() error

Preflight is the verdict on the tools, taken before `agentlab configure` asks its first question (or, with --defaults, writes anything): an error naming every tool `agentlab up` would fail on — not on PATH — with why and where to get it. So nobody walks through the whole form to be refused at boot time. The container engine is the one tool always asked for; the secret tooling only while agentlab.yaml records a key source; everything else the lab runs is in the binary.

func (*Discovery) Report added in v0.15.0

func (d *Discovery) Report(cfg *config.Config) string

Report is the human-readable account of the discovery, printed by `agentlab configure` before it changes anything. The tools line states what answered on PATH and what the binary carries; the verdict on the former is Preflight's.

type EgressTestOptions added in v0.110.0

type EgressTestOptions struct {
	// Email is the lab user the agent is created by and the turn sent as;
	// empty is the admin.
	Email string
	// ReadyTimeout bounds the agent's boot.
	ReadyTimeout time.Duration
	// ModelConfig is the kagent ModelConfig the agent runs on; empty is
	// agent-manager's default one.
	ModelConfig string
	// Origin is the origin the agent declares and the probe reaches; empty
	// is DefaultEgressOrigin.
	Origin string
	// WithoutEgress creates the agent without its egress entry: the control
	// run, whose declared stage must fail.
	WithoutEgress bool
}

EgressTestOptions tunes the egress proof.

type FLMServer added in v0.15.0

type FLMServer struct {
	Port   int
	Models int
}

FLMServer is a standalone `flm serve` (FastFlowLM's own OpenAI-compatible server). The lab does not wire it: it has no management API and lists its whole catalog rather than what is downloaded — Lemonade Server is the supported front for FLM.

type HostModel added in v0.15.0

type HostModel struct {
	ID string
	// Tools: the model supports tool calling — what agents need, since they
	// send tool schemas with every turn (a model without it fails each turn
	// with "does not support tools").
	Tools bool
	// Size on disk in bytes (Lemonade reports decimal GB; converted).
	Size int64
}

HostModel is one model a host model server has downloaded.

type HostServer added in v0.15.0

type HostServer struct {
	Backend string // config.ModelManagerBackend*
	// Ident is what the server says it is: its version where it reports one,
	// the API generation for LM Studio, which reports none anywhere.
	Ident string
	Port  int
	// Probed: the reachability question was put to a running node, so PodHost
	// is an answer. False while there was nothing to dial or no node to dial
	// from, and when the probe itself failed, which ReachErr then explains.
	Probed   bool
	ReachErr error
	// PodHost is the host part pods reach this server on: the kind network
	// gateway where that is this machine, else the container runtime's host
	// alias, which resolves only inside the cluster. Empty when Probed and
	// neither answers.
	PodHost   string
	Models    []HostModel
	ModelsErr error
}

HostServer is a model server found on this machine.

type KagentStepOptions added in v0.114.0

type KagentStepOptions struct {
	// To is the kagent release the lab steps to: an exact version of the
	// kagent line (1.14.0, 1.15.1-rc.2), pinned on the kagent and kagent-crds
	// components.
	To string
	// Chart is the agent-platform release the lab steps to (4.145.1-rc.6): a
	// candidate whose kagent range moves.
	Chart string
	// DevImages are platform.devImages entries for the step alone (a kagent
	// controller build of a change not yet in a release).
	DevImages map[string]string
	// ModelConfig is the kagent ModelConfig the agent runs on (default:
	// default-model-config).
	ModelConfig string
	// ReadyTimeout bounds the agent's golden boot before the step.
	ReadyTimeout time.Duration
	// Stay leaves the lab on the step instead of returning it to its own
	// configuration.
	Stay bool
}

KagentStepOptions tunes the proof. To, Chart or both name the step.

type KlausGatewayTestOptions added in v0.39.0

type KlausGatewayTestOptions struct {
	// GatewayImage is the klaus-gateway image run on the host's network
	// (default the release the lab's meta chart runs as its klaus-gateway
	// component, componentGatewayImage); GatewayBinary, a local build, takes
	// precedence — the proof of a branch.
	GatewayImage  string
	GatewayBinary string
	// Port is the host port of the gateway's Slack endpoints; the admin
	// endpoints take Port+1, the fake Slack Web API Port+2 when it runs in
	// this process. Default the lab's own block, gatewayTestPort.
	Port int
	// SlackFakeBinary is the static Linux agentlab the fake Slack Web API
	// container runs when the component's pods call it (default: this
	// binary).
	SlackFakeBinary string
	// ModelConfig is the kagent ModelConfig the fixture runs on (default
	// default-model-config, the Anthropic one the lab renders).
	ModelConfig string
	// Harness is the Harness the fixture's Agent references and whose Ready
	// the golden-boot wait reads (default the platform Harness).
	Harness string
	// ReadyTimeout bounds the fixture's golden boot (default 10 min).
	ReadyTimeout time.Duration
	// RunDir holds the stores, the keys and the gateway's log; empty picks
	// a temporary directory removed at the end.
	RunDir string
}

KlausGatewayTestOptions tunes the proof.

type ListedLab added in v0.62.0

type ListedLab struct {
	Name string `json:"name"`
	Dir  string `json:"dir"`
	// Current marks the lab of the current directory.
	Current bool `json:"current"`
	// State is the kind cluster's: running, exited (a node container a `down`
	// that lost its race with docker left behind, node.go), paused, not
	// created, or unknown while docker does not answer.
	State string `json:"state"`
	// Components are the enabled parts of the lab, the platform with the
	// chart it installs.
	Components []string `json:"components"`
	// URLs are the lab's entry points by name: portal, muster.
	URLs map[string]string `json:"urls,omitempty"`
	// CA is trusted, untrusted, or none (no lab CA minted yet).
	CA string `json:"ca"`
	// Error is set when the lab's agentlab.yaml cannot be read; the other
	// fields past Dir are empty then.
	Error string `json:"error,omitempty"`
	// Unregistered marks a kind cluster no registered lab names: its lab
	// directory is unknown (Dir empty), so only its State is known.
	Unregistered bool `json:"unregistered,omitempty"`
}

ListedLab is one lab as `agentlab list` shows it, and its -o json shape.

func ListLabs added in v0.62.0

func ListLabs(registered []labs.Lab, here string) []ListedLab

ListLabs describes every registered lab and every kind cluster no registered lab names (Unregistered: a lab whose registry entry or directory is gone still holds its cluster, ports and memory), sorted by name; here is the current directory (absolute), whose lab is marked. Nothing here needs a cluster to answer.

type ModelsTestOptions added in v0.68.0

type ModelsTestOptions struct {
	// Backend is the backend to prove (default: the first of the list).
	Backend string
	// Model is the model to pull (default: the backend's proof model).
	Model string
}

ModelsTestOptions are models-test's flags.

type ObservabilityStatus added in v0.111.0

type ObservabilityStatus struct {
	// Configured is platform.observability.
	Configured bool `json:"configured"`
	// Namespace reports the observability namespace (kps and its pods);
	// MCPPrometheus the mcp-prometheus HelmRelease.
	Namespace     bool `json:"namespace"`
	MCPPrometheus bool `json:"mcpPrometheus"`
}

ObservabilityStatus is the observability stack in place against platform.observability: what `agentlab status` reports.

func (ObservabilityStatus) String added in v0.111.0

func (s ObservabilityStatus) String() string

type Offers added in v0.32.0

type Offers struct {
	Trust *bool
	Open  *bool
}

Offers pre-answer the questions `up` and `platform` end with (the --trust and --open flags): nil asks on a terminal and stays silent off one, a value is the answer wherever the command runs.

type Overlay added in v0.113.0

type Overlay struct {
	// File is the entry as agentlab.yaml lists it.
	File string `json:"file"`
	// Sets are the values the file sets, one `<dotted key>=<value>` each in
	// key order: a component's version, versionRange, semverFilter or
	// repository among them.
	Sets []string `json:"sets,omitempty"`
	// Error is why the file could not be read; "" when it was.
	Error string `json:"error,omitempty"`
	// Installed reports that the release in place was installed with it.
	Installed bool `json:"installed"`
}

Overlay is one platform.valuesFiles entry as `agentlab status` reports it.

type PolexTestOptions added in v0.120.0

type PolexTestOptions struct {
	// ChartVersion is an exact agent-platform release to render instead of
	// the chart agentlab.yaml installs (platform.chartVersion, chartPath,
	// chartBranch); the lab's values stay the same.
	ChartVersion string
}

PolexTestOptions picks the chart the PolicyException proof renders.

type ServingTestOptions added in v0.52.0

type ServingTestOptions struct {
	// Preset is the published preset to serve (default: the lab's).
	Preset string
	// SkipChat skips the agent turn on the wired ModelConfig.
	SkipChat bool
	// ReadyTimeout bounds the serve (download and start).
	ReadyTimeout time.Duration
}

ServingTestOptions are the proof's knobs.

type SkillsFixture added in v0.33.0

type SkillsFixture struct {
	Repo, Commit, Skill, Question, Expect string
	// CredentialSecret names the Secret (key skillsCredentialKey); "" fetches
	// anonymously. The proof never reads the Secret.
	CredentialSecret string
}

SkillsFixture is the skill the proof boots and asks about: a git repository at a full commit, the skill's directory within it (its last element is the skill's name), the question the turn asks and the answer only the skill's text has — and, for a private repository, the Secret in the kagent namespace whose token key the runtime presents to the repository's host (skills[].source.git.credentialRef). The zero value is the public fixture.

type SkillsTestOptions added in v0.31.0

type SkillsTestOptions struct {
	// ModelConfig is the kagent ModelConfig the throwaway agent runs on
	// (default: default-model-config, the Anthropic one the lab renders).
	ModelConfig string
	// ReadyTimeout bounds the golden boot (default SkillsTestReadyTimeout).
	ReadyTimeout time.Duration
	// Fixture is the skill to boot and ask about; the zero value is the
	// public fixture, a private repository's names its Secret.
	Fixture SkillsFixture
	// SkillHost boots the skill from the lab's own private git host instead
	// (skillhost.go): a Secret the proof creates, a record of what the
	// golden boot and the Session's sandbox sent. Excludes Fixture.
	SkillHost bool
	// SkillHostBinary is the static Linux agentlab the fixture's container
	// runs (default: this binary).
	SkillHostBinary string
}

SkillsTestOptions tunes the proof.

type Status added in v0.83.0

type Status struct {
	Name string `json:"name"`
	Dir  string `json:"dir"`
	// Chart is the chart in place; nil when the cluster holds no platform
	// release.
	Chart *installedChart `json:"chart,omitempty"`
	// Configured is the chart agentlab.yaml installs, in the install's own
	// words; "" when the platform is disabled.
	Configured string `json:"configured,omitempty"`
	// Replaces reports that `agentlab platform` would replace the chart in
	// place: the configured chart is not it.
	Replaces bool `json:"replaces"`
	// Drift words that disagreement (chartDrift): both charts, which side is
	// behind and the ways to end it; "" when the two agree.
	Drift string `json:"drift,omitempty"`
	// Releases are the platform HelmReleases with their Ready condition; none
	// without a platform release.
	Releases []platformReleaseStatus `json:"releases,omitempty"`
	// AppConfigDrift names Backstage's app-config ConfigMaps whose data is not
	// what the lab or the chart rendered (appconfig.go); none in sync.
	AppConfigDrift []string `json:"appConfigDrift,omitempty"`
	// ForeignFields are the platform workloads' fields written outside the
	// platform's Helm releases (foreignfields.go); none as rendered.
	ForeignFields []foreignFields `json:"foreignFields,omitempty"`
	// Workspaces is the workspace storage in place (workspaces.go); nil
	// without a platform release.
	Workspaces *WorkspacesStatus `json:"workspaces,omitempty"`
	// Observability is the observability stack in place against
	// platform.observability (observability.go).
	Observability *ObservabilityStatus `json:"observability,omitempty"`
	// Registry is the lab registry container's docker state (devimages.go),
	// "missing" when there is none; "" when the platform is disabled.
	Registry string `json:"registry,omitempty"`
	// Overlays are agentlab.yaml's platform.valuesFiles with what each sets
	// (overlays.go); none without.
	Overlays []Overlay `json:"overlays,omitempty"`
	// StaleOverlays are the overlays the release in place was installed with
	// that agentlab.yaml no longer lists.
	StaleOverlays []string `json:"staleOverlays,omitempty"`
}

Status is the lab's live state as `agentlab status` reports it, and its -o json shape: the chart the cluster runs against the one agentlab.yaml installs, and the platform's HelmReleases.

func LabStatus added in v0.83.0

func LabStatus(cfg *config.Config, dir string) (*Status, error)

LabStatus reads the lab's live state. A lab that is not running is refused with the fact, like `pods`.

type SubstrateStepOptions added in v0.94.0

type SubstrateStepOptions struct {
	// To is the Substrate release the lab steps to: an exact version of the
	// Substrate line (1.8.0, 1.8.1-rc.4).
	To string
	// DevImages are platform.devImages entries for the step alone (the
	// ate-api-server build of a change not yet in a release); the lab before
	// the step runs the chart's images.
	DevImages map[string]string
	// ModelConfig is the kagent ModelConfig the agent runs on (default:
	// default-model-config).
	ModelConfig string
	// ReadyTimeout bounds the golden boot before the step, RetakeTimeout the
	// goldens' re-take after it on a layout change.
	ReadyTimeout, RetakeTimeout time.Duration
	// Stay leaves the lab on To instead of returning it to the chart's
	// Substrate.
	Stay bool
	// NoDrain skips the drain case: the step without its workers deleted
	// under the golden re-take and the resume.
	NoDrain bool
}

SubstrateStepOptions tunes the proof.

type SubstrateTunnelOptions added in v0.107.0

type SubstrateTunnelOptions struct {
	// Substrate pins the substrate components to an exact release for the
	// run (1.11.3, 1.11.4-rc.1); empty runs on the lab's Substrate.
	Substrate string
	// ClientTimeout is the gRPC-shaped call's client timeout, Promptly how
	// soon it must fail.
	ClientTimeout, Promptly time.Duration
	// ReadyTimeout bounds the golden boot, the resume and the route.
	ReadyTimeout time.Duration
	// Stay leaves the lab on Substrate instead of returning it to the
	// chart's.
	Stay bool
}

SubstrateTunnelOptions tunes the proof.

type TenantsTestOptions added in v0.116.0

type TenantsTestOptions struct {
	GatewayImage, GatewayBinary string
}

TenantsTestOptions tunes tenants-test's Slack half: the klaus-gateway it runs on the host (klaus-gateway-test's GatewayImage and GatewayBinary).

type ToolVersion added in v0.15.0

type ToolVersion struct {
	Name     string
	Version  string
	Embedded bool
}

ToolVersion is one entry of the report's tools line: the container engine the lab shells out to (Version empty when it is not on PATH or does not answer), or one of the libraries the binary carries — Embedded — whose Version is the one built in (kind's names its node image too).

type ToolsetsTestOptions added in v0.19.0

type ToolsetsTestOptions struct {
	// ModelConfig is the kagent ModelConfig the throwaway agents run on
	// (default: default-model-config, the Anthropic one the lab renders).
	ModelConfig string
	// SkipChat skips the turns that need the model to answer (the runtime
	// path and the chat-only agent); the objects, muster's resolution and
	// the sign-in claim are proven regardless.
	SkipChat bool
	// SkipPortal skips the portal's create path (agent-manager's create_agent
	// through the portal's muster backend as the person); the Tools step's
	// endpoints are proven regardless.
	SkipPortal bool
}

ToolsetsTestOptions tunes the proof.

type VMManagerTestOptions added in v0.43.0

type VMManagerTestOptions struct {
	// SkipVM skips the VM lifecycle: the registration, the identity boundary
	// and the read tools are proven, no VM boots.
	SkipVM bool
	// VMTimeout bounds the boot of the proof's VM (installer boot plus the
	// installed boot to READY=1; about 30 s on a laptop).
	VMTimeout time.Duration
}

VMManagerTestOptions tunes the vm-manager proof.

type WorkspacesMeasureOptions added in v0.101.0

type WorkspacesMeasureOptions struct {
	// Runs is how many times each figure is measured; zero is
	// DefaultWorkspacesMeasureRuns.
	Runs int
	// ReadyTimeout bounds each wait: a cycle, a Session, a probe pod.
	ReadyTimeout time.Duration
	// GoProxy is the module proxy the build's download goes through; "" is
	// the git image's (Go's default, proxy.golang.org).
	GoProxy string
	// RunDir is where the report is written; "" is a directory of its own
	// under the state directory.
	RunDir string

	// The cluster with the platform: the context of the person's
	// kubeconfig and the muster URL, the Organization, the provider
	// instance and the repositories of the two workspaces.
	KubeContext  string
	MusterURL    string
	Organization string
	Provider     string
	SmallRepos   []string
	LargeRepo    string
	// AgentgatewayURL and Agent (namespace/name, an Agent whose Sessions may
	// reach the provider) measure the Sessions there; without them the
	// Session figures are not available.
	AgentgatewayURL string
	Agent           string
	// GitURL is the provider's git base URL the pushes go to,
	// <GitURL>/<owner>/<name>.git; "" is https://github.com.
	GitURL string
}

WorkspacesMeasureOptions tune the measurement.

type WorkspacesStatus added in v0.88.0

type WorkspacesStatus struct {
	// NFSServer, Controller and NodePlugin are the workloads' rollout states
	// in a word: Ready, or what is not. The controller carries the mTLS
	// proxy.
	NFSServer  string `json:"nfsServer"`
	Controller string `json:"controller"`
	NodePlugin string `json:"nodePlugin"`
	// Node is the node the server and the controller run on.
	Node string `json:"node,omitempty"`
	// StorageClass reports whether the class exists.
	StorageClass bool `json:"storageClass"`
	// Driver is the name the class provisions the volumes with: the lab's
	// NFS driver as itself, or as the CSI companion's preset driver.
	Driver string `json:"driver,omitempty"`
	// Companion is the chart's CSI companion in a word when it runs
	// (platform.workspaces.csiCompanion): Ready, or what is not.
	Companion string `json:"companion,omitempty"`
	// Proxy reports whether the live controller runs its mTLS proxy, which
	// the lab renders with the workspaces (they come with Agent Substrate).
	Proxy bool `json:"proxy"`
	// CSIDriverConfig says who registered the driver with Substrate: "the
	// lab", "the chart", "hand", or "" when nothing did.
	CSIDriverConfig string `json:"csiDriverConfig,omitempty"`
	// NoSubstrate reports that Agent Substrate's control plane is not on the
	// cluster (substrateControlPlaneOn): a CSIDriverConfig then registers nothing.
	NoSubstrate bool `json:"noSubstrate,omitempty"`
	// SessionAdmission words the rig a Session on a workspace volume is
	// admitted with (workspacegrant.go): kagent's jwt admission, the
	// manager's grant key and the claude Harness.
	SessionAdmission string `json:"sessionAdmission,omitempty"`
}

WorkspacesStatus is the workspace storage as `agentlab status` reports it.

func (*WorkspacesStatus) String added in v0.88.0

func (s *WorkspacesStatus) String() string

String words the status in one line, for `agentlab status` and `list`.

type WorkspacesTestOptions added in v0.88.0

type WorkspacesTestOptions struct {
	// StorageOnly proves the storage alone, without the harness stage: no
	// claude Session admitted on the volume (workspacesharness.go).
	StorageOnly bool
	// ReadyTimeout bounds each wait: the storage's rollouts, a claim bound,
	// a pod finished, a volume gone, a sync cycle.
	ReadyTimeout time.Duration
	// Part runs one part instead of the storage proof: WorkspacesPartGitLab
	// (workspacesgitlab.go). "" is the storage proof.
	Part string
	// Email is the GitLab part's second user beside the admin, a member of
	// the lab's Organization (default dev@lab.local).
	Email string
}

WorkspacesTestOptions tunes the workspaces proof.

Source Files

Jump to

Keyboard shortcuts

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