harness

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package harness is part of the GoFastr harness.

See docs/harness-architecture.md for the architecture this package implements.

Package harness is the top-level composition of the GoFastr harness. The Harness struct wires the subsystems New() actually constructs today: the control multiplexer + resource catalog, the context reader, the skill registry, the built-in tool registry + permission engine, the credstore + in-process credential helper, the OpenRouter + ZAI providers, the SQLite session store, the file-based memory store, and the hook runner. See docs/harness-architecture.md for the full design (much of it not-yet-built) and § Lifecycle / boot for what is and is not wired.

What New() does NOT do (owned by the CLI subcommand or a later phase): it runs no TOFU ack gate on context or skill files, their SHA-256 hashes are computed and stored but never compared against an approval store; it does not spawn MCP servers (the mcpclient package exists but is not wired into New); and it does not start the control plane transports or the bundled TUI/web clients, which the `gofastr harness` subcommand owns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Profile is the loaded profile (framework.toml or default.toml).
	Profile *profile.Profile

	// WorkingDir is the repo root (used for AGENTS.md walk-upward).
	WorkingDir string

	// XDGConfig and XDGState are the base config + state directories
	// (`~/.config/gofastr/harness/` and `~/.local/share/gofastr/harness/`).
	XDGConfig string
	XDGState  string

	// SkillSearchPaths overrides the default paths
	// (built-in + user-global + project-local).
	SkillSearchPaths []string

	// Logger is the operational logger.
	Logger *logging.Logger

	// AllowProjectHooks gates project-local hooks (§ TOFU rule 13).
	AllowProjectHooks bool

	// CredstorePass is the passphrase used to derive the credstore key.
	// In CI, prefer GOFASTR_HARNESS_MACHINE_KEY env var instead.
	CredstorePass string

	// MachineKey overrides passphrase-derived key (CI path).
	MachineKey []byte
}

Config is the input to New.

type Harness

type Harness struct {
	Config Config
	Logger *logging.Logger

	Providers []provider.Provider
	Tools     *tool.Registry
	Skills    *skill.Registry
	Memory    *memory.Store
	Hooks     *hook.Runner
	Sessions  session.Store
	Creds     credstore.Store
	Helper    helper.Helper
	Perms     *permission.Engine
	Context   *xcontext.Reader

	Mux     *multiplex.Mux
	Catalog *resources.Catalog
	// contains filtered or unexported fields
}

Harness is the composed v0.1 system.

func New

func New(cfg Config) (*Harness, error)

New runs the boot sequence and returns a Harness ready to drive sessions.

func (*Harness) CreateSession

func (h *Harness) CreateSession(prov provider.Provider, model string) ids.SessionID

CreateSession wires a fresh EngineRun bound to the given provider. Returns the SessionID for the caller to attach clients to.

func (*Harness) Shutdown

func (h *Harness) Shutdown() error

Shutdown releases resources held by the Harness. It tears down every per-session run created by CreateSession (cancelling the persistLoop context, closing the engine bus so subscriptions drain, and unregistering the engine from the mux + catalog) before closing the session store.

Directories

Path Synopsis
client
tui
Package tui is part of the GoFastr harness.
Package tui is part of the GoFastr harness.
web
Package web is part of the GoFastr harness.
Package web is part of the GoFastr harness.
Package context is part of the GoFastr harness.
Package context is part of the GoFastr harness.
Package control is part of the GoFastr harness.
Package control is part of the GoFastr harness.
auth
Package auth implements the capability-token model: claim set, internal JWT-like encoding (no third-party dep), revocation list, and the issuance flow with TTY/notification confirmation.
Package auth implements the capability-token model: claim set, internal JWT-like encoding (no third-party dep), revocation list, and the issuance flow with TTY/notification confirmation.
inproc
Package inproc is part of the GoFastr harness.
Package inproc is part of the GoFastr harness.
mcpserver
Package mcpserver will expose the harness engine as an MCP server.
Package mcpserver will expose the harness engine as an MCP server.
multiplex
Package multiplex is part of the GoFastr harness.
Package multiplex is part of the GoFastr harness.
resources
Package resources is part of the GoFastr harness.
Package resources is part of the GoFastr harness.
rest
Package rest is part of the GoFastr harness.
Package rest is part of the GoFastr harness.
ws
Package ws will implement the WebSocket transport for the control plane.
Package ws will implement the WebSocket transport for the control plane.
Package engine is part of the GoFastr harness.
Package engine is part of the GoFastr harness.
Package hook is part of the GoFastr harness.
Package hook is part of the GoFastr harness.
Package ids is part of the GoFastr harness.
Package ids is part of the GoFastr harness.
internal
clock
Package clock provides a swap-able clock for tests.
Package clock provides a swap-able clock for tests.
ulid
Package ulid is part of the GoFastr harness.
Package ulid is part of the GoFastr harness.
Package logging is part of the GoFastr harness.
Package logging is part of the GoFastr harness.
Package mcpclient implements the MCP client (consumer side) the harness uses to talk to external MCP servers.
Package mcpclient implements the MCP client (consumer side) the harness uses to talk to external MCP servers.
Package memory is part of the GoFastr harness.
Package memory is part of the GoFastr harness.
Package profile is part of the GoFastr harness.
Package profile is part of the GoFastr harness.
Package provider is part of the GoFastr harness.
Package provider is part of the GoFastr harness.
credstore
Package credstore implements credential storage.
Package credstore implements credential storage.
helper
Package helper is part of the GoFastr harness.
Package helper is part of the GoFastr harness.
internal/openai
Package openai is an internal OpenAI-compatible adapter used by the OpenRouter and ZAI providers (both speak the same wire shape).
Package openai is an internal OpenAI-compatible adapter used by the OpenRouter and ZAI providers (both speak the same wire shape).
openrouter
Package openrouter is part of the GoFastr harness.
Package openrouter is part of the GoFastr harness.
zai
Package zai is part of the GoFastr harness.
Package zai is part of the GoFastr harness.
Package secrets locates and loads the repo-local .harness-secrets/env file.
Package secrets locates and loads the repo-local .harness-secrets/env file.
Package session is part of the GoFastr harness.
Package session is part of the GoFastr harness.
sqlite
Package sqlite is part of the GoFastr harness.
Package sqlite is part of the GoFastr harness.
Package skill is part of the GoFastr harness.
Package skill is part of the GoFastr harness.
skillmd
Package skillmd is part of the GoFastr harness.
Package skillmd is part of the GoFastr harness.
Package slash is part of the GoFastr harness.
Package slash is part of the GoFastr harness.
Package tool is part of the GoFastr harness.
Package tool is part of the GoFastr harness.
builtins
Package builtins is part of the GoFastr harness.
Package builtins is part of the GoFastr harness.
permission
Package permission is part of the GoFastr harness.
Package permission is part of the GoFastr harness.
Package tracing is part of the GoFastr harness.
Package tracing is part of the GoFastr harness.

Jump to

Keyboard shortcuts

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