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 ¶
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 ¶
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.
type OverlayID ¶
type OverlayID string
OverlayID is a bounded stable identifier for a steering overlay.
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 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.