@tangle-network/agent-eval 0.27.2 → 0.29.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/{baseline-4R5deP0N.d.ts → baseline-BwdCXUS8.d.ts} +1 -1
  3. package/dist/builder-eval/index.d.ts +3 -3
  4. package/dist/chunk-UW4NOOZI.js +1561 -0
  5. package/dist/chunk-UW4NOOZI.js.map +1 -0
  6. package/dist/{control-BT4qnXiS.d.ts → control-rJhEDdpy.d.ts} +4 -4
  7. package/dist/{control-runtime-BZ_lVLYW.d.ts → control-runtime-BRdQ0wrx.d.ts} +2 -2
  8. package/dist/control.d.ts +5 -5
  9. package/dist/{emitter-DP_cSSiw.d.ts → emitter-BqjeOvJh.d.ts} +1 -1
  10. package/dist/{failure-cluster-Cw65_5FY.d.ts → failure-cluster-D1NZKqYu.d.ts} +1 -1
  11. package/dist/{feedback-trajectory-D1aGKusy.d.ts → feedback-trajectory-j0nJFgC6.d.ts} +1 -1
  12. package/dist/governance/index.d.ts +2 -2
  13. package/dist/{index-BhLlu-qO.d.ts → index-Cgt3DKXr.d.ts} +1 -1
  14. package/dist/index.d.ts +1190 -335
  15. package/dist/index.js +1580 -489
  16. package/dist/index.js.map +1 -1
  17. package/dist/{integrity-DK2EBVZC.d.ts → integrity-BAxLGJ9I.d.ts} +2 -2
  18. package/dist/knowledge/index.d.ts +3 -3
  19. package/dist/meta-eval/index.d.ts +1 -1
  20. package/dist/{multi-layer-verifier-U-c8ge1k.d.ts → multi-layer-verifier-BNi4-8lR.d.ts} +1 -1
  21. package/dist/openapi.json +1 -1
  22. package/dist/optimization.d.ts +8 -8
  23. package/dist/pipelines/index.d.ts +6 -6
  24. package/dist/prm/index.d.ts +4 -4
  25. package/dist/{query-DODUYdPg.d.ts → query-BFDT0kX_.d.ts} +1 -1
  26. package/dist/{release-report-CCQqnK46.d.ts → release-report-PWhGlpfO.d.ts} +1 -1
  27. package/dist/replay-BX5Fm8en.d.ts +529 -0
  28. package/dist/reporting.d.ts +4 -4
  29. package/dist/{researcher-G81CWc0q.d.ts → researcher-ClDX3KZx.d.ts} +5 -5
  30. package/dist/rl.d.ts +8 -8
  31. package/dist/{rubric-D5tjHNJQ.d.ts → rubric-DgSqjqqj.d.ts} +2 -2
  32. package/dist/{store-Db2Bv8Cf.d.ts → store-BP5be6s7.d.ts} +1 -1
  33. package/dist/{summary-report-Dl4akLKX.d.ts → summary-report-jrSGb2xZ.d.ts} +1 -1
  34. package/dist/{test-graded-scenario-B2kWEdh9.d.ts → test-graded-scenario-BJ54PDan.d.ts} +2 -2
  35. package/dist/traces.d.ts +9 -311
  36. package/dist/traces.js +15 -986
  37. package/dist/traces.js.map +1 -1
  38. package/dist/{trajectory-CnoBo-JY.d.ts → trajectory-BFmveYZt.d.ts} +1 -1
  39. package/dist/wire/index.d.ts +4 -4
  40. package/package.json +1 -1
  41. package/dist/chunk-4U4BKCXK.js +0 -569
  42. package/dist/chunk-4U4BKCXK.js.map +0 -1
  43. package/dist/replay-D7z0J43-.d.ts +0 -225
package/dist/index.d.ts CHANGED
@@ -1,168 +1,234 @@
1
- export { A as ActionExecutionPolicy, a as ActionPolicyDecision, C as ControlRunToRunRecordOptions, L as LlmJsonCall, b as LlmReviewerConfig, P as ProposeFn, c as ProposeInput, d as ProposeOutput, e as ProposeReviewConfig, f as ProposeReviewControlAction, g as ProposeReviewControlConfig, h as ProposeReviewControlResult, i as ProposeReviewControlState, j as ProposeReviewReport, k as ProposeReviewShot, R as Review, l as ReviewFn, m as ReviewInput, n as ReviewMemoryEntry, o as ReviewMemoryStore, p as RunEvidenceMetadata, V as Verification, q as VerifyFn, r as controlFailureClassFromVerification, s as controlRunToRunRecord, t as createLlmReviewer, u as evaluateActionPolicy, v as inMemoryReviewStore, w as jsonlReviewStore, x as runProposeReview, y as runProposeReviewAsControlLoop, z as scoreFromEvals } from './control-BT4qnXiS.js';
1
+ export { A as ActionExecutionPolicy, a as ActionPolicyDecision, C as ControlRunToRunRecordOptions, L as LlmJsonCall, b as LlmReviewerConfig, P as ProposeFn, c as ProposeInput, d as ProposeOutput, e as ProposeReviewConfig, f as ProposeReviewControlAction, g as ProposeReviewControlConfig, h as ProposeReviewControlResult, i as ProposeReviewControlState, j as ProposeReviewReport, k as ProposeReviewShot, R as Review, l as ReviewFn, m as ReviewInput, n as ReviewMemoryEntry, o as ReviewMemoryStore, p as RunEvidenceMetadata, V as Verification, q as VerifyFn, r as controlFailureClassFromVerification, s as controlRunToRunRecord, t as createLlmReviewer, u as evaluateActionPolicy, v as inMemoryReviewStore, w as jsonlReviewStore, x as runProposeReview, y as runProposeReviewAsControlLoop, z as scoreFromEvals } from './control-rJhEDdpy.js';
2
+ import { AxAIService, AxFunction } from '@ax-llm/ax';
3
+ import { S as Severity, M as MultiLayerVerifier, a as VerifyOptions, L as Layer, b as LayerResult, c as VerifyContext } from './multi-layer-verifier-BNi4-8lR.js';
4
+ export { F as Finding, d as LayerStatus, V as VerificationReport, g as gradeSemanticStatus } from './multi-layer-verifier-BNi4-8lR.js';
5
+ import { R as Run$1, S as Span, b as TraceEvent, A as Artifact$1, B as BudgetLedgerEntry, T as TraceStore, g as BudgetSpec, l as RunFilter, L as LlmSpan } from './store-BP5be6s7.js';
6
+ export { h as EventFilter, E as EventKind, i as FAILURE_CLASSES, F as FailureClass, j as FileSystemTraceStore, k as FileSystemTraceStoreOptions, G as GenericSpan, I as InMemoryTraceStore, J as JudgeSpan, M as Message, e as RetrievalSpan, m as RunLayer, n as RunStatus, f as SandboxSpan, o as SpanBase, p as SpanFilter, d as SpanKind, q as SpanStatus, r as TRACE_SCHEMA_VERSION, a as ToolSpan, s as isJudgeSpan, t as isLlmSpan, u as isRetrievalSpan, v as isSandboxSpan, w as isToolSpan } from './store-BP5be6s7.js';
7
+ import { L as LlmClientOptions, m as LlmCallRequest, n as LlmCallResult } from './researcher-ClDX3KZx.js';
8
+ export { C as CallbackResearcher, a as CallbackResearcherOptions, b as CampaignFactoryParams, c as CampaignIntegrityPolicy, d as CampaignRunContext, e as CampaignRunOutcome, f as CampaignRunner, g as CampaignScenario, h as CampaignVariant, E as EvalCampaignOptions, i as EvalCampaignResult, j as ExperimentPlan, k as ExperimentResult, F as FailedRun, l as FailureMode, o as LlmCallError, p as LlmClient, q as LlmMessage, s as LlmRouteAssertionError, t as LlmRouteRequirements, u as LlmUsage, N as NoopResearcher, R as Researcher, S as SteeringChange, v as assertLlmRoute, w as callLlm, x as callLlmJson, y as probeLlm, r as runEvalCampaign, z as stripFencedJson } from './researcher-ClDX3KZx.js';
9
+ import { T as TraceAnalysisStore, A as AnalyzeTracesOptions } from './replay-BX5Fm8en.js';
10
+ export { g as DEFAULT_REDACTION_RULES, O as OTEL_AGENT_EVAL_SCOPE, i as OtlpExport, j as OtlpResourceSpans, k as OtlpSpan, R as REDACTION_VERSION, l as RedactionReport, m as RedactionRule, n as ReplayCache, o as ReplayCacheEntry, p as ReplayCacheMissError, q as ReplayCacheStats, r as ReplayFetchOptions, C as createReplayFetch, E as exportRunAsOtlp, F as iterateRawCalls, G as redactString, H as redactValue } from './replay-BX5Fm8en.js';
2
11
  import { TCloud } from '@tangle-network/tcloud';
3
- import { C as ControlEvalResult } from './control-runtime-BZ_lVLYW.js';
4
- export { c as ControlActionFailureMode, d as ControlActionOutcome, e as ControlBudget, f as ControlContext, g as ControlDecision, a as ControlRunResult, h as ControlRuntimeConfig, i as ControlRuntimeError, j as ControlSeverity, b as ControlStep, k as ControlStopPolicies, S as StopDecision, l as allCriticalPassed, o as objectiveEval, r as runAgentControlLoop, s as stopOnNoProgress, m as stopOnRepeatedAction, n as subjectiveEval } from './control-runtime-BZ_lVLYW.js';
12
+ import { R as RunRecord, a as RunSplitTag } from './run-record-CqzahIbx.js';
13
+ export { c as RunJudgeMetadata, d as RunOutcome, e as RunRecordValidationError, b as RunTokenUsage, i as isRunRecord, p as parseRunRecordSafe, r as roundTripRunRecord, v as validateRunRecord } from './run-record-CqzahIbx.js';
14
+ import { z } from 'zod';
15
+ import { C as ControlEvalResult } from './control-runtime-BRdQ0wrx.js';
16
+ export { c as ControlActionFailureMode, d as ControlActionOutcome, e as ControlBudget, f as ControlContext, g as ControlDecision, a as ControlRunResult, h as ControlRuntimeConfig, i as ControlRuntimeError, j as ControlSeverity, b as ControlStep, k as ControlStopPolicies, S as StopDecision, l as allCriticalPassed, o as objectiveEval, r as runAgentControlLoop, s as stopOnNoProgress, m as stopOnRepeatedAction, n as subjectiveEval } from './control-runtime-BRdQ0wrx.js';
5
17
  import { A as AgentEvalError } from './errors-BZ9sTdz7.js';
6
18
  export { a as AgentEvalErrorCode, C as CaptureIntegrityError, b as ConfigError, J as JudgeError, N as NotFoundError, R as ReplayError, V as ValidationError, c as VerificationError } from './errors-BZ9sTdz7.js';
7
- import { b as FeedbackLabel, n as FeedbackTrajectoryStore, l as FeedbackTrajectory } from './feedback-trajectory-D1aGKusy.js';
8
- export { F as FeedbackArtifactType, a as FeedbackAttempt, c as FeedbackLabelKind, d as FeedbackLabelSource, e as FeedbackOptimizerRow, f as FeedbackOutcome, g as FeedbackReplayAdapter, h as FeedbackReplayResult, i as FeedbackSeverity, j as FeedbackSplitPolicy, k as FeedbackTask, m as FeedbackTrajectoryFilter, o as FileSystemFeedbackTrajectoryStore, I as InMemoryFeedbackTrajectoryStore, P as PreferenceMemoryEntry, p as ProposedSideEffect, q as assignFeedbackSplit, r as controlRunToFeedbackTrajectory, s as createFeedbackTrajectory, t as feedbackTrajectoriesToDatasetScenarios, u as feedbackTrajectoriesToOptimizerRows, v as feedbackTrajectoryToDatasetScenario, w as feedbackTrajectoryToOptimizerRow, x as parseFeedbackTrajectoriesJsonl, y as renderPreferenceMemoryMarkdown, z as replayFeedbackTrajectories, A as replayFeedbackTrajectory, B as serializeFeedbackTrajectoriesJsonl, C as summarizePreferenceMemory, D as withAssignedFeedbackSplit } from './feedback-trajectory-D1aGKusy.js';
9
- import { A as ActionableSideInfo, h as MultiShotRunner, j as MultiShotScorer, c as MultiShotMutateAdapter, a4 as HeldOutGateConfig, E as EvolvableVariant, m as MultiShotTrialResult, e as MultiShotOptimizationResult, a3 as GateDecision, a5 as Objective, a6 as ParetoResult, V as VariantAggregate, t as TrialResult, o as MutateAdapter, T as TrialCache } from './summary-report-Dl4akLKX.js';
10
- export { a as AsiSeverity, D as DEFAULT_MUTATION_PRIMITIVES, a7 as Direction, C as GainDistributionBin, F as GainDistributionFigureSpec, H as GainDistributionOptions, a8 as GateEvidence, G as GenerationReport, a9 as HeldOutGate, aa as HeldOutGateRejectionCode, I as InMemoryTrialCache, M as MultiShotGateConfig, b as MultiShotGateResult, d as MultiShotOptimizationConfig, f as MultiShotRun, g as MultiShotRunInput, i as MultiShotScore, k as MultiShotSplit, l as MultiShotTrace, n as MultiShotVariant, J as ParetoFigureSpec, K as ParetoPoint, P as PromptEvolutionConfig, p as PromptEvolutionEvent, q as PromptEvolutionResult, L as RESEARCH_REPORT_HARD_PAIR_FLOOR, R as ReflectionContext, r as ReflectionProposal, N as ResearchReport, O as ResearchReportCandidate, Q as ResearchReportDecision, U as ResearchReportMethodology, W as ResearchReportOptions, X as ResearchReportRecommendation, S as ScenarioAggregate, s as ScoreAdapter, Y as SummaryTable, Z as SummaryTableOptions, _ as SummaryTableRow, u as TrialTrace, v as buildReflectionPrompt, ab as crowdingDistance, w as defaultMultiShotObjectives, ac as dominates, $ as gainHistogram, a0 as paretoChart, ad as paretoFrontier, ae as paretoFrontierWithCrowding, x as parseReflectionResponse, a1 as researchReport, y as runMultiShotOptimization, z as runPromptEvolution, af as scalarScore, a2 as summaryTable, B as trialTraceFromMultiShotTrial } from './summary-report-Dl4akLKX.js';
19
+ import { b as FeedbackLabel, n as FeedbackTrajectoryStore, l as FeedbackTrajectory } from './feedback-trajectory-j0nJFgC6.js';
20
+ export { F as FeedbackArtifactType, a as FeedbackAttempt, c as FeedbackLabelKind, d as FeedbackLabelSource, e as FeedbackOptimizerRow, f as FeedbackOutcome, g as FeedbackReplayAdapter, h as FeedbackReplayResult, i as FeedbackSeverity, j as FeedbackSplitPolicy, k as FeedbackTask, m as FeedbackTrajectoryFilter, o as FileSystemFeedbackTrajectoryStore, I as InMemoryFeedbackTrajectoryStore, P as PreferenceMemoryEntry, p as ProposedSideEffect, q as assignFeedbackSplit, r as controlRunToFeedbackTrajectory, s as createFeedbackTrajectory, t as feedbackTrajectoriesToDatasetScenarios, u as feedbackTrajectoriesToOptimizerRows, v as feedbackTrajectoryToDatasetScenario, w as feedbackTrajectoryToOptimizerRow, x as parseFeedbackTrajectoriesJsonl, y as renderPreferenceMemoryMarkdown, z as replayFeedbackTrajectories, A as replayFeedbackTrajectory, B as serializeFeedbackTrajectoriesJsonl, C as summarizePreferenceMemory, D as withAssignedFeedbackSplit } from './feedback-trajectory-j0nJFgC6.js';
21
+ import { A as ActionableSideInfo, h as MultiShotRunner, j as MultiShotScorer, c as MultiShotMutateAdapter, a4 as HeldOutGateConfig, E as EvolvableVariant, m as MultiShotTrialResult, e as MultiShotOptimizationResult, a3 as GateDecision, a5 as Objective, a6 as ParetoResult, V as VariantAggregate, t as TrialResult, o as MutateAdapter, T as TrialCache } from './summary-report-jrSGb2xZ.js';
22
+ export { a as AsiSeverity, D as DEFAULT_MUTATION_PRIMITIVES, a7 as Direction, C as GainDistributionBin, F as GainDistributionFigureSpec, H as GainDistributionOptions, a8 as GateEvidence, G as GenerationReport, a9 as HeldOutGate, aa as HeldOutGateRejectionCode, I as InMemoryTrialCache, M as MultiShotGateConfig, b as MultiShotGateResult, d as MultiShotOptimizationConfig, f as MultiShotRun, g as MultiShotRunInput, i as MultiShotScore, k as MultiShotSplit, l as MultiShotTrace, n as MultiShotVariant, J as ParetoFigureSpec, K as ParetoPoint, P as PromptEvolutionConfig, p as PromptEvolutionEvent, q as PromptEvolutionResult, L as RESEARCH_REPORT_HARD_PAIR_FLOOR, R as ReflectionContext, r as ReflectionProposal, N as ResearchReport, O as ResearchReportCandidate, Q as ResearchReportDecision, U as ResearchReportMethodology, W as ResearchReportOptions, X as ResearchReportRecommendation, S as ScenarioAggregate, s as ScoreAdapter, Y as SummaryTable, Z as SummaryTableOptions, _ as SummaryTableRow, u as TrialTrace, v as buildReflectionPrompt, ab as crowdingDistance, w as defaultMultiShotObjectives, ac as dominates, $ as gainHistogram, a0 as paretoChart, ad as paretoFrontier, ae as paretoFrontierWithCrowding, x as parseReflectionResponse, a1 as researchReport, y as runMultiShotOptimization, z as runPromptEvolution, af as scalarScore, a2 as summaryTable, B as trialTraceFromMultiShotTrial } from './summary-report-jrSGb2xZ.js';
11
23
  export { DataAcquisitionPlan, KnowledgeAcquisitionMode, KnowledgeBundle, KnowledgeFallbackPolicy, KnowledgeFreshness, KnowledgeImportance, KnowledgeReadinessReport, KnowledgeRecommendedAction, KnowledgeRequirement, KnowledgeRequirementCategory, KnowledgeResponsibleSurface, KnowledgeSensitivity, ScoreKnowledgeReadinessOptions, UserQuestion, acquisitionPlansForKnowledgeGaps, blockingKnowledgeEval, knowledgeReadinessTracePayload, scoreKnowledgeReadiness, userQuestionsForKnowledgeGaps } from './knowledge/index.js';
12
- import { i as ReleaseConfidenceThresholds, g as ReleaseConfidenceScorecard } from './release-report-CCQqnK46.js';
13
- export { B as BootstrapOptions, a as BootstrapResult, J as JudgeReplayGateArgs, P as PairedBootstrapOptions, b as PairedBootstrapResult, R as ReleaseConfidenceAxis, c as ReleaseConfidenceAxisName, d as ReleaseConfidenceInput, e as ReleaseConfidenceIssue, f as ReleaseConfidenceMetrics, h as ReleaseConfidenceStatus, j as ReleaseTraceEvidence, k as RenderReleaseReportOptions, V as Verdict, l as assertReleaseConfidence, m as bhAdjust, n as bootstrapCi, o as evaluateReleaseConfidence, p as judgeReplayGate, q as pairedBootstrap, r as pairedWilcoxon, s as releaseTraceEvidenceFromMultiShotTrials, t as renderReleaseReport } from './release-report-CCQqnK46.js';
14
- import { a as FailureCluster } from './failure-cluster-Cw65_5FY.js';
15
- export { D as DEFAULT_FAILURE_RULES, b as FailureClassification, c as FailureContext, d as FailureRule, e as classifyFailure } from './failure-cluster-Cw65_5FY.js';
16
- import { a as RunSplitTag, R as RunRecord } from './run-record-CqzahIbx.js';
17
- export { c as RunJudgeMetadata, d as RunOutcome, e as RunRecordValidationError, b as RunTokenUsage, i as isRunRecord, p as parseRunRecordSafe, r as roundTripRunRecord, v as validateRunRecord } from './run-record-CqzahIbx.js';
18
- import { T as TraceStore, R as Run$1, S as Span, b as TraceEvent, A as Artifact$1, B as BudgetLedgerEntry, g as BudgetSpec, h as RunFilter, L as LlmSpan } from './store-Db2Bv8Cf.js';
19
- export { i as EventFilter, E as EventKind, j as FAILURE_CLASSES, F as FailureClass, k as FileSystemTraceStore, l as FileSystemTraceStoreOptions, G as GenericSpan, I as InMemoryTraceStore, J as JudgeSpan, M as Message, e as RetrievalSpan, m as RunLayer, n as RunStatus, f as SandboxSpan, o as SpanBase, p as SpanFilter, d as SpanKind, q as SpanStatus, r as TRACE_SCHEMA_VERSION, a as ToolSpan, s as isJudgeSpan, t as isLlmSpan, u as isRetrievalSpan, v as isSandboxSpan, w as isToolSpan } from './store-Db2Bv8Cf.js';
20
- import { C as ContinuousAgreementOptions, a as ContinuousAgreement } from './index-BhLlu-qO.js';
21
- export { b as CalibrationResult, c as CandidateScore, d as ContinuousCalibrationResult, D as DEFAULT_RED_TEAM_CORPUS, E as EuRiskClass, G as GoldenItem, e as GovernanceContext, f as GovernanceFinding, g as GovernanceReport, P as PositionalBiasResult, R as RedTeamCase, h as RedTeamCategory, i as RedTeamFinding, j as RedTeamPayload, k as RedTeamReport, S as SelfPreferenceResult, U as UseCaseSignals, V as VerbosityBiasResult, l as calibrateJudge, m as calibrateJudgeContinuous, n as classifyEuAiRisk, o as continuousAgreement, p as euAiActReport, q as nistAiRmfReport, r as positionalBias, s as redTeamDataset, t as redTeamReport, u as renderMarkdown, v as scoreRedTeamOutput, w as selfPreference, x as soc2Report, y as summarize, z as toolNamesForRun, A as verbosityBias } from './index-BhLlu-qO.js';
22
- import { S as SandboxDriver, H as HarnessConfig, a as SandboxHarnessResult } from './test-graded-scenario-B2kWEdh9.js';
23
- export { D as DockerSandboxDriver, c as SandboxHarness, d as SandboxResult, e as SubprocessSandboxDriver, f as SubprocessSandboxDriverOptions, g as TestGradedRunOptions, b as TestGradedRunResult, T as TestGradedScenario, h as TestOutputParser, i as composeParsers, j as jestTestParser, p as pytestTestParser, r as runTestGradedScenario, v as vitestTestParser } from './test-graded-scenario-B2kWEdh9.js';
24
- import { T as TraceEmitter } from './emitter-DP_cSSiw.js';
25
- export { R as RunCompleteHook, a as RunCompleteHookContext, S as SpanHandle, b as TraceEmitterOptions, l as llmSpanFromProvider } from './emitter-DP_cSSiw.js';
26
- export { F as FileSystemRawProviderSink, d as FileSystemRawProviderSinkOptions, I as InMemoryRawProviderSink, e as InMemoryRawProviderSinkOptions, N as NoopRawProviderSink, P as ProviderRedactor, f as RawProviderDirection, c as RawProviderEvent, R as RawProviderSink, g as RawProviderSinkFilter, h as RunIntegrityError, a as RunIntegrityExpectations, i as RunIntegrityIssue, j as RunIntegrityIssueCode, b as RunIntegrityReport, k as assertRunCaptured, l as defaultProviderRedactor, p as providerFromBaseUrl, t as throwIfRunIncomplete } from './integrity-DK2EBVZC.js';
27
- export { D as DEFAULT_REDACTION_RULES, O as OTEL_AGENT_EVAL_SCOPE, a as OtlpExport, b as OtlpResourceSpans, c as OtlpSpan, R as REDACTION_VERSION, d as RedactionReport, e as RedactionRule, f as ReplayCache, g as ReplayCacheEntry, h as ReplayCacheMissError, i as ReplayCacheStats, j as ReplayFetchOptions, k as createReplayFetch, l as exportRunAsOtlp, m as iterateRawCalls, r as redactString, n as redactValue } from './replay-D7z0J43-.js';
28
- export { a as aggregateLlm, b as argHash, g as groupBy, j as judgeSpans, l as llmSpans, r as runFailureClass, c as runsForScenario, t as toolSpans } from './query-DODUYdPg.js';
29
- import { a as BaselineReport } from './baseline-4R5deP0N.js';
30
- export { B as BaselineOptions, M as MetricSamples, b as MetricVerdict, T as ToolStats, d as ToolUseMetrics, e as ToolUseOptions, f as compareToBaseline, c as computeToolUseMetrics, i as iqr, w as welchsTTest } from './baseline-4R5deP0N.js';
31
- import { T as Trajectory, a as TrajectoryStep } from './trajectory-CnoBo-JY.js';
32
- export { b as buildTrajectory } from './trajectory-CnoBo-JY.js';
24
+ import { i as ReleaseConfidenceThresholds, g as ReleaseConfidenceScorecard } from './release-report-PWhGlpfO.js';
25
+ export { B as BootstrapOptions, a as BootstrapResult, J as JudgeReplayGateArgs, P as PairedBootstrapOptions, b as PairedBootstrapResult, R as ReleaseConfidenceAxis, c as ReleaseConfidenceAxisName, d as ReleaseConfidenceInput, e as ReleaseConfidenceIssue, f as ReleaseConfidenceMetrics, h as ReleaseConfidenceStatus, j as ReleaseTraceEvidence, k as RenderReleaseReportOptions, V as Verdict, l as assertReleaseConfidence, m as bhAdjust, n as bootstrapCi, o as evaluateReleaseConfidence, p as judgeReplayGate, q as pairedBootstrap, r as pairedWilcoxon, s as releaseTraceEvidenceFromMultiShotTrials, t as renderReleaseReport } from './release-report-PWhGlpfO.js';
26
+ import { a as FailureCluster } from './failure-cluster-D1NZKqYu.js';
27
+ export { D as DEFAULT_FAILURE_RULES, b as FailureClassification, c as FailureContext, d as FailureRule, e as classifyFailure } from './failure-cluster-D1NZKqYu.js';
28
+ import { C as ContinuousAgreementOptions, a as ContinuousAgreement } from './index-Cgt3DKXr.js';
29
+ export { b as CalibrationResult, c as CandidateScore, d as ContinuousCalibrationResult, D as DEFAULT_RED_TEAM_CORPUS, E as EuRiskClass, G as GoldenItem, e as GovernanceContext, f as GovernanceFinding, g as GovernanceReport, P as PositionalBiasResult, R as RedTeamCase, h as RedTeamCategory, i as RedTeamFinding, j as RedTeamPayload, k as RedTeamReport, S as SelfPreferenceResult, U as UseCaseSignals, V as VerbosityBiasResult, l as calibrateJudge, m as calibrateJudgeContinuous, n as classifyEuAiRisk, o as continuousAgreement, p as euAiActReport, q as nistAiRmfReport, r as positionalBias, s as redTeamDataset, t as redTeamReport, u as renderMarkdown, v as scoreRedTeamOutput, w as selfPreference, x as soc2Report, y as summarize, z as toolNamesForRun, A as verbosityBias } from './index-Cgt3DKXr.js';
30
+ import { S as SandboxDriver, H as HarnessConfig, a as SandboxHarnessResult } from './test-graded-scenario-BJ54PDan.js';
31
+ export { D as DockerSandboxDriver, c as SandboxHarness, d as SandboxResult, e as SubprocessSandboxDriver, f as SubprocessSandboxDriverOptions, g as TestGradedRunOptions, b as TestGradedRunResult, T as TestGradedScenario, h as TestOutputParser, i as composeParsers, j as jestTestParser, p as pytestTestParser, r as runTestGradedScenario, v as vitestTestParser } from './test-graded-scenario-BJ54PDan.js';
32
+ import { T as TraceEmitter } from './emitter-BqjeOvJh.js';
33
+ export { R as RunCompleteHook, a as RunCompleteHookContext, S as SpanHandle, b as TraceEmitterOptions, l as llmSpanFromProvider } from './emitter-BqjeOvJh.js';
34
+ export { F as FileSystemRawProviderSink, c as FileSystemRawProviderSinkOptions, I as InMemoryRawProviderSink, d as InMemoryRawProviderSinkOptions, N as NoopRawProviderSink, P as ProviderRedactor, e as RawProviderDirection, f as RawProviderEvent, R as RawProviderSink, g as RawProviderSinkFilter, h as RunIntegrityError, a as RunIntegrityExpectations, i as RunIntegrityIssue, j as RunIntegrityIssueCode, b as RunIntegrityReport, k as assertRunCaptured, l as defaultProviderRedactor, p as providerFromBaseUrl, t as throwIfRunIncomplete } from './integrity-BAxLGJ9I.js';
35
+ export { a as aggregateLlm, b as argHash, g as groupBy, j as judgeSpans, l as llmSpans, r as runFailureClass, c as runsForScenario, t as toolSpans } from './query-BFDT0kX_.js';
36
+ import { a as BaselineReport } from './baseline-BwdCXUS8.js';
37
+ export { B as BaselineOptions, M as MetricSamples, b as MetricVerdict, T as ToolStats, d as ToolUseMetrics, e as ToolUseOptions, f as compareToBaseline, c as computeToolUseMetrics, i as iqr, w as welchsTTest } from './baseline-BwdCXUS8.js';
38
+ import { T as Trajectory, a as TrajectoryStep } from './trajectory-BFmveYZt.js';
39
+ export { b as buildTrajectory } from './trajectory-BFmveYZt.js';
33
40
  import { a as DatasetScenario, c as Dataset } from './dataset-CiK_3LDr.js';
34
41
  export { d as DatasetDifficulty, b as DatasetManifest, e as DatasetProvenance, D as DatasetSplit, H as HoldoutLockedError, S as SliceOptions, h as hashScenarios } from './dataset-CiK_3LDr.js';
35
- import { a as PrmGrader } from './rubric-D5tjHNJQ.js';
36
- import { L as Layer, S as Severity, a as LayerResult, b as VerifyContext } from './multi-layer-verifier-U-c8ge1k.js';
37
- export { F as Finding, c as LayerStatus, M as MultiLayerVerifier, V as VerificationReport, d as VerifyOptions, g as gradeSemanticStatus } from './multi-layer-verifier-U-c8ge1k.js';
38
- import { L as LlmClientOptions } from './researcher-G81CWc0q.js';
39
- export { C as CallbackResearcher, a as CallbackResearcherOptions, b as CampaignFactoryParams, c as CampaignIntegrityPolicy, d as CampaignRunContext, e as CampaignRunOutcome, f as CampaignRunner, g as CampaignScenario, h as CampaignVariant, E as EvalCampaignOptions, i as EvalCampaignResult, j as ExperimentPlan, k as ExperimentResult, F as FailedRun, l as FailureMode, m as LlmCallError, n as LlmCallRequest, o as LlmCallResult, p as LlmClient, q as LlmMessage, s as LlmRouteAssertionError, t as LlmRouteRequirements, u as LlmUsage, N as NoopResearcher, R as Researcher, S as SteeringChange, v as assertLlmRoute, w as callLlm, x as callLlmJson, y as probeLlm, r as runEvalCampaign, z as stripFencedJson } from './researcher-G81CWc0q.js';
42
+ import { a as PrmGrader } from './rubric-DgSqjqqj.js';
40
43
  export { B as BENCHMARK_SPLIT_SEED, a as BenchmarkAdapter, b as BenchmarkDatasetItem, c as BenchmarkEvaluation, d as benchmarkDeterministicSplit, i as benchmarks } from './index--fVrWDiR.js';
41
44
  export { I as InterimReleaseConfidence, a as InterimReleaseConfidenceInput, P as PairedEvalueOptions, b as PairedEvalueSequence, c as PairedEvalueStep, S as SequentialDecision, e as evaluateInterimReleaseConfidence, p as pairedEvalueSequence } from './sequential-5iSVfzl2.js';
42
45
  import './outcome-store-D6KWmYvj.js';
43
46
 
47
+ interface RunScore {
48
+ success: number;
49
+ goalProgress: number;
50
+ repoGroundedness: number;
51
+ driftPenalty: number;
52
+ toolUseQuality: number;
53
+ patchQuality: number;
54
+ testReality: number;
55
+ finalGate: number;
56
+ reviewerBlockers: number;
57
+ costUsd: number;
58
+ wallSeconds: number;
59
+ notes?: string[];
60
+ }
61
+ interface RunScoreWeights {
62
+ success: number;
63
+ goalProgress: number;
64
+ repoGroundedness: number;
65
+ driftPenalty: number;
66
+ toolUseQuality: number;
67
+ patchQuality: number;
68
+ testReality: number;
69
+ finalGate: number;
70
+ reviewerBlockers: number;
71
+ costUsd: number;
72
+ wallSeconds: number;
73
+ }
74
+ declare const DEFAULT_RUN_SCORE_WEIGHTS: RunScoreWeights;
75
+ declare function aggregateRunScore(score: RunScore, weights?: Partial<RunScoreWeights>): number;
76
+ declare function clamp01(value: number): number;
77
+
78
+ interface RunTrace {
79
+ run: Run$1;
80
+ spans: Span[];
81
+ events: TraceEvent[];
82
+ artifacts: Artifact$1[];
83
+ budget: BudgetLedgerEntry[];
84
+ }
85
+ interface RunCriticOptions {
86
+ weights?: Partial<RunScoreWeights>;
87
+ driftPatterns?: RegExp[];
88
+ }
89
+ declare class RunCritic {
90
+ private readonly weights?;
91
+ private readonly driftPatterns;
92
+ constructor(options?: RunCriticOptions);
93
+ score(store: TraceStore, runId: string): Promise<RunScore>;
94
+ scoreTrace(trace: RunTrace): RunScore;
95
+ rank(score: RunScore): number;
96
+ private isDrift;
97
+ }
98
+
44
99
  /**
45
- * Automated pull request opener for the production loop.
100
+ * Semantic concept judge "does the built artifact actually implement
101
+ * the features the user asked for?"
46
102
  *
47
- * `runProductionLoop` produces a `promotedPrompt` string and a release
48
- * scorecard. To close the eval prod → eval cycle the framework needs
49
- * to land that prompt as a reviewable code change. This module does
50
- * exactly that:
103
+ * Distinct from the domain/code/coherence judges in `judges.ts`:
104
+ * - those judges score free-form conversational agent outputs along
105
+ * quality dimensions (accuracy, depth, etc.)
106
+ * - this judge scores a *built artifact* (served HTML + source files)
107
+ * against an explicit list of expected concepts, returning per-concept
108
+ * {present, score 0-10, evidence, severity}.
51
109
  *
52
- * 1. Stage a branch off `baseBranch`.
53
- * 2. Write each `fileChange` into the worktree.
54
- * 3. Commit + push.
55
- * 4. Open a PR via the GitHub API.
110
+ * The judge is strict about distinguishing (a) a working implementation
111
+ * from (b) a keyword-present stub. "// TODO: mint button" is NOT present.
112
+ * Only real, functional, wired-up code counts.
56
113
  *
57
- * Two transports ship in core:
114
+ * Use via {@link createSemanticConceptJudge} or directly via
115
+ * {@link runSemanticConceptJudge}. Soft-fails (available=false) on LLM
116
+ * or JSON-parse errors so the caller can treat that as "layer skipped"
117
+ * rather than "layer failed" in a multi-layer pipeline.
118
+ */
119
+
120
+ /**
121
+ * Implementation complexity class for weighted scoring.
58
122
  *
59
- * - `ghCliClient(opts)` shells out to the `gh` CLI. No extra deps,
60
- * re-uses the developer machine's `gh auth` state, works with both
61
- * github.com and GitHub Enterprise. This is the recommended default.
62
- * - `httpGithubClient(opts)` direct `fetch` against `api.github.com`
63
- * with a bearer token. Useful in CI where `gh` may not be installed.
123
+ * - `render` (default): the concept is a UI surface that displays static
124
+ * data render a list, show a counter, lay out a button. Single-file
125
+ * work, no external integration.
126
+ * - `integrate`: the concept requires wiring a real external system —
127
+ * wallet connect (wagmi + RainbowKit + chain config), payment provider
128
+ * (Stripe Elements + intent + webhook), an API client with auth.
129
+ * Multi-file, library-knowledge, runtime correctness matters.
130
+ * - `compute`: the concept requires algorithmic work — solver, simulator,
131
+ * constraint propagation, ML inference. Correctness > UI polish.
64
132
  *
65
- * Both implement the small `AutoPrClient` interface, so tests substitute
66
- * a fake without spinning a process or network.
133
+ * Default weights (when applied via `weightConcepts: 'complexity'`):
134
+ * render=1.0, integrate=2.0, compute=2.5
67
135
  *
68
- * @experimental surface may evolve as consumers wire it into CI workflows.
136
+ * Cross-vertical scoring without complexity weighting silently inflates
137
+ * the rate of UI-heavy verticals (healthcare, fintech dashboards) vs
138
+ * integration-heavy verticals (DeFi, wallets) — all concepts treated
139
+ * equally even though the agent does 2-3x the work for `integrate`.
69
140
  */
70
- interface FileChange {
71
- /** Repo-relative path. Forward slashes; no `..`. */
72
- path: string;
73
- /** New file contents. UTF-8. */
74
- contents: string;
75
- /** Optional explanatory comment shown in the commit body. */
76
- rationale?: string;
77
- }
78
- interface RepoRef {
79
- owner: string;
141
+ type ConceptComplexity = 'render' | 'integrate' | 'compute';
142
+ interface ConceptSpec {
80
143
  name: string;
144
+ /** Short hints that help the judge; not used for matching. */
145
+ keywords?: string[];
146
+ /** Optional explicit weight; default 1.0. Overrides complexity-derived weight. */
147
+ weight?: number;
148
+ /** Implementation complexity class. Default `render`. */
149
+ complexity?: ConceptComplexity;
81
150
  }
82
- interface ProposeAutomatedPullRequestInput {
83
- repo: RepoRef;
84
- /** Branch to base the PR on. Default `'main'`. */
85
- baseBranch?: string;
86
- /** New branch name. Use a prefix + a short stable id; no spaces. */
87
- branchName: string;
88
- fileChanges: FileChange[];
89
- title: string;
90
- body: string;
91
- /** Optional GitHub usernames to request review from. */
92
- reviewers?: string[];
93
- /** Optional labels to apply. */
94
- labels?: string[];
95
- /** Commit author name. Default: derived from the GitHub client. */
96
- authorName?: string;
97
- /** Commit author email. Default: derived from the GitHub client. */
98
- authorEmail?: string;
99
- /** Dry-run — do not push or open a PR; just return the would-be plan. */
100
- dryRun?: boolean;
101
- }
102
- interface ProposeAutomatedPullRequestResult {
103
- prUrl: string;
104
- branchName: string;
105
- headSha: string;
106
- dryRun: boolean;
151
+ interface ConceptFinding {
152
+ concept: string;
153
+ present: boolean;
154
+ /** 0..10. 10 = production-ready; 7 = functional thin; 4 = partial; 0 = absent. */
155
+ score: number;
156
+ evidence: string;
157
+ severity: Severity;
107
158
  }
108
- /** Pluggable transport for the auto-PR pipeline. */
109
- interface AutoPrClient {
110
- /**
111
- * Create a branch from `baseBranch`, write file changes, commit, push,
112
- * and open a PR. Returns the PR's HTML url and head SHA.
113
- *
114
- * Implementations must be idempotent on `branchName`: if the branch
115
- * already exists with the same head SHA as the would-be commit, return
116
- * the existing PR rather than failing. This makes the production loop
117
- * safe to retry on transient errors.
118
- */
119
- proposeChange(input: ProposeAutomatedPullRequestInput): Promise<ProposeAutomatedPullRequestResult>;
159
+ interface SemanticConceptJudgeInput {
160
+ /** Full natural-language prompt the agent was handed. */
161
+ userRequest: string;
162
+ /** Rendered HTML the preview returns (UI artifacts). Optional. */
163
+ servedHtml?: string;
164
+ /** Top-level source files from the agent's workdir. */
165
+ sourceFiles: Array<{
166
+ path: string;
167
+ content: string;
168
+ }>;
169
+ /** The expected concept list. */
170
+ expectedConcepts: ConceptSpec[];
171
+ /** Free-form metadata (id, difficulty) to inject into the prompt. */
172
+ artifactLabel?: string;
173
+ artifactDescription?: string;
120
174
  }
121
- declare function proposeAutomatedPullRequest(client: AutoPrClient, input: ProposeAutomatedPullRequestInput): Promise<ProposeAutomatedPullRequestResult>;
122
- interface HttpGithubClientOptions {
123
- /** Personal access token, GitHub App token, or `GITHUB_TOKEN` from Actions. */
124
- token: string;
125
- /** Override for GitHub Enterprise. Default `'https://api.github.com'`. */
126
- apiBase?: string;
127
- /** Test seam — defaults to global `fetch`. */
128
- fetchImpl?: typeof fetch;
129
- /** Test seam — clock for commit timestamps. */
130
- now?: () => Date;
175
+ interface SemanticConceptJudgeResult {
176
+ kind: 'semantic-concept';
177
+ version: string;
178
+ /** Normalized 0..1 score — mean of per-concept scores / 10. */
179
+ score: number;
180
+ presentCount: number;
181
+ totalCount: number;
182
+ findings: ConceptFinding[];
183
+ summary: string;
184
+ durationMs: number;
185
+ costUsd: number | null;
186
+ /** False on LLM/JSON error — treat as "skipped / unable to judge" in pipelines. */
187
+ available: boolean;
188
+ error?: string;
131
189
  }
132
190
  /**
133
- * Direct REST-API GitHub client. No external deps.
134
- *
135
- * Idempotency strategy: before creating refs/commits/PRs, check whether
136
- * the branch already exists at the desired tree. If so, return the
137
- * existing PR (or open one if missing). Errors from concurrent runs
138
- * (`Reference already exists`) are caught and treated as success.
191
+ * Score-aggregation strategy. `mean` averages 0-10 scores uniformly.
192
+ * `complexity` applies the default weight table (render=1, integrate=2,
193
+ * compute=2.5) unless a concept has an explicit `weight`. `explicit`
194
+ * honors only `weight` (defaulting to 1 for unspecified).
139
195
  */
140
- declare function httpGithubClient(opts: HttpGithubClientOptions): AutoPrClient;
141
- interface GhCliClientOptions {
142
- /** Override the CLI binary (`gh`). For testing. */
143
- bin?: string;
144
- /** Working directory containing a clone of `repo`. Default: process cwd. */
145
- cwd?: string;
146
- /** Test seam: process spawner. Default: node:child_process spawn. */
147
- exec?: (bin: string, args: string[], opts: {
148
- cwd: string;
149
- stdin?: string;
150
- }) => Promise<{
151
- stdout: string;
152
- stderr: string;
153
- exitCode: number;
154
- }>;
196
+ type ConceptWeightStrategy = 'mean' | 'complexity' | 'explicit';
197
+ declare const DEFAULT_COMPLEXITY_WEIGHTS: Record<ConceptComplexity, number>;
198
+ interface SemanticConceptJudgeOptions {
199
+ /** Model id to call. Default 'claude-sonnet-4-6' via agent-eval defaults. */
200
+ model?: string;
201
+ /** Per-call timeout. Default 180s. */
202
+ timeoutMs?: number;
203
+ /** Pipeline budget for the prompt (source blob truncation). Default 45000. */
204
+ maxSourceChars?: number;
205
+ /** Per-file cap before inclusion. Default 20000. */
206
+ maxPerFileChars?: number;
207
+ /** HTML cap. Default 30000. */
208
+ maxHtmlChars?: number;
209
+ /** LlmClient config (baseUrl, apiKey, authHeader, …). */
210
+ llm?: LlmClientOptions;
211
+ /**
212
+ * Score aggregation strategy. Default `mean` — uniform average across
213
+ * concepts. Cross-vertical comparisons should use `complexity` to
214
+ * neutralize the integrate-vs-render asymmetry.
215
+ */
216
+ weightConcepts?: ConceptWeightStrategy;
217
+ /** Override the default complexity → weight table. */
218
+ complexityWeights?: Partial<Record<ConceptComplexity, number>>;
155
219
  }
220
+ declare const SEMANTIC_CONCEPT_JUDGE_VERSION = "semantic-concept-judge-v1-2026-04-24";
156
221
  /**
157
- * `gh` CLI transport. Requires:
158
- * - `gh` installed and authenticated (`gh auth status`).
159
- * - A local clone of the repo with a clean working tree.
160
- * - `git` on PATH.
161
- *
162
- * Uses `gh api` for repo metadata and `gh pr create` for the PR. The
163
- * actual commit lands via `git`, which keeps `gh`'s footprint minimal.
222
+ * Run the semantic concept judge. Soft-fails to available=false on
223
+ * LLM/JSON errors callers in a MultiLayerVerifier pipeline can treat
224
+ * that as "skip" rather than "fail."
164
225
  */
165
- declare function ghCliClient(opts?: GhCliClientOptions): AutoPrClient;
226
+ declare function runSemanticConceptJudge(input: SemanticConceptJudgeInput, options?: SemanticConceptJudgeOptions): Promise<SemanticConceptJudgeResult>;
227
+ /**
228
+ * Factory: pin LLM options once, return a closure that accepts inputs.
229
+ * Convenient for pipelines that want to share a single LlmClient config.
230
+ */
231
+ declare function createSemanticConceptJudge(options?: SemanticConceptJudgeOptions): (input: SemanticConceptJudgeInput) => Promise<SemanticConceptJudgeResult>;
166
232
 
167
233
  interface Scenario {
168
234
  id: string;
@@ -404,19 +470,994 @@ interface TestResult {
404
470
  detail?: string;
405
471
  checks: CheckResult[];
406
472
  }
407
- interface CheckResult {
408
- name: string;
409
- passed: boolean;
410
- expected: string;
411
- actual: string;
473
+ interface CheckResult {
474
+ name: string;
475
+ passed: boolean;
476
+ expected: string;
477
+ actual: string;
478
+ }
479
+ interface EvalResult {
480
+ scenario: string;
481
+ status: 'pass' | 'fail' | 'skip';
482
+ duration: number;
483
+ detail?: string;
484
+ artifact?: string;
485
+ }
486
+
487
+ /**
488
+ * ChatClient — the single LLM abstraction analysts call.
489
+ *
490
+ * agent-eval already ships an `LlmClient` (OpenAI-compatible, retry,
491
+ * graceful JSON-schema degrade) and judges that talk to `TCloud`. Two
492
+ * mixed patterns force every analyst author to pick a transport, which
493
+ * couples analyst code to runtime concerns (cli-bridge vs router vs
494
+ * sandbox-sdk) it shouldn't know about.
495
+ *
496
+ * `ChatClient` is one interface every analyst takes via `AnalystContext.chat`.
497
+ * The operator decides at the registry boundary which transport binds
498
+ * to it. Analyst code stays transport-agnostic; swapping production
499
+ * (sandbox-sdk) for local dev (cli-bridge) or tests (mock) is a one-
500
+ * line factory call.
501
+ *
502
+ * Designed to coexist: existing `LlmClient` callers and existing
503
+ * `TCloud`-based judges keep working untouched. New analyst code uses
504
+ * `ChatClient`. When old call sites migrate, they pick up budgeting,
505
+ * cancellation, and unified telemetry for free.
506
+ */
507
+
508
+ /**
509
+ * Unified chat interface. Mirrors LlmCallRequest/Result so the OpenAI-
510
+ * compatible mental model stays. Two methods: a one-shot `chat()` and
511
+ * an `streamChat()` for future agentic loops (not yet exposed).
512
+ */
513
+ interface ChatClient {
514
+ /** Display name of the bound transport — included in telemetry. */
515
+ readonly transport: ChatTransport;
516
+ /** Default model when caller omits — operators bind this per environment. */
517
+ readonly defaultModel?: string;
518
+ chat(req: ChatRequest, opts?: ChatCallOpts): Promise<ChatResponse>;
519
+ }
520
+ type ChatTransport = 'router' | 'sandbox-sdk' | 'cli-bridge' | 'direct-provider' | 'mock';
521
+ interface ChatRequest extends Omit<LlmCallRequest, 'model'> {
522
+ /** Optional — falls back to ChatClient.defaultModel. */
523
+ model?: string;
524
+ }
525
+ type ChatResponse = LlmCallResult;
526
+ interface ChatCallOpts {
527
+ /** Cancel the in-flight request. */
528
+ signal?: AbortSignal;
529
+ /** Hard USD ceiling for this single call (informational; the underlying transport may not enforce). */
530
+ maxCostUsd?: number;
531
+ /** Correlation tag carried into request headers when the transport allows. */
532
+ correlationId?: string;
533
+ }
534
+ type CreateChatClientOpts = RouterTransportOpts | CliBridgeTransportOpts | DirectProviderTransportOpts | SandboxSdkTransportOpts | MockTransportOpts;
535
+ interface BaseTransportOpts {
536
+ defaultModel?: string;
537
+ }
538
+ interface RouterTransportOpts extends BaseTransportOpts {
539
+ transport: 'router';
540
+ baseUrl?: string;
541
+ apiKey: string;
542
+ }
543
+ interface CliBridgeTransportOpts extends BaseTransportOpts {
544
+ transport: 'cli-bridge';
545
+ baseUrl?: string;
546
+ bearer?: string;
547
+ }
548
+ interface DirectProviderTransportOpts extends BaseTransportOpts {
549
+ transport: 'direct-provider';
550
+ baseUrl: string;
551
+ apiKey: string;
552
+ }
553
+ /**
554
+ * Sandbox-SDK transport. Provided as a thin pass-through: the caller
555
+ * supplies a callable that mimics LlmClient.chat() against an already-
556
+ * configured Sandbox handle. We don't import the SDK here to keep
557
+ * agent-eval dep-free of @tangle-network/sandbox.
558
+ */
559
+ interface SandboxSdkTransportOpts extends BaseTransportOpts {
560
+ transport: 'sandbox-sdk';
561
+ chat: (req: ChatRequest, opts?: ChatCallOpts) => Promise<ChatResponse>;
562
+ }
563
+ /**
564
+ * Mock transport for tests. The handler receives the request and returns
565
+ * whatever the test wants. No retries, no JSON-schema degrade.
566
+ */
567
+ interface MockTransportOpts extends BaseTransportOpts {
568
+ transport: 'mock';
569
+ handler: (req: ChatRequest, opts?: ChatCallOpts) => Promise<ChatResponse>;
570
+ }
571
+ /**
572
+ * Build a ChatClient bound to a specific transport. The returned client
573
+ * is safe to share across analysts in a single registry run.
574
+ */
575
+ declare function createChatClient(opts: CreateChatClientOpts): ChatClient;
576
+
577
+ /**
578
+ * Analyst contract — the missing orchestration layer over agent-eval's
579
+ * existing analyzers (analyzeTraces, MultiLayerVerifier, RunCritic,
580
+ * SemanticConceptJudge, JudgeFn, ...).
581
+ *
582
+ * Each existing primitive returns its own output shape. The Analyst
583
+ * contract is the single envelope every primitive lifts into, so a
584
+ * registry can run N analysts against a run and a single renderer can
585
+ * compose findings without knowing which analyzer produced them.
586
+ *
587
+ * The contract is intentionally domain-agnostic: nothing here knows
588
+ * about code, voice, RAG, or any particular agent stack. Analysts
589
+ * declare what INPUT KIND they need (a trace store, an artifact dir,
590
+ * a RunRecord, a JudgeInput, or `custom`), and the registry routes
591
+ * the matching input from `AnalystRunInputs`.
592
+ */
593
+
594
+ /**
595
+ * Unified envelope every analyst emits. Schema-versioned so renderers
596
+ * and time-series diffs survive future field additions.
597
+ */
598
+ interface AnalystFinding {
599
+ schema_version: '1.0.0';
600
+ /**
601
+ * Stable hash over identity-defining fields (analyst_id + canonical
602
+ * claim + area + optional subject). Two findings from two runs that
603
+ * "are the same finding" share this id — that's what `diffFindings`
604
+ * uses to compute appeared/disappeared sets across runs.
605
+ */
606
+ finding_id: string;
607
+ analyst_id: string;
608
+ produced_at: string;
609
+ severity: AnalystSeverity;
610
+ /**
611
+ * Coarse classification. Renderers group by this. Free-form so
612
+ * domain-specific analysts can introduce categories without a
613
+ * schema change ('agent-reasoning', 'verification', 'cost',
614
+ * 'tool-use', 'safety', 'latency', 'data-quality', ...).
615
+ */
616
+ area: string;
617
+ claim: string;
618
+ rationale?: string;
619
+ evidence_refs: EvidenceRef[];
620
+ recommended_action?: string;
621
+ validation_plan?: string;
622
+ /** 0..1 — the analyst's own confidence. Not calibrated across analysts. */
623
+ confidence: number;
624
+ /**
625
+ * Optional subject the finding is about — leaf id, agent id, request
626
+ * id. Included in finding_id when present so per-subject findings
627
+ * diff cleanly across runs.
628
+ */
629
+ subject?: string;
630
+ /** Analyst-private extras; renderers ignore unless they know the analyst. */
631
+ metadata?: Record<string, unknown>;
632
+ }
633
+ type AnalystSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info';
634
+ interface EvidenceRef {
635
+ /**
636
+ * Where the evidence lives. `span` and `event` refer to OTLP trace
637
+ * elements; `artifact` to a file inside the run's artifact tree;
638
+ * `finding` to another AnalystFinding (cross-analyst chaining);
639
+ * `metric` to a named scalar reading the renderer knows how to read.
640
+ */
641
+ kind: 'span' | 'event' | 'artifact' | 'finding' | 'metric';
642
+ uri: string;
643
+ excerpt?: string;
644
+ }
645
+ /**
646
+ * The discriminator the registry uses to pass the right input.
647
+ * `custom` is the escape hatch — analysts that need something else
648
+ * (e.g. an embedding cache, a partner SDK handle) read it from
649
+ * `AnalystRunInputs.custom[<analyst id>]`.
650
+ */
651
+ type AnalystInputKind = 'trace-store' | 'artifact-dir' | 'run-record' | 'judge-input' | 'custom';
652
+ interface AnalystCost {
653
+ /** `deterministic` analysts MUST NOT call the LLM. */
654
+ kind: 'deterministic' | 'llm';
655
+ /** Optional declared upper bound; the registry can enforce a budget. */
656
+ est_usd_per_run?: number;
657
+ /** Models the analyst expects to use (informational). */
658
+ models?: string[];
659
+ }
660
+ interface AnalystRequirements {
661
+ /** Min number of shots / samples the analyst needs to produce signal. */
662
+ min_shots?: number;
663
+ /** Capabilities the runtime must supply (e.g. ['network', 'gpu']). */
664
+ capabilities?: string[];
665
+ }
666
+ /**
667
+ * What's passed to every analyst call. The registry resolves which
668
+ * field the analyst's `inputKind` selects and asserts it's present.
669
+ */
670
+ interface AnalystRunInputs {
671
+ traceStore?: TraceAnalysisStore;
672
+ artifactDir?: string;
673
+ runRecord?: RunRecord;
674
+ judgeInput?: JudgeInput;
675
+ /** Keyed by analyst id; populated by callers that registered custom analysts. */
676
+ custom?: Record<string, unknown>;
677
+ }
678
+ interface AnalystContext {
679
+ runId: string;
680
+ /** Stable correlation id so logs from a single registry.run() share a tag. */
681
+ correlationId: string;
682
+ /** Wall-clock deadline (epoch ms). Analysts SHOULD honor for graceful cancel. */
683
+ deadlineMs?: number;
684
+ /** Per-analyst USD budget. Analysts MAY check before issuing LLM calls. */
685
+ budgetUsd?: number;
686
+ /**
687
+ * Shared chat client. Analysts that call an LLM go through this so
688
+ * the operator picks transport (sandbox-sdk | router | cli-bridge |
689
+ * direct-provider | mock) at the registry boundary without touching
690
+ * analyst code.
691
+ */
692
+ chat?: ChatClient;
693
+ /**
694
+ * Findings from a prior run the operator wants the analyst to see as
695
+ * retrieval context. Kinds that take advantage of cross-run memory
696
+ * (failure-mode "I saw this cluster last run", knowledge-gap "the wiki
697
+ * page I asked for is still missing") render these into the actor's
698
+ * working set. Filtering is the operator's job: pass the slice that
699
+ * matches the analyst's id, or pass everything and let the kind
700
+ * filter. Empty / absent means no cross-run context.
701
+ */
702
+ priorFindings?: ReadonlyArray<AnalystFinding>;
703
+ /** Free-form runtime tags (env, host, op). Findings can echo these into metadata. */
704
+ tags?: Record<string, string>;
705
+ /** Logger callback — analysts SHOULD prefer this over console.* for testability. */
706
+ log?: (msg: string, fields?: Record<string, unknown>) => void;
707
+ /** Optional abort signal. Analysts SHOULD pass it through to LLM calls. */
708
+ signal?: AbortSignal;
709
+ }
710
+ /**
711
+ * The minimal contract. Concrete analysts can refine `TInput` so
712
+ * implementations stay type-safe (e.g. a trace analyst's `TInput` is
713
+ * `TraceAnalysisStore`); the registry passes the right field from
714
+ * `AnalystRunInputs` based on `inputKind`.
715
+ */
716
+ interface Analyst<TInput = unknown> {
717
+ /** Stable identifier — appears in finding_id, telemetry, and registry exclusion lists. */
718
+ readonly id: string;
719
+ /** Human-readable. One sentence. */
720
+ readonly description: string;
721
+ readonly inputKind: AnalystInputKind;
722
+ readonly cost: AnalystCost;
723
+ readonly requires?: AnalystRequirements;
724
+ /** Bump on breaking changes to claim wording or area so old finding_ids don't collide. */
725
+ readonly version: string;
726
+ analyze(input: TInput, ctx: AnalystContext): Promise<AnalystFinding[]>;
727
+ }
728
+ /**
729
+ * Compute the stable finding_id from the identity-defining fields.
730
+ * Default implementation hashes {analyst_id, area, subject, normalized claim}.
731
+ * Analysts that emit findings whose claim text varies per run (timestamps,
732
+ * counts) SHOULD either: (a) pass an explicit `id_basis` to fix the hash,
733
+ * or (b) move the variable part into `rationale`/`metadata` and keep the
734
+ * `claim` static.
735
+ */
736
+ declare function computeFindingId(input: {
737
+ analyst_id: string;
738
+ area: string;
739
+ subject?: string;
740
+ claim: string;
741
+ /** Override the claim for hashing — use when the displayed claim has run-specific bits. */
742
+ id_basis?: string;
743
+ }): string;
744
+ /**
745
+ * Convenience factory: produce a fully-formed AnalystFinding with the
746
+ * id computed automatically. Analyst code stays terse.
747
+ */
748
+ declare function makeFinding(init: Omit<AnalystFinding, 'schema_version' | 'finding_id' | 'produced_at'> & {
749
+ id_basis?: string;
750
+ produced_at?: string;
751
+ }): AnalystFinding;
752
+ interface AnalystRunSummary {
753
+ analyst_id: string;
754
+ status: 'ok' | 'skipped' | 'failed';
755
+ /** Why skipped — missing input, budget exceeded, capability unmet. */
756
+ reason?: string;
757
+ findings_count: number;
758
+ latency_ms: number;
759
+ cost_usd: number;
760
+ /** When `status='failed'`: the error class + message, never the full stack. */
761
+ error?: {
762
+ class: string;
763
+ message: string;
764
+ };
765
+ }
766
+ interface AnalystRunResult {
767
+ run_id: string;
768
+ correlation_id: string;
769
+ started_at: string;
770
+ ended_at: string;
771
+ findings: AnalystFinding[];
772
+ per_analyst: AnalystRunSummary[];
773
+ /** Total LLM cost in USD across all analysts in this registry.run(). */
774
+ total_cost_usd: number;
775
+ }
776
+
777
+ /**
778
+ * Adapter factories — lift each existing agent-eval primitive into the
779
+ * Analyst contract without re-implementing it.
780
+ *
781
+ * Five primitives, five factories. Each one:
782
+ * - Builds an Analyst with a stable id (caller chooses; defaults
783
+ * given), a sensible default `inputKind`, a version derived from
784
+ * the wrapped primitive's version + an adapter revision, and an
785
+ * `analyze()` that calls the primitive and lifts its output to
786
+ * AnalystFinding[] using `makeFinding()`.
787
+ * - Maps severities: the existing `Severity` ('critical' | 'major' |
788
+ * 'minor' | 'info') projects onto AnalystSeverity ('critical' |
789
+ * 'high' | 'medium' | 'low' | 'info'); 'major' → 'high', 'minor' →
790
+ * 'medium'. Domain analysts that want finer-grained mapping override.
791
+ *
792
+ * Adapters never own state. Calling the same factory twice with the
793
+ * same primitive instance is safe.
794
+ */
795
+
796
+ declare function liftSeverity(s: Severity): AnalystSeverity;
797
+ interface TraceAnalystAdapterOpts {
798
+ id?: string;
799
+ area?: string;
800
+ /** The natural-language question(s) put to the analyst. One finding per question. */
801
+ questions: string[];
802
+ /** Caller-provided AxAI service — same one trace-analyst.ts expects. */
803
+ ai: AxAIService;
804
+ model?: string;
805
+ /** Forwarded to analyzeTraces. */
806
+ extra?: Omit<AnalyzeTracesOptions, 'source' | 'ai' | 'model'>;
807
+ }
808
+ /**
809
+ * @deprecated Prefer `createTraceAnalystKind` + one of the failure /
810
+ * improvement kinds from `./kinds`. This adapter wraps the legacy
811
+ * `analyzeTraces` flow whose output is `findings:string[]` — every
812
+ * bullet gets flat-defaulted severity `medium` / confidence `0.6`,
813
+ * which loses the per-finding grading kinds provide via Ax structured
814
+ * output + Zod validation. Kept for one minor while consumers migrate.
815
+ */
816
+ declare function createTraceAnalystAdapter(opts: TraceAnalystAdapterOpts): Analyst<TraceAnalysisStore>;
817
+ interface VerifierAdapterOpts<Env> {
818
+ id?: string;
819
+ area?: string;
820
+ verifier: MultiLayerVerifier<Env>;
821
+ /**
822
+ * The verifier expects an `env` per run. Adapters take it from
823
+ * `AnalystRunInputs.custom[<id>]` via the registry's 'custom' routing.
824
+ */
825
+ options?: Omit<VerifyOptions<Env>, 'env'>;
826
+ }
827
+ declare function createVerifierAdapter<Env>(opts: VerifierAdapterOpts<Env>): Analyst<Env>;
828
+ interface RunCriticAdapterOpts {
829
+ id?: string;
830
+ area?: string;
831
+ critic?: RunCritic;
832
+ /** Optional threshold below which a dimension is reported as a finding. Default 0.5. */
833
+ threshold?: number;
834
+ }
835
+ declare function createRunCriticAdapter(opts?: RunCriticAdapterOpts): Analyst<RunTrace>;
836
+ interface JudgeAdapterOpts {
837
+ id?: string;
838
+ area?: string;
839
+ judge: JudgeFn;
840
+ /** TCloud handle the JudgeFn calls. */
841
+ tcloud: TCloud;
842
+ /** Optional cost classification — most judges call an LLM. */
843
+ cost?: Analyst['cost'];
844
+ /** Optional threshold below which a JudgeScore becomes a finding. Default 6 (on 0-10 scale). */
845
+ threshold?: number;
846
+ }
847
+ declare function createJudgeAdapter(opts: JudgeAdapterOpts): Analyst<JudgeInput>;
848
+ interface SemanticConceptJudgeAdapterOpts {
849
+ id?: string;
850
+ area?: string;
851
+ options?: SemanticConceptJudgeOptions;
852
+ }
853
+ declare function createSemanticConceptJudgeAdapter(opts?: SemanticConceptJudgeAdapterOpts): Analyst<SemanticConceptJudgeInput>;
854
+
855
+ /**
856
+ * Typed Ax output for analyst findings.
857
+ *
858
+ * Replaces the legacy `findings:string[]` pattern (where every bullet
859
+ * became a flat-severity `AnalystFinding`) with a structured object
860
+ * array. Ax binds the field as `findings:json[]` so the provider emits
861
+ * native structured output; at the kind-factory boundary we Zod-validate
862
+ * each emitted finding so malformed rows fail loud instead of being
863
+ * silently lifted with default severity.
864
+ *
865
+ * Why not `f.object().array()` directly in the signature? The Ax
866
+ * signature string `question:string -> findings:json[]` already lets
867
+ * the provider emit JSON arrays. A Zod boundary is required either
868
+ * way (the provider can return any JSON), and Zod gives us a single
869
+ * validation surface independent of which Ax version is installed.
870
+ */
871
+
872
+ declare const ANALYST_SEVERITIES: readonly ["critical", "high", "medium", "low", "info"];
873
+ declare const RawAnalystFindingSchema: z.ZodObject<{
874
+ severity: z.ZodEnum<{
875
+ info: "info";
876
+ critical: "critical";
877
+ medium: "medium";
878
+ low: "low";
879
+ high: "high";
880
+ }>;
881
+ claim: z.ZodString;
882
+ subject: z.ZodOptional<z.ZodString>;
883
+ evidence_uri: z.ZodString;
884
+ evidence_excerpt: z.ZodOptional<z.ZodString>;
885
+ confidence: z.ZodNumber;
886
+ rationale: z.ZodOptional<z.ZodString>;
887
+ recommended_action: z.ZodOptional<z.ZodString>;
888
+ }, z.core.$strict>;
889
+ type RawAnalystFinding = z.infer<typeof RawAnalystFindingSchema>;
890
+ /**
891
+ * Description embedded into the actor prompt so the LLM knows what
892
+ * shape to emit. Kept here so kinds share one source of truth rather
893
+ * than restating the schema in every prompt.
894
+ */
895
+ declare const RAW_FINDING_SCHEMA_PROMPT = "Each finding MUST be a JSON object with these fields:\n - severity: one of \"critical\" | \"high\" | \"medium\" | \"low\" | \"info\"\n - claim: one-sentence statement (max 2000 chars)\n - subject?: the leaf id, agent id, span id, tool name, or noun phrase the finding is about\n - evidence_uri: \"span://<trace_id>/<span_id>\" for trace evidence, \"artifact://<relative-path>\" for files, \"metric://<name>\" for named scalars \u2014 ALWAYS cite a real id surfaced by the tools\n - evidence_excerpt?: short quote (<=2000 chars) from the cited span/artifact\n - confidence: number 0..1 \u2014 0.9+ when backed by exact quotes, 0.6-0.8 for inferred patterns, <0.5 for speculative\n - rationale?: one or two sentences explaining the reasoning\n - recommended_action?: concrete change phrased as an imperative (\"Add ...\", \"Replace ...\", \"Stop ...\") \u2014 omit when the finding is purely descriptive\n\nEmit an empty array when the question has no findings to report. Do not fabricate evidence.";
896
+ /**
897
+ * Validate one row emitted by the LLM. Returns the typed finding on
898
+ * success; returns `null` and logs the reason on failure so the kind
899
+ * factory can skip-and-count rather than abort the whole analyst run.
900
+ */
901
+ declare function parseRawFinding(row: unknown, log?: (msg: string, fields?: Record<string, unknown>) => void): RawAnalystFinding | null;
902
+
903
+ /**
904
+ * FindingsStore — durable persistence for AnalystFinding rows + a diff
905
+ * helper so we can answer "what changed since the last run?" without
906
+ * recomputing analysts.
907
+ *
908
+ * On-disk shape is JSONL: one finding per line, append-only, locked via
909
+ * LockedJsonlAppender. Operators get crash-safety (no partial JSON),
910
+ * cheap reads (sequential parse), and trivial backup (rsync the file).
911
+ *
912
+ * Reads are non-locking: a reader sees a consistent snapshot of all
913
+ * fully-written lines and skips an incomplete trailing line if the
914
+ * writer is mid-append. Cross-process locking is intentionally out of
915
+ * scope (see locked-jsonl-appender.ts).
916
+ *
917
+ * The store is run-scoped: callers pass `runId` on append and on load,
918
+ * which keeps multi-run files cleanly partitioned. The `diffFindings`
919
+ * helper compares two run-id sets using stable `finding_id` semantics —
920
+ * the diff is the cross-run signal the regression dashboard renders.
921
+ */
922
+
923
+ /**
924
+ * One persisted row. We attach `run_id` on disk so a single file can
925
+ * hold multiple runs and the diff helper can query without re-walking
926
+ * separate files.
927
+ */
928
+ interface PersistedFinding extends AnalystFinding {
929
+ run_id: string;
930
+ }
931
+ declare class FindingsStore {
932
+ readonly path: string;
933
+ private readonly appender;
934
+ constructor(path: string);
935
+ append(runId: string, findings: AnalystFinding[]): Promise<void>;
936
+ /** Load every persisted finding. Discards malformed trailing lines silently. */
937
+ loadAll(): PersistedFinding[];
938
+ /** Filter to a single run. */
939
+ loadRun(runId: string): PersistedFinding[];
940
+ }
941
+ interface FindingsDiff {
942
+ /** New finding ids in `current` that weren't in `previous`. */
943
+ appeared: PersistedFinding[];
944
+ /** Finding ids in `previous` that aren't in `current`. */
945
+ disappeared: PersistedFinding[];
946
+ /** Same finding id present in both runs and unchanged per the materiality test. */
947
+ persisted: PersistedFinding[];
948
+ /**
949
+ * Same finding id in both runs but at least one non-identity field
950
+ * shifted per `DiffPolicy.isMaterial`. Reported as [previous, current].
951
+ */
952
+ changed: Array<{
953
+ previous: PersistedFinding;
954
+ current: PersistedFinding;
955
+ }>;
956
+ }
957
+ interface DiffPolicy {
958
+ /**
959
+ * Predicate that decides whether two findings (same finding_id) count
960
+ * as a material change. Defaults to {@link defaultIsMaterial}: severity
961
+ * shift, confidence Δ > 0.05, or evidence count change. Compliance /
962
+ * perf consumers MAY supply a stricter predicate (e.g. rationale text
963
+ * diff, metric Δ thresholds).
964
+ */
965
+ isMaterial?: (previous: AnalystFinding, current: AnalystFinding) => boolean;
966
+ }
967
+ /**
968
+ * Default materiality test. Deliberately narrow so LLM-reword churn
969
+ * doesn't flood the diff. Stricter tests are opt-in via DiffPolicy.
970
+ */
971
+ declare function defaultIsMaterial(a: AnalystFinding, b: AnalystFinding): boolean;
972
+ /**
973
+ * Diff two findings sets by stable finding_id. Callers typically load
974
+ * the two run-id slices from the same store and pass them in.
975
+ */
976
+ declare function diffFindings(previous: PersistedFinding[], current: PersistedFinding[], policy?: DiffPolicy): FindingsDiff;
977
+
978
+ /**
979
+ * Analyst-kind factory — the typed, focused replacement for the
980
+ * legacy `createTraceAnalystAdapter`.
981
+ *
982
+ * A "kind" is a specialized analyst whose actor prompt, tool subset,
983
+ * and Ax recursion config target one failure-mode lens (failure-mode
984
+ * classification, knowledge gap discovery, knowledge poisoning, recursive
985
+ * self-improvement, ...). Kinds emit findings in the typed `RawAnalystFinding`
986
+ * shape via a JSON-array Ax output; the factory validates each row with
987
+ * Zod and lifts it into `AnalystFinding[]` with no shape guessing.
988
+ *
989
+ * Composition rules:
990
+ * - Each kind owns its actor description. No generic "answer this
991
+ * question" prompt — the prompt names the failure lens.
992
+ * - Each kind picks a narrow tool subset from `ANALYST_TOOL_GROUPS`.
993
+ * A kind that never needs full-trace dumps can drop `viewTrace` /
994
+ * `viewSpans` and stay cheap.
995
+ * - Each kind declares its recursion + parallelism budget. Discovery-
996
+ * heavy kinds (failure-mode) get higher `maxDepth`; lens kinds
997
+ * (poisoning) usually stay at 0 since they have a tighter brief.
998
+ *
999
+ * Optimizer hook: kinds may declare `goldens` — labeled examples used
1000
+ * by `AxMiPRO` / `AxBootstrapFewShot` / `AxGEPA` to fit the actor
1001
+ * description programmatically. Stored on the kind, not the registry,
1002
+ * because the right metric is kind-specific.
1003
+ */
1004
+
1005
+ /**
1006
+ * Per-kind specification. The factory turns this into a regular
1007
+ * `Analyst<TraceAnalysisStore>` ready for `AnalystRegistry.register()`.
1008
+ */
1009
+ interface TraceAnalystKindSpec {
1010
+ /** Stable id. Appears in finding_id, telemetry, and registry exclusions. */
1011
+ id: string;
1012
+ /** One-sentence description shown in `registry.list()`. */
1013
+ description: string;
1014
+ /** Coarse classification stamped on every emitted finding (`failure-mode`, `knowledge-gap`, ...). */
1015
+ area: string;
1016
+ /** Bump on any breaking change to the actor prompt or output schema. */
1017
+ version: string;
1018
+ /** Actor system prompt. Must instruct the LLM to emit `findings` per the schema. */
1019
+ actorDescription: string;
1020
+ /** Responder system prompt; falls back to a minimal "format the findings" instruction. */
1021
+ responderDescription?: string;
1022
+ /** Tool functions the actor may call. Pick narrow subsets via `ANALYST_TOOL_GROUPS`. */
1023
+ buildTools: (store: TraceAnalysisStore) => AxFunction[];
1024
+ /** Recursion budget. `maxDepth: 0` disables subagents. */
1025
+ recursion?: {
1026
+ maxDepth: number;
1027
+ maxParallelSubagents?: number;
1028
+ };
1029
+ /** Actor turn cap. Default 12. */
1030
+ maxTurns?: number;
1031
+ /** Runtime char cap. Default 6000. */
1032
+ maxRuntimeChars?: number;
1033
+ /** Cost classification surfaced in `registry.list()` and budget enforcement. */
1034
+ cost: AnalystCost;
1035
+ /** Per-finding-row hook — kinds may reject / rewrite before lifting. */
1036
+ postProcess?: (row: RawAnalystFinding, ctx: AnalystContext) => RawAnalystFinding | null;
1037
+ /** Optional optimizer hook — populated when a kind wants to fit its prompt against labeled examples. */
1038
+ goldens?: TraceAnalystGolden[];
1039
+ }
1040
+ /**
1041
+ * One labeled example consumed by Ax optimizers (MIPRO / GEPA / Bootstrap).
1042
+ * Each input is the same `{question}` an analyst would receive; `expected`
1043
+ * is the ground-truth finding set a fitted prompt should produce on this
1044
+ * input. Metric: kind-specific (default: F1 on `finding_id` overlap).
1045
+ */
1046
+ interface TraceAnalystGolden {
1047
+ question: string;
1048
+ expected: ReadonlyArray<Omit<RawAnalystFinding, 'confidence'>>;
1049
+ }
1050
+ interface CreateTraceAnalystKindOpts {
1051
+ /** AxAIService bound at registration time. */
1052
+ ai: AxAIService;
1053
+ /** Optional model override; falls back to the AI service's default. */
1054
+ model?: string;
1055
+ /** Override the spec's `version` (e.g. when an optimizer has fitted a new prompt). */
1056
+ versionSuffix?: string;
1057
+ }
1058
+ /**
1059
+ * Build an `Analyst<TraceAnalysisStore>` from a kind spec.
1060
+ *
1061
+ * Lifts the Ax pipeline once at registration time so the registry
1062
+ * gets a stateless analyst. The Ax agent is freshly constructed per
1063
+ * `analyze()` call (the agent carries chat-log + usage state we don't
1064
+ * want shared across analyst runs).
1065
+ */
1066
+ declare function createTraceAnalystKind(spec: TraceAnalystKindSpec, opts: CreateTraceAnalystKindOpts): Analyst<TraceAnalysisStore>;
1067
+ /**
1068
+ * Render a compact prior-findings block the actor reads alongside its
1069
+ * brief. Each row is one line so the actor can scan dozens cheaply.
1070
+ * The kind's prompt instructs the actor to (a) check whether a new
1071
+ * cluster matches a prior `finding_id` (carry the id forward via
1072
+ * `id_basis` to keep diffs stable) and (b) raise severity / confidence
1073
+ * when a prior finding has reappeared without remediation.
1074
+ *
1075
+ * Returns the empty string when there are no prior findings — most
1076
+ * runs are "first-of-its-kind" and the prompt stays unchanged.
1077
+ *
1078
+ * Exported for tests + for consumers that build their own actor
1079
+ * prompts (e.g. specialized analysts living outside the default kinds).
1080
+ */
1081
+ declare function renderPriorFindings(prior: AnalystContext['priorFindings']): string;
1082
+
1083
+ /**
1084
+ * Failure-mode analyst — classifies what went wrong and why.
1085
+ *
1086
+ * Brief: read the trace dataset, identify the top failure modes across
1087
+ * runs, classify each with severity + evidence, and surface them as
1088
+ * findings. The actor's job is *taxonomy + evidence*, not fix-design —
1089
+ * that's the improvement-analyst's job.
1090
+ *
1091
+ * Recursion is deep (`maxDepth: 3`) because real failure-mode
1092
+ * discovery is genuinely tree-shaped: the actor splits the dataset
1093
+ * into candidate clusters, each cluster spawns a focused investigator
1094
+ * that drills into representative traces, and a deeply-recursed
1095
+ * investigator may itself split a confounded mode into two sub-modes.
1096
+ * Each level fans out 4-way, so the analyst can investigate up to
1097
+ * ~16 leaf clusters before hitting the depth ceiling.
1098
+ */
1099
+
1100
+ declare const FAILURE_MODE_KIND_SPEC: TraceAnalystKindSpec;
1101
+
1102
+ /**
1103
+ * Improvement analyst — actionable, recursive self-improvement findings.
1104
+ *
1105
+ * Brief: read findings from upstream analysts (failure-mode,
1106
+ * knowledge-gap, knowledge-poisoning) AND the trace dataset itself,
1107
+ * then propose **concrete edits** to the agent's runtime: prompt
1108
+ * additions, RAG documents to ingest, tool descriptions to rewrite,
1109
+ * scaffolding changes to make, memory entries to invalidate. Each
1110
+ * finding is one proposed edit with the locus, the diff, and the
1111
+ * expected effect.
1112
+ *
1113
+ * This is the recursive-self-improvement loop's last mile: the prior
1114
+ * kinds describe *what's wrong*; this kind describes *what to change*.
1115
+ *
1116
+ * Recursion is deep (`maxDepth: 3`) because real improvement proposals
1117
+ * are competitive: for each failure-mode there are usually 2-3 viable
1118
+ * fix directions (tighten prompt vs add tool vs adjust scaffolding),
1119
+ * and the actor should explore each with a focused subagent before
1120
+ * picking the highest-leverage one to recommend.
1121
+ */
1122
+
1123
+ declare const IMPROVEMENT_KIND_SPEC: TraceAnalystKindSpec;
1124
+
1125
+ /**
1126
+ * Knowledge-gap analyst — what did the agent NOT know that it needed?
1127
+ *
1128
+ * Brief: find moments in the trace where the agent had to guess, ask
1129
+ * the user to fill in context, recover from a wrong assumption, or
1130
+ * loop on a retrieval. Each finding names a *missing or outdated piece
1131
+ * of knowledge* the agent's curated knowledge base should have held —
1132
+ * or a downstream lookup (web, docs, tool description) that surfaced
1133
+ * stale or outdated information.
1134
+ *
1135
+ * The primary expected store is `@tangle-network/agent-knowledge`: a
1136
+ * Karpathy-style wiki the agent maintains with raw ↔ curated pages,
1137
+ * source anchors, and claim/relation triples. A gap is anything the
1138
+ * agent had to discover at run-time that should already have lived
1139
+ * there. Secondary loci: web-search results that returned outdated
1140
+ * pages, tool descriptions that omitted critical behavior, system-
1141
+ * prompt sections that didn't cover the case.
1142
+ *
1143
+ * Distinct from failure-mode: failure-mode classifies *how* it broke;
1144
+ * knowledge-gap names the *information* whose absence (or staleness)
1145
+ * caused the break. One failure-mode often maps to several gaps.
1146
+ *
1147
+ * Recursion (`maxDepth: 2`) is enough to fan out one subagent per
1148
+ * candidate gap-source layer; each subagent runs a focused detection.
1149
+ */
1150
+
1151
+ declare const KNOWLEDGE_GAP_KIND_SPEC: TraceAnalystKindSpec;
1152
+
1153
+ /**
1154
+ * Knowledge-poisoning analyst — what FALSE information misled the agent?
1155
+ *
1156
+ * Brief: find moments where the agent acted on information that was
1157
+ * *wrong* — stale memory, RAG documents that contradicted ground truth,
1158
+ * tool descriptions that lied about return shapes, system-prompt
1159
+ * instructions that no longer matched reality, prior-run summaries that
1160
+ * cached a wrong decision.
1161
+ *
1162
+ * Distinct from knowledge-gap: a gap is "the agent didn't know X"; a
1163
+ * poisoning is "the agent confidently used X, but X was wrong." Gaps
1164
+ * surface as questions / self-correction; poisonings surface as
1165
+ * confident-but-wrong actions that downstream evidence contradicts.
1166
+ *
1167
+ * Recursion is moderate (`maxDepth: 2`) because each candidate
1168
+ * poisoning typically needs two sub-investigations: one to confirm
1169
+ * the agent acted on the false belief, one to confirm the belief
1170
+ * itself is actually false in ground truth.
1171
+ */
1172
+
1173
+ declare const KNOWLEDGE_POISONING_KIND_SPEC: TraceAnalystKindSpec;
1174
+
1175
+ /**
1176
+ * Default analyst kinds focused on agent failure + recursive
1177
+ * self-improvement.
1178
+ *
1179
+ * The four kinds chain: failure-mode classifies; knowledge-gap and
1180
+ * knowledge-poisoning explain *why* in two orthogonal ways; improvement
1181
+ * proposes concrete edits. Register all four against the same trace
1182
+ * store and the registry runs them in dependency order if the operator
1183
+ * pipes findings between them.
1184
+ */
1185
+
1186
+ /**
1187
+ * The default kind suite. Order is the run order operators should
1188
+ * use: failure-mode first (no upstream deps), gap + poisoning next
1189
+ * (both depend on failures), improvement last (chains all three).
1190
+ */
1191
+ declare const DEFAULT_TRACE_ANALYST_KINDS: readonly TraceAnalystKindSpec[];
1192
+
1193
+ /**
1194
+ * AnalystRegistry — orchestrate N analysts against one run.
1195
+ *
1196
+ * Owns three responsibilities and only three:
1197
+ * 1. Registration — ids must be unique; bad registrations fail loudly
1198
+ * at register-time, not run-time.
1199
+ * 2. Routing — each analyst declares its `inputKind`; the registry
1200
+ * picks the matching field from AnalystRunInputs and skips the
1201
+ * analyst with a logged reason if it's missing.
1202
+ * 3. Isolation — one analyst's exception MUST NOT stop other analysts.
1203
+ * Failed analysts produce zero findings + a 'failed' summary row.
1204
+ *
1205
+ * Cross-cutting concerns (telemetry, error → finding conversion, cost
1206
+ * ingestion, storage rotation) live in `AnalystHooks`. Budget shaping
1207
+ * (equal split vs weighted vs custom) lives in `BudgetPolicy`. Both
1208
+ * have sensible defaults; consumers override only what they need.
1209
+ */
1210
+
1211
+ interface AnalystHooks {
1212
+ /** Before analyze() — last chance to mutate ctx (e.g. inject tags, override budget). */
1213
+ onBeforeAnalyze?(args: {
1214
+ analyst: Analyst;
1215
+ ctx: AnalystContext;
1216
+ runId: string;
1217
+ }): void | Promise<void>;
1218
+ /** After every analyst (ok | failed | skipped). Use for telemetry, ingestion, rotation. */
1219
+ onAfterAnalyze?(args: {
1220
+ analyst: Analyst;
1221
+ summary: AnalystRunSummary;
1222
+ findings: AnalystFinding[];
1223
+ runId: string;
1224
+ }): void | Promise<void>;
1225
+ /**
1226
+ * On analyst exception. Hook MAY return findings to convert the
1227
+ * error into structured findings; the summary still reports 'failed'.
1228
+ * Return void to keep the default empty-findings behavior.
1229
+ */
1230
+ onError?(args: {
1231
+ analyst: Analyst;
1232
+ error: Error;
1233
+ runId: string;
1234
+ }): AnalystFinding[] | void | Promise<AnalystFinding[] | void>;
1235
+ /** Once after registry.run() completes. Use for final aggregation, persistence. */
1236
+ onComplete?(args: {
1237
+ result: AnalystRunResult;
1238
+ }): void | Promise<void>;
1239
+ }
1240
+ interface BudgetPolicy {
1241
+ /** Overall USD cap across the registry.run(). */
1242
+ totalUsd?: number;
1243
+ /** Per-analyst weight for the default allocator. Missing ids get weight 1. */
1244
+ weights?: Record<string, number>;
1245
+ /**
1246
+ * Custom allocator — receives the analyst, remaining/total budget, and
1247
+ * the count of analysts that will run. Returns the per-analyst budget
1248
+ * (or undefined to leave it uncapped). Overrides weights when set.
1249
+ */
1250
+ allocate?: (args: {
1251
+ analyst: Analyst;
1252
+ totalUsd: number | undefined;
1253
+ remainingUsd: number | undefined;
1254
+ runningCount: number;
1255
+ }) => number | undefined;
1256
+ }
1257
+ interface AnalystRegistryOptions {
1258
+ /** Shared chat client passed to every LLM analyst via AnalystContext. */
1259
+ chat?: ChatClient;
1260
+ /** Logger callback. Defaults to a no-op. */
1261
+ log?: (msg: string, fields?: Record<string, unknown>) => void;
1262
+ /** Hooks invoked around analyze() — observability + customization seam. */
1263
+ hooks?: AnalystHooks;
1264
+ /** Default budget when run() doesn't override. */
1265
+ defaultBudget?: BudgetPolicy;
1266
+ }
1267
+ interface RegistryRunOpts {
1268
+ /** Restrict to a subset of registered analysts by id. */
1269
+ only?: string[];
1270
+ /** Skip these analysts even if registered. Useful for cheap iteration. */
1271
+ skip?: string[];
1272
+ /** Budget policy — totalUsd + optional weights/allocator. Falls back to options.defaultBudget. */
1273
+ budget?: BudgetPolicy;
1274
+ /** Wall-clock cap. Analysts SHOULD honor `ctx.deadlineMs`. */
1275
+ timeoutMs?: number;
1276
+ /** Abort signal — forwarded into every analyst's context. */
1277
+ signal?: AbortSignal;
1278
+ /** Tags echoed into AnalystContext.tags — useful for tracking environment/version in findings. */
1279
+ tags?: Record<string, string>;
1280
+ /**
1281
+ * Prior-run findings made available as retrieval context to every
1282
+ * analyst via `ctx.priorFindings`. The registry forwards the slice
1283
+ * whose `analyst_id` matches each registered analyst so a kind sees
1284
+ * only its own history. Pass `{ '*': findings }` to broadcast to
1285
+ * every analyst (useful for cross-kind chaining where the improvement
1286
+ * analyst consumes upstream failure findings).
1287
+ */
1288
+ priorFindings?: ReadonlyArray<AnalystFinding> | Record<string, ReadonlyArray<AnalystFinding>>;
1289
+ }
1290
+ declare class AnalystRegistry {
1291
+ private readonly analysts;
1292
+ private readonly options;
1293
+ constructor(options?: AnalystRegistryOptions);
1294
+ register(analyst: Analyst): void;
1295
+ list(): ReadonlyArray<{
1296
+ id: string;
1297
+ description: string;
1298
+ version: string;
1299
+ cost: Analyst['cost'];
1300
+ }>;
1301
+ run(runId: string, inputs: AnalystRunInputs, runOpts?: RegistryRunOpts): Promise<AnalystRunResult>;
1302
+ private selectAnalysts;
1303
+ private routeInput;
1304
+ }
1305
+
1306
+ /**
1307
+ * Pre-curated tool subsets for analyst kinds.
1308
+ *
1309
+ * The full trace-analyst tool set is seven functions. Most kinds only
1310
+ * need three or four. Picking from named groups instead of importing
1311
+ * the whole bundle keeps every kind's actor-context budget tight and
1312
+ * makes "what can this analyst see?" obvious at registration time.
1313
+ *
1314
+ * Each function in the group keeps its full `name`/`description` from
1315
+ * `buildTraceAnalystTools` — we filter, we don't re-implement.
1316
+ */
1317
+
1318
+ /** Named tool sets. Kinds pass `tools: TRACE_TOOL_GROUPS.failureForensics` etc. */
1319
+ type TraceToolGroupName =
1320
+ /** All seven tools. Use for open-ended discovery kinds. */
1321
+ 'all'
1322
+ /** Overview + paginated query + count. No deep reads. Cheap. */
1323
+ | 'discovery'
1324
+ /** Discovery + viewTrace + viewSpans. Deep-read but no regex search. */
1325
+ | 'discoveryAndRead'
1326
+ /** Discovery + search tools. For pattern-matching across many traces. */
1327
+ | 'discoveryAndSearch'
1328
+ /** Discovery + viewSpans + searchSpan. Targeted-span work after another kind narrows down. */
1329
+ | 'targeted';
1330
+ /**
1331
+ * Build the tool set for a named group bound to a specific trace store.
1332
+ *
1333
+ * `all` returns every tool. Other groups filter `buildTraceAnalystTools`
1334
+ * by name to the documented subset. An unrecognised group name throws —
1335
+ * silently returning all tools would defeat the cost-control point.
1336
+ */
1337
+ declare function buildTraceToolsForGroup(group: TraceToolGroupName, store: TraceAnalysisStore): AxFunction[];
1338
+
1339
+ /**
1340
+ * Automated pull request opener for the production loop.
1341
+ *
1342
+ * `runProductionLoop` produces a `promotedPrompt` string and a release
1343
+ * scorecard. To close the eval → prod → eval cycle the framework needs
1344
+ * to land that prompt as a reviewable code change. This module does
1345
+ * exactly that:
1346
+ *
1347
+ * 1. Stage a branch off `baseBranch`.
1348
+ * 2. Write each `fileChange` into the worktree.
1349
+ * 3. Commit + push.
1350
+ * 4. Open a PR via the GitHub API.
1351
+ *
1352
+ * Two transports ship in core:
1353
+ *
1354
+ * - `ghCliClient(opts)` — shells out to the `gh` CLI. No extra deps,
1355
+ * re-uses the developer machine's `gh auth` state, works with both
1356
+ * github.com and GitHub Enterprise. This is the recommended default.
1357
+ * - `httpGithubClient(opts)` — direct `fetch` against `api.github.com`
1358
+ * with a bearer token. Useful in CI where `gh` may not be installed.
1359
+ *
1360
+ * Both implement the small `AutoPrClient` interface, so tests substitute
1361
+ * a fake without spinning a process or network.
1362
+ *
1363
+ * @experimental — surface may evolve as consumers wire it into CI workflows.
1364
+ */
1365
+ interface FileChange {
1366
+ /** Repo-relative path. Forward slashes; no `..`. */
1367
+ path: string;
1368
+ /** New file contents. UTF-8. */
1369
+ contents: string;
1370
+ /** Optional explanatory comment shown in the commit body. */
1371
+ rationale?: string;
1372
+ }
1373
+ interface RepoRef {
1374
+ owner: string;
1375
+ name: string;
1376
+ }
1377
+ interface ProposeAutomatedPullRequestInput {
1378
+ repo: RepoRef;
1379
+ /** Branch to base the PR on. Default `'main'`. */
1380
+ baseBranch?: string;
1381
+ /** New branch name. Use a prefix + a short stable id; no spaces. */
1382
+ branchName: string;
1383
+ fileChanges: FileChange[];
1384
+ title: string;
1385
+ body: string;
1386
+ /** Optional GitHub usernames to request review from. */
1387
+ reviewers?: string[];
1388
+ /** Optional labels to apply. */
1389
+ labels?: string[];
1390
+ /** Commit author name. Default: derived from the GitHub client. */
1391
+ authorName?: string;
1392
+ /** Commit author email. Default: derived from the GitHub client. */
1393
+ authorEmail?: string;
1394
+ /** Dry-run — do not push or open a PR; just return the would-be plan. */
1395
+ dryRun?: boolean;
1396
+ }
1397
+ interface ProposeAutomatedPullRequestResult {
1398
+ prUrl: string;
1399
+ branchName: string;
1400
+ headSha: string;
1401
+ dryRun: boolean;
1402
+ }
1403
+ /** Pluggable transport for the auto-PR pipeline. */
1404
+ interface AutoPrClient {
1405
+ /**
1406
+ * Create a branch from `baseBranch`, write file changes, commit, push,
1407
+ * and open a PR. Returns the PR's HTML url and head SHA.
1408
+ *
1409
+ * Implementations must be idempotent on `branchName`: if the branch
1410
+ * already exists with the same head SHA as the would-be commit, return
1411
+ * the existing PR rather than failing. This makes the production loop
1412
+ * safe to retry on transient errors.
1413
+ */
1414
+ proposeChange(input: ProposeAutomatedPullRequestInput): Promise<ProposeAutomatedPullRequestResult>;
412
1415
  }
413
- interface EvalResult {
414
- scenario: string;
415
- status: 'pass' | 'fail' | 'skip';
416
- duration: number;
417
- detail?: string;
418
- artifact?: string;
1416
+ declare function proposeAutomatedPullRequest(client: AutoPrClient, input: ProposeAutomatedPullRequestInput): Promise<ProposeAutomatedPullRequestResult>;
1417
+ interface HttpGithubClientOptions {
1418
+ /** Personal access token, GitHub App token, or `GITHUB_TOKEN` from Actions. */
1419
+ token: string;
1420
+ /** Override for GitHub Enterprise. Default `'https://api.github.com'`. */
1421
+ apiBase?: string;
1422
+ /** Test seam — defaults to global `fetch`. */
1423
+ fetchImpl?: typeof fetch;
1424
+ /** Test seam — clock for commit timestamps. */
1425
+ now?: () => Date;
1426
+ }
1427
+ /**
1428
+ * Direct REST-API GitHub client. No external deps.
1429
+ *
1430
+ * Idempotency strategy: before creating refs/commits/PRs, check whether
1431
+ * the branch already exists at the desired tree. If so, return the
1432
+ * existing PR (or open one if missing). Errors from concurrent runs
1433
+ * (`Reference already exists`) are caught and treated as success.
1434
+ */
1435
+ declare function httpGithubClient(opts: HttpGithubClientOptions): AutoPrClient;
1436
+ interface GhCliClientOptions {
1437
+ /** Override the CLI binary (`gh`). For testing. */
1438
+ bin?: string;
1439
+ /** Working directory containing a clone of `repo`. Default: process cwd. */
1440
+ cwd?: string;
1441
+ /** Test seam: process spawner. Default: node:child_process spawn. */
1442
+ exec?: (bin: string, args: string[], opts: {
1443
+ cwd: string;
1444
+ stdin?: string;
1445
+ }) => Promise<{
1446
+ stdout: string;
1447
+ stderr: string;
1448
+ exitCode: number;
1449
+ }>;
419
1450
  }
1451
+ /**
1452
+ * `gh` CLI transport. Requires:
1453
+ * - `gh` installed and authenticated (`gh auth status`).
1454
+ * - A local clone of the repo with a clean working tree.
1455
+ * - `git` on PATH.
1456
+ *
1457
+ * Uses `gh api` for repo metadata and `gh pr create` for the PR. The
1458
+ * actual commit lands via `git`, which keeps `gh`'s footprint minimal.
1459
+ */
1460
+ declare function ghCliClient(opts?: GhCliClientOptions): AutoPrClient;
420
1461
 
421
1462
  /**
422
1463
  * BenchmarkRunner — orchestrates scenarios, executor, judges, and scoring.
@@ -1312,58 +2353,6 @@ declare class DualAgentBench {
1312
2353
  run(config: DualAgentBenchConfig): Promise<DualAgentReport>;
1313
2354
  }
1314
2355
 
1315
- interface RunScore {
1316
- success: number;
1317
- goalProgress: number;
1318
- repoGroundedness: number;
1319
- driftPenalty: number;
1320
- toolUseQuality: number;
1321
- patchQuality: number;
1322
- testReality: number;
1323
- finalGate: number;
1324
- reviewerBlockers: number;
1325
- costUsd: number;
1326
- wallSeconds: number;
1327
- notes?: string[];
1328
- }
1329
- interface RunScoreWeights {
1330
- success: number;
1331
- goalProgress: number;
1332
- repoGroundedness: number;
1333
- driftPenalty: number;
1334
- toolUseQuality: number;
1335
- patchQuality: number;
1336
- testReality: number;
1337
- finalGate: number;
1338
- reviewerBlockers: number;
1339
- costUsd: number;
1340
- wallSeconds: number;
1341
- }
1342
- declare const DEFAULT_RUN_SCORE_WEIGHTS: RunScoreWeights;
1343
- declare function aggregateRunScore(score: RunScore, weights?: Partial<RunScoreWeights>): number;
1344
- declare function clamp01(value: number): number;
1345
-
1346
- interface RunTrace {
1347
- run: Run$1;
1348
- spans: Span[];
1349
- events: TraceEvent[];
1350
- artifacts: Artifact$1[];
1351
- budget: BudgetLedgerEntry[];
1352
- }
1353
- interface RunCriticOptions {
1354
- weights?: Partial<RunScoreWeights>;
1355
- driftPatterns?: RegExp[];
1356
- }
1357
- declare class RunCritic {
1358
- private readonly weights?;
1359
- private readonly driftPatterns;
1360
- constructor(options?: RunCriticOptions);
1361
- score(store: TraceStore, runId: string): Promise<RunScore>;
1362
- scoreTrace(trace: RunTrace): RunScore;
1363
- rank(score: RunScore): number;
1364
- private isDrift;
1365
- }
1366
-
1367
2356
  interface HostedJudgeDimension {
1368
2357
  name: string;
1369
2358
  weight: number;
@@ -4178,140 +5167,6 @@ declare function buildReviewerPrompt(input: ReviewerPromptInput): {
4178
5167
  */
4179
5168
  declare function createDefaultReviewer(options: CreateDefaultReviewerOptions): (input: ReviewerPromptInput) => Promise<ReviewerOutput>;
4180
5169
 
4181
- /**
4182
- * Semantic concept judge — "does the built artifact actually implement
4183
- * the features the user asked for?"
4184
- *
4185
- * Distinct from the domain/code/coherence judges in `judges.ts`:
4186
- * - those judges score free-form conversational agent outputs along
4187
- * quality dimensions (accuracy, depth, etc.)
4188
- * - this judge scores a *built artifact* (served HTML + source files)
4189
- * against an explicit list of expected concepts, returning per-concept
4190
- * {present, score 0-10, evidence, severity}.
4191
- *
4192
- * The judge is strict about distinguishing (a) a working implementation
4193
- * from (b) a keyword-present stub. "// TODO: mint button" is NOT present.
4194
- * Only real, functional, wired-up code counts.
4195
- *
4196
- * Use via {@link createSemanticConceptJudge} or directly via
4197
- * {@link runSemanticConceptJudge}. Soft-fails (available=false) on LLM
4198
- * or JSON-parse errors so the caller can treat that as "layer skipped"
4199
- * rather than "layer failed" in a multi-layer pipeline.
4200
- */
4201
-
4202
- /**
4203
- * Implementation complexity class for weighted scoring.
4204
- *
4205
- * - `render` (default): the concept is a UI surface that displays static
4206
- * data — render a list, show a counter, lay out a button. Single-file
4207
- * work, no external integration.
4208
- * - `integrate`: the concept requires wiring a real external system —
4209
- * wallet connect (wagmi + RainbowKit + chain config), payment provider
4210
- * (Stripe Elements + intent + webhook), an API client with auth.
4211
- * Multi-file, library-knowledge, runtime correctness matters.
4212
- * - `compute`: the concept requires algorithmic work — solver, simulator,
4213
- * constraint propagation, ML inference. Correctness > UI polish.
4214
- *
4215
- * Default weights (when applied via `weightConcepts: 'complexity'`):
4216
- * render=1.0, integrate=2.0, compute=2.5
4217
- *
4218
- * Cross-vertical scoring without complexity weighting silently inflates
4219
- * the rate of UI-heavy verticals (healthcare, fintech dashboards) vs
4220
- * integration-heavy verticals (DeFi, wallets) — all concepts treated
4221
- * equally even though the agent does 2-3x the work for `integrate`.
4222
- */
4223
- type ConceptComplexity = 'render' | 'integrate' | 'compute';
4224
- interface ConceptSpec {
4225
- name: string;
4226
- /** Short hints that help the judge; not used for matching. */
4227
- keywords?: string[];
4228
- /** Optional explicit weight; default 1.0. Overrides complexity-derived weight. */
4229
- weight?: number;
4230
- /** Implementation complexity class. Default `render`. */
4231
- complexity?: ConceptComplexity;
4232
- }
4233
- interface ConceptFinding {
4234
- concept: string;
4235
- present: boolean;
4236
- /** 0..10. 10 = production-ready; 7 = functional thin; 4 = partial; 0 = absent. */
4237
- score: number;
4238
- evidence: string;
4239
- severity: Severity;
4240
- }
4241
- interface SemanticConceptJudgeInput {
4242
- /** Full natural-language prompt the agent was handed. */
4243
- userRequest: string;
4244
- /** Rendered HTML the preview returns (UI artifacts). Optional. */
4245
- servedHtml?: string;
4246
- /** Top-level source files from the agent's workdir. */
4247
- sourceFiles: Array<{
4248
- path: string;
4249
- content: string;
4250
- }>;
4251
- /** The expected concept list. */
4252
- expectedConcepts: ConceptSpec[];
4253
- /** Free-form metadata (id, difficulty) to inject into the prompt. */
4254
- artifactLabel?: string;
4255
- artifactDescription?: string;
4256
- }
4257
- interface SemanticConceptJudgeResult {
4258
- kind: 'semantic-concept';
4259
- version: string;
4260
- /** Normalized 0..1 score — mean of per-concept scores / 10. */
4261
- score: number;
4262
- presentCount: number;
4263
- totalCount: number;
4264
- findings: ConceptFinding[];
4265
- summary: string;
4266
- durationMs: number;
4267
- costUsd: number | null;
4268
- /** False on LLM/JSON error — treat as "skipped / unable to judge" in pipelines. */
4269
- available: boolean;
4270
- error?: string;
4271
- }
4272
- /**
4273
- * Score-aggregation strategy. `mean` averages 0-10 scores uniformly.
4274
- * `complexity` applies the default weight table (render=1, integrate=2,
4275
- * compute=2.5) unless a concept has an explicit `weight`. `explicit`
4276
- * honors only `weight` (defaulting to 1 for unspecified).
4277
- */
4278
- type ConceptWeightStrategy = 'mean' | 'complexity' | 'explicit';
4279
- declare const DEFAULT_COMPLEXITY_WEIGHTS: Record<ConceptComplexity, number>;
4280
- interface SemanticConceptJudgeOptions {
4281
- /** Model id to call. Default 'claude-sonnet-4-6' via agent-eval defaults. */
4282
- model?: string;
4283
- /** Per-call timeout. Default 180s. */
4284
- timeoutMs?: number;
4285
- /** Pipeline budget for the prompt (source blob truncation). Default 45000. */
4286
- maxSourceChars?: number;
4287
- /** Per-file cap before inclusion. Default 20000. */
4288
- maxPerFileChars?: number;
4289
- /** HTML cap. Default 30000. */
4290
- maxHtmlChars?: number;
4291
- /** LlmClient config (baseUrl, apiKey, authHeader, …). */
4292
- llm?: LlmClientOptions;
4293
- /**
4294
- * Score aggregation strategy. Default `mean` — uniform average across
4295
- * concepts. Cross-vertical comparisons should use `complexity` to
4296
- * neutralize the integrate-vs-render asymmetry.
4297
- */
4298
- weightConcepts?: ConceptWeightStrategy;
4299
- /** Override the default complexity → weight table. */
4300
- complexityWeights?: Partial<Record<ConceptComplexity, number>>;
4301
- }
4302
- declare const SEMANTIC_CONCEPT_JUDGE_VERSION = "semantic-concept-judge-v1-2026-04-24";
4303
- /**
4304
- * Run the semantic concept judge. Soft-fails to available=false on
4305
- * LLM/JSON errors — callers in a MultiLayerVerifier pipeline can treat
4306
- * that as "skip" rather than "fail."
4307
- */
4308
- declare function runSemanticConceptJudge(input: SemanticConceptJudgeInput, options?: SemanticConceptJudgeOptions): Promise<SemanticConceptJudgeResult>;
4309
- /**
4310
- * Factory: pin LLM options once, return a closure that accepts inputs.
4311
- * Convenient for pipelines that want to share a single LlmClient config.
4312
- */
4313
- declare function createSemanticConceptJudge(options?: SemanticConceptJudgeOptions): (input: SemanticConceptJudgeInput) => Promise<SemanticConceptJudgeResult>;
4314
-
4315
5170
  /**
4316
5171
  * Liveness canaries — cheap statistical checks that catch the failure
4317
5172
  * modes a green test suite never sees.
@@ -5124,4 +5979,4 @@ declare function aggregateTrialsByMode(trials: TrialResult[], opts: {
5124
5979
  mode: AggregatorMode;
5125
5980
  }): TrialAggregate;
5126
5981
 
5127
- export { ActionableSideInfo, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, AgentEvalError, type AggregatorMode, type AlignmentOp, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, Artifact$1 as Artifact, type ArtifactCheck, type Artifact as ArtifactCheckArtifact, type ArtifactResult, type ArtifactValidator, type AutoPrClient, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, BaselineReport, BehaviorAssertion, type BenchmarkReport, BenchmarkRunner, type BenchmarkRunnerConfig, type BisectOptions, type BisectResult, type BisectStep, BudgetBreachError, BudgetGuard, BudgetLedgerEntry, BudgetSpec, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateScenario, type CausalAttributionReport, type CheckResult, type CodeMutationOutcome, type CodeMutationRunner, type CollectedArtifacts, type CommandRunner, type CompletionCriterion, type CompositePolicy, type ConceptComplexity, type ConceptFinding, type ConceptSpec, type ConceptWeightStrategy, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, ContinuousAgreement, ContinuousAgreementOptions, type ContractMetric, type ContractReport, ControlEvalResult, ConvergenceTracker, type CorpusAgreementOptions, type CorpusAgreementPerDimension, type CorpusAgreementReport, type CorpusScoreRecord, type CostEntry, CostLedger, type CostLedgerGeneration, type CostLedgerSnapshot, type CostSummary, CostTracker, type CounterfactualContext, type CounterfactualMutation, type CounterfactualResult, type CounterfactualRunner, type CreateCompositeMutatorOpts, type CreateDefaultReviewerOptions, type CreateSandboxCodeMutatorOpts, type CreateSandboxPoolOpts, type CrossTraceDiff, type CrossTraceDiffOptions, D1ExperimentStore, type D1ExperimentStoreOptions, type D1Like, type D1PreparedStatementLike, DEFAULT_AGENT_SLOS, DEFAULT_COMPLEXITY_WEIGHTS, DEFAULT_FINDERS, DEFAULT_HARNESS_OBJECTIVES, DEFAULT_MUTATORS, DEFAULT_RUN_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, Dataset, DatasetScenario, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DirEntry, type DiscoverPersonasOptions, type DiscoveredPersona, type DriverResult, type DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type ErrorCountPattern, type EvalResult, type EvolutionRound, EvolvableVariant, type ExecutorConfig, type Expectation, type Experiment, type Run as ExperimentRun, type ExperimentStore, ExperimentTracker, type ExportedRewardModel, type ExtractOptions, type ExtractResult, type FactorContribution, type FactorialCell, type FailureClusterConfig, FeedbackLabel, type FeedbackPattern, FeedbackTrajectory, FeedbackTrajectoryStore, type FileChange, FileSystemExperimentStore, type FileSystemExperimentStoreOptions, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, GateDecision, type GhCliClientOptions, type GoldenSeverity, type GoldenSpec, type HarnessAdapter, HarnessConfig, type HarnessExperimentConfig, type HarnessExperimentResult, type HarnessIntervention, type HarnessRunRequest, type HarnessRunResult, type HarnessScenario, type HarnessSelection, type HarnessVariant, type HarnessVariantReport, HeldOutGateConfig, HoldoutAuditor, type HostedJudgeConfig, type HostedJudgeDimension, type HostedJudgeRequest, type HostedJudgeResponse, type HostedRunCriticConfig, type HostedRunScoreRequest, type HostedRunScoreResponse, type HttpGithubClientOptions, type HypothesisManifest, type HypothesisResult, INTENT_MATCH_JUDGE_VERSION, type ImageData, InMemoryExperimentStore, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntegrationGateSurface, type IntegrationInvokeFailureInput, type IntegrationManifestGateInput, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JsonlTrialCache, type JudgeConfig, type JudgeFleetOptions, type JudgeFn, type JudgeInput, type JudgeReplayResult, type JudgeRetryOutcome, type JudgeRetryPolicy, type JudgeRubric, JudgeRunner, type JudgeScore, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, Layer, LayerResult, type LineageKind, type LineageKindResolver, type LineageNode, LineageRecorder, type LiveProofArtifact, type LiveProofConfig, type LiveProofContext, type LiveProofResult, LlmClientOptions, LlmSpan, LockedJsonlAppender, MODEL_PRICING, type MatchResult, type MatcherResult, type MeasurementPolicy, type MergeOptions, MetricsCollector, type MuffledFinder, type MuffledFinding, MultiShotMutateAdapter, MultiShotOptimizationResult, MultiShotRunner, MultiShotScorer, MultiShotTrialResult, type MultiToolchainLayerConfig, MutateAdapter, type MutationAttempt, type MutationChannel, MutationTelemetry, type Mutator, Mutex, Objective, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, PairwiseSteeringOptimizer, type ParaphraseRobustnessScenarioInput, type ParaphraseRobustnessScenarioResult, ParetoResult, type PersonaConfig, type Playbook, type PlaybookEntry, type PoolSlot, ProductClient, type ProductClientConfig, type ProductionEvolveConfig, type ProductionLoopCronConfig, type ProductionLoopDecision, type ProductionLoopRenderContext, type ProductionLoopResult, type ProductionShipConfig, type PromptHandle, PromptRegistry, TrialResult as PromptTrialResult, type ProposeAutomatedPullRequestInput, type ProposeAutomatedPullRequestResult, type ReferenceMatchResult, type ReferenceReplayAdapter, type ReferenceReplayAdapterFn, type ReferenceReplayAdapterLike, type ReferenceReplayAggregate, type ReferenceReplayCandidate, type ReferenceReplayCase, type ReferenceReplayCaseRun, type ReferenceReplayExecutionScenario, type ReferenceReplayItem, type ReferenceReplayMatch, type ReferenceReplayMatchStrategy, type ReferenceReplayMatcher, type ReferenceReplayPromotionDecision, type ReferenceReplayPromotionPolicy, type ReferenceReplayRun, type ReferenceReplayRunContext, type ReferenceReplayRunOptions, type ReferenceReplayRunStore, type ReferenceReplayScenario, type ReferenceReplayScenarioScore, type ReferenceReplayScore, type ReferenceReplayScoreOptions, type ReferenceReplaySplit, type ReferenceReplaySplitComparison, type ReferenceReplaySteeringRowsOptions, ReleaseConfidenceScorecard, ReleaseConfidenceThresholds, type RepoRef, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RouteMap, type RubricDimension, Run$1 as Run, type RunCommandInput, type RunCommandResult, type RunConfig, RunCritic, type RunCriticOptions, type RunDiff, RunFilter, type RunProductionLoopOptions, RunRecord, type RunScore, type RunScoreWeights, RunSplitTag, type RunTrace, SEMANTIC_CONCEPT_JUDGE_VERSION, SandboxDriver, SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type ScanOptions, type Scenario, type ScenarioCost, type ScenarioFile, ScenarioRegistry, type ScenarioResult, type ScoredTarget, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SemanticConceptJudgeInput, type SemanticConceptJudgeOptions, type SemanticConceptJudgeResult, type SeriesConvergenceOptions, type SeriesConvergenceResult, Severity, type SignedManifest, type SignedManifestAlgo, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, Span, type SteeringBundle, type SteeringDelta, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type SteeringRolePrompt, type StepAttribution, type SynthesisReason, type SynthesisTarget, type TestResult, type ThresholdContract, TokenCounter, type TokenSpec, TraceEmitter, TraceEvent, TraceStore, Trajectory, TrajectoryStep, type TrialAggregate, type TrialAttempt, TrialCache, TrialTelemetry, type Turn, type TurnMetrics, type TurnResult, UNIVERSAL_FINDERS, type ValidationContext, type ValidationIssue, type ValidationResult, VariantAggregate, VerifyContext, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkflowTopology, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, adversarialJudge, aggregateRunScore, aggregateTrialsByMode, analyzeAntiSlop, analyzeSeries, attributeCounterfactuals, benjaminiHochberg, bisect, bonferroni, buildReviewerPrompt, byteLengthRange, canaryLeakView, canonicalize, causalAttribution, checkBehavioralCanary, checkCanaries, checkSlos, clamp01, codeExecutionJudge, cohensD, coherenceJudge, collectionPreserved, commitBisect, compareReferenceReplay, compilerJudge, composeValidators, confidenceInterval, containsAll, corpusInterRaterAgreement, corpusInterRaterAgreementFromJudgeScores, createAntiSlopJudge, createCompositeMutator, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createIntentMatchJudge, createSandboxCodeMutator, createSandboxPool, createSemanticConceptJudge, crossTraceDiff, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultJudges, defaultReferenceReplayMatcher, deployGateLayer, discoverPersonas, distillPlaybook, estimateCost, estimateTokens, evaluateContract, evaluateHypothesis, evaluateOracles, executeScenario, expectAgent, exportRewardModel, extractAssetUrls, extractErrorCount, fileContains, fileExists, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findSkipCountsAsPass, flowLayer, formatBenchmarkReport, formatDriverReport, formatFindings, ghCliClient, precision as goldenPrecision, hashContent, hashJson, htmlContainsElement, httpGithubClient, inMemoryReferenceReplayStore, integrationAsi, integrationGateEvals, integrationInvokeFailedPayload, integrationManifestResolvedPayload, integrationManifestValidatedPayload, interRaterReliability, jsonHasKeys, jsonShape, jsonlReferenceReplayStore, keyPreserved, linterJudge, loadScorerFromGrader, localCommandRunner, lowercaseMutator, mannWhitneyU, matchGoldens, mergeLayerResults, mergeSteeringBundle, multiToolchainLayer, normalizeScores, notBlocked, pairedTTest, paraphraseRobustness, paraphraseRobustnessScenarios, partialCredit, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, printDriverSummary, promptBisect, proposeAutomatedPullRequest, proposeSynthesisTargets, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatch, regexMatches, renderMarkdownReport, renderPlaybookMarkdown, renderSteeringText, replayScorerOverCorpus, replayTraceThroughJudge, requiredSampleSize, resetLockedAppendersForTesting, rowCount, rowWhere, runAssertions, runBehavioralCanaries, runCanaries, runCounterfactual, runE2EWorkflow, runExpectations, runHarnessExperiment, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runLiveProof, runProductionLoop, runReferenceReplay, runSelfPlay, runSemanticConceptJudge, scanForMuffledGates, scoreContinuity, scoreReferenceReplay, securityJudge, selectHarnessVariant, sentenceReorderMutator, signManifest, statusAdvanced, summarizeHarnessResults, testJudge, textInSnapshot, toLangfuseEnvelope, toPrometheusText, typoMutator, urlContains, verifyManifest, visualDiff, viteDeployRunner, weightedMean, weightedRecall, whitespaceCollapseMutator, wilcoxonSignedRank, withJudgeRetry, wranglerDeployRunner };
5982
+ export { ANALYST_SEVERITIES, ActionableSideInfo, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, AgentEvalError, type AggregatorMode, type AlignmentOp, type Analyst, type AnalystContext, type AnalystCost, type AnalystFinding, type AnalystHooks, type AnalystInputKind, AnalystRegistry, type AnalystRegistryOptions, type AnalystRequirements, type AnalystRunInputs, type AnalystRunResult, type AnalystRunSummary, type AnalystSeverity, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, Artifact$1 as Artifact, type ArtifactCheck, type Artifact as ArtifactCheckArtifact, type ArtifactResult, type ArtifactValidator, type AutoPrClient, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, BaselineReport, BehaviorAssertion, type BenchmarkReport, BenchmarkRunner, type BenchmarkRunnerConfig, type BisectOptions, type BisectResult, type BisectStep, BudgetBreachError, BudgetGuard, BudgetLedgerEntry, type BudgetPolicy, BudgetSpec, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateScenario, type CausalAttributionReport, type ChatCallOpts, type ChatClient, type ChatRequest, type ChatResponse, type ChatTransport, type CheckResult, type CliBridgeTransportOpts, type CodeMutationOutcome, type CodeMutationRunner, type CollectedArtifacts, type CommandRunner, type CompletionCriterion, type CompositePolicy, type ConceptComplexity, type ConceptFinding, type ConceptSpec, type ConceptWeightStrategy, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, ContinuousAgreement, ContinuousAgreementOptions, type ContractMetric, type ContractReport, ControlEvalResult, ConvergenceTracker, type CorpusAgreementOptions, type CorpusAgreementPerDimension, type CorpusAgreementReport, type CorpusScoreRecord, type CostEntry, CostLedger, type CostLedgerGeneration, type CostLedgerSnapshot, type CostSummary, CostTracker, type CounterfactualContext, type CounterfactualMutation, type CounterfactualResult, type CounterfactualRunner, type CreateChatClientOpts, type CreateCompositeMutatorOpts, type CreateDefaultReviewerOptions, type CreateSandboxCodeMutatorOpts, type CreateSandboxPoolOpts, type CreateTraceAnalystKindOpts, type CrossTraceDiff, type CrossTraceDiffOptions, D1ExperimentStore, type D1ExperimentStoreOptions, type D1Like, type D1PreparedStatementLike, DEFAULT_AGENT_SLOS, DEFAULT_COMPLEXITY_WEIGHTS, DEFAULT_FINDERS, DEFAULT_HARNESS_OBJECTIVES, DEFAULT_MUTATORS, DEFAULT_RUN_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, DEFAULT_TRACE_ANALYST_KINDS, Dataset, DatasetScenario, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DiffPolicy, type DirEntry, type DirectProviderTransportOpts, type DiscoverPersonasOptions, type DiscoveredPersona, type DriverResult, type DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type ErrorCountPattern, type EvalResult, type EvidenceRef, type EvolutionRound, EvolvableVariant, type ExecutorConfig, type Expectation, type Experiment, type Run as ExperimentRun, type ExperimentStore, ExperimentTracker, type ExportedRewardModel, type ExtractOptions, type ExtractResult, FAILURE_MODE_KIND_SPEC, type FactorContribution, type FactorialCell, type FailureClusterConfig, FeedbackLabel, type FeedbackPattern, FeedbackTrajectory, FeedbackTrajectoryStore, type FileChange, FileSystemExperimentStore, type FileSystemExperimentStoreOptions, type FindingsDiff, FindingsStore, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, GateDecision, type GhCliClientOptions, type GoldenSeverity, type GoldenSpec, type HarnessAdapter, HarnessConfig, type HarnessExperimentConfig, type HarnessExperimentResult, type HarnessIntervention, type HarnessRunRequest, type HarnessRunResult, type HarnessScenario, type HarnessSelection, type HarnessVariant, type HarnessVariantReport, HeldOutGateConfig, HoldoutAuditor, type HostedJudgeConfig, type HostedJudgeDimension, type HostedJudgeRequest, type HostedJudgeResponse, type HostedRunCriticConfig, type HostedRunScoreRequest, type HostedRunScoreResponse, type HttpGithubClientOptions, type HypothesisManifest, type HypothesisResult, IMPROVEMENT_KIND_SPEC, INTENT_MATCH_JUDGE_VERSION, type ImageData, InMemoryExperimentStore, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntegrationGateSurface, type IntegrationInvokeFailureInput, type IntegrationManifestGateInput, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JsonlTrialCache, type JudgeAdapterOpts, type JudgeConfig, type JudgeFleetOptions, type JudgeFn, type JudgeInput, type JudgeReplayResult, type JudgeRetryOutcome, type JudgeRetryPolicy, type JudgeRubric, JudgeRunner, type JudgeScore, KNOWLEDGE_GAP_KIND_SPEC, KNOWLEDGE_POISONING_KIND_SPEC, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, Layer, LayerResult, type LineageKind, type LineageKindResolver, type LineageNode, LineageRecorder, type LiveProofArtifact, type LiveProofConfig, type LiveProofContext, type LiveProofResult, LlmCallRequest, LlmCallResult, LlmClientOptions, LlmSpan, LockedJsonlAppender, MODEL_PRICING, type MatchResult, type MatcherResult, type MeasurementPolicy, type MergeOptions, MetricsCollector, type MockTransportOpts, type MuffledFinder, type MuffledFinding, MultiLayerVerifier, MultiShotMutateAdapter, MultiShotOptimizationResult, MultiShotRunner, MultiShotScorer, MultiShotTrialResult, type MultiToolchainLayerConfig, MutateAdapter, type MutationAttempt, type MutationChannel, MutationTelemetry, type Mutator, Mutex, Objective, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, PairwiseSteeringOptimizer, type ParaphraseRobustnessScenarioInput, type ParaphraseRobustnessScenarioResult, ParetoResult, type PersistedFinding, type PersonaConfig, type Playbook, type PlaybookEntry, type PoolSlot, ProductClient, type ProductClientConfig, type ProductionEvolveConfig, type ProductionLoopCronConfig, type ProductionLoopDecision, type ProductionLoopRenderContext, type ProductionLoopResult, type ProductionShipConfig, type PromptHandle, PromptRegistry, TrialResult as PromptTrialResult, type ProposeAutomatedPullRequestInput, type ProposeAutomatedPullRequestResult, RAW_FINDING_SCHEMA_PROMPT, type RawAnalystFinding, RawAnalystFindingSchema, type ReferenceMatchResult, type ReferenceReplayAdapter, type ReferenceReplayAdapterFn, type ReferenceReplayAdapterLike, type ReferenceReplayAggregate, type ReferenceReplayCandidate, type ReferenceReplayCase, type ReferenceReplayCaseRun, type ReferenceReplayExecutionScenario, type ReferenceReplayItem, type ReferenceReplayMatch, type ReferenceReplayMatchStrategy, type ReferenceReplayMatcher, type ReferenceReplayPromotionDecision, type ReferenceReplayPromotionPolicy, type ReferenceReplayRun, type ReferenceReplayRunContext, type ReferenceReplayRunOptions, type ReferenceReplayRunStore, type ReferenceReplayScenario, type ReferenceReplayScenarioScore, type ReferenceReplayScore, type ReferenceReplayScoreOptions, type ReferenceReplaySplit, type ReferenceReplaySplitComparison, type ReferenceReplaySteeringRowsOptions, type RegistryRunOpts, ReleaseConfidenceScorecard, ReleaseConfidenceThresholds, type RepoRef, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RouteMap, type RouterTransportOpts, type RubricDimension, Run$1 as Run, type RunCommandInput, type RunCommandResult, type RunConfig, RunCritic, type RunCriticAdapterOpts, type RunCriticOptions, type RunDiff, RunFilter, type RunProductionLoopOptions, RunRecord, type RunScore, type RunScoreWeights, RunSplitTag, type RunTrace, SEMANTIC_CONCEPT_JUDGE_VERSION, SandboxDriver, SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type SandboxSdkTransportOpts, type ScanOptions, type Scenario, type ScenarioCost, type ScenarioFile, ScenarioRegistry, type ScenarioResult, type ScoredTarget, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SemanticConceptJudgeAdapterOpts, type SemanticConceptJudgeInput, type SemanticConceptJudgeOptions, type SemanticConceptJudgeResult, type SeriesConvergenceOptions, type SeriesConvergenceResult, Severity, type SignedManifest, type SignedManifestAlgo, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, Span, type SteeringBundle, type SteeringDelta, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type SteeringRolePrompt, type StepAttribution, type SynthesisReason, type SynthesisTarget, type TestResult, type ThresholdContract, TokenCounter, type TokenSpec, type TraceAnalystAdapterOpts, type TraceAnalystGolden, type TraceAnalystKindSpec, TraceEmitter, TraceEvent, TraceStore, type TraceToolGroupName, Trajectory, TrajectoryStep, type TrialAggregate, type TrialAttempt, TrialCache, TrialTelemetry, type Turn, type TurnMetrics, type TurnResult, UNIVERSAL_FINDERS, type ValidationContext, type ValidationIssue, type ValidationResult, VariantAggregate, type VerifierAdapterOpts, VerifyContext, VerifyOptions, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkflowTopology, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, adversarialJudge, aggregateRunScore, aggregateTrialsByMode, analyzeAntiSlop, analyzeSeries, attributeCounterfactuals, benjaminiHochberg, bisect, bonferroni, buildReviewerPrompt, buildTraceToolsForGroup, byteLengthRange, canaryLeakView, canonicalize, causalAttribution, checkBehavioralCanary, checkCanaries, checkSlos, clamp01, codeExecutionJudge, cohensD, coherenceJudge, collectionPreserved, commitBisect, compareReferenceReplay, compilerJudge, composeValidators, computeFindingId, confidenceInterval, containsAll, corpusInterRaterAgreement, corpusInterRaterAgreementFromJudgeScores, createAntiSlopJudge, createChatClient, createCompositeMutator, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createIntentMatchJudge, createJudgeAdapter, createRunCriticAdapter, createSandboxCodeMutator, createSandboxPool, createSemanticConceptJudge, createSemanticConceptJudgeAdapter, createTraceAnalystAdapter, createTraceAnalystKind, createVerifierAdapter, crossTraceDiff, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultIsMaterial, defaultJudges, defaultReferenceReplayMatcher, deployGateLayer, diffFindings, discoverPersonas, distillPlaybook, estimateCost, estimateTokens, evaluateContract, evaluateHypothesis, evaluateOracles, executeScenario, expectAgent, exportRewardModel, extractAssetUrls, extractErrorCount, fileContains, fileExists, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findSkipCountsAsPass, flowLayer, formatBenchmarkReport, formatDriverReport, formatFindings, ghCliClient, precision as goldenPrecision, hashContent, hashJson, htmlContainsElement, httpGithubClient, inMemoryReferenceReplayStore, integrationAsi, integrationGateEvals, integrationInvokeFailedPayload, integrationManifestResolvedPayload, integrationManifestValidatedPayload, interRaterReliability, jsonHasKeys, jsonShape, jsonlReferenceReplayStore, keyPreserved, liftSeverity, linterJudge, loadScorerFromGrader, localCommandRunner, lowercaseMutator, makeFinding, mannWhitneyU, matchGoldens, mergeLayerResults, mergeSteeringBundle, multiToolchainLayer, normalizeScores, notBlocked, pairedTTest, paraphraseRobustness, paraphraseRobustnessScenarios, parseRawFinding, partialCredit, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, printDriverSummary, promptBisect, proposeAutomatedPullRequest, proposeSynthesisTargets, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatch, regexMatches, renderMarkdownReport, renderPlaybookMarkdown, renderPriorFindings, renderSteeringText, replayScorerOverCorpus, replayTraceThroughJudge, requiredSampleSize, resetLockedAppendersForTesting, rowCount, rowWhere, runAssertions, runBehavioralCanaries, runCanaries, runCounterfactual, runE2EWorkflow, runExpectations, runHarnessExperiment, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runLiveProof, runProductionLoop, runReferenceReplay, runSelfPlay, runSemanticConceptJudge, scanForMuffledGates, scoreContinuity, scoreReferenceReplay, securityJudge, selectHarnessVariant, sentenceReorderMutator, signManifest, statusAdvanced, summarizeHarnessResults, testJudge, textInSnapshot, toLangfuseEnvelope, toPrometheusText, typoMutator, urlContains, verifyManifest, visualDiff, viteDeployRunner, weightedMean, weightedRecall, whitespaceCollapseMutator, wilcoxonSignedRank, withJudgeRetry, wranglerDeployRunner };