Documentation
¶
Index ¶
- Constants
- func RenderThresholdTuningMarkdown(report ThresholdTuningReport) string
- type AgenticRouter
- type AgenticRouterFunc
- type AgenticRoutingDecision
- type AgenticRoutingRequest
- type Assembler
- func (a *Assembler) Assemble(ctx context.Context, req types.ContextAssembleRequest, ...) (types.ModelRequest, types.ContextAssembleResult, error)
- func (a *Assembler) AssembleWithHandoff(ctx context.Context, req types.ContextAssembleRequest, ...) (types.ModelRequest, types.ContextAssembleResult, *handoff.Handoff, error)
- func (a *Assembler) BuildHandoff(req types.ContextAssembleRequest, modelReq types.ModelRequest, ...) (handoff.Handoff, error)
- func (a *Assembler) OnRunFinished(runID string)
- func (a *Assembler) RestoreHandoff(h handoff.Handoff, resolver handoff.Resolver) (handoff.RestoreResult, error)
- func (a *Assembler) RestoreHandoffWithStore(h handoff.Handoff, resolver handoff.Resolver, ...) (handoff.RestoreResult, error)
- func (a *Assembler) SetAgenticRouter(router AgenticRouter)
- type DBSpillBackend
- type ObjectSpillBackend
- type Option
- func WithAgenticRouter(router AgenticRouter) Option
- func WithHandoffRestoreStore(store handoff.RestoreOperationStore) Option
- func WithMemoryConfigProvider(provider func() runtimeconfig.RuntimeMemoryConfig) Option
- func WithRedactionConfigProvider(provider func() runtimeconfig.SecurityRedactionConfig) Option
- func WithRuntimeContextConfigProvider(provider func() runtimeconfig.RuntimeContextConfig) Option
- func WithSemanticEmbeddingScorer(key string, scorer SemanticEmbeddingScorer) Option
- func WithSemanticReranker(provider string, reranker SemanticReranker) Option
- type SemanticEmbeddingScoreRequest
- type SemanticEmbeddingScorer
- type SemanticRerankRequest
- type SemanticRerankResult
- type SemanticReranker
- type SpillBackend
- type ThresholdRecommendation
- type ThresholdTuningReport
- type ThresholdTuningRequest
- type ThresholdTuningSample
Constants ¶
const ( StatusSuccess = "success" StatusFailed = "failed" StatusBypass = "bypass" )
const ThresholdTuningSchemaVersion = "v1"
Variables ¶
This section is empty.
Functions ¶
func RenderThresholdTuningMarkdown ¶
func RenderThresholdTuningMarkdown(report ThresholdTuningReport) string
Types ¶
type AgenticRouter ¶
type AgenticRouter interface {
DecideStage2(ctx context.Context, req AgenticRoutingRequest) (AgenticRoutingDecision, error)
}
AgenticRouter decides whether Stage2 should run for a context stage2 assemble cycle.
type AgenticRouterFunc ¶
type AgenticRouterFunc func(ctx context.Context, req AgenticRoutingRequest) (AgenticRoutingDecision, error)
AgenticRouterFunc adapts a function to AgenticRouter.
func (AgenticRouterFunc) DecideStage2 ¶
func (f AgenticRouterFunc) DecideStage2(ctx context.Context, req AgenticRoutingRequest) (AgenticRoutingDecision, error)
DecideStage2 invokes wrapped function.
type AgenticRoutingDecision ¶
AgenticRoutingDecision is the callback output for context stage2 routing.
type AgenticRoutingRequest ¶
type AgenticRoutingRequest struct {
RunID string
SessionID string
ModelProvider string
Model string
Input string
Messages []types.Message
Capabilities []types.ModelCapability
}
AgenticRoutingRequest is the normalized callback input for context stage2 agentic routing.
type Assembler ¶
type Assembler struct {
// contains filtered or unexported fields
}
Assembler composes context before model execution using prefix-baseline, stage2-routing, and pressure-compaction policies.
func New ¶
func New(cfgProvider func() runtimeconfig.ContextAssemblerConfig, opts ...Option) *Assembler
New creates a context assembler with runtime config provider and optional extensions.
func (*Assembler) Assemble ¶
func (a *Assembler) Assemble(ctx context.Context, req types.ContextAssembleRequest, modelReq types.ModelRequest) (types.ModelRequest, types.ContextAssembleResult, error)
Assemble builds model-ready context with prefix-baseline, stage2-routing, and pressure-compaction policies.
func (*Assembler) AssembleWithHandoff ¶
func (a *Assembler) AssembleWithHandoff(ctx context.Context, req types.ContextAssembleRequest, modelReq types.ModelRequest) (types.ModelRequest, types.ContextAssembleResult, *handoff.Handoff, error)
AssembleWithHandoff preserves the existing Assemble result and optionally emits a bounded handoff when the runtime handoff switch is enabled.
func (*Assembler) BuildHandoff ¶
func (a *Assembler) BuildHandoff(req types.ContextAssembleRequest, modelReq types.ModelRequest, result types.ContextAssembleResult) (handoff.Handoff, error)
BuildHandoff projects an assembled model request into the bounded handoff contract. It is deliberately side-effect-free; source history and checkpoint owners remain authoritative for bodies and lineage.
func (*Assembler) OnRunFinished ¶
OnRunFinished compacts run-scoped context assembler caches without changing external semantics.
func (*Assembler) RestoreHandoff ¶
func (a *Assembler) RestoreHandoff(h handoff.Handoff, resolver handoff.Resolver) (handoff.RestoreResult, error)
RestoreHandoff validates and resolves a handoff before any caller-owned context mutation. The assembler remains stateless with respect to source history; callers decide how to inject the returned restore projection.
func (*Assembler) RestoreHandoffWithStore ¶
func (a *Assembler) RestoreHandoffWithStore(h handoff.Handoff, resolver handoff.Resolver, store handoff.RestoreOperationStore) (handoff.RestoreResult, error)
RestoreHandoffWithStore performs reference validation and uses the injected durable operation store when available. The store is consulted only after schema validation and before any source-owner mutation.
func (*Assembler) SetAgenticRouter ¶
func (a *Assembler) SetAgenticRouter(router AgenticRouter)
SetAgenticRouter updates agentic router callback at runtime.
type DBSpillBackend ¶
type DBSpillBackend interface {
SpillBackend
}
DBSpillBackend is a placeholder SPI for future DB implementations.
type ObjectSpillBackend ¶
type ObjectSpillBackend interface {
SpillBackend
}
ObjectSpillBackend is a placeholder SPI for future object-storage implementations.
type Option ¶
type Option func(*Assembler)
Option customizes assembler behavior for embedding/reranker/redaction integrations.
func WithAgenticRouter ¶
func WithAgenticRouter(router AgenticRouter) Option
WithAgenticRouter registers a host callback for context stage2 agentic routing decisions.
func WithHandoffRestoreStore ¶
func WithHandoffRestoreStore(store handoff.RestoreOperationStore) Option
WithHandoffRestoreStore injects a durable operation identity store for crash/restart-safe handoff restores.
func WithMemoryConfigProvider ¶
func WithMemoryConfigProvider(provider func() runtimeconfig.RuntimeMemoryConfig) Option
WithMemoryConfigProvider injects runtime memory config provider for stage2 memory facade mode.
func WithRedactionConfigProvider ¶
func WithRedactionConfigProvider(provider func() runtimeconfig.SecurityRedactionConfig) Option
WithRedactionConfigProvider injects runtime redaction config provider for recap/stage2 sanitization.
func WithRuntimeContextConfigProvider ¶
func WithRuntimeContextConfigProvider(provider func() runtimeconfig.RuntimeContextConfig) Option
WithRuntimeContextConfigProvider injects runtime context-domain config provider for JIT controls.
func WithSemanticEmbeddingScorer ¶
func WithSemanticEmbeddingScorer(key string, scorer SemanticEmbeddingScorer) Option
WithSemanticEmbeddingScorer registers semantic embedding scorer extension.
func WithSemanticReranker ¶
func WithSemanticReranker(provider string, reranker SemanticReranker) Option
WithSemanticReranker registers provider-specific semantic reranker extension.
type SemanticEmbeddingScorer ¶
type SemanticEmbeddingScorer interface {
Score(ctx context.Context, req SemanticEmbeddingScoreRequest) (float64, error)
}
SemanticEmbeddingScorer is a provider-agnostic SPI hook for semantic quality scoring. Provider adapter binding is intentionally deferred to keep the SPI boundary stable.
type SemanticRerankRequest ¶
type SemanticRerankResult ¶
type SemanticRerankResult struct {
Score float64
}
type SemanticReranker ¶
type SemanticReranker interface {
Rerank(ctx context.Context, req SemanticRerankRequest) (SemanticRerankResult, error)
}
SemanticReranker is an extension hook for provider-specific score reranking.
type SpillBackend ¶
type ThresholdRecommendation ¶
type ThresholdTuningReport ¶
type ThresholdTuningReport struct {
SchemaVersion string `json:"schema_version"`
Recommendation ThresholdRecommendation `json:"recommendation"`
CorpusReadiness string `json:"corpus_readiness"`
CorpusReadinessMsg string `json:"corpus_readiness_message"`
}
func RunThresholdTuning ¶
func RunThresholdTuning(req ThresholdTuningRequest) (ThresholdTuningReport, error)
type ThresholdTuningRequest ¶
type ThresholdTuningRequest struct {
SchemaVersion string `json:"schema_version"`
Samples []ThresholdTuningSample `json:"samples"`
MinPrecision float64 `json:"min_precision"`
MinRecall float64 `json:"min_recall"`
}