featurehost

package
v0.1.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const QuiescePhaseName = "keepwarm-generation"

QuiescePhaseName identifies the ledger phase carrying the keep-warm stop action. The generic candidate ledger runs PhaseQuiesce entries on Quiesce (at generation retirement), on Rollback, and skips them on Close only after a prior Quiesce, matching the previous dedicated quiesce-path semantics (Requirement 6.5: quiesce ordering — maintenance work stops at retirement, not at final close).

Variables

This section is empty.

Functions

func CompactionSchedulerBounds

func CompactionSchedulerBounds(cfg *config.Config) auxreq.SchedulerConfig

CompactionSchedulerBounds translates compaction continuity feature config into generic auxiliary scheduler bounds.

func NewInterleavedProcessorAdapter

func NewInterleavedProcessorAdapter(inner interleavedthinking.Processor) runtime.InterleavedProcessor

NewInterleavedProcessorAdapter creates a new runtime.InterleavedProcessor wrapping the feature-owned interleavedthinking.Processor.

func NewPromptCacheMaintenanceAdapter

func NewPromptCacheMaintenanceAdapter(orch *keepwarm.Orchestrator) runtime.PromptCacheMaintenance

NewPromptCacheMaintenanceAdapter wraps a keepwarm.Orchestrator as runtime.PromptCacheMaintenance. Nil input produces nil output (disabled behavior).

func NewTerminalPolicyReaderAdapter

func NewTerminalPolicyReaderAdapter(store *sessionpolicy.Store) runtime.TerminalPolicyReader

NewTerminalPolicyReaderAdapter wraps a sessionpolicy.Store as a runtime.TerminalPolicyReader. If store is nil, the returned adapter safely returns the generation default without error.

func TerminalDecisionPolicyHTTPProjection

func TerminalDecisionPolicyHTTPProjection(
	r *Runtime,
	snapshot *extensions.RequestRuntimeSnapshot,
	headers lipsdk.HTTPHeaders,
	maxBodyBytes int64,
	store ssessionapp.Store,
) httpcontract.TerminalDecisionPolicyInput

TerminalDecisionPolicyHTTPProjection provides a package-level helper that safely handles nil Runtime.

func ValidateSecretGuardRegistrations

func ValidateSecretGuardRegistrations(regs []lipsdk.Registration) error

ValidateSecretGuardRegistrations validates registration requirements for secret guard.

Types

type CorePorts

type CorePorts struct {
	CompactionDetector            runtime.CompactionDetector
	ConversationReader            conversationprojection.Reader
	ConversationReaderStockOrigin bool
	InterleavedProcessor          runtime.InterleavedProcessor
	PromptCacheMaintenance        runtime.PromptCacheMaintenance
	TerminalPolicyReader          runtime.TerminalPolicyReader
	MetricsSwap                   func()
	KeepwarmAdmin                 adminkeepwarm.Options
	TerminalPolicyProjection      TerminalPolicyProjectionFunc
}

CorePorts carries minimal fixed consumer-owned core interfaces needed by Tasks 3-7. It is a fixed internal adapter, NOT a service map (design §7, Requirement 8.3). Opaque admin/operator projections (MetricsSwap, KeepwarmAdmin, TerminalPolicyProjection) are built by featurehost so generic runtimebundle copies values without referencing concrete feature symbols.

type GenerationInput

type GenerationInput struct {
	Registrations     []lipsdk.Registration
	HostRegistrations []sdkfeaturehost.Registration
	MergeSurface      featurebundle.GeneratedMergeSurface
	Planes            lipfeature.FrozenPlaneSet
	Lifecycles        []lipplugin.Lifecycle
	CandidatePlanes   lipfeature.FrozenPlaneSet
	BackgroundClient  auxiliary.BackgroundClient
	BackgroundPoller  auxiliary.BackgroundPoller
	// ReasoningProdOpts/ReasoningTestOpts carry the raw production and testing
	// reasoning option sources. The facade merges them internally (Task 2.4,
	// Requirement 8.3); generic runtimebundle must never merge or interpret
	// reasoning policy itself, so no merged ReasoningOpts field exists here.
	ReasoningProdOpts  ReasoningCompressionOptions
	ReasoningTestOpts  ReasoningCompressionOptions
	InterleavedConfig  interleavedthinking.Config
	ConfigInterleaved  config.InterleavedConfig
	KeepwarmConfig     keepwarm.Config
	NowFn              func() time.Time
	KeepwarmAccounting billing.ProviderMaintenanceUsageObserver
	ConfigDir          string
	AccessMode         accessmode.Mode
	SecretEnv          SecretGuardEnvironment
	SecretInputs       SecretGuardInputs
	DecisionObserver   SecretDecisionObserver
	FaultInject        error
}

GenerationInput carries inputs for featurehost generation composition. It deliberately does NOT accept *runtimebundle.BuildOptions or *runtimebundle.ProcessServices.

type GenerationOutput

type GenerationOutput struct {
	Bundle     lipfeature.FeatureBundle
	Planes     lipfeature.FrozenPlaneSet
	Lifecycles []lipplugin.Lifecycle
	CorePorts  CorePorts
}

GenerationOutput represents the compiled output of standard-distribution features for a single generation: the ordinary Bundle/Planes/Lifecycles surface plus the minimal fixed CorePorts consumer ports (Task 2.2). Concrete per-feature runtime handles (secret-guard plane, keep-warm manager/quiesce) travel inside the frozen planes, lifecycles, and opaque ports instead of dedicated fields.

type HostEnvironment

type HostEnvironment interface {
	Lookup(name string) (value string, ok bool)
	Snapshot() []string
}

HostEnvironment is a generic process-environment capability for standard feature composition. Concrete interpretation stays in the secret-guard binding below; generic composition forwards it untouched.

type MatcherOptions

type MatcherOptions = secretguard.MatcherOptions

Re-exported types from secretguard so runtimebundle does not import dedicated compose package.

type MetricsRegistry

type MetricsRegistry interface {
	Register(prometheus.Collector) error
}

MetricsRegistry is the narrow generic collector-registration seam owned by metrics infrastructure: implementations register opaque prometheus collectors, carrying no feature knowledge.

type ProcessInput

type ProcessInput struct {
	Logger            *slog.Logger
	ExtensionState    lipstate.Store
	BackgroundAux     *auxreq.BackgroundScheduler
	ContinuityStore   b2bua.Store
	BunDB             *bun.DB
	HostRegistrations []sdkfeaturehost.Registration
	// HostEnv is a generic process-environment capability used when none is registered.
	HostEnv HostEnvironment
	// MetricsRegistry receives the feature-owned keep-warm collector (nil disables).
	MetricsRegistry MetricsRegistry
	// contains filtered or unexported fields
}

ProcessInput contains only generic process capabilities required by the standard feature set. It MUST NOT accept *runtimebundle.BuildOptions, *ProcessServices, full backend maps, database pool registries, or an any services map (Requirement 8.4, Task 2.1).

type ReasoningCompressionOptions

type ReasoningCompressionOptions = reasoning.Options

ReasoningCompressionOptions is aliased from reasoning for generation options.

type ReasoningGenerationInput

type ReasoningGenerationInput = reasoning.GenerationInput

ReasoningGenerationInput carries generation inputs for reasoning composition.

type Registration

type Registration = sdkfeaturehost.Registration

Registration aliases the SDK host registration type for convenient consumption.

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime is the standard-distribution feature host process facade. It owns only migrated process feature resources and disposes them in reverse acquisition order upon Close. Borrowed resources (BackgroundAux, DB pools, etc.) are never closed by Runtime (Requirement 8.5, design §7).

func NewProcess

func NewProcess(ctx context.Context, in ProcessInput) (*Runtime, error)

NewProcess constructs the standard-distribution featurehost process facade. Every successfully constructed owned feature resource is recorded before later construction can fail; on failure, already-registered closers are unwound in reverse order.

func (*Runtime) BoundReasoningOptions

func (r *Runtime) BoundReasoningOptions() ReasoningCompressionOptions

BoundReasoningOptions returns the bound reasoning compression options.

func (*Runtime) BoundSecretGuard

func (r *Runtime) BoundSecretGuard() SecretGuardHostBinding

BoundSecretGuard returns the bound secret guard host options.

func (*Runtime) BuildSecretGuardRuntime

func (r *Runtime) BuildSecretGuardRuntime(in SecretGuardBuildInput) (*SecretGuardRuntime, error)

BuildSecretGuardRuntime builds secret guard runtime through the featurehost facade.

func (*Runtime) Close

func (r *Runtime) Close() error

Close disposes all process feature resources owned by this Runtime in reverse acquisition order. It is idempotent and aggregates any disposal errors. It never closes borrowed generic process resources.

func (*Runtime) Closed

func (r *Runtime) Closed() bool

Closed reports whether Runtime.Close has completed.

func (*Runtime) ClosersCount

func (r *Runtime) ClosersCount() int

ClosersCount returns the number of closers registered on this Runtime.

func (*Runtime) CompactionDetector

func (r *Runtime) CompactionDetector() runtime.CompactionDetector

CompactionDetector returns the featurehost-owned compaction detector. It is the single permitted detector observer: generic runtimebundle wires it into candidate executors (candidate_compile.go), and the transition guard observes it. Coordinator/parent-port have no such observer by design.

func (*Runtime) CompileGeneration

func (r *Runtime) CompileGeneration(ctx context.Context, in GenerationInput) (GenerationOutput, error)

CompileGeneration compiles standard feature planes, lifecycles, and core ports for a candidate generation. It does NOT construct any process-scoped resource listed in the Task 1.1 transition table (Requirement 8.3, Task 2.2). Candidate failure must not mutate process feature state.

func (*Runtime) ConversationReader

func (r *Runtime) ConversationReader() conversationprojection.Reader

ConversationReader returns the featurehost-owned conversation projection reader, if owned.

func (*Runtime) ConversationStore

func (r *Runtime) ConversationStore() conversationview.Store

ConversationStore returns the featurehost-owned conversation-view store, if owned.

func (*Runtime) KeepwarmAdminProjection

func (r *Runtime) KeepwarmAdminProjection() (adminkeepwarm.Options, bool)

KeepwarmAdminProjection exposes the process-owned keep-warm admin projection opaquely for stdhttp composition via generation CorePorts. Generic runtimebundle copies the value without resolving the admin service itself.

func (*Runtime) KeepwarmAdminService

func (r *Runtime) KeepwarmAdminService() adminkeepwarm.Service

KeepwarmAdminService returns an admin-facing policy service adapter for the process-owned keepwarm policy store and manager registry.

func (*Runtime) KeepwarmPolicy

func (r *Runtime) KeepwarmPolicy() *keepwarm.PolicyStore

KeepwarmPolicy returns the featurehost-owned keepwarm policy store, if owned.

func (*Runtime) KeepwarmRegistry

func (r *Runtime) KeepwarmRegistry() *keepwarm.ManagerRegistry

KeepwarmRegistry returns the featurehost-owned keepwarm manager registry, if owned.

func (*Runtime) TerminalDecisionPolicy

func (r *Runtime) TerminalDecisionPolicy() *sessionpolicy.Store

TerminalDecisionPolicy returns the featurehost-owned terminal decision policy store, if owned.

func (*Runtime) TerminalDecisionPolicyHTTPProjection

func (r *Runtime) TerminalDecisionPolicyHTTPProjection(
	snapshot *extensions.RequestRuntimeSnapshot,
	headers lipsdk.HTTPHeaders,
	maxBodyBytes int64,
	store ssessionapp.Store,
) httpcontract.TerminalDecisionPolicyInput

TerminalDecisionPolicyHTTPProjection binds the process-owned policy and secure-session services to one immutable generation's HTTP composition. The callbacks capture only request authority and the process store; they do not perform live provider lookup or mutate generation state.

func (*Runtime) TerminalPolicyProjection

func (r *Runtime) TerminalPolicyProjection() TerminalPolicyProjectionFunc

TerminalPolicyProjection returns the opaque generation-scoped factory for the terminal decision policy HTTP projection bound to this process Runtime.

func (*Runtime) TerminalPolicyReader

func (r *Runtime) TerminalPolicyReader() runtime.TerminalPolicyReader

TerminalPolicyReader returns a consumer-owned adapter for the terminal decision policy store.

type SecretDecisionObserver

type SecretDecisionObserver = sdk.Observer

Re-exported types from secretguard so runtimebundle does not import dedicated compose package.

type SecretGuardBuildInput

type SecretGuardBuildInput struct {
	AccessMode    accessmode.Mode
	Registrations []lipsdk.Registration
	Guards        []sdk.Guard
	Environment   SecretGuardEnvironment
	Inputs        SecretGuardInputs
	// HostInputs carries the bound secret-guard host inputs when a host binding
	// was supplied (nil when absent). Composition overlays explicitly-set host
	// fields onto YAML-decoded options.
	HostInputs       *SecretGuardInputs
	DecisionObserver SecretDecisionObserver
	Logger           *slog.Logger
}

SecretGuardBuildInput contains inputs for building the secret guard runtime.

type SecretGuardEnvironment

type SecretGuardEnvironment = secretguard.Environment

Re-exported types from secretguard so runtimebundle does not import dedicated compose package.

type SecretGuardHostBinding

type SecretGuardHostBinding struct {
	Environment SecretGuardEnvironment
	Inputs      SecretGuardInputs
	Present     bool
}

SecretGuardHostBinding carries bound secret guard host options from registration. Present reports whether a secret-guard binding was supplied. Composition selects bound inputs by presence, never by enumerating individual option fields.

type SecretGuardInputs

type SecretGuardInputs = secretguard.SecretGuardInputs

Re-exported types from secretguard so runtimebundle does not import dedicated compose package.

type SecretGuardRuntime

type SecretGuardRuntime struct {
	Plane     extensions.SecretGuardPlane
	Inventory *diag.InventoryExtras
}

SecretGuardRuntime contains the compiled secret guard plane and inventory extras.

type SingleUserOptions

type SingleUserOptions = secretguard.SingleUserOptions

Re-exported types from secretguard so runtimebundle does not import dedicated compose package.

type TerminalPolicyProjectionFunc

type TerminalPolicyProjectionFunc func(snapshot *extensions.RequestRuntimeSnapshot, headers lipsdk.HTTPHeaders, maxBodyBytes int64, store ssessionapp.Store) httpcontract.TerminalDecisionPolicyInput

TerminalPolicyProjectionFunc builds one generation's terminal decision policy HTTP input from request-time composition state. It is a fixed consumer port: generic runtimebundle invokes it without referencing concrete feature symbols.

Directories

Path Synopsis
Package reasoningcompose provides dedicated runtime composition for reasoning semantic compression.
Package reasoningcompose provides dedicated runtime composition for reasoning semantic compression.
Package sessionclassification provides the standard featurehost's bounded process-local adapter for feature-owned session classification state.
Package sessionclassification provides the standard featurehost's bounded process-local adapter for feature-owned session classification state.
Package sessionpolicy provides the standard featurehost-owned, bounded policy store for terminal-decision session overrides.
Package sessionpolicy provides the standard featurehost-owned, bounded policy store for terminal-decision session overrides.

Jump to

Keyboard shortcuts

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