Documentation
¶
Overview ¶
Package acceptance runs explicitly requested acceptance cases through an already started Client. It never owns a Node or changes controller defaults.
Index ¶
- Constants
- func Archive(ctx context.Context, controller *client.Client, directory string, ...) error
- func CaptureRecording(ctx context.Context, controller *client.Client, directory string, ...) error
- func Execute(ctx context.Context, controller *client.Client, directory string, ...) (protocol.Output, error)
- func ImportReportOwnership(directory string, node protocol.NodeID) error
- func Own(directory string, node protocol.NodeID, session protocol.SessionID) error
- func OwnedSessions(directory string, node protocol.NodeID) ([]protocol.SessionID, error)
- func PackageToolAlias(owner, name string) string
- func RecordingPath(directory string, session protocol.SessionID) string
- func SelectConfig(snapshot protocol.Snapshot, requested *protocol.SessionConfig) (protocol.SessionConfig, error)
- type CaseResult
- type Evidence
- type Options
- type Recorder
- type RecordingFrame
- type RecordingSession
- type RecordingTool
- type Report
- type ReportPaths
Constants ¶
const ( MaxRecordingFrames = 256 MaxRecordingBytes = 16 * 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
func Archive ¶
func Archive(ctx context.Context, controller *client.Client, directory string, sessions []protocol.SessionID) error
Archive finishes and records only the requested test-owned sessions. It uses an independent bounded context per session, including after caller cancellation. Archiving leaves canonical history available for diagnosis and replay while removing the fixture from the ordinary conversation list.
func CaptureRecording ¶
func CaptureRecording(ctx context.Context, controller *client.Client, directory string, session protocol.SessionID) error
CaptureRecording reads only an explicitly owned conversation. Missing entry pages are completed against the captured history revision before removal. Tool details are read through Client's revision-checked public API.
func Execute ¶
func Execute(ctx context.Context, controller *client.Client, directory string, command protocol.Command) (protocol.Output, error)
Execute journals a durable acceptance command before sending it. Unknown admission is inspected by its original identity, never replayed. Successful session creation and backup ownership are published atomically with settling that identity. This also covers a lost creation response before Own is called.
func ImportReportOwnership ¶
ImportReportOwnership merges old reports from fixed acceptance paths and explicit UUID fields before the caller replaces latest.json. Titles, global Node snapshots and filesystem scans never grant ownership.
func Own ¶
Own durably records an explicitly created acceptance session before any further work. It merges with previous runs, including removal tombstones.
func OwnedSessions ¶
OwnedSessions returns only explicitly recorded sessions that have not been confirmed removed. A runner uses it after a child exits before reporting its created sessions; result rows never establish cleanup ownership.
func PackageToolAlias ¶
PackageToolAlias returns the canonical identity defined by the package tool naming contract: the first eight BLAKE3 bytes of the owner name. Callers must verify the declared tool against the turn's captured package version; an arbitrary tool with a matching suffix is never accepted.
func SelectConfig ¶
func SelectConfig(snapshot protocol.Snapshot, requested *protocol.SessionConfig) (protocol.SessionConfig, error)
SelectConfig resolves the enabled acceptance model and its default effort without changing Node defaults or retaining a resource or assistant binding.
Types ¶
type CaseResult ¶
type CaseResult struct {
ID string `json:"id"`
Group string `json:"group"`
Title string `json:"title"`
Status string `json:"status"`
Detail string `json:"detail"`
Duration time.Duration `json:"duration"`
Session string `json:"session,omitempty"`
OwnedSessions []string `json:"owned_sessions,omitempty"`
Turns []string `json:"turns"`
Evidence []Evidence `json:"evidence"`
Uncertain bool `json:"uncertain,omitempty"`
}
func ListBackendCases ¶
func ListBackendCases(suite string) ([]CaseResult, error)
ListBackendCases describes the explicit suite without accessing a Client.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder aggregates copied frames in memory. Flush merges them with any canonical capture already on disk. Append does no filesystem work.
func NewRecorder ¶
func (*Recorder) Append ¶
func (recorder *Recorder) Append(frame RecordingFrame) error
type RecordingFrame ¶
type RecordingFrame struct {
At time.Duration `json:"at"`
Snapshot protocol.ConversationSnapshot `json:"snapshot"`
}
type RecordingSession ¶
type RecordingSession struct {
Version int `json:"version"`
Node protocol.NodeID `json:"node"`
Session protocol.SessionID `json:"session"`
Captured time.Time `json:"captured"`
History protocol.ConversationHistory `json:"history"`
Tools []RecordingTool `json:"tools"`
Frames []RecordingFrame `json:"frames"`
Truncated bool `json:"truncated"`
DroppedFrames int `json:"dropped_frames"`
}
RecordingSession contains only a test-owned conversation's public history, snapshots and original tool details. It never serializes a Node snapshot, SessionConfig, turn capture, provider settings or credential configuration. Truncated includes omitted history, tool details and frames. A replay must expose that flag rather than claim to reproduce the entire live run.
func ReadRecording ¶
func ReadRecording(directory string, session protocol.SessionID) (RecordingSession, error)
type RecordingTool ¶
type RecordingTool struct {
Reference protocol.ToolDetailReference `json:"reference"`
Detail *protocol.ToolDetail `json:"detail,omitempty"`
Error string `json:"error,omitempty"`
}
type Report ¶
type Report struct {
Version int `json:"version"`
Node protocol.NodeID `json:"node,omitempty"`
Suite string `json:"suite"`
Started time.Time `json:"started"`
Finished time.Time `json:"finished"`
Provider string `json:"provider"`
Model string `json:"model"`
Effort *protocol.Effort `json:"effort,omitempty"`
Cases []CaseResult `json:"cases"`
}
func Cleanup ¶
func Cleanup(ctx context.Context, controller *client.Client, directory string, emit func(CaseResult)) (report Report, resultErr error)
Cleanup imports only explicit identities from this directory's ledger and previous reports. It preserves bounded recordings before revision-checked removal. Failed or unknown operations remain recorded for another inspection; no title-based discovery or user-session scan is used to grant ownership.
func RunBackend ¶
func RunBackend(ctx context.Context, controller *client.Client, options Options, emit func(CaseResult)) (report Report, resultErr error)
RunBackend is opt-in: ordinary tests never call it with a real model. Each case creates only unassigned sessions and confines its fixtures to their workspaces. The caller retains ownership of the already started Client.
type ReportPaths ¶
func WriteReport ¶
func WriteReport(directory string, report Report) (ReportPaths, error)
WriteReport publishes private, complete files at fixed paths. The report contains test-owned evidence; HTML always treats that evidence as plain text.