Documentation
¶
Overview ¶
Package extractor builds the one canonical child call used for semantic continuity extraction and validates its bounded result. It intentionally depends only on canonical lipapi contracts and the auxiliary SDK seam.
Index ¶
- Constants
- Variables
- func BuildRequest(in Input) (auxiliary.Request, error)
- func Submit(ctx context.Context, client auxiliary.BackgroundClient, in Input, ...) (auxiliary.JobID, error)
- type DecisionUpdate
- type FactKind
- type FactUpdate
- type Input
- type Limits
- type ParseOptions
- type PlanUpdate
- type Removal
- type Result
Constants ¶
const ( // Role and Visibility are content-free auxiliary lineage labels. Role = "compaction_continuity_extractor" Visibility = "private" PluginID = "compaction-continuity" DefaultMaxOutputToken = 2_000 DefaultTimeout = 8 * time.Second )
const ( // DefaultMaxInputTokens mirrors the validated extractor.max_input_tokens // policy captured by the feature composition layer. DefaultMaxInputTokens = 12_000 )
const OutputSchema = `` /* 624-byte string literal not displayed */
OutputSchema is the fixed result shape shown to the child. It is kept as a literal so the prompt cannot drift into a second, implicit output contract.
const SystemPrompt = `` /* 695-byte string literal not displayed */
SystemPrompt is fixed extractor policy. Source text is always supplied in a separately delimited user payload and is data, never an instruction.
Variables ¶
var (
ErrInvalidResult = errors.New("extractor: invalid result")
)
Functions ¶
func BuildRequest ¶
BuildRequest constructs exactly one detached, no-tools auxiliary request. It does not call routing, a provider, billing, or another plugin.
Types ¶
type DecisionUpdate ¶
type FactUpdate ¶
type Input ¶
type Input struct {
Route string
Inherit bool
InheritedRoute string
ParentBranchBinding string
ParentTraceID string
ParentALegID string
ParentBLegID string
Previous capsule.Envelope
DeterministicPlan *capsule.Plan
DeterministicFacts []capsule.Fact
SanitizedDelta []source.Entry
SourceHighWatermark string
// MaxInputTokens is copied from the immutable extractor.max_input_tokens
// configuration captured for this job. BuildRequest enforces it without a
// provider tokenizer by counting each UTF-8 byte as one token-equivalent
// unit, a conservative upper bound on token count.
MaxInputTokens int
MaxOutputTokens int
Timeout time.Duration
AllowedSourceRefs []string
}
Input is the bounded, already-sanitized source for one child call. The parent branch binding is trusted lineage only; it is never copied into the canonical prompt or Call.Session.
type Limits ¶
type Limits struct {
MaxBytes int
MaxDepth int
MaxItems int
MaxStringBytes int
MaxSourceRefBytes int
MaxConflictBytes int
MaxSupersedes int
}
Limits bounds the untrusted child result before it can become capsule state. Zero values use DefaultLimits.
func DefaultLimits ¶
func DefaultLimits() Limits
type ParseOptions ¶
type ParseOptions struct {
Previous capsule.Envelope
ExpectedBranch string
AllowedSourceRefs []string
SourceHighWatermark string
Limits Limits
}
ParseOptions supplies the locally validated parent capsule and source authority. The result schema has no branch field: cross-branch output is rejected by checking the parent binding and supersede references here.
type PlanUpdate ¶
type PlanUpdate struct {
ID string
Text string
Status capsule.StepStatus
SourceRef string
}
type Result ¶
type Result struct {
SchemaVersion uint8
BaseRevision uint64
Facts []FactUpdate
PlanUpdates []PlanUpdate
Decisions []DecisionUpdate
Removals []Removal
}
func Await ¶
func Await(ctx context.Context, client auxiliary.BackgroundClient, id auxiliary.JobID, in Input) (Result, error)
Await parses one previously submitted child result through the SDK seam.
func Collect ¶
Collect performs one and only one auxiliary collection and parses its text. There is deliberately no summary rewrite or provider-specific fallback.
func ParseResult ¶
func ParseResult(data []byte, opts ParseOptions) (Result, error)
ParseResult accepts exactly one strict JSON object and validates it against the locally verified parent capsule. It never trusts child authority fields.