backendplugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package backendplugin provides a deterministic in-process fake backend plugin and a future executable command skeleton name for host launch tests.

Index

Constants

View Source
const (
	DiagMalformedFrame    = "fake:malformed_frame"
	DiagSlowOutput        = "fake:slow_output"
	DiagBlockedCancel     = "fake:blocked_cancel"
	DiagProcessExit       = "fake:process_exit"
	DiagCommitThenFail    = "fake:commit_then_fail"
	DiagDuplicateTerminal = "fake:duplicate_terminal"
	DiagOversize          = "fake:oversize"
	DiagUnauthorizedPeer  = "fake:unauthorized_peer"
	DiagShutdown          = "fake:shutdown"
	DiagUnknownEventKind  = "fake:unknown_event_kind"
	DiagSecretTerminal    = "fake:secret_terminal"
	DiagExactReasoning    = "fake:exact_reasoning_event"
)

Stable diagnostic codes for broken modes.

View Source
const CommandName = "lip-backendplugin-fake"

CommandName is the future executable skeleton name for process-host launch.

Variables

This section is empty.

Functions

func MaterializeExampleConfig

func MaterializeExampleConfig(tb testing.TB, srcPath string) string

MaterializeExampleConfig copies an example YAML and rewrites plugins.backend_discovery to a freshly staged connectors/localstub root. Configs that enable kind local-stub without discovery get a discovery block injected.

func StageCodex

func StageCodex(tb testing.TB) (pluginRoot string)

StageCodex builds connectors/codex into a discovery root with a closed manifest exporting both openai-codex and openai-codex-app-server (per_instance).

func StageLocalStub

func StageLocalStub(tb testing.TB) (pluginRoot string)

StageLocalStub builds connectors/localstub into a discovery root with a closed manifest suitable for BuildBootstrap discover→trust→install.

func StageOpenCode

func StageOpenCode(tb testing.TB) (pluginRoot string)

StageOpenCode builds connectors/opencode into a discovery root with a closed manifest exporting both opencode-go and opencode-zen (per_instance).

func StageOpenRouter

func StageOpenRouter(tb testing.TB) (pluginRoot string)

StageOpenRouter builds connectors/openrouter into a discovery root with a closed manifest suitable for BuildBootstrap discover→trust→install.

func WriteDogfoodLocalStubConfig

func WriteDogfoodLocalStubConfig(tb testing.TB) string

WriteDogfoodLocalStubConfig stages connectors/localstub and writes a dogfood YAML that discovers it. Use this instead of config/examples/dogfood-local-stub.yaml in automated tests (example file expects a prior make package-full layout).

Types

type FakeService

type FakeService struct {
	Mode                Mode
	SlowWait            time.Duration
	ExecuteCount        atomic.Int64
	LastStartInvocation *backendplugin.Invocation
	LastStartCall       *lipapi.Call
	ProtocolMinor       uint32
	ExtraFeatures       []backendplugin.Feature
	PromptCache         bool
}

FakeService is an in-process deterministic backendplugin.Service for conformance.

func (*FakeService) Configure

Configure creates a fake instance or fails for unauthorized/shutdown modes.

func (*FakeService) Describe

Describe returns a minimal advertised-capability descriptor.

type Mode

type Mode string

Mode selects deterministic broken or valid fake plugin behavior.

const (
	ModeValid             Mode = "valid"
	ModeMalformedFrame    Mode = "malformed_frame"
	ModeSlowOutput        Mode = "slow_output"
	ModeBlockedCancel     Mode = "blocked_cancel"
	ModeProcessExit       Mode = "process_exit"
	ModeCommitThenFail    Mode = "commit_then_fail"
	ModeDuplicateTerminal Mode = "duplicate_terminal"
	ModeOversize          Mode = "oversize"
	ModeUnauthorizedPeer  Mode = "unauthorized_peer"
	ModeShutdown          Mode = "shutdown"
	ModeUnknownEventKind  Mode = "unknown_event_kind"
	ModeSecretTerminal    Mode = "secret_terminal"
	ModeExactReasoning    Mode = "exact_reasoning_event"
)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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