checks

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package checks provides diagnostic check implementations for the doctor command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A2ACheck

type A2ACheck struct{}

A2ACheck validates A2A protocol configuration.

func (*A2ACheck) Fix

func (c *A2ACheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*A2ACheck) Name

func (c *A2ACheck) Name() string

Name returns the check name.

func (*A2ACheck) Run

func (c *A2ACheck) Run(_ context.Context, cfg *config.Config) Result

Run checks A2A configuration validity.

type APIKeySecurityCheck

type APIKeySecurityCheck struct{}

APIKeySecurityCheck validates that API keys use environment variable references rather than plaintext values.

func (*APIKeySecurityCheck) Fix

Fix suggests using environment variables.

func (*APIKeySecurityCheck) Name

func (c *APIKeySecurityCheck) Name() string

Name returns the check name.

func (*APIKeySecurityCheck) Run

Run checks if any provider API keys are stored as plaintext.

type AgentRegistryCheck added in v0.4.0

type AgentRegistryCheck struct{}

AgentRegistryCheck validates agent registry configuration.

func (*AgentRegistryCheck) Fix added in v0.4.0

Fix delegates to Run as automatic fixing is not supported.

func (*AgentRegistryCheck) Name added in v0.4.0

func (c *AgentRegistryCheck) Name() string

Name returns the check name.

func (*AgentRegistryCheck) Run added in v0.4.0

Run checks agent registry configuration and agents directory.

type ApprovalCheck added in v0.4.0

type ApprovalCheck struct{}

ApprovalCheck validates the approval system configuration.

func (*ApprovalCheck) Fix added in v0.4.0

func (c *ApprovalCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*ApprovalCheck) Name added in v0.4.0

func (c *ApprovalCheck) Name() string

Name returns the check name.

func (*ApprovalCheck) Run added in v0.4.0

func (c *ApprovalCheck) Run(_ context.Context, cfg *config.Config) Result

Run checks approval system configuration.

type BootstrapAwareCheck added in v0.7.0

type BootstrapAwareCheck interface {
	Check
	RunWithBootstrap(ctx context.Context, cfg *config.Config, boot *bootstrap.Result) Result
}

BootstrapAwareCheck can use the already-open bootstrap result when available.

type ChannelCheck

type ChannelCheck struct{}

ChannelCheck validates channel token configurations.

func (*ChannelCheck) Fix

func (c *ChannelCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix cannot auto-fix channel tokens - requires user input.

func (*ChannelCheck) Name

func (c *ChannelCheck) Name() string

Name returns the check name.

func (*ChannelCheck) Run

func (c *ChannelCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if enabled channels have valid tokens configured.

type Check

type Check interface {
	// Name returns the human-readable name of the check.
	Name() string
	// Run executes the check and returns the result.
	Run(ctx context.Context, cfg *config.Config) Result
	// Fix attempts to repair the issue if possible.
	// Returns an updated result after the fix attempt.
	Fix(ctx context.Context, cfg *config.Config) Result
}

Check is the interface that all diagnostic checks must implement.

func AllChecks

func AllChecks() []Check

AllChecks returns all available diagnostic checks.

type CompanionConnectionCheck

type CompanionConnectionCheck struct{}

CompanionConnectionCheck checks if the Gateway is running and if companions are connected.

func (*CompanionConnectionCheck) Fix

func (*CompanionConnectionCheck) Name

func (c *CompanionConnectionCheck) Name() string

func (*CompanionConnectionCheck) Run

type ConfigCheck

type ConfigCheck struct{}

ConfigCheck validates the encrypted configuration profile.

func (*ConfigCheck) Fix

func (c *ConfigCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix guides the user to run 'lango onboard' for profile setup.

func (*ConfigCheck) Name

func (c *ConfigCheck) Name() string

Name returns the check name.

func (*ConfigCheck) Run

func (c *ConfigCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if an encrypted configuration profile exists and is valid.

type ContextHealthCheck added in v0.7.0

type ContextHealthCheck struct{}

ContextHealthCheck validates the overall context engineering configuration.

func (*ContextHealthCheck) Fix added in v0.7.0

Fix delegates to Run as automatic fixing is not supported.

func (*ContextHealthCheck) Name added in v0.7.0

func (c *ContextHealthCheck) Name() string

Name returns the check name.

func (*ContextHealthCheck) Run added in v0.7.0

Run checks context subsystem configuration and consistency.

type ContractCheck added in v0.5.0

type ContractCheck struct{}

ContractCheck validates smart contract configuration.

func (*ContractCheck) Fix added in v0.5.0

func (c *ContractCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*ContractCheck) Name added in v0.5.0

func (c *ContractCheck) Name() string

Name returns the check name.

func (*ContractCheck) Run added in v0.5.0

func (c *ContractCheck) Run(_ context.Context, cfg *config.Config) Result

Run checks contract configuration validity.

type DatabaseCheck

type DatabaseCheck struct{}

DatabaseCheck validates the session database accessibility.

func (*DatabaseCheck) Fix

func (c *DatabaseCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix creates the database directory if missing.

func (*DatabaseCheck) Name

func (c *DatabaseCheck) Name() string

Name returns the check name.

func (*DatabaseCheck) Run

func (c *DatabaseCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if the session database is accessible.

type EconomyCheck added in v0.5.0

type EconomyCheck struct{}

EconomyCheck validates economy layer configuration.

func (*EconomyCheck) Fix added in v0.5.0

func (c *EconomyCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*EconomyCheck) Name added in v0.5.0

func (c *EconomyCheck) Name() string

Name returns the check name.

func (*EconomyCheck) Run added in v0.5.0

func (c *EconomyCheck) Run(_ context.Context, cfg *config.Config) Result

Run checks economy configuration validity.

type EmbeddingCheck

type EmbeddingCheck struct{}

EmbeddingCheck validates embedding/RAG configuration.

func (*EmbeddingCheck) Fix

func (c *EmbeddingCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*EmbeddingCheck) Name

func (c *EmbeddingCheck) Name() string

Name returns the check name.

func (*EmbeddingCheck) Run

Run checks embedding configuration validity.

type GraphStoreCheck

type GraphStoreCheck struct{}

GraphStoreCheck validates graph store configuration.

func (*GraphStoreCheck) Fix

func (c *GraphStoreCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*GraphStoreCheck) Name

func (c *GraphStoreCheck) Name() string

Name returns the check name.

func (*GraphStoreCheck) Run

Run checks graph store configuration validity.

type LibrarianCheck added in v0.4.0

type LibrarianCheck struct{}

LibrarianCheck validates the proactive librarian configuration.

func (*LibrarianCheck) Fix added in v0.4.0

func (c *LibrarianCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*LibrarianCheck) Name added in v0.4.0

func (c *LibrarianCheck) Name() string

Name returns the check name.

func (*LibrarianCheck) Run added in v0.4.0

Run checks librarian configuration.

type MultiAgentCheck

type MultiAgentCheck struct{}

MultiAgentCheck validates multi-agent orchestration configuration.

func (*MultiAgentCheck) Fix

func (c *MultiAgentCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*MultiAgentCheck) Name

func (c *MultiAgentCheck) Name() string

Name returns the check name.

func (*MultiAgentCheck) Run

Run checks multi-agent configuration validity.

func (*MultiAgentCheck) RunWithBootstrap added in v0.7.0

func (c *MultiAgentCheck) RunWithBootstrap(
	ctx context.Context,
	cfg *config.Config,
	boot *bootstrap.Result,
) Result

RunWithBootstrap adds runtime diagnostics on top of static config validation.

type NetworkCheck

type NetworkCheck struct{}

NetworkCheck validates network-related configuration.

func (*NetworkCheck) Fix

func (c *NetworkCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix cannot auto-fix port conflicts.

func (*NetworkCheck) Name

func (c *NetworkCheck) Name() string

Name returns the check name.

func (*NetworkCheck) Run

func (c *NetworkCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if the configured server port is available.

type ObservabilityCheck added in v0.5.0

type ObservabilityCheck struct{}

ObservabilityCheck validates observability configuration.

func (*ObservabilityCheck) Fix added in v0.5.0

Fix delegates to Run as automatic fixing is not supported.

func (*ObservabilityCheck) Name added in v0.5.0

func (c *ObservabilityCheck) Name() string

Name returns the check name.

func (*ObservabilityCheck) Run added in v0.5.0

Run checks observability configuration validity.

type ObservationalMemoryCheck

type ObservationalMemoryCheck struct{}

ObservationalMemoryCheck validates observational memory configuration.

func (*ObservationalMemoryCheck) Fix

Fix delegates to Run as automatic fixing is not supported.

func (*ObservationalMemoryCheck) Name

func (c *ObservationalMemoryCheck) Name() string

Name returns the check name.

func (*ObservationalMemoryCheck) Run

Run checks observational memory configuration validity.

type OutputScanningCheck

type OutputScanningCheck struct{}

OutputScanningCheck validates output scanning and interceptor configuration.

func (*OutputScanningCheck) Fix

Fix delegates to Run as automatic fixing is not supported.

func (*OutputScanningCheck) Name

func (c *OutputScanningCheck) Name() string

Name returns the check name.

func (*OutputScanningCheck) Run

Run checks output scanning configuration and state.

type ProvidersCheck

type ProvidersCheck struct{}

ProvidersCheck validates the AI provider configurations.

func (*ProvidersCheck) Fix

func (c *ProvidersCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix suggests running onboard.

func (*ProvidersCheck) Name

func (c *ProvidersCheck) Name() string

Name returns the check name.

func (*ProvidersCheck) Run

func (c *ProvidersCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if providers are correctly configured.

type Result

type Result struct {
	// Name is the human-readable name of the check.
	Name string `json:"name"`
	// Status is the result status.
	Status Status `json:"status"`
	// Message is the main result message.
	Message string `json:"message"`
	// Details provides additional information or hints.
	Details string `json:"details,omitempty"`
	// Fixable indicates if this issue can be auto-repaired.
	Fixable bool `json:"fixable,omitempty"`
	// FixAction is a description of the fix action.
	FixAction string `json:"fixAction,omitempty"`
	// TraceFailures carries structured recent trace metadata when relevant.
	TraceFailures []TraceFailure `json:"traceFailures,omitempty"`
	// IsolationLeakCount reports persisted raw isolated specialist turns.
	IsolationLeakCount *int `json:"isolationLeakCount,omitempty"`
}

Result represents the result of a single check.

func FeatureStatusToDoctorResult added in v0.7.0

func FeatureStatusToDoctorResult(s types.FeatureStatus) Result

FeatureStatusToDoctorResult converts a types.FeatureStatus to a doctor Result.

type RetrievalCheck added in v0.7.0

type RetrievalCheck struct{}

RetrievalCheck validates retrieval coordinator configuration.

func (*RetrievalCheck) Fix added in v0.7.0

func (c *RetrievalCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*RetrievalCheck) Name added in v0.7.0

func (c *RetrievalCheck) Name() string

Name returns the check name.

func (*RetrievalCheck) Run added in v0.7.0

Run checks retrieval coordinator configuration validity.

type RunLedgerCheck added in v0.7.0

type RunLedgerCheck struct{}

RunLedgerCheck validates RunLedger configuration invariants.

func (*RunLedgerCheck) Fix added in v0.7.0

func (c *RunLedgerCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*RunLedgerCheck) Name added in v0.7.0

func (c *RunLedgerCheck) Name() string

Name returns the check name.

func (*RunLedgerCheck) Run added in v0.7.0

Run checks RunLedger configuration validity.

type SecurityCheck

type SecurityCheck struct{}

SecurityCheck checks security configuration and state

func (*SecurityCheck) Fix

func (c *SecurityCheck) Fix(ctx context.Context, cfg *config.Config) Result

func (*SecurityCheck) Name

func (c *SecurityCheck) Name() string

func (*SecurityCheck) Run

func (c *SecurityCheck) Run(ctx context.Context, cfg *config.Config) Result

type Status

type Status int

Status represents the result status of a check.

const (
	// StatusPass indicates the check passed successfully.
	StatusPass Status = iota
	// StatusWarn indicates the check passed with warnings.
	StatusWarn
	// StatusFail indicates the check failed.
	StatusFail
	// StatusSkip indicates the check was skipped.
	StatusSkip
)

func (Status) String

func (s Status) String() string

String returns a string representation of the status.

type Summary

type Summary struct {
	Results  []Result `json:"results"`
	Passed   int      `json:"passed"`
	Warnings int      `json:"warnings"`
	Failed   int      `json:"failed"`
	Skipped  int      `json:"skipped"`
}

Summary aggregates multiple check results.

func NewSummary

func NewSummary(results []Result) Summary

NewSummary creates a Summary from a slice of Results.

func (Summary) HasErrors

func (s Summary) HasErrors() bool

HasErrors returns true if any check failed.

func (Summary) HasWarnings

func (s Summary) HasWarnings() bool

HasWarnings returns true if any check has warnings.

type ToolHooksCheck added in v0.4.0

type ToolHooksCheck struct{}

ToolHooksCheck validates tool hooks configuration.

func (*ToolHooksCheck) Fix added in v0.4.0

func (c *ToolHooksCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*ToolHooksCheck) Name added in v0.4.0

func (c *ToolHooksCheck) Name() string

Name returns the check name.

func (*ToolHooksCheck) Run added in v0.4.0

Run checks tool hooks configuration.

type TraceFailure added in v0.7.0

type TraceFailure struct {
	TraceID    string `json:"traceId"`
	Outcome    string `json:"outcome"`
	ErrorCode  string `json:"errorCode"`
	CauseClass string `json:"causeClass"`
	Summary    string `json:"summary"`
}

TraceFailure is a structured recent failure record for doctor output.

type WorkspaceCheck added in v0.6.0

type WorkspaceCheck struct{}

WorkspaceCheck validates P2P workspace configuration and dependencies.

func (*WorkspaceCheck) Fix added in v0.6.0

Fix attempts to create the workspace data directory.

func (*WorkspaceCheck) Name added in v0.6.0

func (c *WorkspaceCheck) Name() string

Name returns the check name.

func (*WorkspaceCheck) Run added in v0.6.0

Run checks workspace configuration validity.

Jump to

Keyboard shortcuts

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