continuation

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package continuation builds bounded, immutable session carry and resolves its lineage.

Index

Constants

View Source
const (
	// Full identifies content carried without truncation.
	Full = "full"
	// Preview identifies bounded text or arguments.
	Preview = "preview"
	// Placeholder identifies permanently cleared results.
	Placeholder = "placeholder"
)

Variables

This section is empty.

Functions

func Cap

func Cap(settings compaction.Settings, minB int) int

Cap returns the carry ceiling in bytes at two bytes per token. Unknown model budgets use the 60k-token ceiling; explicit recent/protection settings persist.

func Match

func Match(visible, incoming []runstore.Hash) bool

Match reports whether the caller supplies the entire previously visible prefix.

func VisibleHash

func VisibleHash(message *model.Message) (runstore.Hash, error)

VisibleHash hashes only the canonical role and parts, ignoring message metadata.

Types

type Chain

type Chain struct {
	RunID, SessionID string
	Prev             *string
	Pos              int
	Sessions         session.Store
	Continuations    session.ContinuationStore
	Content          runstore.Store
	HeadOf           func(context.Context, string, string) (runstore.Hash, error)
	Authorize        func(context.Context, recall.Access) error
	// contains filtered or unexported fields
}

Chain is anchored to the current run's recorded predecessor, never the live session head. Scope IDs of published roots equal their run IDs.

func (*Chain) Citations

func (c *Chain) Citations(ctx context.Context, source index.Source, entries []index.MessageEntry, through index.MessageID, lines []index.IndexLine) checkpoint.CitationResolver

Citations adapts Chain's label resolution to checkpoint.CitationResolver. Carried content is preferred over an authorized read of an earlier index.

func (*Chain) Head

func (c *Chain) Head(ctx context.Context, run, scope string) (runstore.Hash, error)

Head implements recall.RunChain after the caller verifies session access.

func (*Chain) Resolve

func (c *Chain) Resolve(ctx context.Context, current, label string) (index.RunCheckpoint, error)

Resolve implements recall.RunChain using only committed predecessors.

type Entry

type Entry struct {
	Entry    index.MessageEntry
	Messages []*model.Message
	Form     string
}

Entry pairs canonical provenance with the final rendered messages. Callers must apply the final view's clearing/preview rules before invoking Carry.

type Plan

type Plan struct {
	Tail     []Entry
	Evicted  []index.MessageEntry
	TailFrom index.MessageID
	Bytes    int
	Minimal  bool
}

Plan accounts for every non-reasoning entry in either Tail or Evicted.

func Carry

func Carry(entries []Entry, view index.ViewRef, capBytes, minPreview int) (Plan, error)

Carry drops reasoning, evicts oldest legal units, forces newest results clear, then shrinks the remaining text and arguments evenly to the minimum preview. It never mutates the caller's messages and never restores a carried form.

Jump to

Keyboard shortcuts

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