@tangle-network/agent-eval 0.100.1 → 0.100.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +46 -1
- package/dist/index.js +66 -22
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2355,6 +2355,51 @@ declare class ExperimentTracker {
|
|
|
2355
2355
|
verdictFor(experimentId: string): Promise<ImprovementVerdictResult>;
|
|
2356
2356
|
}
|
|
2357
2357
|
|
|
2358
|
+
/**
|
|
2359
|
+
* Cross-profile leaderboard — rank agent profiles (or any grouping) over a corpus
|
|
2360
|
+
* of RunRecords on pass-rate with a Wilson CI, joined with the cost / token /
|
|
2361
|
+
* latency rollup every benchmark wants next to the score.
|
|
2362
|
+
*
|
|
2363
|
+
* This is substrate, not benchmark-specific: any consumer of agent-eval gets a
|
|
2364
|
+
* cross-harness × model leaderboard without re-implementing grouping, binomial
|
|
2365
|
+
* CIs, or the observability join. The benchmark supplies only what "passed"
|
|
2366
|
+
* means; everything else composes existing primitives (`wilson`, the RunRecord
|
|
2367
|
+
* cost/token/wall fields, the AgentProfileCell grouping key).
|
|
2368
|
+
*/
|
|
2369
|
+
|
|
2370
|
+
interface LeaderboardRow {
|
|
2371
|
+
/** Group key — the agent-profile cellId by default, else a caller dimension. */
|
|
2372
|
+
key: string;
|
|
2373
|
+
/** Display label: `harness · model` when the profile carries them, else the key. */
|
|
2374
|
+
label: string;
|
|
2375
|
+
harness?: string;
|
|
2376
|
+
model?: string;
|
|
2377
|
+
rank: number;
|
|
2378
|
+
/** Measured runs in this group. */
|
|
2379
|
+
n: number;
|
|
2380
|
+
passRate: number;
|
|
2381
|
+
passRateCi95: [number, number];
|
|
2382
|
+
/** Observability rollup — means over the group; null when no run reported it. */
|
|
2383
|
+
meanCostUsd: number | null;
|
|
2384
|
+
meanTokensIn: number | null;
|
|
2385
|
+
meanTokensOut: number | null;
|
|
2386
|
+
meanWallMs: number | null;
|
|
2387
|
+
}
|
|
2388
|
+
interface LeaderboardOptions {
|
|
2389
|
+
/** Per-run pass predicate — the benchmark defines what "passed" means (real-build
|
|
2390
|
+
* hit-rate, test-pass, etc.). The leaderboard owns only the grouping + stats. */
|
|
2391
|
+
passed: (record: RunRecord) => boolean;
|
|
2392
|
+
/** Group key. Default: the agent-profile cellId (harness × model × dimensions),
|
|
2393
|
+
* so persona/harness/model sweeps separate without parsing labels. */
|
|
2394
|
+
groupBy?: (record: RunRecord) => string;
|
|
2395
|
+
}
|
|
2396
|
+
/**
|
|
2397
|
+
* Group `records`, compute pass-rate + Wilson CI + cost/token/latency means per
|
|
2398
|
+
* group, and rank by pass-rate (cost as the tiebreaker — cheaper wins a tie).
|
|
2399
|
+
* Pure projection: no I/O, deterministic, safe to call on any RunRecord[].
|
|
2400
|
+
*/
|
|
2401
|
+
declare function leaderboard(records: RunRecord[], opts: LeaderboardOptions): LeaderboardRow[];
|
|
2402
|
+
|
|
2358
2403
|
/**
|
|
2359
2404
|
* muffled-gate-scanner — test helper that greps consumer source for
|
|
2360
2405
|
* gate + measurement anti-patterns and fails with file:line locations.
|
|
@@ -5974,4 +6019,4 @@ type CachedJudge<TArtifact, TScenario extends Scenario$1 = Scenario$1> = JudgeCo
|
|
|
5974
6019
|
*/
|
|
5975
6020
|
declare function cachedJudge<TArtifact, TScenario extends Scenario$1 = Scenario$1>(judge: JudgeConfig<TArtifact, TScenario>, store: VerdictCacheStore, options: CachedJudgeOptions): CachedJudge<TArtifact, TScenario>;
|
|
5976
6021
|
|
|
5977
|
-
export { ATTESTATION_ALGORITHM, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, AgentEvalError, type AgreementResult, type AlignmentOp, AnalyzeTracesInput, AnalyzeTracesOptions, AnalyzeTracesResult, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, type AssertCrossFamilyOptions, type AssertSingleBackendOptions, type AttestationProvenance, type AttestationVerification, type AttestedReport, type AutoPrClient, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, type BackendDescriptor, BaselineReport, BehaviorAssertion, BehavioralMetrics, BenchmarkReport, BenchmarkRunner, BenchmarkRunnerConfig, type BisectOptions, type BisectResult, type BisectStep, type BlendWeights, BudgetBreachError, BudgetGuard, BudgetLedgerEntry, BudgetSpec, type BuildAgreementJudgeOptions, type CachedJudge, type CachedJudgeOptions, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateComparison, type CandidateScenario, type CausalAttributionReport, type CellVerdict, ChannelRollup, ChatRequest, CheckResult, CollectedArtifacts, type CommandRunner, type CompareLabels, CompletionCriterion, ConfigError, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, type ContractCheckResult, type ContractJudgeOptions, type ContractMetric, type ContractReport, type ContractRule, type ContractRuleKind, type ContractSpan, type ContractVerdict, type ContractViolation, ConvergenceTracker, CorrectnessChecker, type CostEntry, CostLedger, type CostReport, type CostSummary, CostTracker, CreateChatClientOpts, type CreateDefaultReviewerOptions, type CreateExperimentInput, type CreateSandboxPoolOpts, CrossFamilyError, type CrossTraceDiff, type CrossTraceDiffOptions, DEFAULT_AGENT_SLOS, DEFAULT_FINDERS, DEFAULT_MUTATION_PRIMITIVES, DEFAULT_MUTATORS, DEFAULT_PR_REVIEW_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, Dataset, DatasetScenario, type DecideNextUserTurnOpts, DefaultVerdict, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DescriptionLengthCandidate, type DescriptionLengthConfig, type DescriptionLengthDecision, type DescriptionLengthEvidence, DescriptionLengthGate, type DescriptionLengthRejectionCode, type DetectorEvent, type DetectorSeverity, type DetectorSignal, type DiffScorecardOptions, type DirEntry, type DiscoverPersonasOptions, type DiscoveredPersona, DriverResult, DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type EnsembleAggregate, type EnsembleJudgeOptions, type ErrorCountPattern, type ErrorStreakOptions, type EvalToolDef, EvalTraceStore, type EvolutionRound, type ExecutorConfig, type Expectation, type Experiment, type ExperimentProvenance, type ExperimentRep, type ExperimentStats, type ExperimentStore, ExperimentTracker, type ExperimentTrackerOptions, type ExperimentVerdict, type ExportedRewardModel, type ExtractOptions, type ExtractResult, type FactorContribution, type FactorialCell, FailureClass, FeedbackLabel, FeedbackTrajectory, FeedbackTrajectoryStore, type FieldAgreementSpec, type FieldDestination, type FileChange, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, type GhCliClientOptions, type GoldScenario, type GoldSplit, type GoldenSeverity, type GoldenSpec, HarnessConfig, type HeldOutPartition, type HiddenCriteriaGrader, type HiddenGradeResult, type HiddenLeak, HoldoutAuditor, type HttpGithubClientOptions, INTENT_MATCH_JUDGE_VERSION, type ImageData, type ImprovementThresholds, type ImprovementVerdictResult, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JudgeError, type JudgeFamily, type JudgeFleetOptions, JudgeFn, JudgeParseError, type JudgeReplayResult, type JudgeRetryOutcome, type JudgeRetryPolicy, JudgeRunner, type JudgeScoreInput, type JudgeVerdict, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, Layer, LayerResult, type LiveProofArtifact, type LiveProofConfig, type LiveProofContext, type LiveProofResult, LlmClientOptions, LlmSpan, MODEL_PRICING, type MakeEvalToolsConfig, type MatchResult, type MatcherResult, type MergeOptions, MetricsCollector, type ModelCostRollup, type ModelPreflight, type ModelSeats, ModelsUnreachableError, type MuffledFinder, type MuffledFinding, type MultiToolchainLayerConfig, type Mutator, Mutex, type NoLeakOptions, type NoProgressOptions, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, OtelExportConfig, OtelExporter, type OtelPipelineHandle, type OtelPipelineOptions, PairwiseSteeringOptimizer, type ParaphraseRobustnessScenarioInput, type ParaphraseRobustnessScenarioResult, type ParseStudentLabel, type PartitionHeldOutOptions, PersonaConfig, type Playbook, type PlaybookEntry, type PoolSlot, type PrReviewAuditCase, type PrReviewBenchmarkSummary, type PrReviewComment, type PrReviewMatchedFinding, type PrReviewOutcome, type PrReviewReferenceFinding, type PrReviewScore, type PrReviewScoreWeights, type PrReviewSeverity, type PrReviewSource, type PreflightModelsOptions, type PreflightOutcome, ProductClient, ProductClientConfig, type PromptHandle, PromptRegistry, type ProposeAutomatedPullRequestInput, type ProposeAutomatedPullRequestResult, type ProvenanceReader, type RecordRunsOptions, type ReferenceMatchResult, type ReferenceReplayAdapter, type ReferenceReplayAdapterFn, type ReferenceReplayAdapterLike, type ReferenceReplayAggregate, type ReferenceReplayCandidate, type ReferenceReplayCase, type ReferenceReplayCaseRun, type ReferenceReplayExecutionScenario, type ReferenceReplayItem, type ReferenceReplayMatch, type ReferenceReplayMatchStrategy, type ReferenceReplayMatcher, type ReferenceReplayPromotionDecision, type ReferenceReplayPromotionPolicy, type ReferenceReplayRun, type ReferenceReplayRunContext, type ReferenceReplayRunOptions, type ReferenceReplayRunStore, type ReferenceReplayScenario, type ReferenceReplayScenarioScore, type ReferenceReplayScore, type ReferenceReplayScoreOptions, type ReferenceReplaySplit, type ReferenceReplaySplitComparison, type ReferenceReplaySteeringRowsOptions, type ReflectionContext, type ReflectionProposal, ReleaseConfidenceScorecard, ReleaseConfidenceThresholds, type RenderStudentPrompt, type RepeatedActionOptions, type RepoRef, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RoutedField, Run, type RunCommandInput, type RunCommandResult, type RunDistillationOptions, type RunDistillationResult, RunFilter, RunRecord, type RunRecordBackend, type RunRecordFilter, RunScore, RunScoreWeights, RunSplitTag, SandboxDriver, SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type ScanOptions, Scenario, type ScenarioCost, ScenarioFile, ScenarioRegistry, ScenarioResult, type Scorecard, type ScorecardCell, type ScorecardCellDiff, type ScorecardDiff, type ScorecardEntry, type ScorecardLogLine, type ScoredTarget, type SeatName, type SeatPresetName, SeatUnsetError, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SerializedRegex, Severity, type SingleBackendDivergence, SingleBackendError, type SingleBackendField, type SingleBackendReport, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, type SpanPredicate, type SplitGoldOptions, SteeringBundle, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type StepAttribution, type StreamingDetector, type SynthesisReason, type SynthesisTarget, TestResult, type TextMatcher, type ThresholdContract, TokenCounter, type TokenSpec, type ToolMatcher, ToolSpan, TraceAnalystSpan, type TraceContract, TraceContractBuilder, TraceEmitter, TraceStore, type TracedAnalystOptions, type TracedJudgeOptions, Trajectory, TrajectoryStep, type TreatmentClass, type TreatmentGate, type TreatmentGateInput, type TreatmentGateOptions, type TrialTrace, TurnMetrics, UI_FINDING_SEVERITIES, UI_LENSES, UNIVERSAL_FINDERS, type UiFinding, type UiFindingScreenshot, type UiFindingSeverity, type UiLens, type VerdictCacheStats, type VerdictCacheStore, VerifyContext, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkerDriverContext, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, adversarialJudge, agentProfileHash, agentProfileId, agentProfileModelId, agentVisibleFields, aggregateJudgeVerdicts, aggregatePrReviewScore, analyzeAntiSlop, appendScorecard, assertCrossFamily, assertModelsServed, assertNoHiddenLeak, assertSingleBackend, assignHeldOutTag, attachCostToReport, attest, bisect, blendHeldout, buildAgreementJudge, buildDriverSystemPrompt, buildReflectionPrompt, buildReviewerPrompt, buildWorkerDriverSystemPrompt, cachedJudge, canaryLeakView, canonicalJson, causalAttribution, checkBehavioralCanary, checkCanaries, checkSlos, checkTraceContracts, classifyTreatment, codeExecutionJudge, coherenceJudge, collectionPreserved, commentsForSource, commitBisect, compareReferenceReplay, compilerJudge, computeExperimentStats, contentHash, contractJudge, costReport, createAntiSlopJudge, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createIntentMatchJudge, createSandboxPool, crossTraceDiff, dataDescriptionBits, decideNextUserTurn, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultBlendWeights, defaultJudges, defaultParseStudentLabel, defaultReferenceReplayMatcher, defaultRenderStudentPrompt, deployGateLayer, diffScorecard, discoverPersonas, distillPlaybook, ensembleJudge, errorStreakDetector, estimateCost, estimateTokens, evaluateContract, evaluateOracles, evaluateTraceContract, executeScenario, expectAgent, exportRewardModel, extractAssetUrls, extractErrorCount, fieldAgreement, fileContains, fileExists, fileExperimentStore, fileVerdictCache, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findSkipCountsAsPass, flowLayer, fnv1a32, formatBenchmarkReport, formatDriverReport, formatFindings, formatScorecardDiff, gateTreatmentApplied, gateTreatmentFromMetrics, gateTreatmentFromSpans, gateTreatmentFromToolSpans, ghCliClient, gitProvenanceReader, precision as goldenPrecision, gradeOnHidden, hashContent, hashToUnit, hiddenGrade, htmlContainsElement, httpGithubClient, improvementVerdict, inMemoryExperimentStore, inMemoryReferenceReplayStore, inMemoryRunRecordBackend, inMemoryVerdictCache, isHiddenDestination, isModelPriced, isOtelConfigured, jsonShape, jsonlReferenceReplayStore, jsonlRunRecordBackend, judgeFamily, keyPreserved, linterJudge, loadGoldScenarios, loadScorecard, loadScorerFromGrader, localCommandRunner, lowercaseMutator, makeEvalTools, matchGoldens, matchSpan, mergeLayerResults, modelDescriptionBits, multiToolchainLayer, noProgressDetector, notBlocked, observeAll, paraphraseRobustness, paraphraseRobustnessScenarios, parseGoldJsonl, parseReflectionResponse, partitionHeldOut, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, preflightModels, printDriverSummary, index as profile, promptBisect, proposeSynthesisTargets, recordRuns, recordRunsToScorecard, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatches, renderMarkdownReport, renderPlaybookMarkdown, repeatedActionDetector, replayScorerOverCorpus, replayTraceThroughJudge, resolveModelPricing, resolveSeat, routeFields, rowCount, rowWhere, runAssertions, runBehavioralCanaries, runCanaries, runDistillation, runE2EWorkflow, runExpectations, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runLiveProof, runReferenceReplay, runScore, runSelfPlay, scanForMuffledGates, scoreContinuity, scorePrReviewComments, scorePrReviewSource, scoreReferenceReplay, seatPresets, securityJudge, sentenceReorderMutator, splitGold, statusAdvanced, summarizePrReviewBenchmark, testJudge, textInSnapshot, toLangfuseEnvelope, toOpenAiTool, toPrometheusText, traceContract, traceJudge, traceJudgeEnsemble, tracedAnalyzeTraces, typoMutator, urlContains, verifyAttestation, visualDiff, viteDeployRunner, weightedRecall, whitespaceCollapseMutator, withHeldoutBlend, withJudgeRetry, withOtelPipeline, wranglerDeployRunner };
|
|
6022
|
+
export { ATTESTATION_ALGORITHM, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, AgentEvalError, type AgreementResult, type AlignmentOp, AnalyzeTracesInput, AnalyzeTracesOptions, AnalyzeTracesResult, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, type AssertCrossFamilyOptions, type AssertSingleBackendOptions, type AttestationProvenance, type AttestationVerification, type AttestedReport, type AutoPrClient, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, type BackendDescriptor, BaselineReport, BehaviorAssertion, BehavioralMetrics, BenchmarkReport, BenchmarkRunner, BenchmarkRunnerConfig, type BisectOptions, type BisectResult, type BisectStep, type BlendWeights, BudgetBreachError, BudgetGuard, BudgetLedgerEntry, BudgetSpec, type BuildAgreementJudgeOptions, type CachedJudge, type CachedJudgeOptions, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateComparison, type CandidateScenario, type CausalAttributionReport, type CellVerdict, ChannelRollup, ChatRequest, CheckResult, CollectedArtifacts, type CommandRunner, type CompareLabels, CompletionCriterion, ConfigError, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, type ContractCheckResult, type ContractJudgeOptions, type ContractMetric, type ContractReport, type ContractRule, type ContractRuleKind, type ContractSpan, type ContractVerdict, type ContractViolation, ConvergenceTracker, CorrectnessChecker, type CostEntry, CostLedger, type CostReport, type CostSummary, CostTracker, CreateChatClientOpts, type CreateDefaultReviewerOptions, type CreateExperimentInput, type CreateSandboxPoolOpts, CrossFamilyError, type CrossTraceDiff, type CrossTraceDiffOptions, DEFAULT_AGENT_SLOS, DEFAULT_FINDERS, DEFAULT_MUTATION_PRIMITIVES, DEFAULT_MUTATORS, DEFAULT_PR_REVIEW_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, Dataset, DatasetScenario, type DecideNextUserTurnOpts, DefaultVerdict, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DescriptionLengthCandidate, type DescriptionLengthConfig, type DescriptionLengthDecision, type DescriptionLengthEvidence, DescriptionLengthGate, type DescriptionLengthRejectionCode, type DetectorEvent, type DetectorSeverity, type DetectorSignal, type DiffScorecardOptions, type DirEntry, type DiscoverPersonasOptions, type DiscoveredPersona, DriverResult, DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type EnsembleAggregate, type EnsembleJudgeOptions, type ErrorCountPattern, type ErrorStreakOptions, type EvalToolDef, EvalTraceStore, type EvolutionRound, type ExecutorConfig, type Expectation, type Experiment, type ExperimentProvenance, type ExperimentRep, type ExperimentStats, type ExperimentStore, ExperimentTracker, type ExperimentTrackerOptions, type ExperimentVerdict, type ExportedRewardModel, type ExtractOptions, type ExtractResult, type FactorContribution, type FactorialCell, FailureClass, FeedbackLabel, FeedbackTrajectory, FeedbackTrajectoryStore, type FieldAgreementSpec, type FieldDestination, type FileChange, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, type GhCliClientOptions, type GoldScenario, type GoldSplit, type GoldenSeverity, type GoldenSpec, HarnessConfig, type HeldOutPartition, type HiddenCriteriaGrader, type HiddenGradeResult, type HiddenLeak, HoldoutAuditor, type HttpGithubClientOptions, INTENT_MATCH_JUDGE_VERSION, type ImageData, type ImprovementThresholds, type ImprovementVerdictResult, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JudgeError, type JudgeFamily, type JudgeFleetOptions, JudgeFn, JudgeParseError, type JudgeReplayResult, type JudgeRetryOutcome, type JudgeRetryPolicy, JudgeRunner, type JudgeScoreInput, type JudgeVerdict, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, Layer, LayerResult, type LeaderboardOptions, type LeaderboardRow, type LiveProofArtifact, type LiveProofConfig, type LiveProofContext, type LiveProofResult, LlmClientOptions, LlmSpan, MODEL_PRICING, type MakeEvalToolsConfig, type MatchResult, type MatcherResult, type MergeOptions, MetricsCollector, type ModelCostRollup, type ModelPreflight, type ModelSeats, ModelsUnreachableError, type MuffledFinder, type MuffledFinding, type MultiToolchainLayerConfig, type Mutator, Mutex, type NoLeakOptions, type NoProgressOptions, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, OtelExportConfig, OtelExporter, type OtelPipelineHandle, type OtelPipelineOptions, PairwiseSteeringOptimizer, type ParaphraseRobustnessScenarioInput, type ParaphraseRobustnessScenarioResult, type ParseStudentLabel, type PartitionHeldOutOptions, PersonaConfig, type Playbook, type PlaybookEntry, type PoolSlot, type PrReviewAuditCase, type PrReviewBenchmarkSummary, type PrReviewComment, type PrReviewMatchedFinding, type PrReviewOutcome, type PrReviewReferenceFinding, type PrReviewScore, type PrReviewScoreWeights, type PrReviewSeverity, type PrReviewSource, type PreflightModelsOptions, type PreflightOutcome, ProductClient, ProductClientConfig, type PromptHandle, PromptRegistry, type ProposeAutomatedPullRequestInput, type ProposeAutomatedPullRequestResult, type ProvenanceReader, type RecordRunsOptions, type ReferenceMatchResult, type ReferenceReplayAdapter, type ReferenceReplayAdapterFn, type ReferenceReplayAdapterLike, type ReferenceReplayAggregate, type ReferenceReplayCandidate, type ReferenceReplayCase, type ReferenceReplayCaseRun, type ReferenceReplayExecutionScenario, type ReferenceReplayItem, type ReferenceReplayMatch, type ReferenceReplayMatchStrategy, type ReferenceReplayMatcher, type ReferenceReplayPromotionDecision, type ReferenceReplayPromotionPolicy, type ReferenceReplayRun, type ReferenceReplayRunContext, type ReferenceReplayRunOptions, type ReferenceReplayRunStore, type ReferenceReplayScenario, type ReferenceReplayScenarioScore, type ReferenceReplayScore, type ReferenceReplayScoreOptions, type ReferenceReplaySplit, type ReferenceReplaySplitComparison, type ReferenceReplaySteeringRowsOptions, type ReflectionContext, type ReflectionProposal, ReleaseConfidenceScorecard, ReleaseConfidenceThresholds, type RenderStudentPrompt, type RepeatedActionOptions, type RepoRef, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RoutedField, Run, type RunCommandInput, type RunCommandResult, type RunDistillationOptions, type RunDistillationResult, RunFilter, RunRecord, type RunRecordBackend, type RunRecordFilter, RunScore, RunScoreWeights, RunSplitTag, SandboxDriver, SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type ScanOptions, Scenario, type ScenarioCost, ScenarioFile, ScenarioRegistry, ScenarioResult, type Scorecard, type ScorecardCell, type ScorecardCellDiff, type ScorecardDiff, type ScorecardEntry, type ScorecardLogLine, type ScoredTarget, type SeatName, type SeatPresetName, SeatUnsetError, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SerializedRegex, Severity, type SingleBackendDivergence, SingleBackendError, type SingleBackendField, type SingleBackendReport, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, type SpanPredicate, type SplitGoldOptions, SteeringBundle, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type StepAttribution, type StreamingDetector, type SynthesisReason, type SynthesisTarget, TestResult, type TextMatcher, type ThresholdContract, TokenCounter, type TokenSpec, type ToolMatcher, ToolSpan, TraceAnalystSpan, type TraceContract, TraceContractBuilder, TraceEmitter, TraceStore, type TracedAnalystOptions, type TracedJudgeOptions, Trajectory, TrajectoryStep, type TreatmentClass, type TreatmentGate, type TreatmentGateInput, type TreatmentGateOptions, type TrialTrace, TurnMetrics, UI_FINDING_SEVERITIES, UI_LENSES, UNIVERSAL_FINDERS, type UiFinding, type UiFindingScreenshot, type UiFindingSeverity, type UiLens, type VerdictCacheStats, type VerdictCacheStore, VerifyContext, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkerDriverContext, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, adversarialJudge, agentProfileHash, agentProfileId, agentProfileModelId, agentVisibleFields, aggregateJudgeVerdicts, aggregatePrReviewScore, analyzeAntiSlop, appendScorecard, assertCrossFamily, assertModelsServed, assertNoHiddenLeak, assertSingleBackend, assignHeldOutTag, attachCostToReport, attest, bisect, blendHeldout, buildAgreementJudge, buildDriverSystemPrompt, buildReflectionPrompt, buildReviewerPrompt, buildWorkerDriverSystemPrompt, cachedJudge, canaryLeakView, canonicalJson, causalAttribution, checkBehavioralCanary, checkCanaries, checkSlos, checkTraceContracts, classifyTreatment, codeExecutionJudge, coherenceJudge, collectionPreserved, commentsForSource, commitBisect, compareReferenceReplay, compilerJudge, computeExperimentStats, contentHash, contractJudge, costReport, createAntiSlopJudge, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createIntentMatchJudge, createSandboxPool, crossTraceDiff, dataDescriptionBits, decideNextUserTurn, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultBlendWeights, defaultJudges, defaultParseStudentLabel, defaultReferenceReplayMatcher, defaultRenderStudentPrompt, deployGateLayer, diffScorecard, discoverPersonas, distillPlaybook, ensembleJudge, errorStreakDetector, estimateCost, estimateTokens, evaluateContract, evaluateOracles, evaluateTraceContract, executeScenario, expectAgent, exportRewardModel, extractAssetUrls, extractErrorCount, fieldAgreement, fileContains, fileExists, fileExperimentStore, fileVerdictCache, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findSkipCountsAsPass, flowLayer, fnv1a32, formatBenchmarkReport, formatDriverReport, formatFindings, formatScorecardDiff, gateTreatmentApplied, gateTreatmentFromMetrics, gateTreatmentFromSpans, gateTreatmentFromToolSpans, ghCliClient, gitProvenanceReader, precision as goldenPrecision, gradeOnHidden, hashContent, hashToUnit, hiddenGrade, htmlContainsElement, httpGithubClient, improvementVerdict, inMemoryExperimentStore, inMemoryReferenceReplayStore, inMemoryRunRecordBackend, inMemoryVerdictCache, isHiddenDestination, isModelPriced, isOtelConfigured, jsonShape, jsonlReferenceReplayStore, jsonlRunRecordBackend, judgeFamily, keyPreserved, leaderboard, linterJudge, loadGoldScenarios, loadScorecard, loadScorerFromGrader, localCommandRunner, lowercaseMutator, makeEvalTools, matchGoldens, matchSpan, mergeLayerResults, modelDescriptionBits, multiToolchainLayer, noProgressDetector, notBlocked, observeAll, paraphraseRobustness, paraphraseRobustnessScenarios, parseGoldJsonl, parseReflectionResponse, partitionHeldOut, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, preflightModels, printDriverSummary, index as profile, promptBisect, proposeSynthesisTargets, recordRuns, recordRunsToScorecard, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatches, renderMarkdownReport, renderPlaybookMarkdown, repeatedActionDetector, replayScorerOverCorpus, replayTraceThroughJudge, resolveModelPricing, resolveSeat, routeFields, rowCount, rowWhere, runAssertions, runBehavioralCanaries, runCanaries, runDistillation, runE2EWorkflow, runExpectations, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runLiveProof, runReferenceReplay, runScore, runSelfPlay, scanForMuffledGates, scoreContinuity, scorePrReviewComments, scorePrReviewSource, scoreReferenceReplay, seatPresets, securityJudge, sentenceReorderMutator, splitGold, statusAdvanced, summarizePrReviewBenchmark, testJudge, textInSnapshot, toLangfuseEnvelope, toOpenAiTool, toPrometheusText, traceContract, traceJudge, traceJudgeEnsemble, tracedAnalyzeTraces, typoMutator, urlContains, verifyAttestation, visualDiff, viteDeployRunner, weightedRecall, whitespaceCollapseMutator, withHeldoutBlend, withJudgeRetry, withOtelPipeline, wranglerDeployRunner };
|
package/dist/index.js
CHANGED
|
@@ -4491,9 +4491,9 @@ function median(sorted) {
|
|
|
4491
4491
|
const mid = Math.floor(n / 2);
|
|
4492
4492
|
return n % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
|
|
4493
4493
|
}
|
|
4494
|
-
function stddev(values,
|
|
4494
|
+
function stddev(values, mean6) {
|
|
4495
4495
|
if (values.length < 2) return 0;
|
|
4496
|
-
const variance = values.reduce((acc, v) => acc + (v -
|
|
4496
|
+
const variance = values.reduce((acc, v) => acc + (v - mean6) ** 2, 0) / values.length;
|
|
4497
4497
|
return Math.sqrt(variance);
|
|
4498
4498
|
}
|
|
4499
4499
|
function computeExperimentStats(reps, thresholds) {
|
|
@@ -4519,15 +4519,15 @@ function computeExperimentStats(reps, thresholds) {
|
|
|
4519
4519
|
return r.score;
|
|
4520
4520
|
});
|
|
4521
4521
|
const sorted = [...scores2].sort((a, b) => a - b);
|
|
4522
|
-
const
|
|
4523
|
-
const sd = stddev(scores2,
|
|
4522
|
+
const mean6 = scores2.reduce((s, v) => s + v, 0) / n;
|
|
4523
|
+
const sd = stddev(scores2, mean6);
|
|
4524
4524
|
const spread = iqr(scores2);
|
|
4525
4525
|
const rated = reps.filter((r) => typeof r.passed === "boolean");
|
|
4526
4526
|
const passRate = rated.length === 0 ? null : rated.filter((r) => r.passed).length / rated.length;
|
|
4527
4527
|
const stable = spread < t.iqrUnstableAbove && sd < t.stddevUnstableAbove;
|
|
4528
4528
|
return {
|
|
4529
4529
|
median: median(sorted),
|
|
4530
|
-
mean:
|
|
4530
|
+
mean: mean6,
|
|
4531
4531
|
min: sorted[0],
|
|
4532
4532
|
max: sorted[n - 1],
|
|
4533
4533
|
iqr: spread,
|
|
@@ -4697,6 +4697,49 @@ var ExperimentTracker = class {
|
|
|
4697
4697
|
}
|
|
4698
4698
|
};
|
|
4699
4699
|
|
|
4700
|
+
// src/leaderboard.ts
|
|
4701
|
+
function mean3(xs) {
|
|
4702
|
+
return xs.length ? xs.reduce((a, b) => a + b, 0) / xs.length : null;
|
|
4703
|
+
}
|
|
4704
|
+
function leaderboard(records, opts) {
|
|
4705
|
+
const keyOf = opts.groupBy ?? ((r) => r.agentProfile?.cellId ?? "ungrouped");
|
|
4706
|
+
const groups = /* @__PURE__ */ new Map();
|
|
4707
|
+
for (const r of records) {
|
|
4708
|
+
const k = keyOf(r);
|
|
4709
|
+
const g = groups.get(k);
|
|
4710
|
+
if (g) g.push(r);
|
|
4711
|
+
else groups.set(k, [r]);
|
|
4712
|
+
}
|
|
4713
|
+
const rows = [...groups.entries()].map(([key, rs]) => {
|
|
4714
|
+
const passes = rs.filter((r) => opts.passed(r)).length;
|
|
4715
|
+
const ci = wilson(passes, rs.length);
|
|
4716
|
+
const profile = rs[0].agentProfile;
|
|
4717
|
+
const harness = profile?.harness?.id;
|
|
4718
|
+
const model = profile?.model;
|
|
4719
|
+
return {
|
|
4720
|
+
key,
|
|
4721
|
+
label: harness && model ? `${harness} \xB7 ${model}` : key,
|
|
4722
|
+
...harness ? { harness } : {},
|
|
4723
|
+
...model ? { model } : {},
|
|
4724
|
+
rank: 0,
|
|
4725
|
+
n: rs.length,
|
|
4726
|
+
passRate: ci.estimate,
|
|
4727
|
+
passRateCi95: [ci.lower, ci.upper],
|
|
4728
|
+
meanCostUsd: mean3(rs.map((r) => r.costUsd)),
|
|
4729
|
+
meanTokensIn: mean3(rs.map((r) => r.tokenUsage.input)),
|
|
4730
|
+
meanTokensOut: mean3(rs.map((r) => r.tokenUsage.output)),
|
|
4731
|
+
meanWallMs: mean3(rs.map((r) => r.wallMs))
|
|
4732
|
+
};
|
|
4733
|
+
});
|
|
4734
|
+
rows.sort(
|
|
4735
|
+
(a, b) => b.passRate - a.passRate || (a.meanCostUsd ?? Infinity) - (b.meanCostUsd ?? Infinity)
|
|
4736
|
+
);
|
|
4737
|
+
rows.forEach((row, i) => {
|
|
4738
|
+
row.rank = i + 1;
|
|
4739
|
+
});
|
|
4740
|
+
return rows;
|
|
4741
|
+
}
|
|
4742
|
+
|
|
4700
4743
|
// src/muffled-gate-scanner.ts
|
|
4701
4744
|
import { existsSync, readdirSync, readFileSync, statSync } from "fs";
|
|
4702
4745
|
import { join } from "path";
|
|
@@ -6242,12 +6285,12 @@ async function paraphraseRobustness(prompt, mutators, scoreFn, options = {}) {
|
|
|
6242
6285
|
variantScores.push({ mutator: id, score, mutated });
|
|
6243
6286
|
all.push(score);
|
|
6244
6287
|
}
|
|
6245
|
-
const
|
|
6246
|
-
const variance = all.reduce((a, v) => a + (v -
|
|
6288
|
+
const mean6 = all.reduce((a, b) => a + b, 0) / all.length;
|
|
6289
|
+
const variance = all.reduce((a, v) => a + (v - mean6) ** 2, 0) / all.length;
|
|
6247
6290
|
const stdDev = Math.sqrt(variance);
|
|
6248
|
-
const ref = Math.abs(
|
|
6291
|
+
const ref = Math.abs(mean6) > 1e-9 ? Math.abs(mean6) : 1;
|
|
6249
6292
|
const robustness = Math.max(0, 1 - stdDev / ref);
|
|
6250
|
-
return { originalScore, variantScores, meanScore:
|
|
6293
|
+
return { originalScore, variantScores, meanScore: mean6, stdDev, robustness };
|
|
6251
6294
|
}
|
|
6252
6295
|
var lowercaseMutator = (p) => p.toLowerCase();
|
|
6253
6296
|
var sentenceReorderMutator = (p, seed) => {
|
|
@@ -6313,8 +6356,8 @@ async function paraphraseRobustnessScenarios(args) {
|
|
|
6313
6356
|
});
|
|
6314
6357
|
scores2.push(out.score);
|
|
6315
6358
|
}
|
|
6316
|
-
const
|
|
6317
|
-
deltas[m.name] =
|
|
6359
|
+
const mean6 = scores2.reduce((a, b) => a + b, 0) / scores2.length;
|
|
6360
|
+
deltas[m.name] = mean6 - originalScore;
|
|
6318
6361
|
paraphrasedAll.push(...scores2);
|
|
6319
6362
|
}
|
|
6320
6363
|
const paraphrasedMean = paraphrasedAll.length === 0 ? originalScore : paraphrasedAll.reduce((a, b) => a + b, 0) / paraphrasedAll.length;
|
|
@@ -6648,8 +6691,8 @@ async function proposeSynthesisTargets(dataset, traceStore, options = {}) {
|
|
|
6648
6691
|
const sRuns = runs.filter((r) => r.scenarioId === s.id);
|
|
6649
6692
|
const scores2 = sRuns.map((r) => r.outcome?.score).filter((x) => typeof x === "number");
|
|
6650
6693
|
if (scores2.length < 3) continue;
|
|
6651
|
-
const
|
|
6652
|
-
const variance = scores2.reduce((a, b) => a + (b -
|
|
6694
|
+
const mean6 = scores2.reduce((a, b) => a + b, 0) / scores2.length;
|
|
6695
|
+
const variance = scores2.reduce((a, b) => a + (b - mean6) ** 2, 0) / scores2.length;
|
|
6653
6696
|
if (variance > varianceThreshold) {
|
|
6654
6697
|
targets.push({
|
|
6655
6698
|
reason: "high-variance",
|
|
@@ -8104,7 +8147,7 @@ function decideReferenceReplayPromotion(baseline, candidate, policy = {}) {
|
|
|
8104
8147
|
regressions
|
|
8105
8148
|
};
|
|
8106
8149
|
}
|
|
8107
|
-
const requiredMeanDelta =
|
|
8150
|
+
const requiredMeanDelta = mean4(compared.map((item) => item.f1Delta));
|
|
8108
8151
|
if (requiredMeanDelta < minF1Delta) {
|
|
8109
8152
|
return {
|
|
8110
8153
|
promote: false,
|
|
@@ -8340,7 +8383,7 @@ function clamp012(value) {
|
|
|
8340
8383
|
function sum2(values) {
|
|
8341
8384
|
return values.reduce((acc, value) => acc + value, 0);
|
|
8342
8385
|
}
|
|
8343
|
-
function
|
|
8386
|
+
function mean4(values) {
|
|
8344
8387
|
return values.length ? sum2(values) / values.length : 0;
|
|
8345
8388
|
}
|
|
8346
8389
|
function formatPct(value) {
|
|
@@ -8794,10 +8837,10 @@ var HeldOutGate = class {
|
|
|
8794
8837
|
afterHoldout.push(run.outcome.holdoutScore);
|
|
8795
8838
|
}
|
|
8796
8839
|
const productiveRuns = beforeHoldout.length;
|
|
8797
|
-
const candidateSearchMean =
|
|
8798
|
-
const candidateHoldoutMean =
|
|
8799
|
-
const baselineSearchMean =
|
|
8800
|
-
const baselineHoldoutMean =
|
|
8840
|
+
const candidateSearchMean = mean5(scores(candidate, "searchScore", "search"));
|
|
8841
|
+
const candidateHoldoutMean = mean5(scores(candidate, "holdoutScore", "holdout"));
|
|
8842
|
+
const baselineSearchMean = mean5(scores(baseline, "searchScore", "search"));
|
|
8843
|
+
const baselineHoldoutMean = mean5(scores(baseline, "holdoutScore", "holdout"));
|
|
8801
8844
|
const overfitGap = safeDiff(candidateSearchMean, candidateHoldoutMean);
|
|
8802
8845
|
const baselineOverfitGap = safeDiff(baselineSearchMean, baselineHoldoutMean);
|
|
8803
8846
|
const medianCandidateCost = medianFinite(candidate.map((r) => r.costUsd));
|
|
@@ -8909,7 +8952,7 @@ function scores(runs, field, splitFilter) {
|
|
|
8909
8952
|
}
|
|
8910
8953
|
return out;
|
|
8911
8954
|
}
|
|
8912
|
-
function
|
|
8955
|
+
function mean5(xs) {
|
|
8913
8956
|
if (xs.length === 0) return Number.NaN;
|
|
8914
8957
|
return xs.reduce((s, x) => s + x, 0) / xs.length;
|
|
8915
8958
|
}
|
|
@@ -8949,9 +8992,9 @@ function passOrthogonality(input) {
|
|
|
8949
8992
|
sims.push(cosineSimilarity(vectors[i], vectors[j]));
|
|
8950
8993
|
}
|
|
8951
8994
|
}
|
|
8952
|
-
const
|
|
8995
|
+
const mean6 = sims.length === 0 ? 0 : sims.reduce((a, b) => a + b, 0) / sims.length;
|
|
8953
8996
|
return {
|
|
8954
|
-
orthogonality: Math.max(0, Math.min(1, 1 -
|
|
8997
|
+
orthogonality: Math.max(0, Math.min(1, 1 - mean6)),
|
|
8955
8998
|
passCount: passes.length,
|
|
8956
8999
|
similarities: sims
|
|
8957
9000
|
};
|
|
@@ -10431,6 +10474,7 @@ export {
|
|
|
10431
10474
|
judgeSpans,
|
|
10432
10475
|
keyPreserved,
|
|
10433
10476
|
knowledgeReadinessTracePayload,
|
|
10477
|
+
leaderboard,
|
|
10434
10478
|
linterJudge,
|
|
10435
10479
|
llmJudge,
|
|
10436
10480
|
llmSpanFromProvider,
|