openresponses

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OfficialSourceCommit     = "92c12d96d7b61d6d15e2214daa5e9c6000ab6e1c"
	OfficialSchemaDigest     = "sha256:997c4cf16c349751502813f46ea79b2c88880b23171b69f7f2c3d4bf5b330529"
	OfficialComplianceDigest = "sha256:63b5e6595ac831ee74b8e887af76c28d69aee8e2ec7d9e99dc688eec4bccb7fb"
)

Pinned official profile digests for testkit validation (independent of production codecs).

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendEmulatorHarness

type BackendEmulatorHarness interface {
	RunBackendEmulatorScenario(ctx context.Context, scenarioID string) error
}

type BinaryFixtureDescriptor

type BinaryFixtureDescriptor struct {
	ID        string `json:"id"`
	MediaType string `json:"media_type"`
	SizeBytes int64  `json:"size_bytes"`
	Digest    string `json:"digest"`
	RelPath   string `json:"rel_path"`
}

BinaryFixtureDescriptor describes neutral binary fixture files (images, audio, etc.).

func (BinaryFixtureDescriptor) Validate

func (b BinaryFixtureDescriptor) Validate() error

type BoundedCapture

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

BoundedCapture manages a thread-safe, bounded slice of RequestObservations with redaction support.

func NewBoundedCapture

func NewBoundedCapture(maxSize int, redactHeaders []string) *BoundedCapture

func (*BoundedCapture) Capture

func (b *BoundedCapture) Capture(obs RequestObservation) error

func (*BoundedCapture) Len

func (b *BoundedCapture) Len() int

func (*BoundedCapture) Observations

func (b *BoundedCapture) Observations() []RequestObservation

func (*BoundedCapture) OverflowCount

func (b *BoundedCapture) OverflowCount() int

type CleanupContract

type CleanupContract interface {
	Close() error
	IsClosed() bool
}

CleanupContract specifies idempotent teardown rules.

type DirectWireHarness

type DirectWireHarness interface {
	RunDirectWireScenario(ctx context.Context, scenarioID string) error
}

type FixtureDescriptor

type FixtureDescriptor struct {
	ID               string `json:"id"`
	Name             string `json:"name"`
	Category         string `json:"category"`
	SchemaDigest     string `json:"schema_digest"`
	ComplianceDigest string `json:"compliance_digest"`
	SourceCommit     string `json:"source_commit"`
	RelPath          string `json:"rel_path"`
}

FixtureDescriptor links official fixture metadata to Task 1.1 ProfileDescriptor without duplicating raw bytes.

func NewOfficialFixtureDescriptor

func NewOfficialFixtureDescriptor(id, name, category, relPath string) (FixtureDescriptor, error)

NewOfficialFixtureDescriptor creates a FixtureDescriptor bound to the Task 1.1 Profile.

func (FixtureDescriptor) Validate

func (f FixtureDescriptor) Validate() error

type FrontendStubHarness

type FrontendStubHarness interface {
	RunFrontendStubScenario(ctx context.Context, scenarioID string) error
}

type FullBlackBoxHarness

type FullBlackBoxHarness interface {
	RunFullBlackBoxScenario(ctx context.Context, scenarioID string) error
}

type RequestObservation

type RequestObservation struct {
	ID        string      `json:"id"`
	Method    string      `json:"method"`
	URLPath   string      `json:"url_path"`
	Headers   http.Header `json:"headers"`
	Body      []byte      `json:"body,omitempty"`
	Timestamp time.Time   `json:"timestamp"`
	Redacted  bool        `json:"redacted"`
}

RequestObservation captures an observed HTTP/transport request for test assertions.

type ScenarioDescriptor

type ScenarioDescriptor struct {
	ID          string       `json:"id"`
	Kind        ScenarioKind `json:"kind"`
	Description string       `json:"description"`
}

func (ScenarioDescriptor) Validate

func (s ScenarioDescriptor) Validate() error

type ScenarioKind

type ScenarioKind string
const (
	ScenarioKindJSONText     ScenarioKind = "json_text"
	ScenarioKindSSEText      ScenarioKind = "sse_text"
	ScenarioKindTools        ScenarioKind = "tools"
	ScenarioKindMultimodal   ScenarioKind = "multimodal"
	ScenarioKindReasoning    ScenarioKind = "reasoning"
	ScenarioKindContinuation ScenarioKind = "continuation"
	ScenarioKindCompaction   ScenarioKind = "compaction"
	ScenarioKindExtensions   ScenarioKind = "extensions"
	ScenarioKindWebSocket    ScenarioKind = "websocket"
	ScenarioKindNegative     ScenarioKind = "negative_validation"
	ScenarioKindAdversarial  ScenarioKind = "adversarial"
)

type ScenarioRegistry

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

func NewScenarioRegistry

func NewScenarioRegistry() *ScenarioRegistry

func (*ScenarioRegistry) Get

func (*ScenarioRegistry) List

func (*ScenarioRegistry) Register

func (r *ScenarioRegistry) Register(sd ScenarioDescriptor) error

type ScriptContract

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

ScriptContract manages execution of a sequence of ScriptSteps.

func NewScriptContract

func NewScriptContract(steps []ScriptStep) *ScriptContract

func (*ScriptContract) NextStep

func (s *ScriptContract) NextStep() (ScriptStep, error)

func (*ScriptContract) Remaining

func (s *ScriptContract) Remaining() int

type ScriptStep

type ScriptStep struct {
	Name            string            `json:"name"`
	MatchMethod     string            `json:"match_method"`
	MatchPath       string            `json:"match_path"`
	ResponseStatus  int               `json:"response_status"`
	ResponseBody    []byte            `json:"response_body"`
	ResponseHeaders map[string]string `json:"response_headers"`
	SimulateDelay   time.Duration     `json:"simulate_delay"`
	SimulateError   error             `json:"-"`
}

ScriptStep defines one request/response interaction in a scripted test.

type TestCleanup

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

func NewTestCleanup

func NewTestCleanup(onClose func() error) *TestCleanup

func (*TestCleanup) Close

func (c *TestCleanup) Close() error

func (*TestCleanup) IsClosed

func (c *TestCleanup) IsClosed() bool

type TestEvidenceDescriptor

type TestEvidenceDescriptor struct {
	ScenarioID    string   `json:"scenario_id"`
	Outcome       string   `json:"outcome"`
	TestArtifacts []string `json:"test_artifacts"`
}

TestEvidenceDescriptor describes scenario evidence linking for testkit validation.

func (TestEvidenceDescriptor) Validate

func (e TestEvidenceDescriptor) Validate() error

type TestVirtualClock

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

TestVirtualClock implements VirtualClock backed by deterministic time.

func NewVirtualClock

func NewVirtualClock(initial time.Time) *TestVirtualClock

func (*TestVirtualClock) Advance

func (c *TestVirtualClock) Advance(d time.Duration)

func (*TestVirtualClock) Now

func (c *TestVirtualClock) Now() time.Time

func (*TestVirtualClock) Set

func (c *TestVirtualClock) Set(t time.Time)

type VirtualClock

type VirtualClock interface {
	Now() time.Time
	Advance(d time.Duration)
	Set(t time.Time)
}

VirtualClock provides deterministic time for test execution.

Jump to

Keyboard shortcuts

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