@tangle-network/agent-eval 0.137.0 → 0.138.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/CHANGELOG.md +48 -0
- package/README.md +33 -0
- package/dist/analyst/index.d.ts +473 -39
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +11 -593
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-PVtnfjvA.d.ts → analyze-runs-CPYxfPWT.d.ts} +5 -5
- package/dist/{analyze-runs-PVtnfjvA.d.ts.map → analyze-runs-CPYxfPWT.d.ts.map} +1 -1
- package/dist/{benchmark-YDrpumqB.js → benchmark-D8dkki-J.js} +299 -159
- package/dist/benchmark-D8dkki-J.js.map +1 -0
- package/dist/{benchmark-CHX4orG7.d.ts → benchmark-DlQgU_XI.d.ts} +67 -15
- package/dist/benchmark-DlQgU_XI.d.ts.map +1 -0
- package/dist/benchmark-command-CMqVqReF.js +4332 -0
- package/dist/benchmark-command-CMqVqReF.js.map +1 -0
- package/dist/benchmarks/index.d.ts +1 -1
- package/dist/benchmarks/index.js +1 -1
- package/dist/{benchmarks-DCLkQOmc.js → benchmarks-BJ_xK5rQ.js} +4 -3
- package/dist/{benchmarks-DCLkQOmc.js.map → benchmarks-BJ_xK5rQ.js.map} +1 -1
- package/dist/campaign/index.d.ts +5 -5
- package/dist/campaign/index.js +3 -3
- package/dist/{campaign-lgObcHFC.js → campaign-BIBS-NHV.js} +16 -9
- package/dist/campaign-BIBS-NHV.js.map +1 -0
- package/dist/cli.js +9 -2
- package/dist/cli.js.map +1 -1
- package/dist/{client-C8L6h6Wf.d.ts → client-BwPKohkJ.d.ts} +4 -4
- package/dist/{client-C8L6h6Wf.d.ts.map → client-BwPKohkJ.d.ts.map} +1 -1
- package/dist/{completion-verifier-DSyRNVzU.d.ts → completion-verifier-B4-IMYcS.d.ts} +3 -3
- package/dist/{completion-verifier-DSyRNVzU.d.ts.map → completion-verifier-B4-IMYcS.d.ts.map} +1 -1
- package/dist/contract/index.d.ts +10 -10
- package/dist/contract/index.js +8 -8
- package/dist/control.d.ts +2 -2
- package/dist/{cost-ledger-D2o6JOrL.d.ts → cost-ledger-B1D3COAc.d.ts} +5 -4
- package/dist/{cost-ledger-D2o6JOrL.d.ts.map → cost-ledger-B1D3COAc.d.ts.map} +1 -1
- package/dist/{cost-ledger-D-5_-dhi.js → cost-ledger-CHDLA0Ss.js} +90 -45
- package/dist/cost-ledger-CHDLA0Ss.js.map +1 -0
- package/dist/{default-registry-Dc5D_Loc.d.ts → default-registry-PUhIVRWz.d.ts} +18 -5
- package/dist/default-registry-PUhIVRWz.d.ts.map +1 -0
- package/dist/{default-registry-CLXbRt0f.js → default-registry-lp5R0lve.js} +1503 -258
- package/dist/default-registry-lp5R0lve.js.map +1 -0
- package/dist/{eval-campaign-CHqfLnff.js → eval-campaign-9MozgKL7.js} +2 -2
- package/dist/{eval-campaign-CHqfLnff.js.map → eval-campaign-9MozgKL7.js.map} +1 -1
- package/dist/exact-types-Dpw2LeHA.d.ts +234 -0
- package/dist/exact-types-Dpw2LeHA.d.ts.map +1 -0
- package/dist/{extract-usage-p-56bh8q.js → extract-usage-CS391dOE.js} +2 -2
- package/dist/{extract-usage-p-56bh8q.js.map → extract-usage-CS391dOE.js.map} +1 -1
- package/dist/{feedback-trajectory-N_F0PwHz.d.ts → feedback-trajectory-CoNep7rl.d.ts} +3 -2
- package/dist/feedback-trajectory-CoNep7rl.d.ts.map +1 -0
- package/dist/fuzz.d.ts +1 -1
- package/dist/fuzz.js +1 -1
- package/dist/hosted/index.d.ts +3 -3
- package/dist/{index-U3RHOShi.d.ts → index-B2-IxCMB.d.ts} +2 -2
- package/dist/{index-U3RHOShi.d.ts.map → index-B2-IxCMB.d.ts.map} +1 -1
- package/dist/{index-BnP1QJUv.d.ts → index-CjVYlVBK.d.ts} +5 -5
- package/dist/{index-BnP1QJUv.d.ts.map → index-CjVYlVBK.d.ts.map} +1 -1
- package/dist/{index-C-Pr4OWg.d.ts → index-D0cxAdaV.d.ts} +11 -10
- package/dist/index-D0cxAdaV.d.ts.map +1 -0
- package/dist/index-DEb46kc6.d.ts.map +1 -1
- package/dist/{index-DRNl6g_N.d.ts → index-sMN_hI4E.d.ts} +3 -3
- package/dist/{index-DRNl6g_N.d.ts.map → index-sMN_hI4E.d.ts.map} +1 -1
- package/dist/index.d.ts +24 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -353
- package/dist/index.js.map +1 -1
- package/dist/{insight-report-B9ooYH_g.d.ts → insight-report-CXd8VBDR.d.ts} +4 -4
- package/dist/{insight-report-B9ooYH_g.d.ts.map → insight-report-CXd8VBDR.d.ts.map} +1 -1
- package/dist/{integrity-CKxosZ5Z.d.ts → integrity-B-MLFz0I.d.ts} +2 -2
- package/dist/{integrity-CKxosZ5Z.d.ts.map → integrity-B-MLFz0I.d.ts.map} +1 -1
- package/dist/ledger-core/index.js +1 -1
- package/dist/{ledger-core-t6sItivm.js → ledger-core-C0Yx1I14.js} +220 -27
- package/dist/ledger-core-C0Yx1I14.js.map +1 -0
- package/dist/{llm-client-DKB25jV8.js → llm-client-Cj3c7PEm.js} +5 -5
- package/dist/llm-client-Cj3c7PEm.js.map +1 -0
- package/dist/meta-eval/index.d.ts +2 -2
- package/dist/multishot/index.d.ts +2 -2
- package/dist/openapi.json +1 -1
- package/dist/{proposal-findings-DCawte-y.js → proposal-findings-2GIUo1et.js} +2 -68
- package/dist/proposal-findings-2GIUo1et.js.map +1 -0
- package/dist/{registry-BdM7SuTr.d.ts → registry-C4yJTza7.d.ts} +60 -6
- package/dist/registry-C4yJTza7.d.ts.map +1 -0
- package/dist/{release-report-CofgVNZt.d.ts → release-report-CoyvyLBs.d.ts} +3 -3
- package/dist/{release-report-CofgVNZt.d.ts.map → release-report-CoyvyLBs.d.ts.map} +1 -1
- package/dist/{replay-Bju0T8Ls.js → replay-Cb-4Vf0k.js} +8 -7
- package/dist/replay-Cb-4Vf0k.js.map +1 -0
- package/dist/{replay-K8FaC0CB.d.ts → replay-DbIYwso6.d.ts} +7 -7
- package/dist/{replay-K8FaC0CB.d.ts.map → replay-DbIYwso6.d.ts.map} +1 -1
- package/dist/reporting.d.ts +4 -4
- package/dist/{researcher-Da0Wj-bt.d.ts → researcher-BCeOEjtR.d.ts} +5 -5
- package/dist/{researcher-Da0Wj-bt.d.ts.map → researcher-BCeOEjtR.d.ts.map} +1 -1
- package/dist/{reward-hacking-CQ3hTCO3.d.ts → reward-hacking-sE2l_NV6.d.ts} +2 -2
- package/dist/{reward-hacking-CQ3hTCO3.d.ts.map → reward-hacking-sE2l_NV6.d.ts.map} +1 -1
- package/dist/rl.d.ts +5 -5
- package/dist/rl.js +1 -1
- package/dist/rollout/index.d.ts +1 -1
- package/dist/{rubric-predictive-validity-C4sztLR3.d.ts → rubric-predictive-validity-w2klGv1u.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-C4sztLR3.d.ts.map → rubric-predictive-validity-w2klGv1u.d.ts.map} +1 -1
- package/dist/{run-evidence-BDIircdA.d.ts → run-evidence-CbE0A8Xg.d.ts} +3 -3
- package/dist/{run-evidence-BDIircdA.d.ts.map → run-evidence-CbE0A8Xg.d.ts.map} +1 -1
- package/dist/{run-record-BPCa2rQ8.d.ts → run-record-DwHMk1Ai.d.ts} +2 -2
- package/dist/{run-record-BPCa2rQ8.d.ts.map → run-record-DwHMk1Ai.d.ts.map} +1 -1
- package/dist/{semantic-concept-judge-Bz64IckK.js → semantic-concept-judge-DYXDPZW0.js} +11 -5
- package/dist/semantic-concept-judge-DYXDPZW0.js.map +1 -0
- package/dist/{server-KjXZZUDX.js → server-DLEvyW2z.js} +3 -3
- package/dist/{server-KjXZZUDX.js.map → server-DLEvyW2z.js.map} +1 -1
- package/dist/single-run-lock-D_bS5xhj.js +318 -0
- package/dist/single-run-lock-D_bS5xhj.js.map +1 -0
- package/dist/{skill-usage-CFDLLlhF.d.ts → skill-usage-Bv3G4VkA.d.ts} +18 -8
- package/dist/skill-usage-Bv3G4VkA.d.ts.map +1 -0
- package/dist/{skillopt-optimization-method-f4o9sUT4.js → skillopt-optimization-method-CjKMZy0d.js} +7 -182
- package/dist/skillopt-optimization-method-CjKMZy0d.js.map +1 -0
- package/dist/{skillopt-optimization-method-BpbnlvAZ.d.ts → skillopt-optimization-method-CzfnA8O-.d.ts} +10 -10
- package/dist/{skillopt-optimization-method-BpbnlvAZ.d.ts.map → skillopt-optimization-method-CzfnA8O-.d.ts.map} +1 -1
- package/dist/{statistics-_7P642CN.d.ts → statistics-mf70aXKp.d.ts} +2 -2
- package/dist/{statistics-_7P642CN.d.ts.map → statistics-mf70aXKp.d.ts.map} +1 -1
- package/dist/{tools-DZk2Jn64.js → store-otlp-BenKynPE.js} +4 -192
- package/dist/store-otlp-BenKynPE.js.map +1 -0
- package/dist/{summary-report-DHipz9Kx.d.ts → summary-report-BKinV4yD.d.ts} +3 -3
- package/dist/{summary-report-DHipz9Kx.d.ts.map → summary-report-BKinV4yD.d.ts.map} +1 -1
- package/dist/tools-DZGdROtG.js +255 -0
- package/dist/tools-DZGdROtG.js.map +1 -0
- package/dist/traces.d.ts +5 -5
- package/dist/traces.js +4 -3
- package/dist/{types-CTvKfr5F.d.ts → types-5q2T25iW.d.ts} +2 -2
- package/dist/{types-CTvKfr5F.d.ts.map → types-5q2T25iW.d.ts.map} +1 -1
- package/dist/{types-CKswbJGO.d.ts → types-BtJhn8v6.d.ts} +4 -4
- package/dist/{types-CKswbJGO.d.ts.map → types-BtJhn8v6.d.ts.map} +1 -1
- package/dist/{types-CTGbIm57.d.ts → types-zFYez3PK.d.ts} +5 -5
- package/dist/{types-CTGbIm57.d.ts.map → types-zFYez3PK.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.js +1 -1
- package/docs/trace-analysis.md +123 -3
- package/package.json +5 -3
- package/dist/benchmark-CHX4orG7.d.ts.map +0 -1
- package/dist/benchmark-YDrpumqB.js.map +0 -1
- package/dist/campaign-lgObcHFC.js.map +0 -1
- package/dist/concurrency-MUjT7VjM.js +0 -109
- package/dist/concurrency-MUjT7VjM.js.map +0 -1
- package/dist/cost-ledger-D-5_-dhi.js.map +0 -1
- package/dist/default-registry-CLXbRt0f.js.map +0 -1
- package/dist/default-registry-Dc5D_Loc.d.ts.map +0 -1
- package/dist/feedback-trajectory-N_F0PwHz.d.ts.map +0 -1
- package/dist/index-C-Pr4OWg.d.ts.map +0 -1
- package/dist/ledger-core-t6sItivm.js.map +0 -1
- package/dist/llm-client-DKB25jV8.js.map +0 -1
- package/dist/proposal-findings-DCawte-y.js.map +0 -1
- package/dist/registry-BdM7SuTr.d.ts.map +0 -1
- package/dist/replay-Bju0T8Ls.js.map +0 -1
- package/dist/semantic-concept-judge-Bz64IckK.js.map +0 -1
- package/dist/skill-usage-CFDLLlhF.d.ts.map +0 -1
- package/dist/skillopt-optimization-method-f4o9sUT4.js.map +0 -1
- package/dist/tools-DZk2Jn64.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-DZGdROtG.js","names":[],"sources":["../src/trace-analyst/loop.ts","../src/trace-analyst/tools.ts"],"sourcesContent":["import {\n type AxAgentActorTurnCallback,\n type AxAIService,\n type AxFunction,\n AxJSRuntime,\n agent,\n} from '@ax-llm/ax'\nimport { TraceFileMissingError } from './store-otlp'\n\nconst TRACE_ANALYSIS_TOOL_INSTRUCTION = `Gather the evidence needed for the report with the trace tools.\nWhen the evidence is sufficient, call final(task, evidence) and let the response stage produce the declared report and findings fields.`\n\nconst TRACE_ANALYSIS_CONTEXT_INSTRUCTION = `The complete bounded trace data is available as inputs.context.\nInspect it in the runtime, then call respond(task, evidence) and let the response stage produce the declared report and findings fields.`\n\nconst TRACE_ANALYSIS_RESPONDER_INSTRUCTION = `Use only evidence produced by the analysis stage.\nDo not invent trace ids, span ids, steps, tool results, or final verification outcomes.`\n\nexport interface TraceAnalysisLoopResult<TFinding> {\n report: string\n findings: TFinding[]\n usage: {\n actor: readonly unknown[]\n responder: readonly unknown[]\n }\n chatLog: {\n actor: readonly unknown[]\n responder: readonly unknown[]\n }\n turnCount: number\n}\n\nexport class TraceAnalysisTurnLimitError extends Error {\n readonly analystId: string\n readonly stage: 'distiller' | 'executor'\n readonly maxTurns: number\n\n constructor(analystId: string, stage: 'distiller' | 'executor', maxTurns: number) {\n super(\n `Trace analyst '${analystId}' reached maxTurns=${maxTurns} in the ${stage} stage without explicit completion`,\n )\n this.name = 'TraceAnalysisTurnLimitError'\n this.analystId = analystId\n this.stage = stage\n this.maxTurns = maxTurns\n }\n}\n\ninterface TraceAnalysisLoopOptions {\n id: string\n description: string\n prompt: string\n question: string\n context?: string\n ai: AxAIService\n model?: string\n tools: readonly AxFunction[]\n maxSubqueries: number\n maxParallelSubqueries: number\n maxTurns: number\n maxRuntimeChars: number\n signal?: AbortSignal\n onTurn?: AxAgentActorTurnCallback\n}\n\nexport function runTraceAnalysisLoop(\n options: TraceAnalysisLoopOptions & { findingType: 'string' },\n): Promise<TraceAnalysisLoopResult<string>>\nexport function runTraceAnalysisLoop(\n options: TraceAnalysisLoopOptions & { findingType: 'object' },\n): Promise<TraceAnalysisLoopResult<unknown>>\nexport async function runTraceAnalysisLoop(\n options: TraceAnalysisLoopOptions & { findingType: 'string' | 'object' },\n): Promise<TraceAnalysisLoopResult<unknown>> {\n validateLoopLimits(options)\n\n let turnCount = 0\n const completedStages = new Set<'distiller' | 'executor'>()\n const onTurn: AxAgentActorTurnCallback = async (turn) => {\n if (turn.stage === 'executor') turnCount = Math.max(turnCount, turn.turn)\n if (isExplicitCompletionTurn(turn)) completedStages.add(turn.stage)\n await options.onTurn?.(turn)\n if (turn.turn >= options.maxTurns && !completedStages.has(turn.stage)) {\n throw new TraceAnalysisTurnLimitError(options.id, turn.stage, options.maxTurns)\n }\n }\n const hasPreparedContext = options.context !== undefined\n const config = {\n agentIdentity: { name: options.id, description: options.description },\n contextFields: hasPreparedContext ? (['context'] as const) : ([] as const),\n runtime: new AxJSRuntime({\n permissions: [],\n blockDynamicImport: true,\n allowedModules: [],\n freezeIntrinsics: true,\n blockShadowRealm: true,\n preventGlobalThisExtensions: false,\n }),\n maxSubAgentCalls: options.maxSubqueries,\n maxTurns: options.maxTurns,\n maxRuntimeChars: options.maxRuntimeChars,\n maxBatchedLlmQueryConcurrency: options.maxParallelSubqueries,\n promptLevel: 'detailed' as const,\n contextPolicy: { preset: 'full' as const, budget: 'balanced' as const },\n directResponse:\n hasPreparedContext && options.tools.length === 0 ? ('auto' as const) : ('off' as const),\n functions: options.tools,\n executorOptions: {\n description: `${options.prompt.trim()}\\n\\n${\n hasPreparedContext ? TRACE_ANALYSIS_CONTEXT_INSTRUCTION : TRACE_ANALYSIS_TOOL_INSTRUCTION\n }`,\n ...(options.model ? { model: options.model } : {}),\n showThoughts: false,\n thinkingTokenBudget: 'none' as const,\n },\n responderOptions: {\n description: `${TRACE_ANALYSIS_RESPONDER_INSTRUCTION}\\n\\n${options.prompt.trim()}`,\n ...(options.model ? { model: options.model } : {}),\n showThoughts: false,\n thinkingTokenBudget: 'none' as const,\n },\n actorTurnCallback: onTurn,\n bubbleErrors: [TraceFileMissingError],\n }\n const analyst = hasPreparedContext\n ? options.findingType === 'string'\n ? agent('context:string, question:string -> report:string, findings:string[]', config)\n : agent('context:string, question:string -> report:string, findings:json[]', config)\n : options.findingType === 'string'\n ? agent('question:string -> report:string, findings:string[]', config)\n : agent('question:string -> report:string, findings:json[]', config)\n\n const output = hasPreparedContext\n ? await analyst.forward(\n options.ai,\n { context: options.context!, question: options.question } as never,\n options.signal ? { abortSignal: options.signal } : undefined,\n )\n : await analyst.forward(\n options.ai,\n { question: options.question },\n options.signal ? { abortSignal: options.signal } : undefined,\n )\n assertStageDidNotExhaust(\n options.id,\n 'distiller',\n options.maxTurns,\n analyst.distiller?.getState()?.actionLogEntries,\n )\n assertStageDidNotExhaust(\n options.id,\n 'executor',\n options.maxTurns,\n analyst.executor?.getState()?.actionLogEntries,\n )\n const completed =\n options.findingType === 'string'\n ? readTraceAnalysisOutput(output, 'string')\n : readTraceAnalysisOutput(output, 'object')\n const usage = analyst.getUsage()\n const chatLog = splitChatLog(analyst.getChatLog())\n\n return {\n ...completed,\n usage: {\n actor: usage.actor,\n responder: usage.responder,\n },\n chatLog,\n turnCount,\n }\n}\n\nfunction isExplicitCompletionTurn(turn: Parameters<AxAgentActorTurnCallback>[0]): boolean {\n return !turn.isError && isExplicitCompletionCode(turn.code)\n}\n\nfunction isExplicitCompletionCode(code: string): boolean {\n const executable = trimLeadingComments(code)\n return /^(?:await\\s+)?(?:final|respond|askClarification)\\s*\\(/.test(executable)\n}\n\nfunction assertStageDidNotExhaust(\n analystId: string,\n stage: 'distiller' | 'executor',\n maxTurns: number,\n entries:\n | readonly {\n code: string\n tags: readonly string[]\n }[]\n | undefined,\n): void {\n if (!entries || entries.length < maxTurns) return\n const last = entries.at(-1)\n if (last && !last.tags.includes('error') && isExplicitCompletionCode(last.code)) return\n throw new TraceAnalysisTurnLimitError(analystId, stage, maxTurns)\n}\n\nfunction trimLeadingComments(code: string): string {\n let remaining = code.trimStart()\n while (remaining.startsWith('//') || remaining.startsWith('/*')) {\n if (remaining.startsWith('//')) {\n const lineEnd = remaining.indexOf('\\n')\n if (lineEnd === -1) return ''\n remaining = remaining.slice(lineEnd + 1).trimStart()\n continue\n }\n const commentEnd = remaining.indexOf('*/', 2)\n if (commentEnd === -1) return ''\n remaining = remaining.slice(commentEnd + 2).trimStart()\n }\n return remaining\n}\n\nfunction splitChatLog(entries: readonly unknown[]): {\n actor: readonly unknown[]\n responder: readonly unknown[]\n} {\n const actor: unknown[] = []\n const responder: unknown[] = []\n for (const entry of entries) {\n const name =\n entry && typeof entry === 'object' && 'name' in entry\n ? (entry as { name?: unknown }).name\n : undefined\n if (typeof name === 'string' && (name === 'responder' || name.endsWith('.responder'))) {\n responder.push(entry)\n } else {\n actor.push(entry)\n }\n }\n return { actor, responder }\n}\n\ninterface CompletedTraceAnalysis<TFinding> {\n report: string\n findings: TFinding[]\n}\n\nexport function readTraceAnalysisOutput(\n value: unknown,\n findingType: 'string',\n): CompletedTraceAnalysis<string>\nexport function readTraceAnalysisOutput(\n value: unknown,\n findingType: 'object',\n): CompletedTraceAnalysis<unknown>\nexport function readTraceAnalysisOutput(\n value: unknown,\n findingType: 'string' | 'object',\n): CompletedTraceAnalysis<unknown> {\n if (!value || typeof value !== 'object') {\n throw new Error('Trace analyst response must contain report and findings')\n }\n const { report, findings } = value as { report?: unknown; findings?: unknown }\n if (typeof report !== 'string' || !Array.isArray(findings)) {\n throw new Error('Trace analyst response must contain report and findings')\n }\n if (findingType === 'string') {\n if (findings.some((finding) => typeof finding !== 'string')) {\n throw new Error('Trace analyst response must contain string findings')\n }\n return { report, findings: findings as string[] }\n }\n return { report, findings }\n}\n\nfunction validateLoopLimits(options: TraceAnalysisLoopOptions): void {\n if (!Number.isSafeInteger(options.maxSubqueries) || options.maxSubqueries < 0) {\n throw new TypeError('maxSubqueries must be a non-negative integer')\n }\n if (!Number.isSafeInteger(options.maxParallelSubqueries) || options.maxParallelSubqueries < 1) {\n throw new TypeError('maxParallelSubqueries must be a positive integer')\n }\n}\n","/**\n * Canonical transport-neutral trace tools plus the Ax adapter used by the\n * built-in analyst. Schemas and handlers originate here; provider adapters\n * only translate descriptor fields and cancellation context.\n */\n\nimport type { AxFunction } from '@ax-llm/ax'\n\nimport type { EvalToolDef } from '../eval-tools'\nimport {\n type BoundedTraceAnalysisStoreOptions,\n createBoundedTraceAnalysisStore,\n TRACE_ANALYSIS_LIMITS,\n type TraceAnalysisStore,\n} from './store'\nimport { parseTraceInput, toTraceJsonSchema, traceStoreInputSchemas } from './store-schemas'\n\nexport const TRACE_ANALYST_TOOL_NAMESPACE = 'traces' as const\n\nexport interface BuildTraceAnalysisToolsOptions extends BoundedTraceAnalysisStoreOptions {\n store: TraceAnalysisStore\n}\n\nexport interface TraceAnalysisToolDescriptor extends EvalToolDef {\n namespace: typeof TRACE_ANALYST_TOOL_NAMESPACE\n}\n\n/** Bind all seven trace reads without exposing an agent framework type. */\nexport function buildTraceAnalysisToolDescriptors(\n options: BuildTraceAnalysisToolsOptions,\n): TraceAnalysisToolDescriptor[] {\n const store = createBoundedTraceAnalysisStore(options.store, { budgets: options.budgets })\n\n return [\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'getDatasetOverview',\n description:\n 'Dataset rollup: total traces, raw_jsonl_bytes, services, agents, models, tools, ' +\n 'and sample_trace_ids. Always call this first without a regex_pattern.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.getOverview),\n handler: async (args, context) => {\n const { filters } = parseTraceInput(\n 'getDatasetOverview',\n traceStoreInputSchemas.getOverview,\n args ?? {},\n )\n return store.getOverview(filters, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'queryTraces',\n description:\n `Paginated trace summaries, at most ${TRACE_ANALYSIS_LIMITS.queryTraces} per call. ` +\n 'Each summary carries raw_jsonl_bytes; narrow with indexed filters before regex_pattern.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.queryTraces),\n handler: async (args, context) => {\n const input = parseTraceInput('queryTraces', traceStoreInputSchemas.queryTraces, args)\n return store.queryTraces(input, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'countTraces',\n description:\n 'Count traces matching filters. Use as a cheap pre-flight before a regex_pattern scan.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.countTraces),\n handler: async (args, context) => {\n const { filters } = parseTraceInput(\n 'countTraces',\n traceStoreInputSchemas.countTraces,\n args ?? {},\n )\n return store.countTraces(filters, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'viewTrace',\n description:\n 'Return all spans for one trace with bounded attributes. Oversized responses carry ' +\n 'an oversized summary instead of spans; continue with searchTrace or viewSpans.',\n parameters: toTraceJsonSchema(\n traceStoreInputSchemas.viewTrace.omit({\n per_attribute_byte_cap: true,\n }),\n ),\n handler: async (args, context) => {\n const input = parseTraceInput(\n 'viewTrace',\n traceStoreInputSchemas.viewTrace.omit({ per_attribute_byte_cap: true }),\n args,\n )\n return store.viewTrace(input, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'viewSpans',\n description:\n `Read 1..${TRACE_ANALYSIS_LIMITS.viewSpans} specific spans. Every requested id is ` +\n 'accounted for in spans, missing_span_ids, or omitted_span_ids; retry omitted ids.',\n parameters: toTraceJsonSchema(\n traceStoreInputSchemas.viewSpans.omit({\n per_attribute_byte_cap: true,\n }),\n ),\n handler: async (args, context) => {\n const input = parseTraceInput(\n 'viewSpans',\n traceStoreInputSchemas.viewSpans.omit({ per_attribute_byte_cap: true }),\n args,\n )\n return store.viewSpans(input, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'searchTrace',\n description:\n `Regex search across one trace, bounded to ${TRACE_ANALYSIS_LIMITS.searchMatches} hits. ` +\n 'When has_more is true, refine the regex instead of treating the result as complete.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.searchTrace),\n handler: async (args, context) => {\n const input = parseTraceInput('searchTrace', traceStoreInputSchemas.searchTrace, args)\n return store.searchTrace(input, context)\n },\n },\n {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n name: 'searchSpan',\n description:\n `Regex search inside one span, bounded to ${TRACE_ANALYSIS_LIMITS.searchMatches} hits. ` +\n 'Use after viewSpans omits or truncates a large span payload.',\n parameters: toTraceJsonSchema(traceStoreInputSchemas.searchSpan),\n handler: async (args, context) => {\n const input = parseTraceInput('searchSpan', traceStoreInputSchemas.searchSpan, args)\n return store.searchSpan(input, context)\n },\n },\n ]\n}\n\n/** Adapt the canonical descriptors into Ax functions used by the built-in analyst. */\nexport function buildTraceAnalystTools(options: BuildTraceAnalysisToolsOptions): AxFunction[] {\n return buildTraceAnalysisToolDescriptors(options).map((descriptor) => ({\n namespace: descriptor.namespace,\n name: descriptor.name,\n description: descriptor.description,\n parameters: descriptor.parameters as AxFunction['parameters'],\n func: (args, extra) =>\n descriptor.handler(args, extra?.abortSignal ? { signal: extra.abortSignal } : undefined),\n }))\n}\n\nexport function traceAnalystFunctionGroup(options: BuildTraceAnalysisToolsOptions): {\n namespace: string\n title: string\n selectionCriteria: string\n description: string\n functions: AxFunction[]\n} {\n return {\n namespace: TRACE_ANALYST_TOOL_NAMESPACE,\n title: 'Trace Analysis',\n selectionCriteria: 'Use for any inspection of OTLP-shaped trace data.',\n description:\n 'Discovery, narrowing, and bounded deep reads over a JSONL trace dataset. ' +\n 'Always call getDatasetOverview first.',\n functions: buildTraceAnalystTools(options),\n }\n}\n"],"mappings":";;;AASA,MAAM,kCAAkC;;AAGxC,MAAM,qCAAqC;;AAG3C,MAAM,uCAAuC;;AAiB7C,IAAa,8BAAb,cAAiD,MAAM;CACrD;CACA;CACA;CAEA,YAAY,WAAmB,OAAiC,UAAkB;EAChF,MACE,kBAAkB,UAAU,qBAAqB,SAAS,UAAU,MAAM,mCAC5E;EACA,KAAK,OAAO;EACZ,KAAK,YAAY;EACjB,KAAK,QAAQ;EACb,KAAK,WAAW;CAClB;AACF;AAyBA,eAAsB,qBACpB,SAC2C;CAC3C,mBAAmB,OAAO;CAE1B,IAAI,YAAY;CAChB,MAAM,kCAAkB,IAAI,IAA8B;CAC1D,MAAM,SAAmC,OAAO,SAAS;EACvD,IAAI,KAAK,UAAU,YAAY,YAAY,KAAK,IAAI,WAAW,KAAK,IAAI;EACxE,IAAI,yBAAyB,IAAI,GAAG,gBAAgB,IAAI,KAAK,KAAK;EAClE,MAAM,QAAQ,SAAS,IAAI;EAC3B,IAAI,KAAK,QAAQ,QAAQ,YAAY,CAAC,gBAAgB,IAAI,KAAK,KAAK,GAClE,MAAM,IAAI,4BAA4B,QAAQ,IAAI,KAAK,OAAO,QAAQ,QAAQ;CAElF;CACA,MAAM,qBAAqB,QAAQ,YAAY,KAAA;CAC/C,MAAM,SAAS;EACb,eAAe;GAAE,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W;GACX,MAAM;GACN,aACE,6CAA6C,sBAAsB,cAAc;GAEnF,YAAY,kBAAkB,uBAAuB,WAAW;GAChE,SAAS,OAAO,MAAM,YAAY;IAChC,MAAM,QAAQ,gBAAgB,eAAe,uBAAuB,aAAa,IAAI;IACrF,OAAO,MAAM,YAAY,OAAO,OAAO;GACzC;EACF;EACA;GACE,WAAW;GACX,MAAM;GACN,aACE,4CAA4C,sBAAsB,cAAc;GAElF,YAAY,kBAAkB,uBAAuB,UAAU;GAC/D,SAAS,OAAO,MAAM,YAAY;IAChC,MAAM,QAAQ,gBAAgB,cAAc,uBAAuB,YAAY,IAAI;IACnF,OAAO,MAAM,WAAW,OAAO,OAAO;GACxC;EACF;CACF;AACF;;AAGA,SAAgB,uBAAuB,SAAuD;CAC5F,OAAO,kCAAkC,OAAO,CAAC,CAAC,KAAK,gBAAgB;EACrE,WAAW,WAAW;EACtB,MAAM,WAAW;EACjB,aAAa,WAAW;EACxB,YAAY,WAAW;EACvB,OAAO,MAAM,UACX,WAAW,QAAQ,MAAM,OAAO,cAAc,EAAE,QAAQ,MAAM,YAAY,IAAI,KAAA,CAAS;CAC3F,EAAE;AACJ;AAEA,SAAgB,0BAA0B,SAMxC;CACA,OAAO;EACL,WAAW;EACX,OAAO;EACP,mBAAmB;EACnB,aACE;EAEF,WAAW,uBAAuB,OAAO;CAC3C;AACF"}
|
package/dist/traces.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { C as TraceEvent, D as isSandboxSpan, E as isRetrievalSpan, O as isToolSpan, S as ToolSpan, T as isLlmSpan, _ as Span, a as FAILURE_CLASSES, b as SpanStatus, c as JudgeSpan, d as RetrievalSpan, f as Run, g as SandboxSpan, h as RunStatus, i as EventKind, l as LlmSpan, m as RunOutcome, n as BudgetLedgerEntry, o as FailureClass, p as RunLayer, r as BudgetSpec, s as GenericSpan, t as Artifact, u as Message, v as SpanBase, w as isJudgeSpan, x as TRACE_SCHEMA_VERSION, y as SpanKind } from "./schema-BtVldJ3T.js";
|
|
2
|
-
import { a as ExtractedUsage, c as extractUsageFromResponse, i as ExtractUsageFromSseOptions, l as extractUsageFromSse, n as CaptureFetchOptions, o as SseUsageMode, r as captureFetchToRawSink, s as extractUsage, t as CaptureFetchContext } from "./index-
|
|
3
|
-
import { _t as RawProviderSink, bt as providerFromBaseUrl, dt as InMemoryRawProviderSink, ft as InMemoryRawProviderSinkOptions, gt as RawProviderEvent, ht as RawProviderDirection, lt as FileSystemRawProviderSink, mt as ProviderRedactor, pt as NoopRawProviderSink, ut as FileSystemRawProviderSinkOptions, vt as RawProviderSinkFilter, yt as defaultProviderRedactor } from "./types-
|
|
2
|
+
import { a as ExtractedUsage, c as extractUsageFromResponse, i as ExtractUsageFromSseOptions, l as extractUsageFromSse, n as CaptureFetchOptions, o as SseUsageMode, r as captureFetchToRawSink, s as extractUsage, t as CaptureFetchContext } from "./index-sMN_hI4E.js";
|
|
3
|
+
import { _t as RawProviderSink, bt as providerFromBaseUrl, dt as InMemoryRawProviderSink, ft as InMemoryRawProviderSinkOptions, gt as RawProviderEvent, ht as RawProviderDirection, lt as FileSystemRawProviderSink, mt as ProviderRedactor, pt as NoopRawProviderSink, ut as FileSystemRawProviderSinkOptions, vt as RawProviderSinkFilter, yt as defaultProviderRedactor } from "./types-5q2T25iW.js";
|
|
4
4
|
import { a as RunFilter, i as InMemoryTraceStore, n as FileSystemTraceStore, o as SpanFilter, r as FileSystemTraceStoreOptions, s as TraceStore, t as EventFilter } from "./store-CT9YIIve.js";
|
|
5
5
|
import { a as TraceEmitterOptions, i as TraceEmitter, n as RunCompleteHookContext, o as llmSpanFromProvider, r as SpanHandle, t as RunCompleteHook } from "./emitter-DGQGoLyj.js";
|
|
6
|
-
import { a as RunIntegrityReport, i as RunIntegrityIssueCode, n as RunIntegrityExpectations, o as assertRunCaptured, r as RunIntegrityIssue, s as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-
|
|
7
|
-
import { $ as buildTraceInsightContext, A as otlpRowsToTraceRunRecords, At as RedactionReport, B as stringField, Bt as OtlpSpanRole, C as otlpTextToTraceAnalysisStore, Ct as createBoundedTraceAnalysisStore, D as OtlpTraceRunRecord, Dt as convertTraceStoresToOtlp, E as OtlpToRunRecordsOptions, Et as TracesToOtlpResult, F as extractOtlpAttributes, Ft as otelRunCompleteHook, G as TraceInsightFinding, Gt as isOtlpModelCall, H as flattenOtlpExportToNdjson, Ht as ToolSpanOtlpInput, I as firstStringAttr, It as ExportableSpan, J as TraceInsightQualityGate, Jt as OtlpExport, K as TraceInsightPanelRole, Kt as traceSpanKindToOpenInferenceKind, L as inferOtlpKind, Lt as OtelExportConfig, M as otlpToTraceRunRecords, Mt as redactString, N as ProjectedOtlpSpan, Nt as redactValue, O as TraceAggregate, Ot as DEFAULT_REDACTION_RULES, P as asString, Pt as createOtelTracingStore, Q as TraceInsightTask, R as projectOtlpFlatLine, Rt as OtelExporter, S as ToolSpansToTraceAnalysisStoreOptions, St as analyzeTraces, T as TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, Tt as TraceStoreToOtlpOptions, U as OtlpFlatLine, Ut as applyToolSpanOtlpAttributes, V as FlattenOtlpOptions, Vt as OtlpSpanRoleInput, W as TraceInsightContext, Wt as classifyOtlpSpanRole, X as TraceInsightReadiness, Xt as OtlpSpan, Y as TraceInsightQuestion, Yt as OtlpResourceSpans, Z as TraceInsightSuite, Zt as exportRunAsOtlp, _t as TraceNotFoundError, a as ReplayFetchOptions, at as planTraceInsightQuestions, b as OtlpFileTraceStore, bt as AnalyzeTracesResult, c as BuildTraceAnalysisToolsOptions, ct as TraceAnalystHookOptions, d as buildTraceAnalysisToolDescriptors, dt as TraceAnalysisLimitError, et as buildTraceInsightPrompt, f as buildTraceAnalystTools, ft as TraceAnalysisStoreContractError, gt as TraceFileTooLargeError, ht as TraceFileMissingError, i as ReplayCacheStats, it as inferDomainKeywords, j as otlpToRunRecords, jt as RedactionRule, k as otlpRowsToRunRecords, kt as REDACTION_VERSION, l as TRACE_ANALYST_TOOL_NAMESPACE, lt as traceAnalystOnRunComplete, mt as TraceFileMalformedError, n as ReplayCacheEntry, nt as describeTraceInsightScope, o as createReplayFetch, ot as scoreTraceInsightReadiness, p as traceAnalystFunctionGroup, pt as TraceAnalysisValidationError, q as TraceInsightPromptInput, qt as OTEL_AGENT_EVAL_SCOPE, r as ReplayCacheMissError, rt as domainEvidencePattern, s as iterateRawCalls, st as tokenizeDomainWords, t as ReplayCache, tt as defaultTraceInsightPanel, u as TraceAnalysisToolDescriptor, ut as SpanNotFoundError, v as ToolTraceMissingError, vt as AnalyzeTracesInput, w as TRACE_ANALYST_ACTOR_DESCRIPTION, wt as TraceStoreSource, x as OtlpFileTraceStoreOptions, xt as AnalyzeTracesTurnSnapshot, y as toolSpansToTraceAnalysisStore, yt as AnalyzeTracesOptions, z as readOtlpStatus, zt as createOtelExporter } from "./replay-
|
|
6
|
+
import { a as RunIntegrityReport, i as RunIntegrityIssueCode, n as RunIntegrityExpectations, o as assertRunCaptured, r as RunIntegrityIssue, s as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-B-MLFz0I.js";
|
|
7
|
+
import { $ as buildTraceInsightContext, A as otlpRowsToTraceRunRecords, At as RedactionReport, B as stringField, Bt as OtlpSpanRole, C as otlpTextToTraceAnalysisStore, Ct as createBoundedTraceAnalysisStore, D as OtlpTraceRunRecord, Dt as convertTraceStoresToOtlp, E as OtlpToRunRecordsOptions, Et as TracesToOtlpResult, F as extractOtlpAttributes, Ft as otelRunCompleteHook, G as TraceInsightFinding, Gt as isOtlpModelCall, H as flattenOtlpExportToNdjson, Ht as ToolSpanOtlpInput, I as firstStringAttr, It as ExportableSpan, J as TraceInsightQualityGate, Jt as OtlpExport, K as TraceInsightPanelRole, Kt as traceSpanKindToOpenInferenceKind, L as inferOtlpKind, Lt as OtelExportConfig, M as otlpToTraceRunRecords, Mt as redactString, N as ProjectedOtlpSpan, Nt as redactValue, O as TraceAggregate, Ot as DEFAULT_REDACTION_RULES, P as asString, Pt as createOtelTracingStore, Q as TraceInsightTask, R as projectOtlpFlatLine, Rt as OtelExporter, S as ToolSpansToTraceAnalysisStoreOptions, St as analyzeTraces, T as TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, Tt as TraceStoreToOtlpOptions, U as OtlpFlatLine, Ut as applyToolSpanOtlpAttributes, V as FlattenOtlpOptions, Vt as OtlpSpanRoleInput, W as TraceInsightContext, Wt as classifyOtlpSpanRole, X as TraceInsightReadiness, Xt as OtlpSpan, Y as TraceInsightQuestion, Yt as OtlpResourceSpans, Z as TraceInsightSuite, Zt as exportRunAsOtlp, _t as TraceNotFoundError, a as ReplayFetchOptions, at as planTraceInsightQuestions, b as OtlpFileTraceStore, bt as AnalyzeTracesResult, c as BuildTraceAnalysisToolsOptions, ct as TraceAnalystHookOptions, d as buildTraceAnalysisToolDescriptors, dt as TraceAnalysisLimitError, et as buildTraceInsightPrompt, f as buildTraceAnalystTools, ft as TraceAnalysisStoreContractError, gt as TraceFileTooLargeError, ht as TraceFileMissingError, i as ReplayCacheStats, it as inferDomainKeywords, j as otlpToRunRecords, jt as RedactionRule, k as otlpRowsToRunRecords, kt as REDACTION_VERSION, l as TRACE_ANALYST_TOOL_NAMESPACE, lt as traceAnalystOnRunComplete, mt as TraceFileMalformedError, n as ReplayCacheEntry, nt as describeTraceInsightScope, o as createReplayFetch, ot as scoreTraceInsightReadiness, p as traceAnalystFunctionGroup, pt as TraceAnalysisValidationError, q as TraceInsightPromptInput, qt as OTEL_AGENT_EVAL_SCOPE, r as ReplayCacheMissError, rt as domainEvidencePattern, s as iterateRawCalls, st as tokenizeDomainWords, t as ReplayCache, tt as defaultTraceInsightPanel, u as TraceAnalysisToolDescriptor, ut as SpanNotFoundError, v as ToolTraceMissingError, vt as AnalyzeTracesInput, w as TRACE_ANALYST_ACTOR_DESCRIPTION, wt as TraceStoreSource, x as OtlpFileTraceStoreOptions, xt as AnalyzeTracesTurnSnapshot, y as toolSpansToTraceAnalysisStore, yt as AnalyzeTracesOptions, z as readOtlpStatus, zt as createOtelExporter } from "./replay-DbIYwso6.js";
|
|
8
8
|
import { C as TOOL_LATENCY_MS, D as asNumber, E as applyLlmSpanOtlpAttributes, O as contextInputTokens, S as TOOL_ARGS_CAPTURED, T as TOOL_NAME_ATTR_KEYS, _ as LlmSpanOtlpInput, a as LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, b as RUN_COST_ATTR_KEYS, c as LLM_COST_USD, d as LLM_MODEL_ATTR_KEYS, f as LLM_MODEL_NAME, g as LLM_REASONING_TOKEN_ATTR_KEYS, h as LLM_REASONING_TOKENS, i as LLM_CACHE_WRITE_TOKENS, k as firstNumberAttr, l as LLM_INPUT_TOKENS, m as LLM_OUTPUT_TOKEN_ATTR_KEYS, n as LLM_CACHED_TOKENS, o as LLM_CONTEXT_TOKENS, p as LLM_OUTPUT_TOKENS, r as LLM_CACHED_TOKEN_ATTR_KEYS, s as LLM_COST_ATTR_KEYS, t as INPUT_VALUE, u as LLM_INPUT_TOKEN_ATTR_KEYS, v as OPENINFERENCE_SPAN_KIND, w as TOOL_NAME, x as SPAN_KIND_ATTR_KEYS, y as OUTPUT_VALUE } from "./attribute-vocabulary-DLJ6303h.js";
|
|
9
9
|
import { a as judgeSpans, c as runsForScenario, i as hasCapturedToolArgs, l as toolSpans, n as argHash, o as llmSpans, r as groupBy, s as runFailureClass, t as aggregateLlm } from "./query-CJ_DX8vl.js";
|
|
10
|
-
import { A as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, C as DEFAULT_TRACE_ANALYST_BUDGETS, D as SearchSpanResult, E as QueryTracesPage, F as TraceAnalystSpanStatus, I as TraceAnalystTraceSummary, L as ViewSpansResult, M as TraceAnalystFilters, N as TraceAnalystSpan, O as SearchTraceResult, P as TraceAnalystSpanKind, R as ViewTraceOversized, S as TraceAnalysisStoreContext, T as ErrorCluster, b as TRACE_ANALYSIS_LIMITS, j as TraceAnalystByteBudgets, k as SpanMatchRecord, w as DatasetOverview, x as TraceAnalysisStore, y as BoundedTraceAnalysisStoreOptions, z as ViewTraceResult } from "./types-
|
|
10
|
+
import { A as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, C as DEFAULT_TRACE_ANALYST_BUDGETS, D as SearchSpanResult, E as QueryTracesPage, F as TraceAnalystSpanStatus, I as TraceAnalystTraceSummary, L as ViewSpansResult, M as TraceAnalystFilters, N as TraceAnalystSpan, O as SearchTraceResult, P as TraceAnalystSpanKind, R as ViewTraceOversized, S as TraceAnalysisStoreContext, T as ErrorCluster, b as TRACE_ANALYSIS_LIMITS, j as TraceAnalystByteBudgets, k as SpanMatchRecord, w as DatasetOverview, x as TraceAnalysisStore, y as BoundedTraceAnalysisStoreOptions, z as ViewTraceResult } from "./types-BtJhn8v6.js";
|
|
11
11
|
export { type AnalyzeTracesInput, type AnalyzeTracesOptions, type AnalyzeTracesResult, type AnalyzeTracesTurnSnapshot, Artifact, type BoundedTraceAnalysisStoreOptions, BudgetLedgerEntry, BudgetSpec, type BuildTraceAnalysisToolsOptions, CaptureFetchContext, CaptureFetchOptions, DEFAULT_REDACTION_RULES, DEFAULT_TRACE_ANALYST_BUDGETS, type DatasetOverview, type ErrorCluster, EventFilter, EventKind, ExportableSpan, ExtractUsageFromSseOptions, ExtractedUsage, FAILURE_CLASSES, FailureClass, FileSystemRawProviderSink, FileSystemRawProviderSinkOptions, FileSystemTraceStore, FileSystemTraceStoreOptions, type FlattenOtlpOptions, GenericSpan, INPUT_VALUE, InMemoryRawProviderSink, InMemoryRawProviderSinkOptions, InMemoryTraceStore, JudgeSpan, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, LlmSpan, LlmSpanOtlpInput, Message, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtelExportConfig, OtelExporter, OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, OtlpResourceSpans, OtlpSpan, OtlpSpanRole, OtlpSpanRoleInput, type OtlpToRunRecordsOptions, type OtlpTraceRunRecord, type ProjectedOtlpSpan, ProviderRedactor, type QueryTracesPage, REDACTION_VERSION, RUN_COST_ATTR_KEYS, RawProviderDirection, RawProviderEvent, RawProviderSink, RawProviderSinkFilter, RedactionReport, RedactionRule, ReplayCache, ReplayCacheEntry, ReplayCacheMissError, ReplayCacheStats, ReplayFetchOptions, RetrievalSpan, Run, RunCompleteHook, RunCompleteHookContext, RunFilter, RunIntegrityError, RunIntegrityExpectations, RunIntegrityIssue, RunIntegrityIssueCode, RunIntegrityReport, RunLayer, RunOutcome, RunStatus, SPAN_KIND_ATTR_KEYS, SandboxSpan, type SearchSpanResult, type SearchTraceResult, Span, SpanBase, SpanFilter, SpanHandle, SpanKind, type SpanMatchRecord, SpanNotFoundError, SpanStatus, SseUsageMode, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYSIS_LIMITS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TOOL_NAMESPACE, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolSpan, ToolSpanOtlpInput, type ToolSpansToTraceAnalysisStoreOptions, ToolTraceMissingError, type TraceAggregate, TraceAnalysisLimitError, type TraceAnalysisStore, type TraceAnalysisStoreContext, TraceAnalysisStoreContractError, type TraceAnalysisToolDescriptor, TraceAnalysisValidationError, type TraceAnalystByteBudgets, type TraceAnalystFilters, type TraceAnalystHookOptions, type TraceAnalystSpan, type TraceAnalystSpanKind, type TraceAnalystSpanStatus, type TraceAnalystTraceSummary, TraceEmitter, TraceEmitterOptions, TraceEvent, TraceFileMalformedError, TraceFileMissingError, TraceFileTooLargeError, type TraceInsightContext, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceNotFoundError, TraceStore, TraceStoreSource, TraceStoreToOtlpOptions, TracesToOtlpResult, type ViewSpansResult, type ViewTraceOversized, type ViewTraceResult, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, buildTraceAnalysisToolDescriptors, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyOtlpSpanRole, contextInputTokens, convertTraceStoresToOtlp, createBoundedTraceAnalysisStore, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, inferOtlpKind, isJudgeSpan, isLlmSpan, isOtlpModelCall, isRetrievalSpan, isSandboxSpan, isToolSpan, iterateRawCalls, judgeSpans, llmSpanFromProvider, llmSpans, otelRunCompleteHook, otlpRowsToRunRecords, otlpRowsToTraceRunRecords, otlpTextToTraceAnalysisStore, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, readOtlpStatus, redactString, redactValue, runFailureClass, runsForScenario, scoreTraceInsightReadiness, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
|
package/dist/traces.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { a as providerFromBaseUrl, i as defaultProviderRedactor, n as InMemoryRawProviderSink, r as NoopRawProviderSink, t as FileSystemRawProviderSink } from "./raw-provider-sink-BQd7mzyT.js";
|
|
2
2
|
import { INPUT_VALUE, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, OPENINFERENCE_SPAN_KIND, OUTPUT_VALUE, RUN_COST_ATTR_KEYS, SPAN_KIND_ATTR_KEYS, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, applyLlmSpanOtlpAttributes, asNumber, contextInputTokens, firstNumberAttr } from "./trace-attributes.js";
|
|
3
|
-
import { A as
|
|
3
|
+
import { A as classifyOtlpSpanRole, C as firstStringAttr, E as readOtlpStatus, M as traceSpanKindToOpenInferenceKind, O as stringField, S as extractOtlpAttributes, T as projectOtlpFlatLine, _ as TraceFileMissingError, a as createBoundedTraceAnalysisStore, b as asString, d as TRACE_ANALYSIS_LIMITS, f as SpanNotFoundError, g as TraceFileMalformedError, h as TraceAnalysisValidationError, i as otlpTextToTraceAnalysisStore, j as isOtlpModelCall, k as applyToolSpanOtlpAttributes, l as DEFAULT_TRACE_ANALYST_BUDGETS, m as TraceAnalysisStoreContractError, n as OtlpFileTraceStore, p as TraceAnalysisLimitError, u as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, v as TraceFileTooLargeError, w as inferOtlpKind, y as TraceNotFoundError } from "./store-otlp-BenKynPE.js";
|
|
4
|
+
import { i as traceAnalystFunctionGroup, n as buildTraceAnalysisToolDescriptors, r as buildTraceAnalystTools, t as TRACE_ANALYST_TOOL_NAMESPACE } from "./tools-DZGdROtG.js";
|
|
4
5
|
import { n as llmSpanFromProvider, t as TraceEmitter } from "./emitter-CPBAhxum.js";
|
|
5
6
|
import { a as isRetrievalSpan, i as isLlmSpan, n as TRACE_SCHEMA_VERSION, o as isSandboxSpan, r as isJudgeSpan, s as isToolSpan, t as FAILURE_CLASSES } from "./schema-CRhEY1SO.js";
|
|
6
|
-
import { A as TRACE_ANALYST_ACTOR_DESCRIPTION, C as domainEvidencePattern, D as tokenizeDomainWords, E as scoreTraceInsightReadiness, O as traceAnalystOnRunComplete, S as describeTraceInsightScope, T as planTraceInsightQuestions, _ as otlpToTraceRunRecords, a as convertTraceStoresToOtlp, b as buildTraceInsightPrompt, c as otelRunCompleteHook, d as captureFetchToRawSink, f as ToolTraceMissingError, g as otlpToRunRecords, h as otlpRowsToTraceRunRecords, i as iterateRawCalls, j as TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, k as analyzeTraces, l as OTEL_AGENT_EVAL_SCOPE, m as otlpRowsToRunRecords, n as ReplayCacheMissError, o as createOtelExporter, p as toolSpansToTraceAnalysisStore, r as createReplayFetch, s as createOtelTracingStore, t as ReplayCache, u as exportRunAsOtlp, v as flattenOtlpExportToNdjson, w as inferDomainKeywords, x as defaultTraceInsightPanel, y as buildTraceInsightContext } from "./replay-
|
|
7
|
-
import { n as extractUsageFromResponse, r as extractUsageFromSse, t as extractUsage } from "./extract-usage-
|
|
7
|
+
import { A as TRACE_ANALYST_ACTOR_DESCRIPTION, C as domainEvidencePattern, D as tokenizeDomainWords, E as scoreTraceInsightReadiness, O as traceAnalystOnRunComplete, S as describeTraceInsightScope, T as planTraceInsightQuestions, _ as otlpToTraceRunRecords, a as convertTraceStoresToOtlp, b as buildTraceInsightPrompt, c as otelRunCompleteHook, d as captureFetchToRawSink, f as ToolTraceMissingError, g as otlpToRunRecords, h as otlpRowsToTraceRunRecords, i as iterateRawCalls, j as TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, k as analyzeTraces, l as OTEL_AGENT_EVAL_SCOPE, m as otlpRowsToRunRecords, n as ReplayCacheMissError, o as createOtelExporter, p as toolSpansToTraceAnalysisStore, r as createReplayFetch, s as createOtelTracingStore, t as ReplayCache, u as exportRunAsOtlp, v as flattenOtlpExportToNdjson, w as inferDomainKeywords, x as defaultTraceInsightPanel, y as buildTraceInsightContext } from "./replay-Cb-4Vf0k.js";
|
|
8
|
+
import { n as extractUsageFromResponse, r as extractUsageFromSse, t as extractUsage } from "./extract-usage-CS391dOE.js";
|
|
8
9
|
import { a as judgeSpans, c as runsForScenario, i as hasCapturedToolArgs, l as toolSpans, n as argHash, o as llmSpans, r as groupBy, s as runFailureClass, t as aggregateLlm } from "./query-Di7eEQ79.js";
|
|
9
10
|
import { a as InMemoryTraceStore, i as FileSystemTraceStore, n as assertRunCaptured, r as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-fdt8XPAv.js";
|
|
10
11
|
import { i as redactValue, n as REDACTION_VERSION, r as redactString, t as DEFAULT_REDACTION_RULES } from "./redact-7Aq1ukl-.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as CaptureIntegrityError, t as AgentEvalError } from "./errors-DkfjIDvD.js";
|
|
2
|
-
import { b as CustomTokenPricing, c as CostLedgerHandle, f as CostLedgerSummary, g as CostReceiptInput, x as MaximumCharge } from "./cost-ledger-
|
|
2
|
+
import { b as CustomTokenPricing, c as CostLedgerHandle, f as CostLedgerSummary, g as CostReceiptInput, x as MaximumCharge } from "./cost-ledger-B1D3COAc.js";
|
|
3
3
|
//#region src/trace/raw-provider-sink.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* RawProviderSink — first-class persistence for the actual HTTP-level
|
|
@@ -801,4 +801,4 @@ interface EvalResult {
|
|
|
801
801
|
}
|
|
802
802
|
//#endregion
|
|
803
803
|
export { assertLlmRoute as $, ChatClient as A, SandboxSdkTransportOpts as B, ScenarioFile as C, TurnMetrics as D, Turn as E, CreateChatClientOpts as F, LlmCallResult as G, LlmCallError as H, CustomTransportOpts as I, LlmMessage as J, LlmClient as K, DirectProviderTransportOpts as L, ChatResponse as M, ChatTransport as N, TurnResult as O, CliBridgeTransportOpts as P, LlmUsage as Q, MockTransportOpts as R, Scenario as S, TestResult as T, LlmCallMetadata as U, createChatClient as V, LlmCallRequest as W, LlmRouteAssertionError as X, LlmResponseError as Y, LlmRouteRequirements as Z, PersonaConfig as _, RawProviderSink as _t, CheckResult as a, isTransientLlmError as at, RouteMap as b, providerFromBaseUrl as bt, DriverResult as c, stripFencedJson as ct, FeedbackPattern as d, InMemoryRawProviderSink as dt, backoffMs as et, JudgeConfig as f, InMemoryRawProviderSinkOptions as ft, JudgeScore as g, RawProviderEvent as gt, JudgeRubric as h, RawProviderDirection as ht, BenchmarkRunnerConfig as i, costReceiptFromLlmError as it, ChatRequest as j, ChatCallOpts as k, DriverState as l, FileSystemRawProviderSink as lt, JudgeInput as m, ProviderRedactor as mt, ArtifactResult as n, callLlmJson as nt, CollectedArtifacts as o, maximumChargeForLlmRequest as ot, JudgeFn as p, NoopRawProviderSink as pt, LlmClientOptions as q, BenchmarkReport as r, costReceiptFromLlm as rt, CompletionCriterion as s, probeLlm as st, ArtifactCheck as t, callLlm as tt, EvalResult as u, FileSystemRawProviderSinkOptions as ut, PersonaRigor as v, RawProviderSinkFilter as vt, ScenarioResult as w, RubricDimension as x, ProductClientConfig as y, defaultProviderRedactor as yt, RouterTransportOpts as z };
|
|
804
|
-
//# sourceMappingURL=types-
|
|
804
|
+
//# sourceMappingURL=types-5q2T25iW.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-5q2T25iW.d.ts","names":[],"sources":["../src/trace/raw-provider-sink.ts","../src/llm-client.ts","../src/analyst/chat-client.ts","../src/types.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BY;UAEK;;EAEf;;EAEA;EACA;;;;;;EAMA;EACA;;EAEA;;EAEA;;EAEA;EACA,WAAW;;EAEX;;EAEA;EACA;EACA,iBAAiB;EACjB;EACA,kBAAkB;EAClB;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA,YAAY;EACZ;;UAGe;EACf,OAAO,OAAO,mBAAmB;;EAEjC,MAAM,SAAS,wBAAwB,QAAQ;;EAE/C,UAAU;;KAGA,oBAAoB,OAAO,qBAAqB;;;;;;iBAmB5C,wBAAwB,OAAO,mBAAmB;UA8CjD;EACf,WAAW;;cAGA,mCAAmC;UACtC;UACA;EAER,YAAY,OAAM;EAIZ,OAAO,OAAO,mBAAmB;EAIjC,KAAK,SAAQ,wBAA6B,QAAQ;EAUxD;;cAKW,+BAA+B;EACpC,UAAU;;;;;;;EASV,QAAQ,QAAQ;;UAOP;;EAEf;;EAEA;;EAEA;EACA,WAAW;;cAGA,qCAAqC;UACxC;UACA;UACA;UACA;UACA;UACA;UACA;EAER,YAAY,MAAM;UAOJ;UAON;EAKF,OAAO,OAAO,mBAAmB;EAYjC,KAAK,SAAQ,wBAA6B,QAAQ;;;;;;iBAkC1C,oBAAoB;;;UChPnB;EACf;;;;;EAKA,kBAEI;IACM;IAAc;;IACd;IAAmB;MAAa;MAAa;;;;KAI7C;UAEK;EACf;EACA,UAAU;;EAEV;;EAEA;IAAe;IAAc,QAAQ;;EACrC;EACA;;EAEA,WAAW;;EAEX;;;;;;iBAOc,2BACd,SAAS,KAAK,iFACd,UAAS,mBACR;UAgCc;EACf;EACA;EACA;;EAEA;;EAEA;;EAEA;;UAGe;;EAEf;EACA,OAAO;;;;;EAKP;;EAEA;;EAEA;;;;;;;;;EASA;;;;;;;EAOA;;EAEA,KAAK;;KAGK,kBAAkB,KAA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e;EACf;EACA;EACA;EACA;EACA;EACA;EACA;IACE;MACE;MACA;MACA;;;EAGJ,OAAO;EACP,gBAAgB;;UAKD;EACf;EACA,QAAQ,OAAO;EACf,YAAY,OAAO;;UAGJ;EACf;EACA;;;;;;;;;;KAWU;UAEK;EACf;EACA;EACA;EACA,oBAAoB;EACpB,mBAAmB;EACnB;EACA;;EAEA,QAAQ;;;;;;;EAOR;;;;;;;EAOA;;;;;;EAMA;;UAGe;EACf;EACA;EACA;IAAa;IAAiB;IAAkB;;EAChD;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;IAAa;IAAiB;IAAkB;;EAChD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;;EAEA;;EAEA;;;;;;EAMA;EACA;EACA,SAAS;EACT,YAAY;EACZ;EACA;EACA;;UAKe;EACf,WAAW;EACX,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;;EAEA,aAAa;;UAGE;EACf,UAAU;EACV,OAAO;EACP,WAAW;;EAEX,aAAa;EACb;EACA,WAAW;EACX,SAAS;;KAGC,WAAW,MAAM,YAAY,OAAO,eAAe,QAAQ;UAItD;EACf;EACA;EACA;EACA;EACA,QAAQ;;UAGO;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as CostLedgerHandle } from "./cost-ledger-
|
|
2
|
-
import { a as RunRecord, n as RunCostProvenance, u as RunTokenUsage } from "./run-record-
|
|
3
|
-
import { A as ChatClient, m as JudgeInput } from "./types-
|
|
1
|
+
import { c as CostLedgerHandle } from "./cost-ledger-B1D3COAc.js";
|
|
2
|
+
import { a as RunRecord, n as RunCostProvenance, u as RunTokenUsage } from "./run-record-DwHMk1Ai.js";
|
|
3
|
+
import { A as ChatClient, m as JudgeInput } from "./types-5q2T25iW.js";
|
|
4
4
|
import { RE2JS } from "re2js";
|
|
5
5
|
//#region src/trace-analyst/types.d.ts
|
|
6
6
|
/**
|
|
@@ -527,4 +527,4 @@ type AnalystRunEvent = {
|
|
|
527
527
|
};
|
|
528
528
|
//#endregion
|
|
529
529
|
export { TRACE_ANALYST_TRUNCATION_MARKER_PREFIX as A, DEFAULT_TRACE_ANALYST_BUDGETS as C, SearchSpanResult as D, QueryTracesPage as E, TraceAnalystSpanStatus as F, TraceAnalystTraceSummary as I, ViewSpansResult as L, TraceAnalystFilters as M, TraceAnalystSpan as N, SearchTraceResult as O, TraceAnalystSpanKind as P, ViewTraceOversized as R, TraceAnalysisStoreContext as S, ErrorCluster as T, makeFinding as _, AnalystInputKind as a, TRACE_ANALYSIS_LIMITS as b, AnalystRunInputs as c, AnalystSeverity as d, AnalystUsageReceipt as f, computeFindingId as g, ProposalFindingOrigin as h, AnalystFinding as i, TraceAnalystByteBudgets as j, SpanMatchRecord as k, AnalystRunResult as l, ProposalFinding as m, AnalystContext as n, AnalystRequirements as o, EvidenceRef as p, AnalystCost as r, AnalystRunEvent as s, Analyst as t, AnalystRunSummary as u, makeProposalFinding as v, DatasetOverview as w, TraceAnalysisStore as x, BoundedTraceAnalysisStoreOptions as y, ViewTraceResult as z };
|
|
530
|
-
//# sourceMappingURL=types-
|
|
530
|
+
//# sourceMappingURL=types-BtJhn8v6.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-BtJhn8v6.d.ts","names":[],"sources":["../src/trace-analyst/types.ts","../src/trace-analyst/store-contract.ts","../src/analyst/types.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;KAgBY;KAUA;;;;UAKK;EACf;EACA;EACA;EACA;EACA,MAAM;EACN;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;;;EAGA,YAAY;;UAGG;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;EAGA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nB,iBAAiB;;UAGX;;;;;;;EAOf;EACA;EACA;;;;;;;;KAWU;UAOK;;EAEf;;EAEA;;EAEA;;EAEA;;UAGe;;EAEf;;EAEA;;;;;;UAOe;EACf,aAAa;EACb;EACA,YAAY;EACZ,aAAa;;EAEb,SAAS;;UAGM;EACf;;EAEA;;EAEA;;EAEA;;EAEA,aAAa;;EAEb;;;;;;;EAOA,OAAO;;;;;;;;;;EAUP,gBAAgB,cAAc;;;;;;;EAO9B,mBAAmB,cAAc;;;;;EAKjC,eAAe,SAAS;;EAExB,OAAO;;EAEP,OAAO,aAAa,SAAS;;EAE7B,SAAS;;;;;;;;UASM,QAAQ;;WAEd;;WAEA;WACA,WAAW;WACX,MAAM;WACN,WAAW;;WAEX;EACT,QAAQ,OAAO,QAAQ,KAAK,iBAAiB,QAAQ;;;UAItC;;EAEf;;EAEA,QAAQ;;EAER,MAAM;;EAEN;;;;;;;;;;iBAac,iBAAiB;EAC/B;EACA;EACA;EACA;;EAEA;;;;;;iBAyBc,YACd,MAAM,KAAK;EACT;EACA;IAED;;iBAiBa,oBACd,MAAM,KAAK;EACT;EACA;IAED;UAOc;EACf;EACA;;EAEA;EACA;EACA;;EAEA,OAAO;;EAEP;IAAU;IAAe;;;UAGV;EACf;EACA;EACA;EACA;EACA,UAAU;EACV,aAAa;;EAEb;;;;;EAKA,wBAAwB;;;;;;;;;;;;;;;KAkBd;EAEN;EACA;EACA;EACA;;EAEA,aAAa;;EAGb;EACA,SAAS;;EAGT;EACA;EACA;;EAGA;;EAEA,SAAS;EACT,UAAU,cAAc;;EAGxB;EACA,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as PaidCallResult, T as RunPaidCallInput, a as CostChannel, c as CostLedgerHandle, f as CostLedgerSummary } from "./cost-ledger-
|
|
2
|
-
import { u as RunTokenUsage } from "./run-record-
|
|
3
|
-
import { U as LlmCallMetadata } from "./types-
|
|
4
|
-
import { m as ProposalFinding } from "./types-
|
|
1
|
+
import { S as PaidCallResult, T as RunPaidCallInput, a as CostChannel, c as CostLedgerHandle, f as CostLedgerSummary } from "./cost-ledger-B1D3COAc.js";
|
|
2
|
+
import { u as RunTokenUsage } from "./run-record-DwHMk1Ai.js";
|
|
3
|
+
import { U as LlmCallMetadata } from "./types-5q2T25iW.js";
|
|
4
|
+
import { m as ProposalFinding } from "./types-BtJhn8v6.js";
|
|
5
5
|
//#region src/campaign/types.d.ts
|
|
6
6
|
/** Stable identifier + kind tag for any scenario. Consumers
|
|
7
7
|
* extend with their per-domain payload (persona, task, requirement, ...). */
|
|
@@ -620,4 +620,4 @@ interface CampaignResult<TArtifact = unknown, TScenario extends Scenario = Scena
|
|
|
620
620
|
}
|
|
621
621
|
//#endregion
|
|
622
622
|
export { LabeledScenarioWrite as A, ScoredSurfaceOutcome as B, JudgeDimension as C, LabeledScenarioSampleArgs as D, LabeledScenarioRecord as E, ProposeContext as F, labelTrustRank as G, SurfaceProposer as H, ProposedCandidate as I, RedactionStatus as L, OptimizerConfig as M, ParetoParent as N, LabeledScenarioSource as O, ProposalTrackContext as P, Scenario as R, JudgeConfig as S, LabelTrust as T, TraceSpan as U, SessionScript as V, isProposedCandidate as W, GateDecision as _, CampaignResult as a, GenerationRecord as b, CampaignTraceWriter as c, DispatchContext as d, DispatchFn as f, GateContribution as g, GateContext as h, CampaignCostMeter as i, MutableSurface as j, LabeledScenarioStore as k, CodeSurface as l, GateCheckStatus as m, CampaignArtifactWriter as n, CampaignScenarioIdentity as o, Gate as p, CampaignCellResult as r, CampaignTokenUsage as s, CampaignAggregates as t, ComponentSurface as u, GateResult as v, JudgeScore as w, JudgeAggregate as x, GenerationCandidate as y, ScenarioAggregate as z };
|
|
623
|
-
//# sourceMappingURL=types-
|
|
623
|
+
//# sourceMappingURL=types-zFYez3PK.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-zFYez3PK.d.ts","names":[],"sources":["../src/campaign/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AAU,6BACpE,qBAAqB,WAAW;;EAExC;;;EAGA;;UAGe;EACf;;EAEA;;;;EAIA;EACA;IACE;IACA,SAAS,wBAAwB;IACjC;IACA;;;;;IAKA,WAAW;;;UAIE;EACf,QAAQ,OAAO,uBAAuB;EACtC,OAAO,MAAM,4BAA4B,QAAQ;EACjD,QAAQ;IACN;IACA;IACA,UAAU;;;IAGV,SAAS,OAAO;;;UAMH,mBAAmB;;;EAGlC;EACA;EACA;EACA;EACA;EACA,UAAU;EACV,aAAa,eAAe;EAC5B;;EAEA;;EAEA;;;EAGA,YAAY;;;;EAIZ;EACA;EACA;EACA;;EAEA;;EAEA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA,YAAY;EACZ;;;;;;UAOe;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;;EAGA;;;;EAIA;;;;EAIA;IACE;IACA;IACA,iBAAiB;MAAQ;MAAgB;;;;;EAI3C,YAAY;;;;;;;;;;EAUZ,WAAW;IAAQ;IAAoB;IAAmB;IAAgB;;;;EAG1E;;;;EAIA;;UAGe;EACf,SAAS,eAAe;EACxB,YAAY,eAAe;;EAE3B,MAAM;;EAEN;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe,eAAe,qBAAqB,kBAAkB,WAAW;;EAEhF;;EAEA;EACA;;EAEA;EACA;EACA;EACA;EACA,OAAO,MAAM,mBAAmB;EAChC,YAAY;EACZ;IACE,aAAa;IACb;;EAEF,OAAO;EACP;EACA;EACA,iBAAiB;;;EAGjB,WAAW,MAAM,2BAA2B,KAAK"}
|
package/dist/wire/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as CostLedgerHandle } from "../cost-ledger-
|
|
2
|
-
import { Z as LlmRouteRequirements, q as LlmClientOptions } from "../types-
|
|
1
|
+
import { c as CostLedgerHandle } from "../cost-ledger-B1D3COAc.js";
|
|
2
|
+
import { Z as LlmRouteRequirements, q as LlmClientOptions } from "../types-5q2T25iW.js";
|
|
3
3
|
import { s as TraceStore } from "../store-CT9YIIve.js";
|
|
4
|
-
import { _ as FeedbackTrajectoryStore } from "../feedback-trajectory-
|
|
4
|
+
import { _ as FeedbackTrajectoryStore } from "../feedback-trajectory-CoNep7rl.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { ServerType } from "@hono/node-server";
|
|
7
7
|
import { Hono } from "hono";
|
package/dist/wire/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as TraceEventSchema, C as HealthResponseSchema, D as RubricDimensionSchema, E as ListRubricsResponseSchema, F as hashRubric, M as TracesIngestResponseSchema, N as VersionResponseSchema, O as RubricInfoSchema, P as WIRE_VERSION, S as FeedbackTrajectorySchema, T as JudgeResultSchema, _ as ErrorResponseSchema, a as runRpcBatch, b as FeedbackIngestResponseSchema, c as WireError, d as handleListRubrics, f as handleTracesIngest, g as listBuiltinRubrics, h as getBuiltinRubric, i as dispatchRpc, j as TracesIngestRequestSchema, k as RubricSchema, l as handleFeedbackIngest, m as BUILTIN_RUBRICS, n as startServer, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi, t as createApp, u as handleJudge, v as FailureModeSchema, w as JudgeRequestSchema, x as FeedbackLabelSchema, y as FeedbackAttemptSchema } from "../server-
|
|
1
|
+
import { A as TraceEventSchema, C as HealthResponseSchema, D as RubricDimensionSchema, E as ListRubricsResponseSchema, F as hashRubric, M as TracesIngestResponseSchema, N as VersionResponseSchema, O as RubricInfoSchema, P as WIRE_VERSION, S as FeedbackTrajectorySchema, T as JudgeResultSchema, _ as ErrorResponseSchema, a as runRpcBatch, b as FeedbackIngestResponseSchema, c as WireError, d as handleListRubrics, f as handleTracesIngest, g as listBuiltinRubrics, h as getBuiltinRubric, i as dispatchRpc, j as TracesIngestRequestSchema, k as RubricSchema, l as handleFeedbackIngest, m as BUILTIN_RUBRICS, n as startServer, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi, t as createApp, u as handleJudge, v as FailureModeSchema, w as JudgeRequestSchema, x as FeedbackLabelSchema, y as FeedbackAttemptSchema } from "../server-DLEvyW2z.js";
|
|
2
2
|
export { BUILTIN_RUBRICS, ErrorResponseSchema, FailureModeSchema, FeedbackAttemptSchema, FeedbackIngestResponseSchema, FeedbackLabelSchema, FeedbackTrajectorySchema, HealthResponseSchema, JudgeRequestSchema, JudgeResultSchema, ListRubricsResponseSchema, RubricDimensionSchema, RubricInfoSchema, RubricSchema, TraceEventSchema, TracesIngestRequestSchema, TracesIngestResponseSchema, VersionResponseSchema, WIRE_VERSION, WireError, buildOpenApi, createApp, dispatchRpc, getBuiltinRubric, handleFeedbackIngest, handleJudge, handleListRubrics, handleTracesIngest, handleVersion, hashRubric, listBuiltinRubrics, runRpcBatch, runRpcOnce, startServer, startServerAsync };
|
package/docs/trace-analysis.md
CHANGED
|
@@ -225,6 +225,8 @@ import {
|
|
|
225
225
|
const benchmark = await runAnalystBenchmark({
|
|
226
226
|
cases: [{
|
|
227
227
|
id: 'failed-command',
|
|
228
|
+
clusterId: 'incident-42',
|
|
229
|
+
labelState: 'positive',
|
|
228
230
|
input: { traceStore },
|
|
229
231
|
expectedIssues: [{
|
|
230
232
|
id: 'repeated-command',
|
|
@@ -257,9 +259,10 @@ The result reports:
|
|
|
257
259
|
|
|
258
260
|
- issue recall and finding precision,
|
|
259
261
|
- first bad step accuracy,
|
|
260
|
-
- citation coverage, agreement with labeled locations, and actual location resolution,
|
|
261
|
-
- false positives on
|
|
262
|
-
-
|
|
262
|
+
- citation coverage, exact source-quote coverage, agreement with labeled locations, and actual location resolution,
|
|
263
|
+
- false positives and failures on trusted-negative cases,
|
|
264
|
+
- predictions and failures on unlabeled cases,
|
|
265
|
+
- matched-label agreement and full-prediction agreement,
|
|
263
266
|
- failed runs,
|
|
264
267
|
- latency, calls, every reported token counter, and known or missing cost,
|
|
265
268
|
- dataset revision, case tags, case metadata, and runner metadata.
|
|
@@ -327,8 +330,125 @@ Both adapters emit `trace://<id>/span/step-<n>` evidence by default.
|
|
|
327
330
|
`@tangle-network/traces` uses the same IDs when converting chat trajectories.
|
|
328
331
|
Pass `stepUri` when your trace store uses another URI scheme.
|
|
329
332
|
`codeTracerPredictionsToFindings()` and `agentRxPredictionsToFindings()` translate the maintained upstream engines' native outputs into the same evidence and category shape.
|
|
333
|
+
The CodeTracer adapter accepts the published `stage_id` format and the flat or grouped step-label formats emitted by CodeTracer 0.2.
|
|
330
334
|
AgentRx `Report.to_dict()` judge votes reduce to the upstream majority failure type and Python-rounded mean step, and direct `failures` arrays use the same reduction.
|
|
331
335
|
`failure_case: 0` produces no finding, which scores as a missed root cause on AgentRx's failed trajectories.
|
|
336
|
+
External runners can return `observedLatencyMs`, `usage`, `metadata`, and `error` together.
|
|
337
|
+
This records an upstream failure without discarding work already performed.
|
|
338
|
+
Set `observedLatencyMs: null` when an imported run did not record duration.
|
|
339
|
+
The report keeps it unknown instead of timing the import code.
|
|
340
|
+
|
|
341
|
+
## Run A Real-Model Public Benchmark
|
|
342
|
+
|
|
343
|
+
`agent-eval analyst-benchmark` runs the existing label adapters and `runAnalystBenchmark()` with two runners: an empty-finding baseline and a benchmark-specific model analyst.
|
|
344
|
+
The CodeTraceBench runner emits one prediction per incorrect step, including wrong actions that the agent later recovers from.
|
|
345
|
+
Final task success is evidence about the final state, not proof that every earlier action was correct.
|
|
346
|
+
Unuseful but correct exploration is a separate CodeTraceBench label and is not scored by the default run.
|
|
347
|
+
The AgentRx runner emits one taxonomy label and one root-cause step.
|
|
348
|
+
The generic `failure-mode` analyst is not used because its `failure-mode` area does not match either public task.
|
|
349
|
+
|
|
350
|
+
Convert CodeTraceBench trajectories with the maintained importer.
|
|
351
|
+
It writes one OTLP JSONL file per trajectory, preserves assistant step ids, and produces a receipt with source and output hashes.
|
|
352
|
+
Each label row's `traj_id` or `trajectory_id` must exactly equal the OTLP `trace_id`.
|
|
353
|
+
Use a domain-qualified ID when an upstream dataset reuses local trajectory numbers.
|
|
354
|
+
Keep the extracted CodeTraceBench artifact tree intact because each row's `source_relpath` locates its final test output.
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
traces import-codetracebench \
|
|
358
|
+
.artifacts/bench_manifest.verified.jsonl \
|
|
359
|
+
--trajectory-dir .artifacts/codetrace-normalized \
|
|
360
|
+
--out .artifacts/codetrace-otlp \
|
|
361
|
+
--revision aa213b84ffb6690fc37ca15766d6ca174ec36d4d \
|
|
362
|
+
--concurrency 8
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Run a bounded comparison through any OpenAI-compatible endpoint.
|
|
366
|
+
The key is read from the named environment variable and is not written to the result.
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
export CLI_BRIDGE_BEARER="<read from the running bridge environment>"
|
|
370
|
+
|
|
371
|
+
agent-eval analyst-benchmark \
|
|
372
|
+
--dataset codetracebench \
|
|
373
|
+
--labels .artifacts/bench_manifest.verified.jsonl \
|
|
374
|
+
--trace-dir .artifacts/codetrace-otlp \
|
|
375
|
+
--artifact-dir .artifacts/codetrace-extracted \
|
|
376
|
+
--out .artifacts/codetrace-glm52 \
|
|
377
|
+
--revision aa213b84ffb6690fc37ca15766d6ca174ec36d4d \
|
|
378
|
+
--split verified \
|
|
379
|
+
--base-url http://127.0.0.1:3355/v1 \
|
|
380
|
+
--api-key-env CLI_BRIDGE_BEARER \
|
|
381
|
+
--model opencode/zai-coding-plan/glm-5.2 \
|
|
382
|
+
--limit 20 \
|
|
383
|
+
--seed 7 \
|
|
384
|
+
--concurrency 4 \
|
|
385
|
+
--max-cost-usd 5
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
The trace directory may use any filenames, but every JSONL file must contain exactly one trace.
|
|
389
|
+
For CodeTraceBench, the artifact loader reads available final test output and structured result files.
|
|
390
|
+
It adds raw final-test text and one parsed pass, fail, or unavailable outcome as searchable `EVALUATOR` spans on the same case.
|
|
391
|
+
Raw result JSON is hashed and parsed but is not sent to the model.
|
|
392
|
+
`--artifact-dir` may be a shared extraction root with one directory per `traj_id`, or the extraction root for one archive.
|
|
393
|
+
It prefers `panes/post-test.txt` over the duplicate `sessions/tests.log`.
|
|
394
|
+
It also recognizes `test_output.txt`, `results.json`, `result.json`, `report.json`, `*_result.json`, and `*_metrics.json`.
|
|
395
|
+
Each discovered file records its role, path, byte count, and SHA-256.
|
|
396
|
+
Files exposed as spans also record their span ids.
|
|
397
|
+
Missing evidence roles are explicit.
|
|
398
|
+
Known Terminal-Bench, SWE-Bench, and SWE-Multi result formats become one explicit passed or failed outcome span.
|
|
399
|
+
A missing or unparseable result becomes `unavailable`; it is never inferred from the trajectory or raw test text.
|
|
400
|
+
Raw test output is optional because some public cases retain only structured results.
|
|
401
|
+
|
|
402
|
+
Before the first model call, the command also checks that every selected label has a matching `step-<n>` span.
|
|
403
|
+
It refuses a missing dataset revision, implicit all-case run, duplicate trajectory id, multi-trace file, missing step, oversized evidence, or existing `result.json`.
|
|
404
|
+
The model selects positive integer assistant step ids.
|
|
405
|
+
The runner constructs each canonical trace URI and exact action excerpt from the selected span.
|
|
406
|
+
A missing, non-assistant, or empty step fails that model run while preserving its raw output and usage.
|
|
407
|
+
The command consumes already-downloaded labels, normalized traces, and extracted artifacts.
|
|
408
|
+
Dataset download, archive extraction, and trajectory conversion remain separate import steps.
|
|
409
|
+
|
|
410
|
+
The output directory contains:
|
|
411
|
+
|
|
412
|
+
- `manifest.json` with the immutable dataset, model, case, and input identity.
|
|
413
|
+
- `initialization-complete.json` written only after every initial file is durable.
|
|
414
|
+
- `observations.jsonl` with one fsynced, hash-chained row per completed case and runner.
|
|
415
|
+
- `cost-ledger.jsonl` with durable run-wide model reservations and receipts.
|
|
416
|
+
- `model-responses/` with one strict, content-hashed response and receipt per paid call for crash recovery.
|
|
417
|
+
- `result.json` with every observation, summary metric, comparison, error, latency, token counter, measured or estimated cost, explicit unknown cost, selected case id, source digest, dependency-lock digest, artifact digest, analyst protocol digest, implementation digest, and case distribution.
|
|
418
|
+
- `report.md` with the same run and selection distribution rendered for review.
|
|
419
|
+
- `run.local.json` with machine-local paths, endpoint, and command, kept out of the shareable result.
|
|
420
|
+
|
|
421
|
+
When active calls temporarily hold the remaining money limit, later calls wait for their final receipts.
|
|
422
|
+
The command rejects new work only when committed spend plus the next enforced maximum cannot fit.
|
|
423
|
+
|
|
424
|
+
Resume only the exact same run after an interruption:
|
|
425
|
+
|
|
426
|
+
```bash
|
|
427
|
+
agent-eval analyst-benchmark <the same flags> --resume
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Resume rejects changed labels, traces, artifacts, model settings, case selection, local paths, or endpoint.
|
|
431
|
+
It runs only missing case and runner pairs.
|
|
432
|
+
If the provider response was saved before the process stopped, resume settles that exact response without another provider call.
|
|
433
|
+
If the call stopped before a response was saved, resume reuses the same provider request id.
|
|
434
|
+
An already complete run is read and checked without another model call.
|
|
435
|
+
|
|
436
|
+
The command exits `2` when any model analyst fails.
|
|
437
|
+
Its failed row still records latency, calls, available token counters, known spend, and the analyst error.
|
|
438
|
+
See the [32-case GLM-5.2 reference run](https://github.com/tangle-network/agent-eval/tree/main/benchmarks/trace-analysis/codetracebench-glm52-20260730) for a complete measured result and its stated limits.
|
|
439
|
+
|
|
440
|
+
`--limit` uses deterministic hash selection, not stratified sampling.
|
|
441
|
+
Limited runs are marked `representativeOfInput: false`.
|
|
442
|
+
The result compares source and selected distributions for label class, agent, model, difficulty, and solved state.
|
|
443
|
+
CodeTraceBench label classes distinguish `positive`, `trusted-negative`, `unlabeled-failure`, and `unlabeled-unknown`.
|
|
444
|
+
Micro precision, recall, and F1 pool all labeled steps and predictions.
|
|
445
|
+
Macro precision, recall, and F1 average per-case scores over issue-bearing cases, matching step-localization papers that report per-trajectory means.
|
|
446
|
+
The all-row result remains intact for comparison with published work.
|
|
447
|
+
The additional calibrated view measures labeled positives against solved, label-empty negatives and reports failed, label-empty rows separately instead of calling them clean.
|
|
448
|
+
The report separately counts final-result files and passed, failed, or unavailable outcomes.
|
|
449
|
+
Only a full census of the supplied input is marked representative.
|
|
450
|
+
|
|
451
|
+
AgentRx uses the same command with `--dataset agentrx` after obtaining its contact-gated label and trajectory files.
|
|
332
452
|
|
|
333
453
|
## Use Upstream Scorers
|
|
334
454
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-eval",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.138.0",
|
|
4
4
|
"description": "Evaluate and improve AI agents from runs, traces, judges, and feedback. Compare candidates, cluster failures, measure lift, and gate releases.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-eval#readme",
|
|
6
6
|
"repository": {
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"access": "public"
|
|
151
151
|
},
|
|
152
152
|
"scripts": {
|
|
153
|
-
"build": "tsdown && pnpm openapi",
|
|
153
|
+
"build": "pnpm check:analyst-benchmark && tsdown && pnpm openapi",
|
|
154
154
|
"dev": "tsdown --watch",
|
|
155
155
|
"prepare": "husky",
|
|
156
156
|
"prepublishOnly": "pnpm build",
|
|
@@ -161,8 +161,9 @@
|
|
|
161
161
|
"lint": "biome check src",
|
|
162
162
|
"format": "biome format --write src",
|
|
163
163
|
"check:skill": "node scripts/check-skill.mjs",
|
|
164
|
+
"check:analyst-benchmark": "node scripts/check-analyst-benchmark-implementation.mjs",
|
|
164
165
|
"openapi": "node dist/cli.js openapi --out dist/openapi.json",
|
|
165
|
-
"verify:package": "pnpm run check:skill && publint && attw --pack --profile esm-only . && node scripts/verify-package-exports.mjs"
|
|
166
|
+
"verify:package": "pnpm check:analyst-benchmark && pnpm run check:skill && publint && attw --pack --profile esm-only . && node scripts/verify-package-exports.mjs"
|
|
166
167
|
},
|
|
167
168
|
"dependencies": {
|
|
168
169
|
"@asteasolutions/zod-to-openapi": "^9.1.0",
|
|
@@ -201,6 +202,7 @@
|
|
|
201
202
|
"vite"
|
|
202
203
|
],
|
|
203
204
|
"overrides": {
|
|
205
|
+
"@arizeai/openinference-core>@opentelemetry/core": "^2.10.0",
|
|
204
206
|
"esbuild@>=0.27.3 <0.28.1": "^0.28.1",
|
|
205
207
|
"postcss@<8.5.18": "^8.5.18",
|
|
206
208
|
"vite@>=7.0.0 <=7.3.4": "^7.3.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark-CHX4orG7.d.ts","names":[],"sources":["../src/analyst/benchmark.ts"],"mappings":";;;UAYiB;EACf;EACA,OAAO;;UAGQ;EACf;EACA;EACA;EACA;EACA,oBAAoB;EACpB;;EAEA,4BAA4B;;UAGb,qBAAqB;EACpC;EACA,OAAO;EACP,yBAAyB;;EAEzB,2BAA2B;EAC3B;EACA,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA,mBAAmB;EACnB;EACA;EACA;EACA;;EAEA;;EAEA;EACA;;UAGe;EACf,UAAU;EACV;EACA;;UAGe;EACf;EACA;EACA,oBAAoB;EACpB,QAAQ;;EAER;;KAGU,wBAAwB,qBAAqB;EACvD;EACA,WAAW;EACX,UAAU;EACV,SAAS;gBACK;;;;;iBAMA,2BAA2B,QACzC,WAAW,OAAO,WAAW,qBAC5B,wBAAwB;UAiBV;EACf,mBAAmB;EACnB,QAAQ;EACR,WAAW;;UAGI,uBAAuB;EACtC;EACA,QACE,OAAO,QACP;IAAW;IAAgB;IAAoB,SAAS;MACvD,yBAAyB,QAAQ;;UAGrB;EACf;EACA;EACA;EACA;EACA;EACA,mBAAmB;EACnB,OAAO;EACP,qBAAqB;EACrB;EACA,eAAe;EACf,QAAQ;EACR,iBAAiB;EACjB;IAAU;IAAe;;;UAGV;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA,UAAU;EACV;EACA,cAAc;EACd,WAAW;;UAGI,mCAAmC;EAClD;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,YAAY;EACZ,cAAc;EACd,WAAW;;UAGI,2BAA2B;EAC1C,gBAAgB,qBAAqB;EACrC,kBAAkB,uBAAuB;EACzC;EACA;EACA;EACA,kBAAkB,wBAAwB;EAC1C,YAAY;EACZ,SAAS;;iBAGK,qBACd,UAAU,KAAK,oEACf,mBAAmB,mBAClB;iBA0FmB,oBAAoB,QACxC,SAAS,2BAA2B,UACnC,QAAQ;iBAiDK,wBAAwB;EACtC;EACA,UAAU;EACV,aAAa,KAAK;IAChB,uBAAuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark-YDrpumqB.js","names":[],"sources":["../src/analyst/benchmark.ts"],"sourcesContent":["import { performance } from 'node:perf_hooks'\nimport { linearSumAssignment } from 'linear-sum-assignment'\nimport type { TraceAnalysisStore } from '../trace-analyst/store'\nimport type { AnalystRegistry, RegistryRunOpts } from './registry'\nimport type {\n AnalystFinding,\n AnalystRunInputs,\n AnalystRunResult,\n AnalystUsageReceipt,\n EvidenceRef,\n} from './types'\n\nexport interface AnalystEvidenceExpectation {\n uri: string\n kind?: EvidenceRef['kind']\n}\n\nexport interface AnalystIssueExpectation {\n id: string\n findingIds?: readonly string[]\n areas?: readonly string[]\n subjects?: readonly string[]\n evidence?: readonly AnalystEvidenceExpectation[]\n evidenceMode?: 'any' | 'all'\n /** Exact evidence location for the first unrecoverable or causal step. */\n criticalEvidence?: readonly AnalystEvidenceExpectation[]\n}\n\nexport interface AnalystBenchmarkCase<TInput = unknown> {\n id: string\n input: TInput\n expectedIssues: readonly AnalystIssueExpectation[]\n /** Complete set of labeled locations used to measure label-location agreement. */\n labeledEvidence?: readonly AnalystEvidenceExpectation[]\n tags?: readonly string[]\n metadata?: Record<string, unknown>\n}\n\nexport interface AnalystFindingScore {\n expectedIssueCount: number\n matchedIssueIds: string[]\n missedIssueIds: string[]\n supportedFindingIndexes: number[]\n unsupportedFindingIndexes: number[]\n unlabeledEvidence: EvidenceRef[]\n issueRecall: number\n findingPrecision: number\n f1: number\n criticalStepAccuracy: number | null\n /** Share of findings that cite at least one evidence location. */\n citationCoverage: number | null\n /** Share of citations that agree with a labeled case location. */\n citationLabelAgreement: number | null\n cleanFalsePositive: boolean\n}\n\nexport interface AnalystEvidenceResolutionError {\n evidence: EvidenceRef\n class: string\n message: string\n}\n\nexport interface AnalystEvidenceResolution {\n checked: number\n resolved: number\n unresolvedEvidence: EvidenceRef[]\n errors: AnalystEvidenceResolutionError[]\n /** Null when no citations were checked or any resolution attempt failed. */\n validity: number | null\n}\n\nexport type AnalystEvidenceResolver<TInput = unknown> = (input: {\n caseId: string\n caseInput: TInput\n evidence: EvidenceRef\n signal?: AbortSignal\n}) => boolean | Promise<boolean>\n\n/**\n * Resolve canonical `trace://<trace>/span/<span>` evidence against a trace store.\n * Other evidence kinds and URI schemes require a caller-supplied resolver.\n */\nexport function traceStoreEvidenceResolver<TInput>(\n getStore: (input: TInput) => TraceAnalysisStore,\n): AnalystEvidenceResolver<TInput> {\n return async ({ caseInput, evidence }) => {\n if (evidence.kind !== 'span') return false\n const location = parseTraceSpanUri(evidence.uri)\n if (!location) return false\n const result = await getStore(caseInput).viewSpans({\n trace_id: location.traceId,\n span_ids: [location.spanId],\n })\n return (\n result.trace_id === location.traceId &&\n result.missing_span_ids.length === 0 &&\n result.spans.some((span) => span.span_id === location.spanId)\n )\n }\n}\n\nexport interface AnalystBenchmarkOutput {\n findings: readonly AnalystFinding[]\n usage?: AnalystUsageReceipt\n metadata?: Record<string, unknown>\n}\n\nexport interface AnalystBenchmarkRunner<TInput = unknown> {\n id: string\n analyze(\n input: TInput,\n context: { caseId: string; repetition: number; signal?: AbortSignal },\n ): AnalystBenchmarkOutput | Promise<AnalystBenchmarkOutput>\n}\n\nexport interface AnalystBenchmarkObservation {\n runnerId: string\n caseId: string\n repetition: number\n executionIndex: number\n latencyMs: number\n findings: readonly AnalystFinding[]\n score: AnalystFindingScore\n evidenceResolution?: AnalystEvidenceResolution\n caseTags: readonly string[]\n caseMetadata?: Record<string, unknown>\n usage?: AnalystUsageReceipt\n runnerMetadata?: Record<string, unknown>\n error?: { class: string; message: string }\n}\n\nexport interface AnalystLatencyDistribution {\n min: number\n mean: number\n p50: number\n p95: number\n max: number\n}\n\nexport interface AnalystBenchmarkSummary {\n runnerId: string\n plannedRuns: number\n completedRuns: number\n failedRuns: number\n issueRecall: number | null\n findingPrecision: number | null\n f1: number | null\n criticalStepAccuracy: number | null\n citationCoverage: number | null\n citationLabelAgreement: number | null\n citationResolution: number | null\n citationResolutionUnknownRuns: number\n unresolvedCitations: number\n citationResolutionErrors: number\n cleanCaseFalsePositiveRate: number | null\n cleanCaseFailureRate: number | null\n runAgreement: number | null\n latencyMs: AnalystLatencyDistribution\n calls: number\n callsUnknownRuns: number\n inputTokens: number\n outputTokens: number\n reasoningTokens: number\n cachedTokens: number\n cacheWriteTokens: number\n tokenUsageUnknownRuns: number\n reasoningTokenUsageUnknownRuns: number\n cachedTokenUsageUnknownRuns: number\n cacheWriteTokenUsageUnknownRuns: number\n knownCostUsd: number\n costUnknownRuns: number\n}\n\nexport interface AnalystBenchmarkDatasetRef {\n id: string\n revision: string\n split?: string\n}\n\nexport interface AnalystBenchmarkDescriptor {\n id?: string\n dataset?: AnalystBenchmarkDatasetRef\n command?: string\n environment?: Record<string, string>\n metadata?: Record<string, unknown>\n}\n\nexport interface AnalystBenchmarkProvenance extends AnalystBenchmarkDescriptor {\n startedAt: string\n endedAt: string\n caseCount: number\n runnerIds: string[]\n repetitions: number\n maxConcurrency: number\n runnerOrderSeed: number\n}\n\nexport interface AnalystBenchmarkResult {\n provenance: AnalystBenchmarkProvenance\n observations: AnalystBenchmarkObservation[]\n summaries: AnalystBenchmarkSummary[]\n}\n\nexport interface RunAnalystBenchmarkOptions<TInput> {\n cases: readonly AnalystBenchmarkCase<TInput>[]\n runners: readonly AnalystBenchmarkRunner<TInput>[]\n repetitions?: number\n maxConcurrency?: number\n runnerOrderSeed?: number\n resolveEvidence?: AnalystEvidenceResolver<TInput>\n benchmark?: AnalystBenchmarkDescriptor\n signal?: AbortSignal\n}\n\nexport function scoreAnalystFindings(\n testCase: Pick<AnalystBenchmarkCase, 'id' | 'expectedIssues' | 'labeledEvidence'>,\n findings: readonly AnalystFinding[],\n): AnalystFindingScore {\n validateCase(testCase)\n const matchedFindingByIssue = matchFindingsToIssues(testCase.expectedIssues, findings)\n const matchedIssueIds = testCase.expectedIssues\n .filter((_, index) => matchedFindingByIssue.has(index))\n .map((issue) => issue.id)\n const missedIssueIds = testCase.expectedIssues\n .filter((_, index) => !matchedFindingByIssue.has(index))\n .map((issue) => issue.id)\n const supportedFindingIndexes = new Set(matchedFindingByIssue.values())\n\n const unsupportedFindingIndexes = findings\n .map((_, index) => index)\n .filter((index) => !supportedFindingIndexes.has(index))\n const expectedIssueCount = testCase.expectedIssues.length\n const issueRecall = expectedIssueCount === 0 ? 1 : matchedIssueIds.length / expectedIssueCount\n const findingPrecision =\n findings.length === 0\n ? expectedIssueCount === 0\n ? 1\n : 0\n : supportedFindingIndexes.size / findings.length\n const f1 = harmonicMean(findingPrecision, issueRecall)\n const allEvidence = findings.flatMap((finding) => finding.evidence_refs)\n\n const criticalIssues = testCase.expectedIssues.filter(\n (issue) => (issue.criticalEvidence?.length ?? 0) > 0,\n )\n const criticalHits = testCase.expectedIssues.filter((issue) => {\n if ((issue.criticalEvidence?.length ?? 0) === 0) return false\n return matchesEvidence(allEvidence, issue.criticalEvidence ?? [], 'any')\n }).length\n\n const findingsWithEvidence = findings.filter((finding) => finding.evidence_refs.length > 0).length\n const unlabeledEvidence = testCase.labeledEvidence\n ? allEvidence.filter(\n (ref) => !testCase.labeledEvidence!.some((expected) => evidenceMatches(ref, expected)),\n )\n : []\n\n return {\n expectedIssueCount,\n matchedIssueIds,\n missedIssueIds,\n supportedFindingIndexes: [...supportedFindingIndexes].sort((a, b) => a - b),\n unsupportedFindingIndexes,\n unlabeledEvidence,\n issueRecall,\n findingPrecision,\n f1,\n criticalStepAccuracy: criticalIssues.length === 0 ? null : criticalHits / criticalIssues.length,\n citationCoverage: findings.length === 0 ? null : findingsWithEvidence / findings.length,\n citationLabelAgreement:\n testCase.labeledEvidence === undefined\n ? null\n : allEvidence.length === 0\n ? findings.length === 0\n ? null\n : 0\n : (allEvidence.length - unlabeledEvidence.length) / allEvidence.length,\n cleanFalsePositive: expectedIssueCount === 0 && findings.length > 0,\n }\n}\n\nfunction matchFindingsToIssues(\n issues: readonly AnalystIssueExpectation[],\n findings: readonly AnalystFinding[],\n): Map<number, number> {\n if (issues.length === 0) return new Map()\n const cardinalityWeight = issues.length + 1\n const scores = issues.map((issue) => [\n ...findings.map((finding) => {\n if (!findingMatchesIssue(finding, issue)) return -1\n const criticalHit =\n (issue.criticalEvidence?.length ?? 0) > 0 &&\n matchesEvidence(finding.evidence_refs, issue.criticalEvidence ?? [], 'any')\n return cardinalityWeight + Number(criticalHit)\n }),\n ...Array.from({ length: issues.length }, () => 0),\n ])\n const assignment = linearSumAssignment(scores, { maximaze: true }).rowAssignments\n const matches = new Map<number, number>()\n for (const [issueIndex, column] of assignment.entries()) {\n if (column < 0 || column >= findings.length) continue\n if (!findingMatchesIssue(findings[column]!, issues[issueIndex]!)) continue\n matches.set(issueIndex, column)\n }\n return matches\n}\n\nexport async function runAnalystBenchmark<TInput>(\n options: RunAnalystBenchmarkOptions<TInput>,\n): Promise<AnalystBenchmarkResult> {\n validateBenchmarkOptions(options)\n const startedAt = new Date().toISOString()\n const repetitions = options.repetitions ?? 1\n const runnerOrderSeed = options.runnerOrderSeed ?? 0\n const maxConcurrency = Math.min(\n options.maxConcurrency ?? 1,\n options.runners.length * options.cases.length * repetitions,\n )\n const jobs = benchmarkJobs(options.cases, options.runners, repetitions, runnerOrderSeed)\n const observations: AnalystBenchmarkObservation[] = []\n let cursor = 0\n const worker = async (): Promise<void> => {\n while (cursor < jobs.length) {\n options.signal?.throwIfAborted()\n const job = jobs[cursor++]!\n observations.push(await runBenchmarkJob(job, options.signal, options.resolveEvidence))\n }\n }\n await Promise.all(Array.from({ length: maxConcurrency }, worker))\n const runnerOrder = new Map(options.runners.map((runner, index) => [runner.id, index]))\n const caseOrder = new Map(options.cases.map((testCase, index) => [testCase.id, index]))\n observations.sort(\n (a, b) =>\n (runnerOrder.get(a.runnerId) ?? 0) - (runnerOrder.get(b.runnerId) ?? 0) ||\n (caseOrder.get(a.caseId) ?? 0) - (caseOrder.get(b.caseId) ?? 0) ||\n a.repetition - b.repetition,\n )\n return {\n provenance: {\n ...options.benchmark,\n startedAt,\n endedAt: new Date().toISOString(),\n caseCount: options.cases.length,\n runnerIds: options.runners.map((runner) => runner.id),\n repetitions,\n maxConcurrency,\n runnerOrderSeed,\n },\n observations,\n summaries: options.runners.map((runner) =>\n summarizeRunner(\n runner.id,\n observations.filter((observation) => observation.runnerId === runner.id),\n ),\n ),\n }\n}\n\nexport function registryBenchmarkRunner(options: {\n id: string\n registry: AnalystRegistry\n runOptions?: Omit<RegistryRunOpts, 'signal'>\n}): AnalystBenchmarkRunner<AnalystRunInputs> {\n return {\n id: options.id,\n async analyze(input, context) {\n const result = await options.registry.run(\n `${options.id}:${context.caseId}:${context.repetition}`,\n input,\n { ...options.runOptions, signal: context.signal },\n )\n return {\n findings: result.findings,\n usage: mergeRegistryUsage(result),\n metadata: { analystRun: result },\n }\n },\n }\n}\n\nasync function runBenchmarkJob<TInput>(\n job: {\n runner: AnalystBenchmarkRunner<TInput>\n testCase: AnalystBenchmarkCase<TInput>\n repetition: number\n executionIndex: number\n },\n signal?: AbortSignal,\n resolveEvidence?: AnalystEvidenceResolver<TInput>,\n): Promise<AnalystBenchmarkObservation> {\n const started = performance.now()\n try {\n const output = await job.runner.analyze(job.testCase.input, {\n caseId: job.testCase.id,\n repetition: job.repetition,\n signal,\n })\n return {\n runnerId: job.runner.id,\n caseId: job.testCase.id,\n repetition: job.repetition,\n executionIndex: job.executionIndex,\n latencyMs: performance.now() - started,\n findings: output.findings,\n score: scoreAnalystFindings(job.testCase, output.findings),\n evidenceResolution: resolveEvidence\n ? await resolveFindingEvidence(job.testCase, output.findings, resolveEvidence, signal)\n : undefined,\n caseTags: [...(job.testCase.tags ?? [])],\n caseMetadata: job.testCase.metadata,\n usage: output.usage,\n runnerMetadata: output.metadata,\n }\n } catch (error) {\n if (signal?.aborted) throw error\n const findings: AnalystFinding[] = []\n return {\n runnerId: job.runner.id,\n caseId: job.testCase.id,\n repetition: job.repetition,\n executionIndex: job.executionIndex,\n latencyMs: performance.now() - started,\n findings,\n score: scoreAnalystFindings(job.testCase, findings),\n caseTags: [...(job.testCase.tags ?? [])],\n caseMetadata: job.testCase.metadata,\n error: {\n class: error instanceof Error ? error.constructor.name : 'Error',\n message: error instanceof Error ? error.message : String(error),\n },\n }\n }\n}\n\nfunction benchmarkJobs<TInput>(\n cases: readonly AnalystBenchmarkCase<TInput>[],\n runners: readonly AnalystBenchmarkRunner<TInput>[],\n repetitions: number,\n runnerOrderSeed: number,\n): Array<{\n runner: AnalystBenchmarkRunner<TInput>\n testCase: AnalystBenchmarkCase<TInput>\n repetition: number\n executionIndex: number\n}> {\n const seededRunners = [...runners].sort(\n (left, right) =>\n stableHash(`${runnerOrderSeed}\\u0000${left.id}`) -\n stableHash(`${runnerOrderSeed}\\u0000${right.id}`) || left.id.localeCompare(right.id),\n )\n let executionIndex = 0\n return cases.flatMap((testCase, caseIndex) =>\n Array.from({ length: repetitions }, (_, repetition) => {\n const blockIndex = caseIndex * repetitions + repetition\n const rotation = blockIndex % seededRunners.length\n const ordered = [...seededRunners.slice(rotation), ...seededRunners.slice(0, rotation)]\n return ordered.map((runner) => ({\n runner,\n testCase,\n repetition,\n executionIndex: executionIndex++,\n }))\n }).flat(),\n )\n}\n\nasync function resolveFindingEvidence<TInput>(\n testCase: AnalystBenchmarkCase<TInput>,\n findings: readonly AnalystFinding[],\n resolver: AnalystEvidenceResolver<TInput>,\n signal?: AbortSignal,\n): Promise<AnalystEvidenceResolution> {\n const evidence = findings.flatMap((finding) => finding.evidence_refs)\n const resolved: EvidenceRef[] = []\n const unresolvedEvidence: EvidenceRef[] = []\n const errors: AnalystEvidenceResolutionError[] = []\n for (const ref of evidence) {\n signal?.throwIfAborted()\n try {\n if (\n await resolver({\n caseId: testCase.id,\n caseInput: testCase.input,\n evidence: ref,\n signal,\n })\n ) {\n resolved.push(ref)\n } else {\n unresolvedEvidence.push(ref)\n }\n } catch (error) {\n if (signal?.aborted) throw error\n errors.push({\n evidence: ref,\n class: error instanceof Error ? error.constructor.name : 'Error',\n message: error instanceof Error ? error.message : String(error),\n })\n }\n }\n return {\n checked: evidence.length,\n resolved: resolved.length,\n unresolvedEvidence,\n errors,\n validity: evidence.length === 0 || errors.length > 0 ? null : resolved.length / evidence.length,\n }\n}\n\nfunction summarizeRunner(\n runnerId: string,\n observations: readonly AnalystBenchmarkObservation[],\n): AnalystBenchmarkSummary {\n const issueBearing = observations.filter(\n (observation) => observation.score.expectedIssueCount > 0,\n )\n const expectedIssues = issueBearing.reduce(\n (sum, observation) => sum + observation.score.expectedIssueCount,\n 0,\n )\n const matchedIssues = issueBearing.reduce(\n (sum, observation) => sum + observation.score.matchedIssueIds.length,\n 0,\n )\n const issueFindings = issueBearing.reduce(\n (sum, observation) => sum + observation.findings.length,\n 0,\n )\n const supportedFindings = issueBearing.reduce(\n (sum, observation) => sum + observation.score.supportedFindingIndexes.length,\n 0,\n )\n const issueRecall = expectedIssues === 0 ? null : matchedIssues / expectedIssues\n const findingPrecision =\n expectedIssues === 0 ? null : issueFindings === 0 ? 0 : supportedFindings / issueFindings\n const critical = observations\n .map((observation) => observation.score.criticalStepAccuracy)\n .filter((value): value is number => value !== null)\n const findingsWithEvidence = observations.reduce(\n (sum, observation) =>\n sum + observation.findings.filter((finding) => finding.evidence_refs.length > 0).length,\n 0,\n )\n const allFindings = observations.reduce(\n (sum, observation) => sum + observation.findings.length,\n 0,\n )\n const citationObservations = observations.filter(\n (observation) => observation.score.citationLabelAgreement !== null,\n )\n const citationCount = citationObservations.reduce(\n (sum, observation) =>\n sum +\n observation.findings.reduce((count, finding) => count + finding.evidence_refs.length, 0),\n 0,\n )\n const invalidCitationCount = citationObservations.reduce(\n (sum, observation) => sum + observation.score.unlabeledEvidence.length,\n 0,\n )\n const clean = observations.filter((observation) => observation.score.expectedIssueCount === 0)\n const completedClean = clean.filter((observation) => !observation.error)\n const resolvedCitations = observations.reduce(\n (sum, observation) => sum + (observation.evidenceResolution?.resolved ?? 0),\n 0,\n )\n const unresolvedCitations = observations.reduce(\n (sum, observation) => sum + (observation.evidenceResolution?.unresolvedEvidence.length ?? 0),\n 0,\n )\n const citationResolutionErrors = observations.reduce(\n (sum, observation) => sum + (observation.evidenceResolution?.errors.length ?? 0),\n 0,\n )\n const resolutionAttempts = observations.filter((observation) =>\n observation.findings.some((finding) => finding.evidence_refs.length > 0),\n )\n const citationResolutionUnknownRuns = resolutionAttempts.filter(\n (observation) =>\n !observation.evidenceResolution || observation.evidenceResolution.errors.length > 0,\n ).length\n const usages = observations.map((observation) => observation.usage)\n const knownCostUsd = usages.reduce((sum, usage) => {\n if (!usage) return sum\n return sum + (usage.cost.kind === 'uncaptured' ? (usage.knownCostUsd ?? 0) : usage.cost.usd)\n }, 0)\n return {\n runnerId,\n plannedRuns: observations.length,\n completedRuns: observations.filter((observation) => !observation.error).length,\n failedRuns: observations.filter((observation) => Boolean(observation.error)).length,\n issueRecall,\n findingPrecision,\n f1:\n findingPrecision === null || issueRecall === null\n ? null\n : harmonicMean(findingPrecision, issueRecall),\n criticalStepAccuracy: critical.length === 0 ? null : mean(critical),\n citationCoverage: allFindings === 0 ? null : findingsWithEvidence / allFindings,\n citationLabelAgreement:\n citationObservations.length === 0\n ? null\n : citationCount === 0\n ? 0\n : (citationCount - invalidCitationCount) / citationCount,\n citationResolution:\n resolutionAttempts.length === 0 ||\n citationResolutionUnknownRuns > 0 ||\n resolvedCitations + unresolvedCitations === 0\n ? null\n : resolvedCitations / (resolvedCitations + unresolvedCitations),\n citationResolutionUnknownRuns,\n unresolvedCitations,\n citationResolutionErrors,\n cleanCaseFalsePositiveRate:\n completedClean.length === 0\n ? null\n : completedClean.filter((observation) => observation.score.cleanFalsePositive).length /\n completedClean.length,\n cleanCaseFailureRate:\n clean.length === 0\n ? null\n : clean.filter((observation) => Boolean(observation.error)).length / clean.length,\n runAgreement: issueAgreement(observations.filter((observation) => !observation.error)),\n latencyMs: latencyDistribution(observations.map((observation) => observation.latencyMs)),\n calls: usages.reduce((sum, usage) => sum + (usage?.calls ?? 0), 0),\n callsUnknownRuns: usages.filter((usage) => !usage || usage.calls === null).length,\n inputTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.input ?? 0), 0),\n outputTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.output ?? 0), 0),\n reasoningTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.reasoning ?? 0), 0),\n cachedTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.cached ?? 0), 0),\n cacheWriteTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.cacheWrite ?? 0), 0),\n tokenUsageUnknownRuns: usages.filter((usage) => !usage?.tokens).length,\n reasoningTokenUsageUnknownRuns: usages.filter((usage) => usage?.tokens?.reasoning === undefined)\n .length,\n cachedTokenUsageUnknownRuns: usages.filter((usage) => usage?.tokens?.cached === undefined)\n .length,\n cacheWriteTokenUsageUnknownRuns: usages.filter(\n (usage) => usage?.tokens?.cacheWrite === undefined,\n ).length,\n knownCostUsd,\n costUnknownRuns: usages.filter((usage) => !usage || usage.cost.kind === 'uncaptured').length,\n }\n}\n\nfunction findingMatchesIssue(finding: AnalystFinding, issue: AnalystIssueExpectation): boolean {\n if (issue.findingIds && !issue.findingIds.includes(finding.finding_id)) return false\n if (issue.areas && !issue.areas.includes(finding.area)) return false\n if (issue.subjects && (!finding.subject || !issue.subjects.includes(finding.subject)))\n return false\n if (\n issue.evidence &&\n !matchesEvidence(finding.evidence_refs, issue.evidence, issue.evidenceMode ?? 'any')\n ) {\n return false\n }\n return true\n}\n\nfunction matchesEvidence(\n actual: readonly EvidenceRef[],\n expected: readonly AnalystEvidenceExpectation[],\n mode: 'any' | 'all',\n): boolean {\n if (expected.length === 0) return true\n const match = (target: AnalystEvidenceExpectation) =>\n actual.some((ref) => evidenceMatches(ref, target))\n return mode === 'all' ? expected.every(match) : expected.some(match)\n}\n\nfunction evidenceMatches(actual: EvidenceRef, expected: AnalystEvidenceExpectation): boolean {\n return (\n actual.uri === expected.uri && (expected.kind === undefined || actual.kind === expected.kind)\n )\n}\n\nfunction parseTraceSpanUri(uri: string): { traceId: string; spanId: string } | null {\n const match = /^trace:\\/\\/([^/]+)\\/span\\/([^/]+)$/.exec(uri)\n if (!match) return null\n try {\n const traceId = decodeURIComponent(match[1]!)\n const spanId = decodeURIComponent(match[2]!)\n return traceId && spanId ? { traceId, spanId } : null\n } catch {\n return null\n }\n}\n\nfunction validateCase(\n testCase: Pick<AnalystBenchmarkCase, 'id' | 'expectedIssues' | 'labeledEvidence'>,\n): void {\n if (!testCase.id.trim()) throw new TypeError('analyst benchmark case id must not be empty')\n const ids = new Set<string>()\n for (const issue of testCase.expectedIssues) {\n if (!issue.id.trim()) throw new TypeError(`${testCase.id}: expected issue id must not be empty`)\n if (ids.has(issue.id))\n throw new TypeError(`${testCase.id}: duplicate expected issue id '${issue.id}'`)\n ids.add(issue.id)\n if (\n !issue.findingIds?.length &&\n !issue.areas?.length &&\n !issue.subjects?.length &&\n !issue.evidence?.length\n ) {\n throw new TypeError(\n `${testCase.id}/${issue.id}: expected issue must identify a finding by id, area, subject, or evidence`,\n )\n }\n }\n for (const ref of testCase.labeledEvidence ?? []) {\n if (!ref.uri.trim()) {\n throw new TypeError(`${testCase.id}: labeled evidence URI must not be empty`)\n }\n }\n}\n\nfunction validateBenchmarkOptions<TInput>(options: RunAnalystBenchmarkOptions<TInput>): void {\n if (options.cases.length === 0) throw new TypeError('runAnalystBenchmark requires cases')\n if (options.runners.length === 0) throw new TypeError('runAnalystBenchmark requires runners')\n const repetitions = options.repetitions ?? 1\n const maxConcurrency = options.maxConcurrency ?? 1\n if (!Number.isSafeInteger(repetitions) || repetitions < 1) {\n throw new RangeError('runAnalystBenchmark repetitions must be a positive safe integer')\n }\n if (!Number.isSafeInteger(maxConcurrency) || maxConcurrency < 1) {\n throw new RangeError('runAnalystBenchmark maxConcurrency must be a positive safe integer')\n }\n if (!Number.isSafeInteger(options.runnerOrderSeed ?? 0)) {\n throw new RangeError('runAnalystBenchmark runnerOrderSeed must be a safe integer')\n }\n assertUniqueNonEmpty(\n options.cases.map((testCase) => testCase.id),\n 'case',\n )\n assertUniqueNonEmpty(\n options.runners.map((runner) => runner.id),\n 'runner',\n )\n for (const testCase of options.cases) validateCase(testCase)\n}\n\nfunction assertUniqueNonEmpty(values: readonly string[], label: string): void {\n const seen = new Set<string>()\n for (const value of values) {\n if (!value.trim()) throw new TypeError(`analyst benchmark ${label} id must not be empty`)\n if (seen.has(value)) throw new TypeError(`duplicate analyst benchmark ${label} id '${value}'`)\n seen.add(value)\n }\n}\n\nfunction harmonicMean(a: number, b: number): number {\n return a + b === 0 ? 0 : (2 * a * b) / (a + b)\n}\n\nfunction mean(values: readonly number[]): number {\n return values.length === 0 ? 0 : values.reduce((sum, value) => sum + value, 0) / values.length\n}\n\nfunction latencyDistribution(values: readonly number[]): AnalystLatencyDistribution {\n const sorted = [...values].sort((a, b) => a - b)\n return {\n min: sorted[0] ?? 0,\n mean: mean(sorted),\n p50: percentile(sorted, 0.5),\n p95: percentile(sorted, 0.95),\n max: sorted.at(-1) ?? 0,\n }\n}\n\nfunction percentile(sorted: readonly number[], quantile: number): number {\n if (sorted.length === 0) return 0\n return sorted[Math.ceil(quantile * sorted.length) - 1] ?? sorted.at(-1) ?? 0\n}\n\nfunction stableHash(value: string): number {\n let hash = 2166136261\n for (let index = 0; index < value.length; index += 1) {\n hash ^= value.charCodeAt(index)\n hash = Math.imul(hash, 16777619)\n }\n return hash >>> 0\n}\n\nfunction issueAgreement(observations: readonly AnalystBenchmarkObservation[]): number | null {\n const byCase = new Map<string, AnalystBenchmarkObservation[]>()\n for (const observation of observations) {\n const rows = byCase.get(observation.caseId) ?? []\n rows.push(observation)\n byCase.set(observation.caseId, rows)\n }\n const agreements: number[] = []\n for (const rows of byCase.values()) {\n for (let left = 0; left < rows.length; left++) {\n for (let right = left + 1; right < rows.length; right++) {\n agreements.push(\n jaccard(rows[left]!.score.matchedIssueIds, rows[right]!.score.matchedIssueIds),\n )\n }\n }\n }\n return agreements.length === 0 ? null : mean(agreements)\n}\n\nfunction jaccard(left: readonly string[], right: readonly string[]): number {\n const a = new Set(left)\n const b = new Set(right)\n const union = new Set([...a, ...b])\n if (union.size === 0) return 1\n let intersection = 0\n for (const value of a) if (b.has(value)) intersection += 1\n return intersection / union.size\n}\n\nfunction mergeRegistryUsage(result: AnalystRunResult): AnalystUsageReceipt {\n const usages = result.per_analyst.map((summary) => summary.usage)\n const calls = usages.every((usage) => usage.calls !== null)\n ? usages.reduce((sum, usage) => sum + (usage.calls ?? 0), 0)\n : null\n const tokens = usages.every((usage) => usage.tokens !== null)\n ? usages.reduce(\n (sum, usage) => ({\n input: sum.input + (usage.tokens?.input ?? 0),\n output: sum.output + (usage.tokens?.output ?? 0),\n reasoning: sum.reasoning + (usage.tokens?.reasoning ?? 0),\n cached: sum.cached + (usage.tokens?.cached ?? 0),\n cacheWrite: sum.cacheWrite + (usage.tokens?.cacheWrite ?? 0),\n }),\n { input: 0, output: 0, reasoning: 0, cached: 0, cacheWrite: 0 },\n )\n : null\n const knownCostUsd = usages.reduce(\n (sum, usage) =>\n sum + (usage.cost.kind === 'uncaptured' ? (usage.knownCostUsd ?? 0) : usage.cost.usd),\n 0,\n )\n const cost = usages.some((usage) => usage.cost.kind === 'uncaptured')\n ? ({ kind: 'uncaptured', usd: null } as const)\n : usages.some((usage) => usage.cost.kind === 'estimated')\n ? ({ kind: 'estimated', usd: knownCostUsd } as const)\n : ({ kind: 'observed', usd: knownCostUsd } as const)\n return {\n calls,\n tokens,\n cost,\n ...(cost.kind === 'uncaptured' ? { knownCostUsd } : {}),\n }\n}\n"],"mappings":";;;;;;;AAkFA,SAAgB,2BACd,UACiC;CACjC,OAAO,OAAO,EAAE,WAAW,eAAe;EACxC,IAAI,SAAS,SAAS,QAAQ,OAAO;EACrC,MAAM,WAAW,kBAAkB,SAAS,GAAG;EAC/C,IAAI,CAAC,UAAU,OAAO;EACtB,MAAM,SAAS,MAAM,SAAS,SAAS,CAAC,CAAC,UAAU;GACjD,UAAU,SAAS;GACnB,UAAU,CAAC,SAAS,MAAM;EAC5B,CAAC;EACD,OACE,OAAO,aAAa,SAAS,WAC7B,OAAO,iBAAiB,WAAW,KACnC,OAAO,MAAM,MAAM,SAAS,KAAK,YAAY,SAAS,MAAM;CAEhE;AACF;AAmHA,SAAgB,qBACd,UACA,UACqB;CACrB,aAAa,QAAQ;CACrB,MAAM,wBAAwB,sBAAsB,SAAS,gBAAgB,QAAQ;CACrF,MAAM,kBAAkB,SAAS,eAC9B,QAAQ,GAAG,UAAU,sBAAsB,IAAI,KAAK,CAAC,CAAC,CACtD,KAAK,UAAU,MAAM,EAAE;CAC1B,MAAM,iBAAiB,SAAS,eAC7B,QAAQ,GAAG,UAAU,CAAC,sBAAsB,IAAI,KAAK,CAAC,CAAC,CACvD,KAAK,UAAU,MAAM,EAAE;CAC1B,MAAM,0BAA0B,IAAI,IAAI,sBAAsB,OAAO,CAAC;CAEtE,MAAM,4BAA4B,SAC/B,KAAK,GAAG,UAAU,KAAK,CAAC,CACxB,QAAQ,UAAU,CAAC,wBAAwB,IAAI,KAAK,CAAC;CACxD,MAAM,qBAAqB,SAAS,eAAe;CACnD,MAAM,cAAc,uBAAuB,IAAI,IAAI,gBAAgB,SAAS;CAC5E,MAAM,mBACJ,SAAS,WAAW,IAChB,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