benchmarks

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ProtocolSHA256 = "646841dbb7c790e2e372f4c47b1357eb64b6cb6e29750b502896a04fd77b12b3"

ProtocolSHA256 is the exact-byte digest of docs/benchmark/spec.md v1. Changes to that contract require regenerating this fingerprint.

View Source
const WaiverAPDomainAbsent = "ap_domain_absent"

WaiverAPDomainAbsent is the owner's recorded acceptance that a pilot set has no artificial-photosynthesis held-out question (spec section 2; owner, 2026-10-19).

Variables

This section is empty.

Functions

func CanonicalJSON added in v0.2.0

func CanonicalJSON(v any) ([]byte, error)

CanonicalJSON returns stored/report JSON: JCS plus one LF.

func CheckAgentLeak added in v0.2.0

func CheckAgentLeak(s Set, bibliography [][]Identifier, text []string) error

CheckAgentLeak rejects all reference reviews in the set, including other questions' reviews, in final identifiers and substantive answer text.

func ReadAgentArtifact added in v0.2.0

func ReadAgentArtifact(path string, dst any) error

ReadAgentArtifact applies the benchmark's strict JSON rules, including missing fields, duplicate keys, unknown fields and non-finite numbers, to agent files.

func ValidateCandidateSet added in v0.2.0

func ValidateCandidateSet(dir string, allowAPFallback bool) error

ValidateCandidateSet checks unapproved, snapshot-free pilot input without executing it or changing its lifecycle. allowAPFallback is an explicit curator opt-in for the owner's documented AP exception; it relaxes only AP presence. Callers must separately establish the source-list evidence for that fallback.

Types

type Aggregate added in v0.2.0

type Aggregate struct {
	Condition     string   `json:"condition"`
	Domain        *string  `json:"domain"`
	Metric        string   `json:"metric"`
	K             *int     `json:"k"`
	QuestionCount int      `json:"question_count"`
	MacroMean     *float64 `json:"macro_mean"`
	Micro         *Ratio   `json:"micro"`
}

type Approval added in v0.2.0

type Approval struct {
	Approver   string   `json:"approver"`
	ApprovedAt string   `json:"approved_at"`
	Waivers    []string `json:"waivers,omitempty"`
}

type AtK added in v0.2.0

type AtK struct {
	K         int   `json:"k"`
	Recall    Ratio `json:"recall_at_k"`
	Precision Ratio `json:"precision_at_k"`
}

type BenchmarkFixture

type BenchmarkFixture struct {
	ID          string   `json:"id"`
	Description string   `json:"description"`
	Tools       []string `json:"tools"`
}

type BenchmarkMetric

type BenchmarkMetric struct {
	ID             string  `json:"id"`
	Label          string  `json:"label"`
	Score          float64 `json:"score"`
	Numerator      int     `json:"numerator"`
	Denominator    int     `json:"denominator"`
	Interpretation string  `json:"interpretation"`
}

type Budgets added in v0.2.0

type Budgets struct {
	MaxHTTPRequests int   `json:"max_http_requests"`
	MaxWallClockMS  int64 `json:"max_wall_clock_ms"`
}

type Capture added in v0.2.0

type Capture struct {
	CapturedAt    string `json:"captured_at"`
	RforgeVersion string `json:"rforge_version"`
	Revision      string `json:"revision"`
	Rights        string `json:"rights"`
}

type CaptureFailure added in v0.2.0

type CaptureFailure struct {
	QuestionID string `json:"question_id"`
	PlanCall   int    `json:"plan_call"`
	Provider   string `json:"provider"`
	Sequence   int    `json:"sequence"`
	HTTPStatus *int   `json:"http_status"`
	Check      string `json:"check"`
	Why        string `json:"why"`
}

CaptureFailure is private operational evidence, never an agent/scorer input. HTTPStatus is null when no response was received (or no call was attempted).

type CitationAudit added in v0.2.0

type CitationAudit struct {
	ClaimIndex    int                `json:"claimIndex"`
	EvidenceIndex int                `json:"evidenceIndex"`
	Check         claims.CheckResult `json:"check"`
}

type CitationFacetCounts added in v0.2.0

type CitationFacetCounts struct {
	Passed       int `json:"passed"`
	Failed       int `json:"failed"`
	Inconclusive int `json:"inconclusive"`
	Missing      int `json:"missing"`
}

CitationFacetCounts keeps unavailable data visible. Missing is the subset of occurrences lacking required reference fields, not a fourth assessment state; unavailable stored evidence also contributes to Inconclusive.

type CitationRatio added in v0.2.0

type CitationRatio struct {
	Numerator   int      `json:"numerator"`
	Denominator int      `json:"denominator"`
	Value       *float64 `json:"value"`
}

CitationRatio is null-valued for 0/0, never a perfect score for no citations.

type CitationScore added in v0.2.0

type CitationScore struct {
	Status           string              `json:"citation_status"`
	Correctness      CitationRatio       `json:"citation_correctness"`
	SourceIdentity   CitationFacetCounts `json:"sourceIdentity"`
	ContentIntegrity CitationFacetCounts `json:"contentIntegrity"`
	PassageMatch     CitationFacetCounts `json:"passageMatch"`
	// Audit belongs in the private scoring artifact, not an agent-visible gold set.
	Audit []CitationAudit `json:"audit"`
}

func ScoreCitations added in v0.2.0

func ScoreCitations(records []claims.Claim, input claims.CheckInput) (CitationScore, error)

ScoreCitations recomputes every claim-to-source citation occurrence against the caller's locked evidence corpus. It never trusts supplied facet states, deduplicates citations, or infers semantic support/human approval. The metric's conjunction is not an overall claim facet or a scientific truth judgment.

type CrossToolBenchmarkInput

type CrossToolBenchmarkInput struct {
	DiscoveryRelevantFound, DiscoveryRelevantTotal      int
	DedupeTrueMerges, DedupeProposedMerges              int
	ParserCorrectFields, ParserTotalFields              int
	ReferenceNormalized, ReferenceTotal                 int
	RetrievalRelevantAtK, RetrievalRelevantTotal        int
	ScreeningBaselineRecords, ScreeningModelRecords     int
	ReportReproducibleChecks, ReportReproducibleTotal   int
	PackageReproducibleChecks, PackageReproducibleTotal int
}

func DefaultCrossToolBenchmarkInput

func DefaultCrossToolBenchmarkInput() CrossToolBenchmarkInput

DefaultCrossToolBenchmarkInput contains DEMO constants, not measured results. It is never an input to the research-quality engine benchmark.

type CrossToolBenchmarkReport

type CrossToolBenchmarkReport struct {
	Purpose       string             `json:"purpose"`
	SchemaVersion string             `json:"schemaVersion"`
	Fixtures      []BenchmarkFixture `json:"fixtures"`
	Metrics       []BenchmarkMetric  `json:"metrics"`
	Markdown      string             `json:"markdown"`
}

func BuildCrossToolBenchmarkReport

func BuildCrossToolBenchmarkReport(input CrossToolBenchmarkInput) CrossToolBenchmarkReport

func (CrossToolBenchmarkReport) HasFixture

func (r CrossToolBenchmarkReport) HasFixture(id string) bool

func (CrossToolBenchmarkReport) HasMetric

func (r CrossToolBenchmarkReport) HasMetric(id string) bool

func (CrossToolBenchmarkReport) Score

type DateExclusion added in v0.2.0

type DateExclusion struct {
	RecordID string `json:"record_id"`
	Reason   string `json:"reason"`
}

type EngineAggregateComparison added in v0.2.0

type EngineAggregateComparison struct {
	Condition              string            `json:"condition"`
	Domain                 *string           `json:"domain"`
	Metric                 string            `json:"metric"`
	K                      *int              `json:"k"`
	BaselineQuestionCount  int               `json:"baseline_question_count"`
	CandidateQuestionCount int               `json:"candidate_question_count"`
	Macro                  MeasurementDelta  `json:"macro"`
	Micro                  *MeasurementDelta `json:"micro,omitempty"`
}

type EngineComparison added in v0.2.0

type EngineComparison struct {
	SchemaVersion int                         `json:"schema_version"`
	Baseline      EngineReportIdentity        `json:"baseline"`
	Candidate     EngineReportIdentity        `json:"candidate"`
	Aggregates    []EngineAggregateComparison `json:"aggregates"`
	Limitations   []string                    `json:"limitations"`
}

func CompareEngineReports added in v0.2.0

func CompareEngineReports(baseline, candidate EngineReport) (EngineComparison, error)

CompareEngineReports computes qualified offline deltas without executing the engine, modifying its reports, or making a release/agent-quality judgment.

type EngineOptions added in v0.2.0

type EngineOptions struct {
	SetDir, Split, Version, Revision string
	Record                           bool
	// Optional live gateway for embedding applications; ignored in replay.
	RecordTransport http.RoundTripper
}

type EngineReport added in v0.2.0

type EngineReport struct {
	SchemaVersion   int         `json:"schema_version"`
	Purpose         string      `json:"purpose"`
	Tier            string      `json:"tier"`
	Mode            string      `json:"mode"`
	Status          string      `json:"status"`
	SetID           string      `json:"set_id"`
	SetChecksum     string      `json:"set_checksum"`
	SnapshotsSHA256 *string     `json:"snapshots_sha256"`
	Split           string      `json:"split"`
	RforgeVersion   string      `json:"rforge_version"`
	Revision        string      `json:"revision"`
	ProtocolSHA256  string      `json:"protocol_sha256"`
	K               []int       `json:"k"`
	Runs            []Run       `json:"runs"`
	Aggregates      []Aggregate `json:"aggregates"`
	Paired          []any       `json:"paired"`
	Errors          []RunError  `json:"errors"`
}

type EngineReportIdentity added in v0.2.0

type EngineReportIdentity struct {
	SchemaVersion   int     `json:"schema_version"`
	Purpose         string  `json:"purpose"`
	Tier            string  `json:"tier"`
	Mode            string  `json:"mode"`
	RforgeVersion   string  `json:"rforge_version"`
	Revision        string  `json:"revision"`
	SetID           string  `json:"set_id"`
	SetChecksum     string  `json:"set_checksum"`
	SnapshotsSHA256 *string `json:"snapshots_sha256"`
	ProtocolSHA256  string  `json:"protocol_sha256"`
	Split           string  `json:"split"`
	K               []int   `json:"k"`
}

EngineReportIdentity keeps both implementation and input identities visible. It describes report assertions, not authenticated input custody or approval.

type EngineResult added in v0.2.0

type EngineResult struct {
	Report           []byte
	Audit            []byte
	DiagnosticsDir   string
	DiagnosticsError error
}

func RunEngine added in v0.2.0

func RunEngine(ctx context.Context, o EngineOptions) (result EngineResult, runErr error)

RunEngine runs only locked plans through actual connectors and the production batch deduper. Replay has no live transport, source cache, workspace or LLM.

type Exchange added in v0.2.0

type Exchange struct {
	Sequence       int       `json:"sequence"`
	PlanCall       int       `json:"plan_call"`
	Request        Request   `json:"request"`
	RequestKey     string    `json:"request_key"`
	Response       *Response `json:"response"`
	TransportError *string   `json:"transport_error"`
	ElapsedMS      int64     `json:"elapsed_ms"`
	RetryAfterMS   int64     `json:"retry_after_ms"`
	Redactions     []string  `json:"redactions"`
}

type GoldPaper added in v0.2.0

type GoldPaper struct {
	PaperID                string       `json:"paper_id"`
	Identifiers            []Identifier `json:"identifiers"`
	IncludedListEntry      string       `json:"included_list_entry"`
	PublicationDate        string       `json:"publication_date"`
	PublicationDateLocator string       `json:"publication_date_locator"`
}

type HTTPPolicy added in v0.2.0

type HTTPPolicy struct {
	Algorithm        string `json:"algorithm"`
	MaxRetries       int    `json:"max_retries"`
	TimeoutMS        int64  `json:"timeout_ms"`
	RequestDelayMS   int64  `json:"request_delay_ms"`
	MaxRetryAfterMS  int64  `json:"max_retry_after_ms"`
	MaxResponseBytes int64  `json:"max_response_bytes"`
	MaxRedirects     int    `json:"max_redirects"`
}

type Identifier added in v0.2.0

type Identifier struct {
	Scheme string `json:"scheme"`
	Value  string `json:"value"`
}

type MeasurementDelta added in v0.2.0

type MeasurementDelta struct {
	Baseline  *float64 `json:"baseline"`
	Candidate *float64 `json:"candidate"`
	Delta     *float64 `json:"delta"`
}

MeasurementDelta is signed candidate minus baseline. Missing measurements remain nil, including when only one side is measured.

type PlanCall added in v0.2.0

type PlanCall struct {
	Source     string            `json:"source"`
	Terms      string            `json:"terms"`
	Limit      int               `json:"limit"`
	PageCursor string            `json:"page_cursor"`
	Filters    map[string]string `json:"filters"`
}

type Question added in v0.2.0

type Question struct {
	QuestionID string      `json:"question_id"`
	Question   string      `json:"question"`
	Domain     string      `json:"domain"`
	Split      string      `json:"split"`
	Review     Review      `json:"gold_source_review"`
	Gold       []GoldPaper `json:"gold"`
	SearchPlan []PlanCall  `json:"search_plan"`
	Budgets    Budgets     `json:"budgets"`
}

type QuestionAudit added in v0.2.0

type QuestionAudit struct {
	QuestionID string                 `json:"question_id"`
	Raw        []sources.SourceRecord `json:"raw"`
	Clusters   [][]string             `json:"clusters"`
}

type Ratio added in v0.2.0

type Ratio struct {
	Numerator   *int64   `json:"numerator"`
	Denominator *int64   `json:"denominator"`
	Value       *float64 `json:"value"`
}

type Request added in v0.2.0

type Request struct {
	Method     string              `json:"method"`
	URL        string              `json:"url"`
	Headers    map[string][]string `json:"headers"`
	BodySHA256 *string             `json:"body_sha256"`
}

type Response added in v0.2.0

type Response struct {
	Status     int                 `json:"status"`
	Headers    map[string][]string `json:"headers"`
	BodySHA256 string              `json:"body_sha256"`
}

type Review added in v0.2.0

type Review struct {
	Identifiers         []Identifier `json:"identifiers"`
	Title               string       `json:"title"`
	SearchDate          string       `json:"search_date"`
	SearchDatePrecision string       `json:"search_date_precision,omitempty"`
	SearchDateLocator   string       `json:"search_date_locator"`
	IncludedListLocator string       `json:"included_list_locator"`
	Rights              string       `json:"rights"`
}

type Run added in v0.2.0

type Run struct {
	QuestionID          string   `json:"question_id"`
	Domain              string   `json:"domain"`
	Condition           string   `json:"condition"`
	Repetition          int      `json:"repetition"`
	StopReason          string   `json:"stop_reason"`
	Returned            *int64   `json:"returned"`
	GoldCount           int      `json:"gold_count"`
	AtK                 []AtK    `json:"at_k"`
	Recall              Ratio    `json:"recall"`
	DedupeStatus        string   `json:"dedupe_status"`
	TrueMerges          *int64   `json:"dedupe_true_merges"`
	FalseMerges         *int64   `json:"dedupe_false_merges"`
	UnjudgedMerges      *int64   `json:"dedupe_unjudged_merges"`
	MissedMerges        *int64   `json:"dedupe_missed_merges"`
	HTTPRequests        *int64   `json:"http_requests"`
	SearchCalls         *int64   `json:"search_calls"`
	ToolCalls           *int64   `json:"tool_calls"`
	WallClockMS         *int64   `json:"wall_clock_ms"`
	InputTokens         *int64   `json:"input_tokens"`
	OutputTokens        *int64   `json:"output_tokens"`
	CostUSD             *float64 `json:"cost_usd"`
	DateExcluded        *int64   `json:"date_excluded"`
	CitationStatus      string   `json:"citation_status"`
	CitationCorrectness Ratio    `json:"citation_correctness"`
}

func ScoreAgentBibliography added in v0.2.0

func ScoreAgentBibliography(q Question, ks []int, bibliography [][]Identifier) (Run, error)

ScoreAgentBibliography reuses engine-tier identity/rank scoring. Each entry is one bibliography rank, not a hidden tool hit. Without raw membership, dedupe counts are unavailable rather than guessed zero. Citation facets require a separately pinned corpus/checker and are explicitly not implemented here.

type RunError added in v0.2.0

type RunError struct {
	QuestionID *string `json:"question_id"`
	Code       string  `json:"code"`
}

type Set added in v0.2.0

type Set struct {
	SchemaVersion     int        `json:"schema_version"`
	SetID             string     `json:"set_id"`
	State             string     `json:"state"`
	Approval          *Approval  `json:"approval"`
	ReviewSheetSHA256 string     `json:"review_sheet_sha256"`
	SnapshotsSHA256   *string    `json:"snapshots_sha256"`
	SetChecksum       string     `json:"set_checksum"`
	K                 []int      `json:"k"`
	HTTPPolicy        HTTPPolicy `json:"http_policy"`
	Questions         []Question `json:"questions"`
}

func LoadAgentSet added in v0.2.0

func LoadAgentSet(dir string) (Set, error)

LoadAgentSet validates the full locked package before either scoring or preparing agent inputs. Callers must not expose this return value to agents.

type SnapshotIndex added in v0.2.0

type SnapshotIndex struct {
	SchemaVersion int                `json:"schema_version"`
	SetID         string             `json:"set_id"`
	Capture       Capture            `json:"capture"`
	Questions     []SnapshotQuestion `json:"questions"`
}

type SnapshotQuestion added in v0.2.0

type SnapshotQuestion struct {
	QuestionID       string            `json:"question_id"`
	StartedAt        string            `json:"started_at"`
	WallClockMS      int64             `json:"wall_clock_ms"`
	Timing           []Timing          `json:"timing"`
	StopReason       string            `json:"stop_reason"`
	DateExclusions   []DateExclusion   `json:"date_exclusions"`
	RecordExclusions []DateExclusion   `json:"record_exclusions,omitempty"`
	Identities       map[string]string `json:"identities"`
	IdentityEvidence map[string]string `json:"identity_evidence"`
	Exchanges        []Exchange        `json:"exchanges"`
}

type Timing added in v0.2.0

type Timing struct {
	Stage     string `json:"stage"`
	PlanCall  *int   `json:"plan_call"`
	Sequence  *int   `json:"sequence"`
	ElapsedMS int64  `json:"elapsed_ms"`
}

Jump to

Keyboard shortcuts

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