feat: add bounded iterative cognitive retrieval
This commit is contained in:
@@ -59,14 +59,54 @@ type ContextAssemblyTrace struct {
|
||||
CompilerVersion string
|
||||
}
|
||||
|
||||
type IterativeRetrievalLane string
|
||||
|
||||
const (
|
||||
IterativeRetrievalCurrentFact IterativeRetrievalLane = "CURRENT_FACT"
|
||||
IterativeRetrievalPositiveExperience IterativeRetrievalLane = "POSITIVE_EXPERIENCE"
|
||||
IterativeRetrievalNegativeExperience IterativeRetrievalLane = "NEGATIVE_EXPERIENCE"
|
||||
IterativeRetrievalContradiction IterativeRetrievalLane = "CONTRADICTION"
|
||||
IterativeRetrievalHistoricalAnalogy IterativeRetrievalLane = "HISTORICAL_ANALOGY"
|
||||
)
|
||||
|
||||
// IterativeRetrievalRequest is the model-visible, storage-agnostic intent.
|
||||
// Principal, Scope, Focus and policy are deliberately absent: Core binds them
|
||||
// from the already-authorized request and never accepts them from a model.
|
||||
type IterativeRetrievalRequest struct {
|
||||
Query string
|
||||
RemainingBytes int
|
||||
Pass int
|
||||
Query string
|
||||
SemanticSubject string
|
||||
Lane IterativeRetrievalLane
|
||||
Reason string
|
||||
RemainingBytes int
|
||||
Pass int
|
||||
}
|
||||
|
||||
// IterativeRetrievalBudget is a Core-enforced per-request budget.
|
||||
type IterativeRetrievalBudget struct {
|
||||
MaxRounds int
|
||||
MaxFragments int
|
||||
MaxAddedBytes int
|
||||
MaxLatencyMillis int64
|
||||
}
|
||||
|
||||
// IterativeRetrievalEnvelope is the trusted continuation input assembled by
|
||||
// Core. It is never produced by a provider or model adapter.
|
||||
type IterativeRetrievalEnvelope struct {
|
||||
Request IterativeRetrievalRequest
|
||||
PrincipalID string
|
||||
ContextScopeRef string
|
||||
FocusFrameRef string
|
||||
TaskRef string
|
||||
FreshnessRequirement string
|
||||
DataPolicy capability.DataPolicy
|
||||
Budget IterativeRetrievalBudget
|
||||
SeenExcerptIDs []ContextExcerptID
|
||||
}
|
||||
type IterativeRetrievalResponse struct {
|
||||
Candidates []ContextCandidate
|
||||
Exhausted bool
|
||||
Reason string
|
||||
AddedBytes int
|
||||
}
|
||||
|
||||
// CompileContext deterministically selects permitted, relevant excerpts for a
|
||||
|
||||
@@ -69,18 +69,19 @@ type AdvisoryRequest struct {
|
||||
// GatewayAdvisoryRequest describes the task and policy requirement. It cannot
|
||||
// name a provider, model or binding; Capability owns that selection.
|
||||
type GatewayAdvisoryRequest struct {
|
||||
Version ContractVersion
|
||||
RequestID RequestID
|
||||
ActorID identity.ActorID
|
||||
PrincipalID identity.PrincipalID
|
||||
ScopeID authority.ScopeID
|
||||
Message string
|
||||
Context []ContextExcerpt
|
||||
Locale string
|
||||
MaxOutputBytes int
|
||||
DataPolicy capability.DataPolicy
|
||||
EgressAcknowledged bool
|
||||
Meaning TaskMeaning
|
||||
Version ContractVersion
|
||||
RequestID RequestID
|
||||
ActorID identity.ActorID
|
||||
PrincipalID identity.PrincipalID
|
||||
ScopeID authority.ScopeID
|
||||
Message string
|
||||
Context []ContextExcerpt
|
||||
Locale string
|
||||
MaxOutputBytes int
|
||||
DataPolicy capability.DataPolicy
|
||||
EgressAcknowledged bool
|
||||
AllowIterativeRetrieval bool
|
||||
Meaning TaskMeaning
|
||||
}
|
||||
|
||||
// TaskMeaning is the trusted semantic summary produced by Core. It is not a
|
||||
@@ -177,4 +178,5 @@ type GatewayAdvisoryResponse struct {
|
||||
ReferencedExcerptIDs []ContextExcerptID
|
||||
FinishReason FinishReason
|
||||
Usage *ProviderUsage
|
||||
IterativeRetrieval *IterativeRetrievalRequest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user