steering

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: 6 Imported by: 0

Documentation

Overview

Package steering defines the trusted producer contract for persistent backend-only steering overlays.

The Writer is an explicitly constructed trusted service bound to an authoritative A-leg scope via construction time application context. It is never a global registry or map[string]any locator and never exposed through client frontends. Each overlay carries a bounded stable OverlayID, bounded reason, bounded model-visible message payload (role+text, ≤64KiB), placement and anchor-missing policy. No client/data-plane transport API is provided.

Hidden steering is sent to the remote provider/model and may be quoted in output. It is a transport/session visibility property, not a secrecy or credential channel: producers must not place secrets, tokens, or credentials in overlay text. Diagnostics are content-free (no plaintext/digest/OverlayID).

Index

Constants

View Source
const (
	MaxOverlayIDBytes    = 128
	MaxReasonCodeBytes   = 64
	MaxSteeringTextBytes = 64 * 1024
)

Bounds mirror internal/core/conversationview limits.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorMissingPolicy

type AnchorMissingPolicy string

AnchorMissingPolicy controls behavior when a fixed anchor disappears.

const (
	StablePrefixFallback AnchorMissingPolicy = "stable_prefix_fallback"
	FailClosed           AnchorMissingPolicy = "fail_closed"
)

func (AnchorMissingPolicy) Validate

func (p AnchorMissingPolicy) Validate() error

Validate reports whether the policy is known.

type Message

type Message struct {
	Role lipapi.Role
	Text string
}

Message is the bounded model-visible payload for a steering overlay. It deliberately mirrors internal/core/conversationview#StoredMessageV1 shape publicly without importing internal packages. Only role and text are persisted; proxy-only metadata, trace IDs, and transport wrappers are never part of the payload.

func (Message) Validate

func (m Message) Validate() error

Validate reports whether the steering message is well-formed.

type OverlayID

type OverlayID string

OverlayID is a bounded stable identifier for a steering overlay.

func (OverlayID) Validate

func (id OverlayID) Validate() error

Validate reports whether the overlay ID is a bounded ascii identifier.

type PlacementKind

type PlacementKind string

PlacementKind enumerates producer-facing steering placement.

const (
	StablePrefix     PlacementKind = "stable_prefix"
	AfterIngressTail PlacementKind = "after_ingress_tail"
)

func (PlacementKind) Validate

func (k PlacementKind) Validate() error

Validate reports whether the placement kind is known.

type PutRequest

type PutRequest struct {
	OverlayID           OverlayID
	Message             Message
	Placement           PlacementKind
	AnchorMissingPolicy AnchorMissingPolicy
	Reason              ReasonCode
}

PutRequest is the trusted mutation for a steering overlay.

func (PutRequest) Validate

func (r PutRequest) Validate() error

Validate reports whether the put request is well-formed. It rejects empty/oversized IDs, unknown placement/policy values, and invalid payloads.

type ReasonCode

type ReasonCode string

ReasonCode is a bounded non-secret identifier for diagnostics.

func (ReasonCode) Validate

func (r ReasonCode) Validate() error

Validate reports whether the reason code is a bounded ascii identifier.

type State

type State struct {
	OverlayID   OverlayID
	Revision    uint64
	SlotOrdinal uint64
	Active      bool
}

State is the post-mutation steering summary returned by Writer.

type Writer

type Writer interface {
	Put(ctx context.Context, req PutRequest) (State, error)
	Deactivate(ctx context.Context, id OverlayID) (State, error)
}

Writer is the trusted narrow port for mutating persistent backend-only steering. Implementations are explicitly constructed with an authoritative A-leg scope and must not be exposed to client frontends or retrieved via a global registry.

Jump to

Keyboard shortcuts

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