Documentation
¶
Overview ¶
Package e2e proves the composed SDK works end to end. The harness holds the shared deterministic tools and recorders; the scenarios in e2e/e2e_test wire real high-level blocks together and assert each run's outputs. See docs/plans/e2e.md.
Index ¶
- Variables
- func NewAgent(name string, plan *flow.Definition) (*agent.Agent, error)
- type EscalateTool
- type FaultCompleter
- type FaultNotifier
- type FaultStore
- func (f *FaultStore) CompareAndSwap(ctx context.Context, key ledger.IdempotencyKey, old, new ledger.TaskState) (bool, error)
- func (f *FaultStore) Load(ctx context.Context, key ledger.IdempotencyKey) (ledger.TaskState, bool, error)
- func (f *FaultStore) Range(ctx context.Context, fn func(ledger.TaskState) bool) error
- type FaultWait
- type HangCompleter
- type PrefixTool
- type Recorder
- type ThreadCapture
Constants ¶
This section is empty.
Variables ¶
var ErrFault = errors.New("e2e: injected fault")
ErrFault is the error every fault decorator wraps on its injected call. A scenario asserts a failing run with errors.Is.
Functions ¶
Types ¶
type EscalateTool ¶
type EscalateTool struct {
ToolName string
}
EscalateTool fails every run with an error wrapping agent.ErrEscalated, so a wired Ask round trip can resolve it.
type FaultCompleter ¶
type FaultCompleter struct {
// Completer is the wrapped provider. Required.
Completer provider.Completer
// FaultOn is the 1-based method call to fail. Zero disables.
FaultOn int32
// contains filtered or unexported fields
}
FaultCompleter wraps a provider.Completer and faults one call. The FaultOn-th Chat or ChatStream call returns an error wrapping ErrFault; every other call passes through.
func (*FaultCompleter) ChatStream ¶
func (f *FaultCompleter) ChatStream(ctx context.Context, req provider.Request) (<-chan provider.Chunk, error)
ChatStream faults on the target call, else passes through.
func (*FaultCompleter) Name ¶
func (f *FaultCompleter) Name() string
Name returns a fixed label; it never faults.
type FaultNotifier ¶
type FaultNotifier struct {
// Notifier is the wrapped channel. Required.
Notifier channel.Notifier
// FaultOn is the 1-based ask to fail. Zero disables faults.
FaultOn int32
// contains filtered or unexported fields
}
FaultNotifier wraps a channel.Notifier and faults one call. The FaultOn-th ask returns an error wrapping ErrFault; every other ask passes through.
type FaultStore ¶
type FaultStore struct {
// Store is the wrapped ledger.Store. Required.
Store ledger.Store
// FaultOn is the 1-based call to fail. Zero disables faults.
FaultOn int32
// HangOn is the 1-based call to block until ctx is done. Zero disables.
HangOn int32
// contains filtered or unexported fields
}
FaultStore wraps a ledger.Store and faults one call. The FaultOn-th call returns an error wrapping ErrFault; the HangOn-th call blocks until ctx is done, then returns ctx.Err(); every other call passes through unchanged. Zero on a mode disables it.
func (*FaultStore) CompareAndSwap ¶
func (f *FaultStore) CompareAndSwap(ctx context.Context, key ledger.IdempotencyKey, old, new ledger.TaskState) (bool, error)
CompareAndSwap faults or hangs on its target call, else passes through.
type FaultWait ¶
type FaultWait struct {
// Inner is the wrapped agent.AckWait. Required.
Inner agent.AckWait
// FaultOn is the 1-based ack to fail. Zero disables faults.
FaultOn int32
// contains filtered or unexported fields
}
FaultWait wraps an agent.AckWait and faults one call. The FaultOn-th ack resolution returns an error wrapping ErrFault; every other call passes through.
type HangCompleter ¶
type HangCompleter struct{}
HangCompleter is a provider.Completer whose Chat and ChatStream block until ctx is done, then return ctx.Err(). It models a provider whose response never arrives unless the caller cancels, so a scenario asserts a runner with a deadline surfaces the timeout, not a hang.
func (*HangCompleter) ChatStream ¶
func (h *HangCompleter) ChatStream(ctx context.Context, _ provider.Request) (<-chan provider.Chunk, error)
ChatStream blocks until ctx is done, then returns ctx.Err().
type PrefixTool ¶
PrefixTool returns its prefix joined to the string payload it receives, so each step records a distinct, deterministic result.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder counts every event it observes, in arrival order. It is safe for concurrent use.
type ThreadCapture ¶
type ThreadCapture struct {
// contains filtered or unexported fields
}
ThreadCapture is an agent.AckWait that confirms every step message and records the signed messages for later thread verification.
func NewThreadCapture ¶
func NewThreadCapture() *ThreadCapture
NewThreadCapture returns an empty ThreadCapture.
func (*ThreadCapture) Messages ¶
func (t *ThreadCapture) Messages() []envelope.Message
Messages returns every recorded message, in wait order.