Help us shape the future of Go! Take the 2026 Go Developer Survey

controlledquest

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package controlledquest exercises the controlled reuse workflow through a real local broker. Its provider, embeddings, token counts, and verifier are explicit deterministic fixtures, not measurements of a model's answer quality or speed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	Mode                             string     `json:"mode"`
	Generation                       string     `json:"generation"`
	Embedding                        string     `json:"embedding"`
	Verification                     string     `json:"verification"`
	PhysicalHosts                    int        `json:"physical_hosts"`
	IsolatedClients                  int        `json:"isolated_clients"`
	Passed                           int        `json:"passed"`
	Total                            int        `json:"total"`
	RequestRuns                      int        `json:"request_runs"`
	ActualFixtureWork                WorkCounts `json:"actual_fixture_work"`
	ExactOnlyReferenceCalls          int        `json:"exact_only_reference_generation_calls"`
	ExactOnlyReferenceInputTokens    int64      `json:"exact_only_reference_input_tokens"`
	ExactOnlyReferenceOutputTokens   int64      `json:"exact_only_reference_output_tokens"`
	ReferenceKind                    string     `json:"reference_kind"`
	GenerationAvoidedBySemantic      int        `json:"generation_avoided_by_semantic"`
	GenerationAvoidedByExact         int        `json:"generation_avoided_by_exact"`
	HistoricalSourceUsageProxyTokens int64      `json:"historical_source_usage_proxy_tokens"`
	ProviderAPISpendUSD              int        `json:"provider_api_spend_usd"`
	Limitations                      []string   `json:"limitations"`
	Cases                            []Row      `json:"cases"`
}

func Run

func Run(ctx context.Context) (report Report, err error)

Run creates its own temporary SQLite broker and two same-scope clients. No external generation, embedding, or verifier endpoint is contacted. The exact- only baseline is a declared count of distinct fresh requests, not an executed comparison or a measured token-saving claim.

type Row

type Row struct {
	ID              string `json:"id"`
	Passed          bool   `json:"passed"`
	BrokerRestarted bool   `json:"broker_restarted"`
	Steps           []Step `json:"steps"`
}

type Step

type Step struct {
	Name        string                       `json:"name"`
	Passed      bool                         `json:"passed"`
	Status      string                       `json:"status"`
	Reused      bool                         `json:"reused"`
	ReuseKind   string                       `json:"reuse_kind,omitempty"`
	Work        WorkCounts                   `json:"fixture_work"`
	Observation *delegation.ReuseObservation `json:"semantic_reuse,omitempty"`
}

type WorkCounts

type WorkCounts struct {
	GenerationCalls        int64 `json:"generation_calls"`
	GenerationInputTokens  int64 `json:"generation_input_tokens"`
	GenerationOutputTokens int64 `json:"generation_output_tokens"`
	EmbeddingCalls         int64 `json:"embedding_calls"`
	EmbeddingInputTokens   int64 `json:"embedding_input_tokens"`
	VerifierCalls          int64 `json:"verifier_calls"`
	VerifierInputTokens    int64 `json:"verifier_input_tokens"`
	VerifierOutputTokens   int64 `json:"verifier_output_tokens"`
}

WorkCounts count fixture execution, independently of reused historical usage. Their token values are declared fixture values, not tokenizer measurements.

Jump to

Keyboard shortcuts

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