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
- func MaterializeExampleConfig(tb testing.TB, srcPath string) string
- func StageCodex(tb testing.TB) (pluginRoot string)
- func StageLocalStub(tb testing.TB) (pluginRoot string)
- func StageOpenCode(tb testing.TB) (pluginRoot string)
- func StageOpenRouter(tb testing.TB) (pluginRoot string)
- func WriteDogfoodLocalStubConfig(tb testing.TB) string
- type FakeService
- type Mode
Constants ¶
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" DiagShutdown = "fake:shutdown" DiagUnknownEventKind = "fake:unknown_event_kind" DiagSecretTerminal = "fake:secret_terminal" DiagExactReasoning = "fake:exact_reasoning_event" )
Stable diagnostic codes for broken modes.
const CommandName = "lip-backendplugin-fake"
CommandName is the future executable skeleton name for process-host launch.
Variables ¶
This section is empty.
Functions ¶
func MaterializeExampleConfig ¶
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 ¶
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 ¶
StageLocalStub builds connectors/localstub into a discovery root with a closed manifest suitable for BuildBootstrap discover→trust→install.
func StageOpenCode ¶
StageOpenCode builds connectors/opencode into a discovery root with a closed manifest exporting both opencode-go and opencode-zen (per_instance).
func StageOpenRouter ¶
StageOpenRouter builds connectors/openrouter into a discovery root with a closed manifest suitable for BuildBootstrap discover→trust→install.
func WriteDogfoodLocalStubConfig ¶
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 ¶
func (f *FakeService) Configure(ctx context.Context, req backendplugin.ConfigureRequest) (backendplugin.ConfiguredInstance, error)
Configure creates a fake instance or fails for unauthorized/shutdown modes.
func (*FakeService) Describe ¶
func (f *FakeService) Describe(ctx context.Context) (backendplugin.PluginDescriptor, error)
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" ModeShutdown Mode = "shutdown" ModeUnknownEventKind Mode = "unknown_event_kind" ModeSecretTerminal Mode = "secret_terminal" ModeExactReasoning Mode = "exact_reasoning_event" )