@tangle-network/agent-eval 0.36.0 → 0.37.0
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/{chunk-HIO4UIS5.js → chunk-L5UNCDAJ.js} +207 -1
- package/dist/chunk-L5UNCDAJ.js.map +1 -0
- package/dist/index.d.ts +111 -3
- package/dist/index.js +204 -1
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/traces.d.ts +81 -2
- package/dist/traces.js +7 -1
- package/package.json +1 -1
- package/dist/chunk-HIO4UIS5.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ import { R as Run$1, S as Span, b as TraceEvent, A as Artifact$1, B as BudgetLed
|
|
|
8
8
|
export { i as EventFilter, E as EventKind, j as FAILURE_CLASSES, F as FailureClass, k as FileSystemTraceStore, l as FileSystemTraceStoreOptions, G as GenericSpan, I as InMemoryTraceStore, J as JudgeSpan, M as Message, e as RetrievalSpan, m as RunLayer, n as RunStatus, f as SandboxSpan, o as SpanBase, p as SpanFilter, d as SpanKind, q as SpanStatus, r as TRACE_SCHEMA_VERSION, a as ToolSpan, s as isJudgeSpan, t as isLlmSpan, u as isRetrievalSpan, v as isSandboxSpan, w as isToolSpan } from './store-Db2Bv8Cf.js';
|
|
9
9
|
import { L as LlmClientOptions, m as LlmCallRequest, n as LlmCallResult } from './researcher-DeZ_EArp.js';
|
|
10
10
|
export { C as CallbackResearcher, a as CallbackResearcherOptions, b as CampaignFactoryParams, c as CampaignIntegrityPolicy, d as CampaignRunContext, e as CampaignRunOutcome, f as CampaignRunner, g as CampaignScenario, h as CampaignVariant, E as EvalCampaignOptions, i as EvalCampaignResult, j as ExperimentPlan, k as ExperimentResult, F as FailedRun, l as FailureMode, o as LlmCallError, p as LlmClient, q as LlmMessage, s as LlmRouteAssertionError, t as LlmRouteRequirements, u as LlmUsage, N as NoopResearcher, R as Researcher, S as SteeringChange, v as assertLlmRoute, w as backoffMs, x as callLlm, y as callLlmJson, z as isTransientLlmError, A as probeLlm, r as runEvalCampaign, B as stripFencedJson } from './researcher-DeZ_EArp.js';
|
|
11
|
-
import { TraceAnalysisStore, AnalyzeTracesOptions } from './traces.js';
|
|
12
|
-
export {
|
|
11
|
+
import { TraceAnalysisStore, AnalyzeTracesOptions, OtelExporter, OtelExportConfig, AnalyzeTracesInput, AnalyzeTracesResult } from './traces.js';
|
|
12
|
+
export { AnalyzeTracesTurnSnapshot, DEFAULT_REDACTION_RULES, DEFAULT_TRACE_ANALYST_BUDGETS, DatasetOverview, ExportableSpan, OTEL_AGENT_EVAL_SCOPE, OtlpExport, OtlpFileTraceStore, OtlpFileTraceStoreOptions, OtlpResourceSpans, OtlpSpan, QueryTracesPage, REDACTION_VERSION, RedactionReport, RedactionRule, ReplayCache, ReplayCacheEntry, ReplayCacheMissError, ReplayCacheStats, ReplayFetchOptions, SearchSpanResult, SearchTraceResult, SpanMatchRecord, SpanNotFoundError, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_SUBAGENT_DESCRIPTION, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TraceAnalystByteBudgets, TraceAnalystFilters, TraceAnalystHookOptions, TraceAnalystSpan, TraceAnalystSpanKind, TraceAnalystSpanStatus, TraceAnalystTraceSummary, TraceFileMissingError, TraceInsightContext, TraceInsightFinding, TraceInsightPanelRole, TraceInsightPromptInput, TraceInsightQualityGate, TraceInsightQuestion, TraceInsightReadiness, TraceInsightSuite, TraceInsightTask, TraceNotFoundError, ViewSpansResult, ViewTraceOversized, ViewTraceResult, analyzeTraces, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, inferDomainKeywords, iterateRawCalls, otelRunCompleteHook, planTraceInsightQuestions, redactString, redactValue, scoreTraceInsightReadiness, tokenizeDomainWords, traceAnalystFunctionGroup, traceAnalystOnRunComplete } from './traces.js';
|
|
13
13
|
import { t as JudgeInput, u as JudgeFn, v as BenchmarkRunnerConfig, S as Scenario, x as BenchmarkReport, y as ProductClientConfig, C as CheckResult, T as TestResult, z as PersonaConfig, D as DriverResult, A as DriverState, E as CollectedArtifacts, F as ScenarioResult, i as ReleaseConfidenceThresholds, g as ReleaseConfidenceScorecard, G as TurnMetrics, H as ScenarioFile, I as CompletionCriterion } from './release-report-D2ykiLSe.js';
|
|
14
14
|
export { K as ArtifactCheck, L as ArtifactResult, B as BootstrapOptions, a as BootstrapResult, M as CorpusAgreementOptions, N as CorpusAgreementPerDimension, O as CorpusAgreementReport, Q as CorpusScoreRecord, U as EvalResult, W as FeedbackPattern, X as JudgeConfig, J as JudgeReplayGateArgs, Y as JudgeRubric, Z as JudgeScore, P as PairedBootstrapOptions, b as PairedBootstrapResult, _ as PersonaRigor, R as ReleaseConfidenceAxis, c as ReleaseConfidenceAxisName, d as ReleaseConfidenceInput, e as ReleaseConfidenceIssue, f as ReleaseConfidenceMetrics, h as ReleaseConfidenceStatus, j as ReleaseTraceEvidence, k as RenderReleaseReportOptions, $ as RouteMap, a0 as RubricDimension, a1 as Turn, a2 as TurnResult, V as Verdict, l as assertReleaseConfidence, m as benjaminiHochberg, a3 as bonferroni, n as bootstrapCi, a4 as cohensD, a5 as confidenceInterval, a6 as corpusInterRaterAgreement, a7 as corpusInterRaterAgreementFromJudgeScores, o as evaluateReleaseConfidence, a8 as interRaterReliability, p as judgeReplayGate, a9 as mannWhitneyU, aa as normalizeScores, q as pairedBootstrap, ab as pairedMde, ac as pairedTTest, ad as partialCredit, r as releaseTraceEvidenceFromMultiShotTrials, s as renderReleaseReport, ae as requiredSampleSize, af as weightedMean, w as wilcoxonSignedRank } from './release-report-D2ykiLSe.js';
|
|
15
15
|
import { TCloud } from '@tangle-network/tcloud';
|
|
@@ -6278,4 +6278,112 @@ declare function aggregateTrialsByMode(trials: TrialResult[], opts: {
|
|
|
6278
6278
|
mode: AggregatorMode;
|
|
6279
6279
|
}): TrialAggregate;
|
|
6280
6280
|
|
|
6281
|
-
export { ANALYST_SEVERITIES, ActionableSideInfo, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, AgentEvalError, type AgentProfile, type AggregatorMode, type AlignmentOp, type Analyst, type AnalystContext, type AnalystCost, type AnalystFinding, type AnalystHooks, type AnalystInputKind, AnalystRegistry, type AnalystRegistryOptions, type AnalystRequirements, type AnalystRunEvent, type AnalystRunInputs, type AnalystRunResult, type AnalystRunSummary, type AnalystSeverity, AnalyzeTracesOptions, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, Artifact$1 as Artifact, type Artifact as ArtifactCheckArtifact, type ArtifactEventLike, type ArtifactValidator, type AutoPrClient, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, BackendIntegrityError, type BackendIntegrityReport, BaselineReport, BehaviorAssertion, BenchmarkReport, BenchmarkRunner, BenchmarkRunnerConfig, type BisectOptions, type BisectResult, type BisectStep, BudgetBreachError, BudgetGuard, BudgetLedgerEntry, type BudgetPolicy, BudgetSpec, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateScenario, type CausalAttributionReport, type CellVerdict, type ChatCallOpts, type ChatClient, type ChatRequest, type ChatResponse, type ChatTransport, CheckResult, type CliBridgeTransportOpts, type CodeMutationOutcome, type CodeMutationRunner, CollectedArtifacts, type CommandRunner, CompletionCriterion, type CompletionRequirement, type CompletionVerdict, type CompositePolicy, type ConceptComplexity, type ConceptFinding, type ConceptSpec, type ConceptWeightStrategy, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, type ContractMetric, type ContractReport, ControlEvalResult, ConvergenceTracker, type CorrectnessChecker, type CostEntry, CostLedger, type CostLedgerGeneration, type CostLedgerSnapshot, type CostSummary, CostTracker, type CounterfactualContext, type CounterfactualMutation, type CounterfactualResult, type CounterfactualRunner, type CreateChatClientOpts, type CreateCompositeMutatorOpts, type CreateDefaultReviewerOptions, type CreateSandboxCodeMutatorOpts, type CreateSandboxPoolOpts, type CreateTraceAnalystKindOpts, type CrossTraceDiff, type CrossTraceDiffOptions, D1ExperimentStore, type D1ExperimentStoreOptions, type D1Like, type D1PreparedStatementLike, DEFAULT_AGENT_SLOS, DEFAULT_COMPLEXITY_WEIGHTS, DEFAULT_FINDERS, DEFAULT_HARNESS_OBJECTIVES, DEFAULT_MUTATORS, DEFAULT_PR_REVIEW_SCORE_WEIGHTS, DEFAULT_RUN_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, DEFAULT_TRACE_ANALYST_KINDS, Dataset, DatasetScenario, type DecideNextUserTurnOpts, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DiffPolicy, type DiffScorecardOptions, type DirEntry, type DirectProviderTransportOpts, type DiscoverPersonasOptions, type DiscoveredPersona, DriverResult, DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type ErrorCountPattern, type EvidenceRef, type EvolutionRound, EvolvableVariant, type ExecutorConfig, type Expectation, type Experiment, type Run as ExperimentRun, type ExperimentStore, ExperimentTracker, type ExportedRewardModel, type ExtractOptions, type ExtractResult, FAILURE_MODE_KIND_SPEC, FINDING_SUBJECT_GRAMMAR_PROMPT, FINDING_SUBJECT_KINDS, type FactorContribution, type FactorialCell, type FailureClusterConfig, FeedbackLabel, FeedbackTrajectory, FeedbackTrajectoryStore, type FileChange, FileSystemExperimentStore, type FileSystemExperimentStoreOptions, type FindingSubject, type FindingSubjectKind, FindingSubjectStringSchema, type FindingsDiff, FindingsStore, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, GateDecision, type GhCliClientOptions, type GoldenSeverity, type GoldenSpec, type HarnessAdapter, HarnessConfig, type HarnessExperimentConfig, type HarnessExperimentResult, type HarnessIntervention, type HarnessRunRequest, type HarnessRunResult, type HarnessScenario, type HarnessSelection, type HarnessVariant, type HarnessVariantReport, HeldOutGateConfig, HoldoutAuditor, type HostedJudgeConfig, type HostedJudgeDimension, type HostedJudgeRequest, type HostedJudgeResponse, type HostedRunCriticConfig, type HostedRunScoreRequest, type HostedRunScoreResponse, type HttpGithubClientOptions, type HypothesisManifest, type HypothesisResult, IMPROVEMENT_KIND_SPEC, INTENT_MATCH_JUDGE_VERSION, type ImageData, InMemoryExperimentStore, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntegrationGateSurface, type IntegrationInvokeFailureInput, type IntegrationManifestGateInput, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JsonlTrialCache, type JudgeAdapterOpts, type JudgeFleetOptions, JudgeFn, JudgeInput, type JudgeReplayResult, type JudgeRetryOutcome, type JudgeRetryPolicy, JudgeRunner, KIND_EXPECTED_SUBJECTS, KNOWLEDGE_GAP_KIND_SPEC, KNOWLEDGE_POISONING_KIND_SPEC, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, Layer, LayerResult, type LineageKind, type LineageKindResolver, type LineageNode, LineageRecorder, type LiveProofArtifact, type LiveProofConfig, type LiveProofContext, type LiveProofResult, LlmCallRequest, LlmCallResult, LlmClientOptions, type LlmCorrectnessCheckerOpts, LlmSpan, LockedJsonlAppender, MODEL_PRICING, type MatchResult, type MatcherResult, type MeasurementPolicy, type MergeOptions, MetricsCollector, type MockTransportOpts, type MuffledFinder, type MuffledFinding, MultiLayerVerifier, MultiShotMutateAdapter, MultiShotOptimizationResult, MultiShotRunner, MultiShotScorer, MultiShotTrialResult, type MultiToolchainLayerConfig, MutateAdapter, type MutationAttempt, type MutationChannel, MutationTelemetry, type Mutator, Mutex, Objective, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, PairwiseSteeringOptimizer, type ParaphraseRobustnessScenarioInput, type ParaphraseRobustnessScenarioResult, ParetoResult, type PersistedFinding, 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 ProducedProposal, type ProducedState, ProductClient, ProductClientConfig, type ProductionEvolveConfig, type ProductionLoopCronConfig, type ProductionLoopDecision, type ProductionLoopRenderContext, type ProductionLoopResult, type ProductionShipConfig, type PromptHandle, PromptRegistry, TrialResult as PromptTrialResult, type ProposalEventLike, type ProposeAutomatedPullRequestInput, type ProposeAutomatedPullRequestResult, RAW_FINDING_SCHEMA_PROMPT, type RawAnalystFinding, RawAnalystFindingSchema, 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 RegistryRunOpts, ReleaseConfidenceScorecard, ReleaseConfidenceThresholds, type RepoRef, type RequirementCheck, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RouterTransportOpts, Run$1 as Run, type RunCommandInput, type RunCommandResult, type RunConfig, RunCritic, type RunCriticAdapterOpts, type RunCriticOptions, type RunDiff, RunFilter, type RunProductionLoopOptions, RunRecord, type RunScore, type RunScoreWeights, RunSplitTag, type RunTrace, type RuntimeEventLike, SEMANTIC_CONCEPT_JUDGE_VERSION, SandboxDriver, SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type SandboxSdkTransportOpts, type SatisfiedBy, type ScanOptions, Scenario, type ScenarioCost, ScenarioFile, ScenarioRegistry, ScenarioResult, type Scorecard, type ScorecardCell, type ScorecardCellDiff, type ScorecardDiff, type ScorecardEntry, type ScorecardLogLine, type ScoredTarget, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SemanticConceptJudgeAdapterOpts, type SemanticConceptJudgeInput, type SemanticConceptJudgeOptions, type SemanticConceptJudgeResult, type SeriesConvergenceOptions, type SeriesConvergenceResult, Severity, type SignedManifest, type SignedManifestAlgo, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, Span, type SteeringBundle, type SteeringDelta, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type SteeringRolePrompt, type StepAttribution, type SynthesisReason, type SynthesisTarget, type TaskGold, TestResult, type ThresholdContract, TokenCounter, type TokenSpec, type ToolCallEventLike, TraceAnalysisStore, type TraceAnalystAdapterOpts, type TraceAnalystGolden, type TraceAnalystKindSpec, TraceEmitter, TraceEvent, TraceStore, type TraceToolGroupName, Trajectory, TrajectoryStep, type TrialAggregate, type TrialAttempt, TrialCache, TrialTelemetry, TurnMetrics, UNIVERSAL_FINDERS, type ValidationContext, type ValidationIssue, type ValidationResult, VariantAggregate, type VerifierAdapterOpts, VerifyContext, VerifyOptions, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkflowTopology, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, adversarialJudge, agentProfileHash, aggregatePrReviewScore, aggregateRunScore, aggregateTrialsByMode, analyzeAntiSlop, analyzeSeries, appendScorecard, assertRealBackend, attributeCounterfactuals, bisect, buildDriverSystemPrompt, buildReviewerPrompt, buildTraceToolsForGroup, byteLengthRange, canaryLeakView, canonicalize, causalAttribution, checkBehavioralCanary, checkCanaries, checkSlos, clamp01, codeExecutionJudge, coherenceJudge, collectionPreserved, commentsForSource, commitBisect, compareReferenceReplay, compilerJudge, composeValidators, computeFindingId, containsAll, createAntiSlopJudge, createChatClient, createCompositeMutator, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createIntentMatchJudge, createJudgeAdapter, createLlmCorrectnessChecker, createRunCriticAdapter, createSandboxCodeMutator, createSandboxPool, createSemanticConceptJudge, createSemanticConceptJudgeAdapter, createTraceAnalystAdapter, createTraceAnalystKind, createVerifierAdapter, crossTraceDiff, decideNextUserTurn, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultIsMaterial, defaultJudges, defaultReferenceReplayMatcher, deployGateLayer, diffFindings, diffScorecard, discoverPersonas, distillPlaybook, estimateCost, estimateTokens, evaluateContract, evaluateHypothesis, evaluateOracles, executeScenario, expectAgent, exportRewardModel, extractAssetUrls, extractErrorCount, extractProducedState, fileContains, fileExists, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findSkipCountsAsPass, flowLayer, formatBenchmarkReport, formatDriverReport, formatFindings, formatScorecardDiff, ghCliClient, precision as goldenPrecision, hashContent, hashJson, htmlContainsElement, httpGithubClient, inMemoryReferenceReplayStore, integrationAsi, integrationGateEvals, integrationInvokeFailedPayload, integrationManifestResolvedPayload, integrationManifestValidatedPayload, jsonHasKeys, jsonShape, jsonlReferenceReplayStore, keyPreserved, liftSeverity, linterJudge, loadScorecard, loadScorerFromGrader, localCommandRunner, lowercaseMutator, makeFinding, matchGoldens, mergeLayerResults, mergeSteeringBundle, multiToolchainLayer, notBlocked, paraphraseRobustness, paraphraseRobustnessScenarios, parseCorrectnessResponse, parseFindingSubject, parseRawFinding, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, printDriverSummary, promptBisect, proposeAutomatedPullRequest, proposeSynthesisTargets, recordRuns, recordRunsToScorecard, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatch, regexMatches, renderFindingSubject, renderMarkdownReport, renderPlaybookMarkdown, renderPriorFindings, renderSteeringText, replayScorerOverCorpus, replayTraceThroughJudge, resetLockedAppendersForTesting, rowCount, rowWhere, runAssertions, runBehavioralCanaries, runCanaries, runCounterfactual, runE2EWorkflow, runExpectations, runHarnessExperiment, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runLiveProof, runProductionLoop, runReferenceReplay, runSelfPlay, runSemanticConceptJudge, scanForMuffledGates, scoreContinuity, scorePrReviewComments, scorePrReviewSource, scoreReferenceReplay, securityJudge, selectHarnessVariant, sentenceReorderMutator, signManifest, statusAdvanced, summarizeBackendIntegrity, summarizeHarnessResults, summarizePrReviewBenchmark, testJudge, textInSnapshot, toLangfuseEnvelope, toPrometheusText, typoMutator, urlContains, verifyCompletion, verifyManifest, visualDiff, viteDeployRunner, weightedRecall, whitespaceCollapseMutator, withJudgeRetry, wranglerDeployRunner };
|
|
6281
|
+
/**
|
|
6282
|
+
* Pipeline-level OTEL integration — auto-attaches an OTEL exporter when
|
|
6283
|
+
* OTEL_EXPORTER_OTLP_ENDPOINT is set. Pipelines call `withOtelPipeline()`
|
|
6284
|
+
* to get a configured exporter + shutdown handle without manual wiring.
|
|
6285
|
+
*
|
|
6286
|
+
* Used by: runEvalCampaign, runProductionLoop, runAgentMatrix.
|
|
6287
|
+
*/
|
|
6288
|
+
|
|
6289
|
+
interface OtelPipelineHandle {
|
|
6290
|
+
/** The active exporter, or undefined if no endpoint is configured. */
|
|
6291
|
+
exporter: OtelExporter | undefined;
|
|
6292
|
+
/** Call at pipeline end to flush + shutdown. Safe to call even if exporter is undefined. */
|
|
6293
|
+
shutdown(): Promise<void>;
|
|
6294
|
+
}
|
|
6295
|
+
interface OtelPipelineOptions {
|
|
6296
|
+
/** Override OTEL config. */
|
|
6297
|
+
otelConfig?: OtelExportConfig;
|
|
6298
|
+
/** Pipeline-specific resource attributes. */
|
|
6299
|
+
pipelineKind?: string;
|
|
6300
|
+
pipelineId?: string;
|
|
6301
|
+
}
|
|
6302
|
+
/**
|
|
6303
|
+
* Create an OTEL exporter scoped to a pipeline run. Auto-reads
|
|
6304
|
+
* OTEL_EXPORTER_OTLP_ENDPOINT from env when no explicit config is passed.
|
|
6305
|
+
*
|
|
6306
|
+
* Returns a handle with `exporter` (possibly undefined) and `shutdown()`.
|
|
6307
|
+
*/
|
|
6308
|
+
declare function withOtelPipeline(opts?: OtelPipelineOptions): OtelPipelineHandle;
|
|
6309
|
+
/**
|
|
6310
|
+
* Check if OTEL export is configured (endpoint is set).
|
|
6311
|
+
*/
|
|
6312
|
+
declare function isOtelConfigured(): boolean;
|
|
6313
|
+
|
|
6314
|
+
/**
|
|
6315
|
+
* Traced judge wrappers — instruments every LLM call inside the judge
|
|
6316
|
+
* ensemble with child spans so OTEL sinks see per-judge latency, model,
|
|
6317
|
+
* token counts, and score dimensions.
|
|
6318
|
+
*
|
|
6319
|
+
* The ensemble parent span groups all individual judge spans; each judge
|
|
6320
|
+
* gets its own child span with model + score as attributes.
|
|
6321
|
+
*/
|
|
6322
|
+
|
|
6323
|
+
interface TracedJudgeOptions {
|
|
6324
|
+
/** TraceEmitter to emit spans into. */
|
|
6325
|
+
emitter: TraceEmitter;
|
|
6326
|
+
/** Parent span id for the ensemble. If omitted, uses the emitter stack. */
|
|
6327
|
+
parentSpanId?: string;
|
|
6328
|
+
}
|
|
6329
|
+
/**
|
|
6330
|
+
* Wrap a single JudgeFn so its LLM call emits a traced span.
|
|
6331
|
+
*/
|
|
6332
|
+
declare function traceJudge(judge: JudgeFn, judgeName: string, opts: TracedJudgeOptions): JudgeFn;
|
|
6333
|
+
/**
|
|
6334
|
+
* Wrap an array of JudgeFns with tracing, running them inside an ensemble
|
|
6335
|
+
* parent span. Returns a single function that calls all judges and merges
|
|
6336
|
+
* their scores.
|
|
6337
|
+
*/
|
|
6338
|
+
declare function traceJudgeEnsemble(judges: JudgeFn[], judgeNames: string[], opts: TracedJudgeOptions): JudgeFn;
|
|
6339
|
+
|
|
6340
|
+
/**
|
|
6341
|
+
* Traced analyst wrapper — instruments `analyzeTraces` with spans so the
|
|
6342
|
+
* analyst's internal LLM calls (actor + responder turns) appear in the
|
|
6343
|
+
* trace tree. Also wraps each actor turn callback with a span.
|
|
6344
|
+
*
|
|
6345
|
+
* Since the analyst uses @ax-llm/ax internally (an agent framework with
|
|
6346
|
+
* its own turn loop), we cannot wrap individual `tc.chat()` calls without
|
|
6347
|
+
* forking ax. Instead, we wrap at the boundary:
|
|
6348
|
+
* 1. A parent span for the entire analyst run.
|
|
6349
|
+
* 2. Per-turn child spans from the `onTurn` callback (captures code,
|
|
6350
|
+
* output size, error status).
|
|
6351
|
+
* 3. Summary attributes on the parent (total turns, usage, findings).
|
|
6352
|
+
*/
|
|
6353
|
+
|
|
6354
|
+
interface TracedAnalystOptions {
|
|
6355
|
+
/** TraceEmitter for span emission. */
|
|
6356
|
+
emitter: TraceEmitter;
|
|
6357
|
+
/** Parent span id. If omitted, uses emitter stack. */
|
|
6358
|
+
parentSpanId?: string;
|
|
6359
|
+
}
|
|
6360
|
+
/**
|
|
6361
|
+
* Run `analyzeTraces` wrapped in a parent span with per-turn child spans.
|
|
6362
|
+
*/
|
|
6363
|
+
declare function tracedAnalyzeTraces(input: AnalyzeTracesInput, options: AnalyzeTracesOptions, traceOpts: TracedAnalystOptions): Promise<AnalyzeTracesResult>;
|
|
6364
|
+
|
|
6365
|
+
/**
|
|
6366
|
+
* Traced mutator wrapper — instruments reflective-mutation LLM calls.
|
|
6367
|
+
*
|
|
6368
|
+
* The reflective mutator (used by production-loop + multi-shot-optimization)
|
|
6369
|
+
* builds a prompt via `buildReflectionPrompt` and calls an LLM to produce
|
|
6370
|
+
* candidate mutations. This wrapper emits a span around each mutation call
|
|
6371
|
+
* so OTEL sinks observe:
|
|
6372
|
+
* - Model used for mutation
|
|
6373
|
+
* - Input context (target, trial count, child count)
|
|
6374
|
+
* - Output (proposal count, labels)
|
|
6375
|
+
* - Duration + cost if available
|
|
6376
|
+
*/
|
|
6377
|
+
|
|
6378
|
+
interface TracedMutatorOptions {
|
|
6379
|
+
/** TraceEmitter for span emission. */
|
|
6380
|
+
emitter: TraceEmitter;
|
|
6381
|
+
/** Parent span id. If omitted, uses emitter stack. */
|
|
6382
|
+
parentSpanId?: string;
|
|
6383
|
+
}
|
|
6384
|
+
/**
|
|
6385
|
+
* Wrap a MutateAdapter so every mutate() call emits a span.
|
|
6386
|
+
*/
|
|
6387
|
+
declare function traceMutator<P>(adapter: MutateAdapter<P>, opts: TracedMutatorOptions): MutateAdapter<P>;
|
|
6388
|
+
|
|
6389
|
+
export { ANALYST_SEVERITIES, ActionableSideInfo, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, AgentEvalError, type AgentProfile, type AggregatorMode, type AlignmentOp, type Analyst, type AnalystContext, type AnalystCost, type AnalystFinding, type AnalystHooks, type AnalystInputKind, AnalystRegistry, type AnalystRegistryOptions, type AnalystRequirements, type AnalystRunEvent, type AnalystRunInputs, type AnalystRunResult, type AnalystRunSummary, type AnalystSeverity, AnalyzeTracesInput, AnalyzeTracesOptions, AnalyzeTracesResult, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, Artifact$1 as Artifact, type Artifact as ArtifactCheckArtifact, type ArtifactEventLike, type ArtifactValidator, type AutoPrClient, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, BackendIntegrityError, type BackendIntegrityReport, BaselineReport, BehaviorAssertion, BenchmarkReport, BenchmarkRunner, BenchmarkRunnerConfig, type BisectOptions, type BisectResult, type BisectStep, BudgetBreachError, BudgetGuard, BudgetLedgerEntry, type BudgetPolicy, BudgetSpec, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateScenario, type CausalAttributionReport, type CellVerdict, type ChatCallOpts, type ChatClient, type ChatRequest, type ChatResponse, type ChatTransport, CheckResult, type CliBridgeTransportOpts, type CodeMutationOutcome, type CodeMutationRunner, CollectedArtifacts, type CommandRunner, CompletionCriterion, type CompletionRequirement, type CompletionVerdict, type CompositePolicy, type ConceptComplexity, type ConceptFinding, type ConceptSpec, type ConceptWeightStrategy, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, type ContractMetric, type ContractReport, ControlEvalResult, ConvergenceTracker, type CorrectnessChecker, type CostEntry, CostLedger, type CostLedgerGeneration, type CostLedgerSnapshot, type CostSummary, CostTracker, type CounterfactualContext, type CounterfactualMutation, type CounterfactualResult, type CounterfactualRunner, type CreateChatClientOpts, type CreateCompositeMutatorOpts, type CreateDefaultReviewerOptions, type CreateSandboxCodeMutatorOpts, type CreateSandboxPoolOpts, type CreateTraceAnalystKindOpts, type CrossTraceDiff, type CrossTraceDiffOptions, D1ExperimentStore, type D1ExperimentStoreOptions, type D1Like, type D1PreparedStatementLike, DEFAULT_AGENT_SLOS, DEFAULT_COMPLEXITY_WEIGHTS, DEFAULT_FINDERS, DEFAULT_HARNESS_OBJECTIVES, DEFAULT_MUTATORS, DEFAULT_PR_REVIEW_SCORE_WEIGHTS, DEFAULT_RUN_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, DEFAULT_TRACE_ANALYST_KINDS, Dataset, DatasetScenario, type DecideNextUserTurnOpts, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DiffPolicy, type DiffScorecardOptions, type DirEntry, type DirectProviderTransportOpts, type DiscoverPersonasOptions, type DiscoveredPersona, DriverResult, DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type ErrorCountPattern, type EvidenceRef, type EvolutionRound, EvolvableVariant, type ExecutorConfig, type Expectation, type Experiment, type Run as ExperimentRun, type ExperimentStore, ExperimentTracker, type ExportedRewardModel, type ExtractOptions, type ExtractResult, FAILURE_MODE_KIND_SPEC, FINDING_SUBJECT_GRAMMAR_PROMPT, FINDING_SUBJECT_KINDS, type FactorContribution, type FactorialCell, type FailureClusterConfig, FeedbackLabel, FeedbackTrajectory, FeedbackTrajectoryStore, type FileChange, FileSystemExperimentStore, type FileSystemExperimentStoreOptions, type FindingSubject, type FindingSubjectKind, FindingSubjectStringSchema, type FindingsDiff, FindingsStore, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, GateDecision, type GhCliClientOptions, type GoldenSeverity, type GoldenSpec, type HarnessAdapter, HarnessConfig, type HarnessExperimentConfig, type HarnessExperimentResult, type HarnessIntervention, type HarnessRunRequest, type HarnessRunResult, type HarnessScenario, type HarnessSelection, type HarnessVariant, type HarnessVariantReport, HeldOutGateConfig, HoldoutAuditor, type HostedJudgeConfig, type HostedJudgeDimension, type HostedJudgeRequest, type HostedJudgeResponse, type HostedRunCriticConfig, type HostedRunScoreRequest, type HostedRunScoreResponse, type HttpGithubClientOptions, type HypothesisManifest, type HypothesisResult, IMPROVEMENT_KIND_SPEC, INTENT_MATCH_JUDGE_VERSION, type ImageData, InMemoryExperimentStore, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntegrationGateSurface, type IntegrationInvokeFailureInput, type IntegrationManifestGateInput, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JsonlTrialCache, type JudgeAdapterOpts, type JudgeFleetOptions, JudgeFn, JudgeInput, type JudgeReplayResult, type JudgeRetryOutcome, type JudgeRetryPolicy, JudgeRunner, KIND_EXPECTED_SUBJECTS, KNOWLEDGE_GAP_KIND_SPEC, KNOWLEDGE_POISONING_KIND_SPEC, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, Layer, LayerResult, type LineageKind, type LineageKindResolver, type LineageNode, LineageRecorder, type LiveProofArtifact, type LiveProofConfig, type LiveProofContext, type LiveProofResult, LlmCallRequest, LlmCallResult, LlmClientOptions, type LlmCorrectnessCheckerOpts, LlmSpan, LockedJsonlAppender, MODEL_PRICING, type MatchResult, type MatcherResult, type MeasurementPolicy, type MergeOptions, MetricsCollector, type MockTransportOpts, type MuffledFinder, type MuffledFinding, MultiLayerVerifier, MultiShotMutateAdapter, MultiShotOptimizationResult, MultiShotRunner, MultiShotScorer, MultiShotTrialResult, type MultiToolchainLayerConfig, MutateAdapter, type MutationAttempt, type MutationChannel, MutationTelemetry, type Mutator, Mutex, Objective, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, OtelExportConfig, OtelExporter, type OtelPipelineHandle, type OtelPipelineOptions, PairwiseSteeringOptimizer, type ParaphraseRobustnessScenarioInput, type ParaphraseRobustnessScenarioResult, ParetoResult, type PersistedFinding, 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 ProducedProposal, type ProducedState, ProductClient, ProductClientConfig, type ProductionEvolveConfig, type ProductionLoopCronConfig, type ProductionLoopDecision, type ProductionLoopRenderContext, type ProductionLoopResult, type ProductionShipConfig, type PromptHandle, PromptRegistry, TrialResult as PromptTrialResult, type ProposalEventLike, type ProposeAutomatedPullRequestInput, type ProposeAutomatedPullRequestResult, RAW_FINDING_SCHEMA_PROMPT, type RawAnalystFinding, RawAnalystFindingSchema, 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 RegistryRunOpts, ReleaseConfidenceScorecard, ReleaseConfidenceThresholds, type RepoRef, type RequirementCheck, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RouterTransportOpts, Run$1 as Run, type RunCommandInput, type RunCommandResult, type RunConfig, RunCritic, type RunCriticAdapterOpts, type RunCriticOptions, type RunDiff, RunFilter, type RunProductionLoopOptions, RunRecord, type RunScore, type RunScoreWeights, RunSplitTag, type RunTrace, type RuntimeEventLike, SEMANTIC_CONCEPT_JUDGE_VERSION, SandboxDriver, SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type SandboxSdkTransportOpts, type SatisfiedBy, type ScanOptions, Scenario, type ScenarioCost, ScenarioFile, ScenarioRegistry, ScenarioResult, type Scorecard, type ScorecardCell, type ScorecardCellDiff, type ScorecardDiff, type ScorecardEntry, type ScorecardLogLine, type ScoredTarget, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SemanticConceptJudgeAdapterOpts, type SemanticConceptJudgeInput, type SemanticConceptJudgeOptions, type SemanticConceptJudgeResult, type SeriesConvergenceOptions, type SeriesConvergenceResult, Severity, type SignedManifest, type SignedManifestAlgo, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, Span, type SteeringBundle, type SteeringDelta, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type SteeringRolePrompt, type StepAttribution, type SynthesisReason, type SynthesisTarget, type TaskGold, TestResult, type ThresholdContract, TokenCounter, type TokenSpec, type ToolCallEventLike, TraceAnalysisStore, type TraceAnalystAdapterOpts, type TraceAnalystGolden, type TraceAnalystKindSpec, TraceEmitter, TraceEvent, TraceStore, type TraceToolGroupName, type TracedAnalystOptions, type TracedJudgeOptions, type TracedMutatorOptions, Trajectory, TrajectoryStep, type TrialAggregate, type TrialAttempt, TrialCache, TrialTelemetry, TurnMetrics, UNIVERSAL_FINDERS, type ValidationContext, type ValidationIssue, type ValidationResult, VariantAggregate, type VerifierAdapterOpts, VerifyContext, VerifyOptions, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkflowTopology, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, adversarialJudge, agentProfileHash, aggregatePrReviewScore, aggregateRunScore, aggregateTrialsByMode, analyzeAntiSlop, analyzeSeries, appendScorecard, assertRealBackend, attributeCounterfactuals, bisect, buildDriverSystemPrompt, buildReviewerPrompt, buildTraceToolsForGroup, byteLengthRange, canaryLeakView, canonicalize, causalAttribution, checkBehavioralCanary, checkCanaries, checkSlos, clamp01, codeExecutionJudge, coherenceJudge, collectionPreserved, commentsForSource, commitBisect, compareReferenceReplay, compilerJudge, composeValidators, computeFindingId, containsAll, createAntiSlopJudge, createChatClient, createCompositeMutator, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createIntentMatchJudge, createJudgeAdapter, createLlmCorrectnessChecker, createRunCriticAdapter, createSandboxCodeMutator, createSandboxPool, createSemanticConceptJudge, createSemanticConceptJudgeAdapter, createTraceAnalystAdapter, createTraceAnalystKind, createVerifierAdapter, crossTraceDiff, decideNextUserTurn, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultIsMaterial, defaultJudges, defaultReferenceReplayMatcher, deployGateLayer, diffFindings, diffScorecard, discoverPersonas, distillPlaybook, estimateCost, estimateTokens, evaluateContract, evaluateHypothesis, evaluateOracles, executeScenario, expectAgent, exportRewardModel, extractAssetUrls, extractErrorCount, extractProducedState, fileContains, fileExists, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findSkipCountsAsPass, flowLayer, formatBenchmarkReport, formatDriverReport, formatFindings, formatScorecardDiff, ghCliClient, precision as goldenPrecision, hashContent, hashJson, htmlContainsElement, httpGithubClient, inMemoryReferenceReplayStore, integrationAsi, integrationGateEvals, integrationInvokeFailedPayload, integrationManifestResolvedPayload, integrationManifestValidatedPayload, isOtelConfigured, jsonHasKeys, jsonShape, jsonlReferenceReplayStore, keyPreserved, liftSeverity, linterJudge, loadScorecard, loadScorerFromGrader, localCommandRunner, lowercaseMutator, makeFinding, matchGoldens, mergeLayerResults, mergeSteeringBundle, multiToolchainLayer, notBlocked, paraphraseRobustness, paraphraseRobustnessScenarios, parseCorrectnessResponse, parseFindingSubject, parseRawFinding, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, printDriverSummary, promptBisect, proposeAutomatedPullRequest, proposeSynthesisTargets, recordRuns, recordRunsToScorecard, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatch, regexMatches, renderFindingSubject, renderMarkdownReport, renderPlaybookMarkdown, renderPriorFindings, renderSteeringText, replayScorerOverCorpus, replayTraceThroughJudge, resetLockedAppendersForTesting, rowCount, rowWhere, runAssertions, runBehavioralCanaries, runCanaries, runCounterfactual, runE2EWorkflow, runExpectations, runHarnessExperiment, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runLiveProof, runProductionLoop, runReferenceReplay, runSelfPlay, runSemanticConceptJudge, scanForMuffledGates, scoreContinuity, scorePrReviewComments, scorePrReviewSource, scoreReferenceReplay, securityJudge, selectHarnessVariant, sentenceReorderMutator, signManifest, statusAdvanced, summarizeBackendIntegrity, summarizeHarnessResults, summarizePrReviewBenchmark, testJudge, textInSnapshot, toLangfuseEnvelope, toPrometheusText, traceJudge, traceJudgeEnsemble, traceMutator, tracedAnalyzeTraces, typoMutator, urlContains, verifyCompletion, verifyManifest, visualDiff, viteDeployRunner, weightedRecall, whitespaceCollapseMutator, withJudgeRetry, withOtelPipeline, wranglerDeployRunner };
|
package/dist/index.js
CHANGED
|
@@ -195,6 +195,8 @@ import {
|
|
|
195
195
|
buildTraceAnalystTools,
|
|
196
196
|
buildTraceInsightContext,
|
|
197
197
|
buildTraceInsightPrompt,
|
|
198
|
+
createOtelExporter,
|
|
199
|
+
createOtelTracingStore,
|
|
198
200
|
createReplayFetch,
|
|
199
201
|
defaultTraceInsightPanel,
|
|
200
202
|
describeTraceInsightScope,
|
|
@@ -202,6 +204,7 @@ import {
|
|
|
202
204
|
exportRunAsOtlp,
|
|
203
205
|
inferDomainKeywords,
|
|
204
206
|
iterateRawCalls,
|
|
207
|
+
otelRunCompleteHook,
|
|
205
208
|
planTraceInsightQuestions,
|
|
206
209
|
redactString,
|
|
207
210
|
redactValue,
|
|
@@ -209,7 +212,7 @@ import {
|
|
|
209
212
|
tokenizeDomainWords,
|
|
210
213
|
traceAnalystFunctionGroup,
|
|
211
214
|
traceAnalystOnRunComplete
|
|
212
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-L5UNCDAJ.js";
|
|
213
216
|
import {
|
|
214
217
|
aggregateLlm,
|
|
215
218
|
argHash,
|
|
@@ -11031,6 +11034,197 @@ function aggregateTrialsByMode(trials, opts) {
|
|
|
11031
11034
|
metrics: meanMetrics(counted.map((t) => t.metrics ?? {}))
|
|
11032
11035
|
};
|
|
11033
11036
|
}
|
|
11037
|
+
|
|
11038
|
+
// src/otel-pipeline.ts
|
|
11039
|
+
function withOtelPipeline(opts) {
|
|
11040
|
+
const config = {
|
|
11041
|
+
...opts?.otelConfig,
|
|
11042
|
+
resourceAttributes: {
|
|
11043
|
+
...opts?.pipelineKind ? { "pipeline.kind": opts.pipelineKind } : {},
|
|
11044
|
+
...opts?.pipelineId ? { "pipeline.id": opts.pipelineId } : {},
|
|
11045
|
+
...opts?.otelConfig?.resourceAttributes
|
|
11046
|
+
}
|
|
11047
|
+
};
|
|
11048
|
+
const exporter = createOtelExporter(config);
|
|
11049
|
+
return {
|
|
11050
|
+
exporter,
|
|
11051
|
+
async shutdown() {
|
|
11052
|
+
if (exporter) await exporter.shutdown();
|
|
11053
|
+
}
|
|
11054
|
+
};
|
|
11055
|
+
}
|
|
11056
|
+
function isOtelConfigured() {
|
|
11057
|
+
return !!(typeof process !== "undefined" && process.env.OTEL_EXPORTER_OTLP_ENDPOINT);
|
|
11058
|
+
}
|
|
11059
|
+
|
|
11060
|
+
// src/traced-judges.ts
|
|
11061
|
+
function traceJudge(judge, judgeName, opts) {
|
|
11062
|
+
return async (tc, input) => {
|
|
11063
|
+
const span = await opts.emitter.span({
|
|
11064
|
+
kind: "llm",
|
|
11065
|
+
name: `judge:${judgeName}`,
|
|
11066
|
+
parentSpanId: opts.parentSpanId,
|
|
11067
|
+
attributes: {
|
|
11068
|
+
"judge.name": judgeName,
|
|
11069
|
+
"eval.phase": "judge"
|
|
11070
|
+
}
|
|
11071
|
+
});
|
|
11072
|
+
try {
|
|
11073
|
+
const scores = await judge(tc, input);
|
|
11074
|
+
const composite = scores.length > 0 ? scores.reduce((sum3, s) => sum3 + s.score, 0) / scores.length : 0;
|
|
11075
|
+
await span.end({
|
|
11076
|
+
attributes: {
|
|
11077
|
+
"judge.name": judgeName,
|
|
11078
|
+
"judge.composite_score": composite,
|
|
11079
|
+
"judge.dimension_count": scores.length,
|
|
11080
|
+
"eval.phase": "judge"
|
|
11081
|
+
}
|
|
11082
|
+
});
|
|
11083
|
+
return scores;
|
|
11084
|
+
} catch (err) {
|
|
11085
|
+
await span.fail(err instanceof Error ? err : String(err));
|
|
11086
|
+
throw err;
|
|
11087
|
+
}
|
|
11088
|
+
};
|
|
11089
|
+
}
|
|
11090
|
+
function traceJudgeEnsemble(judges, judgeNames, opts) {
|
|
11091
|
+
return async (tc, input) => {
|
|
11092
|
+
const ensembleSpan = await opts.emitter.span({
|
|
11093
|
+
kind: "custom",
|
|
11094
|
+
name: "judge:ensemble",
|
|
11095
|
+
parentSpanId: opts.parentSpanId,
|
|
11096
|
+
attributes: {
|
|
11097
|
+
"judge.ensemble_size": judges.length,
|
|
11098
|
+
"eval.phase": "judge"
|
|
11099
|
+
}
|
|
11100
|
+
});
|
|
11101
|
+
try {
|
|
11102
|
+
const allScores = [];
|
|
11103
|
+
for (let i = 0; i < judges.length; i++) {
|
|
11104
|
+
const judge = judges[i];
|
|
11105
|
+
const name = judgeNames[i] ?? `judge_${i}`;
|
|
11106
|
+
const tracedFn = traceJudge(judge, name, {
|
|
11107
|
+
emitter: opts.emitter,
|
|
11108
|
+
parentSpanId: ensembleSpan.span.spanId
|
|
11109
|
+
});
|
|
11110
|
+
const scores = await tracedFn(tc, input);
|
|
11111
|
+
allScores.push(...scores);
|
|
11112
|
+
}
|
|
11113
|
+
const composite = allScores.length > 0 ? allScores.reduce((sum3, s) => sum3 + s.score, 0) / allScores.length : 0;
|
|
11114
|
+
await ensembleSpan.end({
|
|
11115
|
+
attributes: {
|
|
11116
|
+
"judge.ensemble_size": judges.length,
|
|
11117
|
+
"judge.composite_score": composite,
|
|
11118
|
+
"judge.total_dimensions": allScores.length,
|
|
11119
|
+
"eval.phase": "judge"
|
|
11120
|
+
}
|
|
11121
|
+
});
|
|
11122
|
+
return allScores;
|
|
11123
|
+
} catch (err) {
|
|
11124
|
+
await ensembleSpan.fail(err instanceof Error ? err : String(err));
|
|
11125
|
+
throw err;
|
|
11126
|
+
}
|
|
11127
|
+
};
|
|
11128
|
+
}
|
|
11129
|
+
|
|
11130
|
+
// src/traced-analyst.ts
|
|
11131
|
+
async function tracedAnalyzeTraces(input, options, traceOpts) {
|
|
11132
|
+
const parentSpan = await traceOpts.emitter.span({
|
|
11133
|
+
kind: "custom",
|
|
11134
|
+
name: "analyst:analyze-traces",
|
|
11135
|
+
parentSpanId: traceOpts.parentSpanId,
|
|
11136
|
+
attributes: {
|
|
11137
|
+
"analyst.question_length": input.question.length,
|
|
11138
|
+
"analyst.max_turns": options.maxTurns ?? 12,
|
|
11139
|
+
"analyst.max_depth": options.maxDepth ?? 1,
|
|
11140
|
+
"eval.phase": "analyst"
|
|
11141
|
+
}
|
|
11142
|
+
});
|
|
11143
|
+
const originalOnTurn = options.onTurn;
|
|
11144
|
+
const turnSpanIds = [];
|
|
11145
|
+
const wrappedOptions = {
|
|
11146
|
+
...options,
|
|
11147
|
+
onTurn: async (turn) => {
|
|
11148
|
+
const turnSpan = await traceOpts.emitter.span({
|
|
11149
|
+
kind: "custom",
|
|
11150
|
+
name: `analyst:turn-${turn.turn}`,
|
|
11151
|
+
parentSpanId: parentSpan.span.spanId,
|
|
11152
|
+
attributes: {
|
|
11153
|
+
"analyst.turn": turn.turn,
|
|
11154
|
+
"analyst.is_error": turn.isError,
|
|
11155
|
+
"analyst.code_length": turn.code.length,
|
|
11156
|
+
"analyst.output_length": turn.output.length,
|
|
11157
|
+
"eval.phase": "analyst"
|
|
11158
|
+
}
|
|
11159
|
+
});
|
|
11160
|
+
turnSpanIds.push(turnSpan.span.spanId);
|
|
11161
|
+
if (turn.isError) {
|
|
11162
|
+
await turnSpan.fail("Turn produced an error");
|
|
11163
|
+
} else {
|
|
11164
|
+
await turnSpan.end();
|
|
11165
|
+
}
|
|
11166
|
+
if (originalOnTurn) await originalOnTurn(turn);
|
|
11167
|
+
}
|
|
11168
|
+
};
|
|
11169
|
+
try {
|
|
11170
|
+
const result = await analyzeTraces(input, wrappedOptions);
|
|
11171
|
+
await parentSpan.end({
|
|
11172
|
+
attributes: {
|
|
11173
|
+
"analyst.question_length": input.question.length,
|
|
11174
|
+
"analyst.turn_count": result.turnCount,
|
|
11175
|
+
"analyst.finding_count": result.findings.length,
|
|
11176
|
+
"analyst.answer_length": result.answer.length,
|
|
11177
|
+
"eval.phase": "analyst"
|
|
11178
|
+
}
|
|
11179
|
+
});
|
|
11180
|
+
return result;
|
|
11181
|
+
} catch (err) {
|
|
11182
|
+
await parentSpan.fail(err instanceof Error ? err : String(err));
|
|
11183
|
+
throw err;
|
|
11184
|
+
}
|
|
11185
|
+
}
|
|
11186
|
+
|
|
11187
|
+
// src/traced-mutator.ts
|
|
11188
|
+
function traceMutator(adapter, opts) {
|
|
11189
|
+
return {
|
|
11190
|
+
async mutate(args) {
|
|
11191
|
+
const span = await opts.emitter.span({
|
|
11192
|
+
kind: "llm",
|
|
11193
|
+
name: `mutator:gen-${args.generation}`,
|
|
11194
|
+
parentSpanId: opts.parentSpanId,
|
|
11195
|
+
attributes: {
|
|
11196
|
+
"mutator.parent_id": args.parent.id,
|
|
11197
|
+
"mutator.generation": args.generation,
|
|
11198
|
+
"mutator.child_count": args.childCount,
|
|
11199
|
+
"mutator.top_trials": args.topTrials.length,
|
|
11200
|
+
"mutator.bottom_trials": args.bottomTrials.length,
|
|
11201
|
+
"mutator.parent_score": args.parentAggregate.meanScore,
|
|
11202
|
+
"eval.phase": "mutator"
|
|
11203
|
+
}
|
|
11204
|
+
});
|
|
11205
|
+
try {
|
|
11206
|
+
const children = await adapter.mutate(args);
|
|
11207
|
+
await span.end({
|
|
11208
|
+
attributes: {
|
|
11209
|
+
"mutator.parent_id": args.parent.id,
|
|
11210
|
+
"mutator.generation": args.generation,
|
|
11211
|
+
"mutator.child_count": args.childCount,
|
|
11212
|
+
"mutator.top_trials": args.topTrials.length,
|
|
11213
|
+
"mutator.bottom_trials": args.bottomTrials.length,
|
|
11214
|
+
"mutator.parent_score": args.parentAggregate.meanScore,
|
|
11215
|
+
"mutator.produced_count": children.length,
|
|
11216
|
+
"mutator.child_ids": children.map((c) => c.id).join(","),
|
|
11217
|
+
"eval.phase": "mutator"
|
|
11218
|
+
}
|
|
11219
|
+
});
|
|
11220
|
+
return children;
|
|
11221
|
+
} catch (err) {
|
|
11222
|
+
await span.fail(err instanceof Error ? err : String(err));
|
|
11223
|
+
throw err;
|
|
11224
|
+
}
|
|
11225
|
+
}
|
|
11226
|
+
};
|
|
11227
|
+
}
|
|
11034
11228
|
export {
|
|
11035
11229
|
AGENT_PROFILE_KINDS,
|
|
11036
11230
|
ANALYST_SEVERITIES,
|
|
@@ -11229,6 +11423,8 @@ export {
|
|
|
11229
11423
|
createJudgeAdapter,
|
|
11230
11424
|
createLlmCorrectnessChecker,
|
|
11231
11425
|
createLlmReviewer,
|
|
11426
|
+
createOtelExporter,
|
|
11427
|
+
createOtelTracingStore,
|
|
11232
11428
|
createReplayFetch,
|
|
11233
11429
|
createRunCriticAdapter,
|
|
11234
11430
|
createSandboxCodeMutator,
|
|
@@ -11312,6 +11508,7 @@ export {
|
|
|
11312
11508
|
iqr,
|
|
11313
11509
|
isJudgeSpan,
|
|
11314
11510
|
isLlmSpan,
|
|
11511
|
+
isOtelConfigured,
|
|
11315
11512
|
isRetrievalSpan,
|
|
11316
11513
|
isRunRecord,
|
|
11317
11514
|
isSandboxSpan,
|
|
@@ -11345,6 +11542,7 @@ export {
|
|
|
11345
11542
|
normalizeScores,
|
|
11346
11543
|
notBlocked,
|
|
11347
11544
|
objectiveEval,
|
|
11545
|
+
otelRunCompleteHook,
|
|
11348
11546
|
pairedBootstrap,
|
|
11349
11547
|
pairedEvalueSequence,
|
|
11350
11548
|
pairedMde,
|
|
@@ -11467,6 +11665,10 @@ export {
|
|
|
11467
11665
|
toolSpans,
|
|
11468
11666
|
traceAnalystFunctionGroup,
|
|
11469
11667
|
traceAnalystOnRunComplete,
|
|
11668
|
+
traceJudge,
|
|
11669
|
+
traceJudgeEnsemble,
|
|
11670
|
+
traceMutator,
|
|
11671
|
+
tracedAnalyzeTraces,
|
|
11470
11672
|
trialTraceFromMultiShotTrial,
|
|
11471
11673
|
typoMutator,
|
|
11472
11674
|
urlContains,
|
|
@@ -11487,6 +11689,7 @@ export {
|
|
|
11487
11689
|
wilcoxonSignedRank,
|
|
11488
11690
|
withAssignedFeedbackSplit,
|
|
11489
11691
|
withJudgeRetry,
|
|
11692
|
+
withOtelPipeline,
|
|
11490
11693
|
wranglerDeployRunner
|
|
11491
11694
|
};
|
|
11492
11695
|
//# sourceMappingURL=index.js.map
|