Documentation
¶
Overview ¶
Package runboundary tracks the provider-complete and durably branchable prefixes of one active model run.
Index ¶
- type Snapshot
- type Tracker
- func (t *Tracker) Commit(runID string, turnIndex int, messages []llm.Message) bool
- func (t *Tracker) CompletedSnapshot() Snapshot
- func (t *Tracker) InvalidateDurable(runID string) bool
- func (t *Tracker) LiveSnapshot() []llm.Message
- func (t *Tracker) PublishDurable(runID string, turnIndex int, anchorID int64) bool
- func (t *Tracker) Reset(runID string, messages []llm.Message, durableAnchorID int64, durable bool)
- func (t *Tracker) RunID() string
- func (t *Tracker) SetInitialDurable(runID string, anchorID int64) bool
- func (t *Tracker) UpdateAssistant(runID string, assistant llm.Message) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
type Snapshot struct {
RunID string
TurnIndex int
Messages []llm.Message
DurableAnchorID int64
Durable bool
}
Snapshot is an immutable view of one run boundary. Durable is deliberately separate from DurableAnchorID: row ID zero is root branching, not an unavailable active-run boundary.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker owns one run's live provider context and completed boundary.
func New ¶
New initializes a tracker. An initial durable row is published only when durable is true and durableAnchorID is positive.
func (*Tracker) Commit ¶
Commit records one provider-completed turn. Duplicate and out-of-order callbacks are rejected so completed progress is monotonic within the run.
func (*Tracker) CompletedSnapshot ¶
CompletedSnapshot returns provider-complete context for side questions.
func (*Tracker) InvalidateDurable ¶
InvalidateDurable fails active branching closed after a persistence operation that may have replaced the published row identity.
func (*Tracker) LiveSnapshot ¶
LiveSnapshot returns context suitable for estimation, including a pending assistant when one exists.
func (*Tracker) PublishDurable ¶
PublishDurable associates a successfully persisted row with the matching completed turn. A partial or stale persistence completion cannot advance it.
func (*Tracker) Reset ¶
Reset starts ownership of a new run and invalidates callbacks carrying the previous run identity.
func (*Tracker) SetInitialDurable ¶
SetInitialDurable publishes the persisted input boundary before turn zero.