probe

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package probe works out what this machine can offer the dispatcher (supervise.md §factory-agent probe): a HarnessOffer per configured harness, the configured labels, and the base tooling the host itself needs. It never calls the dispatcher.

The harnesses run in the VM, so a harness is offered by its Prober (supervise and probe use the login prober: the owner's model login is in the state dir); Configured reports what the local config says.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseTools

func BaseTools() []string

BaseTools are the programs the host needs (supervise.md §factory-agent probe): git, which fetches the skills for the run bundles.

Types

type BaseTooling

type BaseTooling struct{ Commands Commands }

BaseTooling checks BaseTools on PATH.

func (BaseTooling) Check

func (b BaseTooling) Check(context.Context) []Tool

Check implements Tooling.

type Commands

type Commands interface {
	LookPath(name string) (string, error)
}

Commands finds programs for BaseTooling; tests fake it.

type Configured

type Configured struct{ Name string }

Configured is the default Prober: the offer is the local config's models, efforts and default, with the harness's subscription login assumed (the PoC runs both harnesses on their owners' subscriptions, 10-poc.md). The adapters replace it with real detection.

func (Configured) Probe

Probe implements Prober.

type Dropped

type Dropped struct {
	Kind   string `json:"kind"` // harness
	Name   string `json:"name"`
	Reason string `json:"reason"`
}

Dropped is a configured harness that isn't advertised, and why.

type ExecCommands

type ExecCommands struct{}

ExecCommands finds real programs.

func (ExecCommands) LookPath

func (ExecCommands) LookPath(name string) (string, error)

LookPath is exec.LookPath.

type Options

type Options struct {
	// Harnesses maps a harness name to its Prober; a configured harness without one is
	// probed with Configured.
	Harnesses map[string]Prober
	// Tooling checks the base tooling; nil skips the check.
	Tooling Tooling
}

Options say how to probe. Nil maps and a nil Tooling use the defaults.

type Prober

type Prober interface {
	Probe(ctx context.Context, cfg config.Harness) (v1alpha1.HarnessOffer, error)
}

Prober probes one harness: harness-adapters.md's Adapter.Probe.

type Report

type Report struct {
	Capabilities v1alpha1.AgentCapabilities `json:"capabilities"`
	Dropped      []Dropped                  `json:"dropped,omitempty"`
	Tooling      []Tool                     `json:"tooling,omitempty"`
}

Report is what a probe found.

func Run

func Run(ctx context.Context, cfg *config.Config, o Options) Report

Run probes every configured harness and the base tooling. Harnesses are offered in name order; labels are advertised as configured, in their order.

func (Report) Ready

func (r Report) Ready() (bool, []string)

Ready reports whether the worker may start: at least one harness offered and every base tool present; otherwise the reasons.

type Tool

type Tool struct {
	Name    string `json:"name"`
	OK      bool   `json:"ok"`
	Problem string `json:"problem,omitempty"`
}

Tool is one base-tooling requirement and whether it is met.

type Tooling

type Tooling interface {
	Check(ctx context.Context) []Tool
}

Tooling checks the base tooling the worker refuses to start without.

Jump to

Keyboard shortcuts

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