contextpack

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package contextpack selects and renders bounded, explicitly untrusted historical context.

Index

Constants

View Source
const (
	MemoryCandidateLimit     = 16
	ExperienceCandidateLimit = 8
	EntryLimit               = 8
	ExperienceEntryLimit     = 2
	MaxEntryContentBytes     = 2_000
)
View Source
const (
	SchemaV1        = "powercontext.prepared-context.v1"
	DefaultMaxBytes = 8_000
	MinMaxBytes     = 512
	MaxMaxBytes     = 32_768
	MaxQueryRunes   = 8_192
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Context Prepared
	Origins []Origin
}

func (Build) Clone

func (b Build) Clone() Build

type Builder

type Builder struct{}

func (Builder) Build

func (b Builder) Build(
	request Request,
	memoryRef *artifact.Ref,
	hits []memory.Hit,
	experienceHits []experience.SearchHit,
) (Prepared, error)

func (Builder) BuildResult

func (Builder) BuildResult(
	request Request,
	memoryRef *artifact.Ref,
	hits []memory.Hit,
	experienceHits []experience.SearchHit,
) (Build, error)

func (Builder) Empty

func (Builder) Empty() Prepared

type InvariantError

type InvariantError struct{ Code string }

func (*InvariantError) Error

func (e *InvariantError) Error() string

type Origin

type Origin struct {
	Memory   *memory.Citation
	Artifact *artifact.Ref
}

func (Origin) Clone

func (o Origin) Clone() Origin

type Prepared

type Prepared struct {
	// contains filtered or unexported fields
}

func EmptyPrepared

func EmptyPrepared() Prepared

func NewPrepared

func NewPrepared(status Status, content *string, contentBytes int) (Prepared, error)

func (Prepared) Content

func (p Prepared) Content() *string

func (Prepared) ContentBytes

func (p Prepared) ContentBytes() int

func (Prepared) Schema

func (p Prepared) Schema() string

func (Prepared) Status

func (p Prepared) Status() Status

type Request

type Request struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(query string, maxBytes int) (Request, error)

func (Request) MaxBytes

func (r Request) MaxBytes() int

func (Request) Query

func (r Request) Query() string

func (Request) Validate

func (r Request) Validate() error

type Status

type Status string
const (
	Empty Status = "empty"
	Ready Status = "ready"
)

Jump to

Keyboard shortcuts

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