@remnic/bench 9.21.0 → 9.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -125,6 +125,15 @@ interface BenchRecallSupportRequest {
125
125
  }
126
126
  interface BenchResponder {
127
127
  respond(question: string, recalledText: string, control?: BenchPhaseControl): Promise<BenchResponse>;
128
+ /**
129
+ * Deterministic non-secret fingerprint of the responder's identity
130
+ * (e.g. model name + provider base URL hash). Used by the published
131
+ * harness to pin paired-run replay keys to a concrete responder so a
132
+ * pair of systems with no `systemProvider` cannot cross-replay through
133
+ * a shared cache. Optional: responders that do not declare an identity
134
+ * disable the replay cache and always invoke `respond` directly.
135
+ */
136
+ identity?(): string;
128
137
  }
129
138
  interface BenchJudgeResult {
130
139
  score: number;
@@ -590,6 +599,13 @@ interface BenchmarkDefinition {
590
599
  runnerAvailable: boolean;
591
600
  meta: BenchmarkMeta;
592
601
  }
602
+ interface PairedAnswerReplayEntry {
603
+ sourceRuntimeProfile: BenchRuntimeProfile | null;
604
+ finalAnswer: string;
605
+ answeredText: string;
606
+ model?: string;
607
+ }
608
+ type PairedAnswerReplayCache = Map<string, PairedAnswerReplayEntry>;
593
609
  interface RunBenchmarkOptions {
594
610
  mode?: BenchmarkMode;
595
611
  datasetDir?: string;
@@ -625,6 +641,12 @@ interface RunBenchmarkOptions {
625
641
  * `noJudgeCache` is true. The directory is created on demand.
626
642
  */
627
643
  judgeCacheDir?: string;
644
+ /**
645
+ * Ephemeral cross-profile answer cache for a paired benchmark matrix. A
646
+ * cached answer may only be reused when the responder-facing input is
647
+ * identical and it originated from a different runtime profile.
648
+ */
649
+ pairedAnswerReplayCache?: PairedAnswerReplayCache;
628
650
  /** Called after each task completes for progress logging and partial result tracking. */
629
651
  onTaskComplete?: (task: TaskResult, completedCount: number, totalCount?: number) => void;
630
652
  }
@@ -2617,7 +2639,7 @@ interface ProviderResponderOptions {
2617
2639
  contextBudgetChars?: number;
2618
2640
  promptBudgetChars?: number;
2619
2641
  }
2620
- declare function createResponderFromProvider(provider: LlmProvider, options?: ProviderResponderOptions): BenchResponder;
2642
+ declare function createResponderFromProvider(provider: LlmProvider, options?: ProviderResponderOptions, responderIdentity?: string): BenchResponder;
2621
2643
  declare function createProviderBackedResponder(config: ProviderFactoryConfig, providerInstance?: LlmProvider): BenchResponder;
2622
2644
  declare function createProviderBackedJudge(config: ProviderFactoryConfig, providerInstance?: LlmProvider): BenchJudge;
2623
2645
  declare function createProviderBackedAmaBenchRecommendedJudge(config: ProviderFactoryConfig, providerInstance?: LlmProvider): BenchJudge;
@@ -5781,4 +5803,4 @@ declare function checkCodingGraphRegression(report: CodingGraphBenchReport, base
5781
5803
  */
5782
5804
  declare function buildBaselineFromReport(report: CodingGraphBenchReport, note: string): CodingGraphBaseline;
5783
5805
 
5784
- export { AMA_BENCH_DIAGNOSTIC_VARIANTS, ASSISTANT_AGENT_CONFIG_KEY, ASSISTANT_JUDGE_CONFIG_KEY, ASSISTANT_MEETING_PREP_SCENARIOS, ASSISTANT_MEETING_PREP_SMOKE_SCENARIOS, ASSISTANT_MORNING_BRIEF_SCENARIOS, ASSISTANT_MORNING_BRIEF_SMOKE_SCENARIOS, ASSISTANT_NEXT_BEST_ACTION_SCENARIOS, ASSISTANT_NEXT_BEST_ACTION_SMOKE_SCENARIOS, ASSISTANT_RUBRIC_DIMENSIONS, ASSISTANT_RUBRIC_ID_KEY, ASSISTANT_SEEDS_CONFIG_KEY, ASSISTANT_SPOT_CHECK_DIR_KEY, ASSISTANT_SYNTHESIS_SCENARIOS, ASSISTANT_SYNTHESIS_SMOKE_SCENARIOS, type AblationConfigOverrides, type AbstentionRetrievalCase, type AggregateMetrics, type AmaBenchDiagnosticAdapterOptions, type AmaBenchDiagnosticAnswererMode, type AmaBenchDiagnosticBreakdown, type AmaBenchDiagnosticMatrixArtifact, type AmaBenchDiagnosticRecallMode, type AmaBenchDiagnosticRunContext, type AmaBenchDiagnosticTaskEvidence, type AmaBenchDiagnosticTaskRow, type AmaBenchDiagnosticVariant, type AmaBenchDiagnosticVariantSummary, type AnthropicProviderConfig, type AssistantAgent, type AssistantMemoryFact, type AssistantMemoryGraph, type AssistantRubricDimension, type AssistantRubricRequest, type AssistantRubricScores, type AssistantRunnerOptions, type AssistantScenario, type AssistantStance, type AttackRecallOptions, type AttackRetrievalHit, type AttackerMode, BENCHMARK_ARTIFACT_SCHEMA_VERSION, BENCHMARK_INTEGRITY_META_SCHEMA, BENCHMARK_REPRO_MANIFEST_FILENAME, BENCHMARK_REPRO_MANIFEST_SCHEMA_VERSION, BENCHMARK_RESULT_SCHEMA, BENCHMARK_SPLIT_TYPES, BUILD_WEEK_EVIDENCE_RECEIPT_SCHEMA_VERSION, BUILD_WEEK_LIMITATIONS, type BaselineRow, type BaselineScenario, type BeamDatasetPreview, type BenchConfig, type BenchJudge, type BenchJudgeResult, type BenchMemoryAdapter, type BenchModelSource, type BenchReasoningEffort, type BenchRecallLineageStatus, type BenchRecallOptions, type BenchRecallSupportAssessment, type BenchRecallSupportRequest, type BenchRecallSupportStatus, type BenchRecallTrace, type BenchRecallTraceCoreCapture, type BenchRecallTraceLcmCandidate, type BenchRecallTraceRange, type BenchRecallTraceSection, type BenchRecallTraceSelection, type BenchRecallWithTraceResult, type BenchResponder, type BenchResponse, type BenchRuntimeProfile, type BenchTier, type BenchmarkArtifact, type BenchmarkArtifactEnvironment, type BenchmarkArtifactHardware, type BenchmarkArtifactJudgeCalibration, type BenchmarkArtifactPerTaskScore, type BenchmarkArtifactSystem, type BenchmarkArtifactTier, type BenchmarkCategory, type BenchmarkDefinition, type BenchmarkIntegrityMeta, type BenchmarkMeta, type BenchmarkMode, type BenchmarkReport, type BenchmarkReproManifest, type BenchmarkReproManifestDataset, type BenchmarkReproManifestFile, type BenchmarkReproManifestResult, type BenchmarkResult, type BenchmarkSplitType, type BenchmarkStatus, type BenchmarkSuiteResult, type BenchmarkTier, type BootstrapKappaOptions, type BootstrapKappaResult, type BuildBenchmarkArtifactInput, type BuildBenchmarkPublishFeedOptions, type BuildBenchmarkReproManifestOptions, type BuildBuildWeekEvidenceReceiptOptions, type BuildWeekEvidenceReceipt, type BuildWeekEvidenceReceiptProvider, type BuildWeekLimitationCode, type BuiltInProvider, CALIBRATION_SLICE_SIZE, CANARY_FIXED_RECALL, CANARY_SCORE_FLOOR, DEFAULT_10K_FIXTURE as CODING_GRAPH_10K_FIXTURE, CODING_GRAPH_BENCH_SCHEMA_VERSION, DEFAULT_TOLERANCE_PERCENT as CODING_GRAPH_DEFAULT_TOLERANCE, MIN_ITERATIONS as CODING_GRAPH_MIN_ITERATIONS, DEFAULT_SMOKE_FIXTURE as CODING_GRAPH_SMOKE_FIXTURE, type CalibrationAnswer, type CalibrationVerdictPair, type CanaryAdapterOptions, type CanaryFloorCheck, type CaptureLoCoMoRetrievalTraceOptions, type ClaudeCliProviderConfig, type CodexCliNativeUsage, type CodexCliProviderConfig, CodexCreditAccountingError, type CodexCreditBudgetConfig, CodexCreditDispatchError, type CodexCreditReceipt, type CodexCreditReceiptScope, type CodexCreditReconciliationReceipt, type CodingGraphBaseline, type CodingGraphBenchConfig, type CodingGraphBenchReport, type MachineFingerprint as CodingGraphMachineFingerprint, type CodingGraphMetricKey, type RegressionMetricDetail as CodingGraphRegressionDetail, type RegressionMetricKey as CodingGraphRegressionKey, type RegressionGateResult as CodingGraphRegressionResult, type CohenKappaResult, type ComparisonMetricDelta, type ComparisonResult, type CompletionOpts, type CompletionResult, type ConfidenceInterval, type ContaminationCheckResult, type ContaminationEntry, type ContaminationManifest, type CustomBenchmarkScoring, type CustomBenchmarkSpec, type CustomBenchmarkTask, DEFAULT_ABLATION_BENCHMARK, DEFAULT_ABLATION_BOOTSTRAP_SEED, DEFAULT_ASSISTANT_RUBRIC_ID, DEFAULT_BASELINE_SCENARIOS, DEFAULT_JUDGE_BINARIZATION_THRESHOLD, DEFAULT_KAPPA_BOOTSTRAP_SAMPLES, DEFAULT_KAPPA_CONFIDENCE_LEVEL, DEFAULT_OPENAI_RESPONSES_JUDGE_MODEL, type DatasetSource, type DiagnoseLoComoProfileDeltaOptions, type DiagnoseLoComoRecallDeltaOptions, type DiscoveredModel, EMPTY_CONTAMINATION_MANIFEST, type EffectSizeInterpretation, type EffectSizeSummary, type ExplainResult, type ExtractedEntity, type ExtractedLink, type ExtractedPage, type ExtractionAttackOptions, type ExtractionAttackResult, type ExtractionAttackTarget, type FixtureGenerator, type FixtureOutput, type FixtureVariant, GENERAL_ANSWER_JUDGE_RUBRIC, type GeneratedFile, type GeneratedRepo, type GoldEntity, type GoldEntityType, type GoldGraph, type GoldLink, type GoldPage, type HarnessRng, INTEGRITY_CIPHER_ALGORITHM, INTEGRITY_HASH_ALGORITHM, INTEGRITY_META_FIELDS, type IngestionBenchAdapter, type IngestionLog, JUDGE_CALIBRATION_KAPPA_THRESHOLD, JUDGE_CALIBRATION_PROTOCOL_VERSION, type JudgeCalibrationCheckpointProvenance, type JudgeCalibrationIdentities, type JudgeCalibrationResult, type JudgeCategory, type KappaConfidenceInterval, LOCAL_LAB_PROVIDER_KINDS, LOCOMO_DATASET_FILENAMES, LOCOMO_FULL_TASK_COUNT, LOCOMO_RECALL_DIFF_LINE_LIMIT, LOCOMO_RECALL_EXCERPT_CHARS, LOCOMO_RETRIEVAL_TRACE_BUDGET_VERSION, LOCOMO_RETRIEVAL_TRACE_DELTA_SCHEMA_VERSION, LOCOMO_RETRIEVAL_TRACE_SCHEMA_VERSION, LOCOMO_RETRIEVAL_TRACE_SELECTION_VERSION, LONG_MEM_EVAL_DATASET_FILENAMES, type LeaderboardArtifactWrite, type LettaAdapterConfig, LettaMemCorrectAdapter, type LlmJudge, type LlmProvider, type LoCoMoCategory, type LoCoMoRetrievalMechanism, type LoCoMoRetrievalMechanismSummary, type LoCoMoRetrievalSessionReceipt, type LoCoMoRetrievalStructuralTrace, type LoCoMoRetrievalTaskDelta, type LoCoMoRetrievalTaskReceipt, type LoCoMoRetrievalTraceCoreCaptureReceipt, type LoCoMoRetrievalTraceDeltaReport, type LoCoMoRetrievalTraceProfile, type LoCoMoRetrievalTraceReceipt, type LoCoMoRetrievalTraceSelectionManifest, type LoCoMoRetrievalTraceSelector, type LoCoMoStructuralMultisetDelta, type LoComoCategoryDelta, type LoComoFinalContextRegression, type LoComoMetricDelta, type LoComoProfileArtifactEvidence, type LoComoProfileDeltaReport, type LoComoRawResultEvidence, type LoComoRecallCategoryDelta, type LoComoRecallContextSummary, type LoComoRecallDeltaReport, type LoComoRecallLineDelta, type LoComoRecallLineEvidence, type LoComoRecallMetricDelta, type LoComoRecallResultProvenance, type LoComoRecallTextDigest, type LoComoTaskRegression, type LoadDatasetOptions, type LoadSealedQrelsOptions, type LoadedDataset, type LoadedJudgeCalibrationState, type LocalLabManifest, type LocalLabManifestNotes, type LocalLabPhase, type LocalLabPhaseDescriptor, type LocalLabPhaseExecute, type LocalLabPhaseName, type LocalLabPhaseOutcome, LocalLabPreflightError, type LocalLabPreflightFailure, type LocalLabPreflightInput, type LocalLabPreflightOptions, type LocalLabPreflightResult, type LocalLabPreflightSuccess, type LocalLabProviderKind, type LocalLabRoleConfig, type LocalLlmProviderConfig, MEMCORRECT_CORRECTION_ACCEPTANCE_RUBRIC, MEMCORRECT_CORRECTION_ACCEPTANCE_RUBRIC_VERSION, MEMCORRECT_STALE_HARM_RUBRIC, MEMCORRECT_STALE_HARM_RUBRIC_VERSION, MEMORY_EVAL_DIMENSIONS, MEMORY_EVAL_PUBLIC_LINE, MIN_CALIBRATION_SOURCE_TASKS, MITIGATED_BASELINE_SCENARIOS, type McpArgumentSemantic, type McpBackendErrorCode, type McpBackendResult, type McpBenchMemoryAdapter, type McpConformanceResult, type McpHttpTransportConfig, type McpListedTool, type McpMemCorrectAdapter, type McpMemoryAdapterOptions, McpMemoryBackendError, type McpMemoryToolMapping, type McpMemoryTransportConfig, type McpStdioTransportConfig, type McpToolCallResult, type McpToolClient, type McpToolMappingEntry, type McpToolMappingValue, type McpToolOperation, type Mem0AdapterConfig, Mem0MemCorrectAdapter, type MemCorrectGeneratorOptions, type MemCorrectJudgeRequest, type MemCorrectJudgeResult, type MemCorrectSystemAdapter, type MemoryEvalCategory, type MemoryEvalDimension, type MemoryEvalDimensionId, type MemoryEvalMetric, type MemoryGraph, type MemoryStats, type MemorySystem, type Message, type MetricAggregate, type MicroMetric, MissingCredentialError, type MitigatedBaselineConfig, type MitigatedTargetConfig, type MultipleChoiceQuestion, OPENAI_RESPONSES_JUDGE_RUBRIC_VERSION, OTHER_NAMESPACE_MEMORIES, type OllamaProviderConfig, type OpenAiCompatibleProviderConfig, OpenAiResponsesJudgeError, type OpenAiResponsesJudgeErrorCode, type OpenAiResponsesJudgeTelemetry, OpenAiResponsesProvider, type OpenAiResponsesProviderConfig, type OpenAiResponsesVerdict, type OpenAiResponsesVerdictResult, PROCEDURAL_REAL_SCENARIOS, PROCEDURAL_REAL_SCENARIOS_SMOKE, PUBLISHED_BENCHMARK_ARTIFACT_IDS, type PersonalizationRetrievalCase, type PreflightDiscoveredModel, type ProceduralAblationArtifact, type ProceduralAblationPerCase, type ProceduralAblationScenario, type ProceduralRealScenario, type ProceduralRealScenarioCategory, type ProviderBaseConfig, type ProviderConfig, type ProviderDiscoveryResult, type ProviderFactoryConfig, type PublishSkipReason, type PublishSkipRecord, type PublishedBenchmarkFeed, type PublishedBenchmarkFeedEntry, type PublishedBenchmarkId, REQUIRED_FRONTMATTER_FIELDS, type RecallMetrics, type RecoveredMemory, type RegressionDetail, type RegressionGateResult$1 as RegressionGateResult, type RemnicAdapterOptions, type ReportCardProvenanceContext, type ResolveBenchRuntimeProfileOptions, type ResolvedBenchRuntimeProfile, type ResolvedLocalLabProfile, type ResolvedLocalLabRole, type ResolvedRunBenchmarkOptions, type RotatedChoices, type RunBenchmarkOptions, type RunJudgeCalibrationOptions, type RunProceduralAblationCliArgs, type RunProceduralAblationOptions, type RunSequentialPhasesOptions, SCHEMA_TIER_FIXTURE, SCHEMA_TIER_SMOKE_FIXTURE, SEALED_PROMPT_REGISTRY, SINGLE_FLAG_ABLATION_MATRIX, SYNTHETIC_MEMORIES, type SanitizedDiagnosticProvider, type SavedBaseline, type SchemaTierCorpus, type SchemaTierFixture, type SchemaTierName, type SchemaTierPage, type SchemaTierPageFrontmatter, type SealedArtifact, type SealedJudgeDecision, type SealedJudgeInput, type SealedQrelsArtifact, type SealedQrelsHandle, type SealedRubric, type SearchResult, type SeededMemory, type SeededRng, type SequentialPhaseHooks, type SingleFlagAblationCell, type SingleFlagAblationId, type SpotCheckLogger, type StatisticalReport, type StructuredJudge, StructuredJudgeError, type StructuredJudgeErrorCode, type StructuredJudgeProvider, type StructuredJudgeTelemetry, type StructuredJudgeVerdict, type StructuredJudgeVerdictResult, type StructuredVerdictRequest, type SyntheticEdge, type SyntheticEmailIngestionAdapterOptions, type SyntheticFileIR, type SyntheticRepoConfig, type SyntheticSymbol, type SyntheticTargetOptions, type TaskResult, type TaskTokenUsage, type TemporalRetrievalCase, type ThirdPartyAdapterConfig, type TierDetail, type TimelineEntry, type TokenUsage, type WallMetric, type WriteBenchmarkArtifactResult, type ZepAdapterConfig, ZepMemCorrectAdapter, addContaminationEntry, aggregateTaskScores, answerBenchmarkQuestion, assertCanaryUnderFloor, assertIntegrityMetaPresent, assertPublishableIntegrity, assertSha256Hex, assistantMeetingPrepDefinition, assistantMorningBriefDefinition, assistantNextBestActionDefinition, assistantSynthesisDefinition, backlinkF1, binarizeJudgeScore, bootstrapCohensKappaConfidenceInterval, bootstrapMeanConfidenceInterval, buildAmaBenchDiagnosticMatrixArtifact, buildAmaBenchDiagnosticVariantSummary, buildAmaBenchLeaderboardRows, buildBaselineFromReport, buildBenchmarkArtifact, buildBenchmarkArtifactFilename, buildBenchmarkPublishFeed, buildBenchmarkReproManifest, buildBenchmarkRunSeeds, buildBuildWeekEvidenceReceipt, buildCodexCreditReceipt, buildJudgePayload, buildOracleTrajectoryRecall, buildProviderFreeLoCoMoRetrievalConfig, buildSchemaTierFixture, buildSchemaTierSmokeFixture, calculateCodexBudgetUnits, calendarFixture, canonicalJsonStringify, captureLoCoMoRetrievalTrace, captureMachineFingerprint, chatFixture, checkCodingGraphRegression, checkDatasetContamination, checkRegression, clampScore, cohensD, compareResults, computeCohensKappa, computeSealHash, containsAnswer, createSeededRng$1 as createAdamSeededRng, createAmaBenchDiagnosticAdapter, createAnthropicProvider, createCanaryAdapter, createClaudeCliProvider, createCodexCliProvider, createSeededRng as createCodingGraphSeededRng, createDeterministicSpotCheckLogger, createGatewayResponder, createLightweightAdapter, createLiteLlmProvider, createLocalLlmProvider, createMcpDemoMemCorrectAdapter, createMcpDemoMemoryAdapter, createMcpMemCorrectAdapter, createMcpMemoryAdapter, createMitigatedTarget, createOllamaProvider, createOpenAiCompatibleProvider, createOpenAiResponsesBenchJudge, createOpenAiResponsesProvider, createSeededRandom as createProceduralAblationSeededRandom, createProvider, createProviderBackedAmaBenchRecommendedJudge, createProviderBackedJudge, createProviderBackedResponder, createProviderBackedStructuredJudge, createRemnicAdapter, createResponderFromProvider, createSeededRng$2 as createSeededRng, createSpotCheckFileLogger, createStructuredBenchJudge, createStructuredJudgeFromProvider, createSyntheticEmailIngestionAdapter, createSyntheticTarget, createTimeoutGuardedAdapter, defaultBenchmarkBaselineDir, defaultBenchmarkPublishPath, deleteBenchmarkResults, diagnoseLoCoMoRetrievalTraceDelta, diagnoseLoComoProfileDelta, diagnoseLoComoRecallDelta, discoverAllProviders, discoveryEndpointFor, emailFixture, entityRecall, exactMatch, extractMetrics as extractCodingGraphMetrics, extractMarkdownSectionsByTitle, f1Score, fixtureToAblationScenarios, formatHandoffNote, formatMissingDatasetError, generateReport, generateSyntheticRepo, getAblationCell, getBenchmark, getBenchmarkLowerIsBetter, getGitSha, getMemoryEvalDimension, getProviderBackedJudgePromptIdentity, getRemnicVersion, hashBenchmarkArtifact, hashBytes, hashCanonicalJson, hashOrderedQuestionIds, hashString, integrityMetaIsComplete, interpretEffectSize, isAmaBenchUnknownLikeAnswer, isContaminationEntry, isContaminationManifest, isSealedQrelsArtifact, isSha256Hex, isStructuredJudgeProvider, judgeMemCorrectCorrectionAcceptance, judgeMemCorrectStaleMemoryHarm, linkMatches, listBenchmarkBaselines, listBenchmarkResults, listBenchmarks, listMemoryEvalBenchmarkIds, listMemoryEvalDimensions, llmJudgeScore, llmJudgeScoreDetailed, loadAblationFixture, loadBaseline, loadBeamDatasetPreview, loadBenchmarkArtifact, loadBenchmarkBaseline, loadBenchmarkReportCardProvenance, loadBenchmarkResult, loadCustomBenchmarkFile, loadJudgeCalibrationState, loadLoCoMo10, loadLocalLabManifest, loadLongMemEvalS, loadSealKeyFromEnv, loadSealedQrels, loadSealedRubric, matchEntity, mergeContaminationManifests, openSeal, orchestrateBenchmarkRuns, pairedDeltaConfidenceInterval, parseBenchmarkArtifact, parseCodexJsonlUsage, parseCustomBenchmark, parseLocalLabManifest, parseRubricResponse, parseSealedQrels, pickStableQualifiedName, precisionAtK, preflightLoCoMoRetrievalTraceCapture, preflightLocalLabRole, projectFolderFixture, recallAtK, reconcileCodexCreditLedger, redactBenchmarkResultSecrets, renderBaselineMarkdown, renderBenchmarkResultExport, renderLoComoProfileDeltaMarkdown, renderLoComoRecallDeltaMarkdown, renderMemorySummaryForJudge, renderMemoryViewForAgent, resolveAssistantAgent, resolveAssistantRubricId, resolveAssistantSeeds, resolveAssistantSpotCheckDir, resolveBenchRuntimeProfile, resolveBenchmarkPhaseTimeoutMs, resolveBenchmarkProgressLogging, resolveBenchmarkResultReference, resolveBenchmarkRunCount, resolveCodexCreditBudgetConfig, resolveLocalLabJudgeProviderConfig, resolveLocalLabProfile, resolveLocalLabRole, resolveStructuredJudge, rotateDistractors, rougeL, runAssistantBenchmark, runAssistantMeetingPrepBenchmark, runAssistantMorningBriefBenchmark, runAssistantNextBestActionBenchmark, runAssistantSynthesisBenchmark, runBaseline, runBenchSuite, runBenchmark, runCodingGraphBenchmark, runCustomBenchmarkFile, runExplain, runExtractionAttack, runJudgeCalibration, runMitigatedBaseline, runProceduralAblation, runProceduralAblationCli, runSealedJudge, runSequentialPhases, runWithinCodexCreditBudget, safeHexEqual, sanitizeLoComoResultReference, saveBaseline, saveBenchmarkBaseline, schemaCompleteness, sealPayload, selectAmaBenchDiagnosticVariants, selectCalibrationSlice, selectFixtureVariant, serializeBenchmarkArtifact, serializeBuildWeekEvidenceReceipt, serializeJsonl, serializeLoCoMoRetrievalTraceDelta, serializeLoCoMoRetrievalTraceReceipt, serializeSealedQrels, shuffleTasks, timed, verifyRubricDigest, writeBenchmarkArtifact, writeBenchmarkPublishFeed, writeBenchmarkReproManifest, writeBenchmarkResult, writeBuildWeekEvidenceReceipt, writeJudgeCalibrationState, writeLeaderboardArtifactsForResult, zeroScores };
5806
+ export { AMA_BENCH_DIAGNOSTIC_VARIANTS, ASSISTANT_AGENT_CONFIG_KEY, ASSISTANT_JUDGE_CONFIG_KEY, ASSISTANT_MEETING_PREP_SCENARIOS, ASSISTANT_MEETING_PREP_SMOKE_SCENARIOS, ASSISTANT_MORNING_BRIEF_SCENARIOS, ASSISTANT_MORNING_BRIEF_SMOKE_SCENARIOS, ASSISTANT_NEXT_BEST_ACTION_SCENARIOS, ASSISTANT_NEXT_BEST_ACTION_SMOKE_SCENARIOS, ASSISTANT_RUBRIC_DIMENSIONS, ASSISTANT_RUBRIC_ID_KEY, ASSISTANT_SEEDS_CONFIG_KEY, ASSISTANT_SPOT_CHECK_DIR_KEY, ASSISTANT_SYNTHESIS_SCENARIOS, ASSISTANT_SYNTHESIS_SMOKE_SCENARIOS, type AblationConfigOverrides, type AbstentionRetrievalCase, type AggregateMetrics, type AmaBenchDiagnosticAdapterOptions, type AmaBenchDiagnosticAnswererMode, type AmaBenchDiagnosticBreakdown, type AmaBenchDiagnosticMatrixArtifact, type AmaBenchDiagnosticRecallMode, type AmaBenchDiagnosticRunContext, type AmaBenchDiagnosticTaskEvidence, type AmaBenchDiagnosticTaskRow, type AmaBenchDiagnosticVariant, type AmaBenchDiagnosticVariantSummary, type AnthropicProviderConfig, type AssistantAgent, type AssistantMemoryFact, type AssistantMemoryGraph, type AssistantRubricDimension, type AssistantRubricRequest, type AssistantRubricScores, type AssistantRunnerOptions, type AssistantScenario, type AssistantStance, type AttackRecallOptions, type AttackRetrievalHit, type AttackerMode, BENCHMARK_ARTIFACT_SCHEMA_VERSION, BENCHMARK_INTEGRITY_META_SCHEMA, BENCHMARK_REPRO_MANIFEST_FILENAME, BENCHMARK_REPRO_MANIFEST_SCHEMA_VERSION, BENCHMARK_RESULT_SCHEMA, BENCHMARK_SPLIT_TYPES, BUILD_WEEK_EVIDENCE_RECEIPT_SCHEMA_VERSION, BUILD_WEEK_LIMITATIONS, type BaselineRow, type BaselineScenario, type BeamDatasetPreview, type BenchConfig, type BenchJudge, type BenchJudgeResult, type BenchMemoryAdapter, type BenchModelSource, type BenchReasoningEffort, type BenchRecallLineageStatus, type BenchRecallOptions, type BenchRecallSupportAssessment, type BenchRecallSupportRequest, type BenchRecallSupportStatus, type BenchRecallTrace, type BenchRecallTraceCoreCapture, type BenchRecallTraceLcmCandidate, type BenchRecallTraceRange, type BenchRecallTraceSection, type BenchRecallTraceSelection, type BenchRecallWithTraceResult, type BenchResponder, type BenchResponse, type BenchRuntimeProfile, type BenchTier, type BenchmarkArtifact, type BenchmarkArtifactEnvironment, type BenchmarkArtifactHardware, type BenchmarkArtifactJudgeCalibration, type BenchmarkArtifactPerTaskScore, type BenchmarkArtifactSystem, type BenchmarkArtifactTier, type BenchmarkCategory, type BenchmarkDefinition, type BenchmarkIntegrityMeta, type BenchmarkMeta, type BenchmarkMode, type BenchmarkReport, type BenchmarkReproManifest, type BenchmarkReproManifestDataset, type BenchmarkReproManifestFile, type BenchmarkReproManifestResult, type BenchmarkResult, type BenchmarkSplitType, type BenchmarkStatus, type BenchmarkSuiteResult, type BenchmarkTier, type BootstrapKappaOptions, type BootstrapKappaResult, type BuildBenchmarkArtifactInput, type BuildBenchmarkPublishFeedOptions, type BuildBenchmarkReproManifestOptions, type BuildBuildWeekEvidenceReceiptOptions, type BuildWeekEvidenceReceipt, type BuildWeekEvidenceReceiptProvider, type BuildWeekLimitationCode, type BuiltInProvider, CALIBRATION_SLICE_SIZE, CANARY_FIXED_RECALL, CANARY_SCORE_FLOOR, DEFAULT_10K_FIXTURE as CODING_GRAPH_10K_FIXTURE, CODING_GRAPH_BENCH_SCHEMA_VERSION, DEFAULT_TOLERANCE_PERCENT as CODING_GRAPH_DEFAULT_TOLERANCE, MIN_ITERATIONS as CODING_GRAPH_MIN_ITERATIONS, DEFAULT_SMOKE_FIXTURE as CODING_GRAPH_SMOKE_FIXTURE, type CalibrationAnswer, type CalibrationVerdictPair, type CanaryAdapterOptions, type CanaryFloorCheck, type CaptureLoCoMoRetrievalTraceOptions, type ClaudeCliProviderConfig, type CodexCliNativeUsage, type CodexCliProviderConfig, CodexCreditAccountingError, type CodexCreditBudgetConfig, CodexCreditDispatchError, type CodexCreditReceipt, type CodexCreditReceiptScope, type CodexCreditReconciliationReceipt, type CodingGraphBaseline, type CodingGraphBenchConfig, type CodingGraphBenchReport, type MachineFingerprint as CodingGraphMachineFingerprint, type CodingGraphMetricKey, type RegressionMetricDetail as CodingGraphRegressionDetail, type RegressionMetricKey as CodingGraphRegressionKey, type RegressionGateResult as CodingGraphRegressionResult, type CohenKappaResult, type ComparisonMetricDelta, type ComparisonResult, type CompletionOpts, type CompletionResult, type ConfidenceInterval, type ContaminationCheckResult, type ContaminationEntry, type ContaminationManifest, type CustomBenchmarkScoring, type CustomBenchmarkSpec, type CustomBenchmarkTask, DEFAULT_ABLATION_BENCHMARK, DEFAULT_ABLATION_BOOTSTRAP_SEED, DEFAULT_ASSISTANT_RUBRIC_ID, DEFAULT_BASELINE_SCENARIOS, DEFAULT_JUDGE_BINARIZATION_THRESHOLD, DEFAULT_KAPPA_BOOTSTRAP_SAMPLES, DEFAULT_KAPPA_CONFIDENCE_LEVEL, DEFAULT_OPENAI_RESPONSES_JUDGE_MODEL, type DatasetSource, type DiagnoseLoComoProfileDeltaOptions, type DiagnoseLoComoRecallDeltaOptions, type DiscoveredModel, EMPTY_CONTAMINATION_MANIFEST, type EffectSizeInterpretation, type EffectSizeSummary, type ExplainResult, type ExtractedEntity, type ExtractedLink, type ExtractedPage, type ExtractionAttackOptions, type ExtractionAttackResult, type ExtractionAttackTarget, type FixtureGenerator, type FixtureOutput, type FixtureVariant, GENERAL_ANSWER_JUDGE_RUBRIC, type GeneratedFile, type GeneratedRepo, type GoldEntity, type GoldEntityType, type GoldGraph, type GoldLink, type GoldPage, type HarnessRng, INTEGRITY_CIPHER_ALGORITHM, INTEGRITY_HASH_ALGORITHM, INTEGRITY_META_FIELDS, type IngestionBenchAdapter, type IngestionLog, JUDGE_CALIBRATION_KAPPA_THRESHOLD, JUDGE_CALIBRATION_PROTOCOL_VERSION, type JudgeCalibrationCheckpointProvenance, type JudgeCalibrationIdentities, type JudgeCalibrationResult, type JudgeCategory, type KappaConfidenceInterval, LOCAL_LAB_PROVIDER_KINDS, LOCOMO_DATASET_FILENAMES, LOCOMO_FULL_TASK_COUNT, LOCOMO_RECALL_DIFF_LINE_LIMIT, LOCOMO_RECALL_EXCERPT_CHARS, LOCOMO_RETRIEVAL_TRACE_BUDGET_VERSION, LOCOMO_RETRIEVAL_TRACE_DELTA_SCHEMA_VERSION, LOCOMO_RETRIEVAL_TRACE_SCHEMA_VERSION, LOCOMO_RETRIEVAL_TRACE_SELECTION_VERSION, LONG_MEM_EVAL_DATASET_FILENAMES, type LeaderboardArtifactWrite, type LettaAdapterConfig, LettaMemCorrectAdapter, type LlmJudge, type LlmProvider, type LoCoMoCategory, type LoCoMoRetrievalMechanism, type LoCoMoRetrievalMechanismSummary, type LoCoMoRetrievalSessionReceipt, type LoCoMoRetrievalStructuralTrace, type LoCoMoRetrievalTaskDelta, type LoCoMoRetrievalTaskReceipt, type LoCoMoRetrievalTraceCoreCaptureReceipt, type LoCoMoRetrievalTraceDeltaReport, type LoCoMoRetrievalTraceProfile, type LoCoMoRetrievalTraceReceipt, type LoCoMoRetrievalTraceSelectionManifest, type LoCoMoRetrievalTraceSelector, type LoCoMoStructuralMultisetDelta, type LoComoCategoryDelta, type LoComoFinalContextRegression, type LoComoMetricDelta, type LoComoProfileArtifactEvidence, type LoComoProfileDeltaReport, type LoComoRawResultEvidence, type LoComoRecallCategoryDelta, type LoComoRecallContextSummary, type LoComoRecallDeltaReport, type LoComoRecallLineDelta, type LoComoRecallLineEvidence, type LoComoRecallMetricDelta, type LoComoRecallResultProvenance, type LoComoRecallTextDigest, type LoComoTaskRegression, type LoadDatasetOptions, type LoadSealedQrelsOptions, type LoadedDataset, type LoadedJudgeCalibrationState, type LocalLabManifest, type LocalLabManifestNotes, type LocalLabPhase, type LocalLabPhaseDescriptor, type LocalLabPhaseExecute, type LocalLabPhaseName, type LocalLabPhaseOutcome, LocalLabPreflightError, type LocalLabPreflightFailure, type LocalLabPreflightInput, type LocalLabPreflightOptions, type LocalLabPreflightResult, type LocalLabPreflightSuccess, type LocalLabProviderKind, type LocalLabRoleConfig, type LocalLlmProviderConfig, MEMCORRECT_CORRECTION_ACCEPTANCE_RUBRIC, MEMCORRECT_CORRECTION_ACCEPTANCE_RUBRIC_VERSION, MEMCORRECT_STALE_HARM_RUBRIC, MEMCORRECT_STALE_HARM_RUBRIC_VERSION, MEMORY_EVAL_DIMENSIONS, MEMORY_EVAL_PUBLIC_LINE, MIN_CALIBRATION_SOURCE_TASKS, MITIGATED_BASELINE_SCENARIOS, type McpArgumentSemantic, type McpBackendErrorCode, type McpBackendResult, type McpBenchMemoryAdapter, type McpConformanceResult, type McpHttpTransportConfig, type McpListedTool, type McpMemCorrectAdapter, type McpMemoryAdapterOptions, McpMemoryBackendError, type McpMemoryToolMapping, type McpMemoryTransportConfig, type McpStdioTransportConfig, type McpToolCallResult, type McpToolClient, type McpToolMappingEntry, type McpToolMappingValue, type McpToolOperation, type Mem0AdapterConfig, Mem0MemCorrectAdapter, type MemCorrectGeneratorOptions, type MemCorrectJudgeRequest, type MemCorrectJudgeResult, type MemCorrectSystemAdapter, type MemoryEvalCategory, type MemoryEvalDimension, type MemoryEvalDimensionId, type MemoryEvalMetric, type MemoryGraph, type MemoryStats, type MemorySystem, type Message, type MetricAggregate, type MicroMetric, MissingCredentialError, type MitigatedBaselineConfig, type MitigatedTargetConfig, type MultipleChoiceQuestion, OPENAI_RESPONSES_JUDGE_RUBRIC_VERSION, OTHER_NAMESPACE_MEMORIES, type OllamaProviderConfig, type OpenAiCompatibleProviderConfig, OpenAiResponsesJudgeError, type OpenAiResponsesJudgeErrorCode, type OpenAiResponsesJudgeTelemetry, OpenAiResponsesProvider, type OpenAiResponsesProviderConfig, type OpenAiResponsesVerdict, type OpenAiResponsesVerdictResult, PROCEDURAL_REAL_SCENARIOS, PROCEDURAL_REAL_SCENARIOS_SMOKE, PUBLISHED_BENCHMARK_ARTIFACT_IDS, type PairedAnswerReplayCache, type PairedAnswerReplayEntry, type PersonalizationRetrievalCase, type PreflightDiscoveredModel, type ProceduralAblationArtifact, type ProceduralAblationPerCase, type ProceduralAblationScenario, type ProceduralRealScenario, type ProceduralRealScenarioCategory, type ProviderBaseConfig, type ProviderConfig, type ProviderDiscoveryResult, type ProviderFactoryConfig, type PublishSkipReason, type PublishSkipRecord, type PublishedBenchmarkFeed, type PublishedBenchmarkFeedEntry, type PublishedBenchmarkId, REQUIRED_FRONTMATTER_FIELDS, type RecallMetrics, type RecoveredMemory, type RegressionDetail, type RegressionGateResult$1 as RegressionGateResult, type RemnicAdapterOptions, type ReportCardProvenanceContext, type ResolveBenchRuntimeProfileOptions, type ResolvedBenchRuntimeProfile, type ResolvedLocalLabProfile, type ResolvedLocalLabRole, type ResolvedRunBenchmarkOptions, type RotatedChoices, type RunBenchmarkOptions, type RunJudgeCalibrationOptions, type RunProceduralAblationCliArgs, type RunProceduralAblationOptions, type RunSequentialPhasesOptions, SCHEMA_TIER_FIXTURE, SCHEMA_TIER_SMOKE_FIXTURE, SEALED_PROMPT_REGISTRY, SINGLE_FLAG_ABLATION_MATRIX, SYNTHETIC_MEMORIES, type SanitizedDiagnosticProvider, type SavedBaseline, type SchemaTierCorpus, type SchemaTierFixture, type SchemaTierName, type SchemaTierPage, type SchemaTierPageFrontmatter, type SealedArtifact, type SealedJudgeDecision, type SealedJudgeInput, type SealedQrelsArtifact, type SealedQrelsHandle, type SealedRubric, type SearchResult, type SeededMemory, type SeededRng, type SequentialPhaseHooks, type SingleFlagAblationCell, type SingleFlagAblationId, type SpotCheckLogger, type StatisticalReport, type StructuredJudge, StructuredJudgeError, type StructuredJudgeErrorCode, type StructuredJudgeProvider, type StructuredJudgeTelemetry, type StructuredJudgeVerdict, type StructuredJudgeVerdictResult, type StructuredVerdictRequest, type SyntheticEdge, type SyntheticEmailIngestionAdapterOptions, type SyntheticFileIR, type SyntheticRepoConfig, type SyntheticSymbol, type SyntheticTargetOptions, type TaskResult, type TaskTokenUsage, type TemporalRetrievalCase, type ThirdPartyAdapterConfig, type TierDetail, type TimelineEntry, type TokenUsage, type WallMetric, type WriteBenchmarkArtifactResult, type ZepAdapterConfig, ZepMemCorrectAdapter, addContaminationEntry, aggregateTaskScores, answerBenchmarkQuestion, assertCanaryUnderFloor, assertIntegrityMetaPresent, assertPublishableIntegrity, assertSha256Hex, assistantMeetingPrepDefinition, assistantMorningBriefDefinition, assistantNextBestActionDefinition, assistantSynthesisDefinition, backlinkF1, binarizeJudgeScore, bootstrapCohensKappaConfidenceInterval, bootstrapMeanConfidenceInterval, buildAmaBenchDiagnosticMatrixArtifact, buildAmaBenchDiagnosticVariantSummary, buildAmaBenchLeaderboardRows, buildBaselineFromReport, buildBenchmarkArtifact, buildBenchmarkArtifactFilename, buildBenchmarkPublishFeed, buildBenchmarkReproManifest, buildBenchmarkRunSeeds, buildBuildWeekEvidenceReceipt, buildCodexCreditReceipt, buildJudgePayload, buildOracleTrajectoryRecall, buildProviderFreeLoCoMoRetrievalConfig, buildSchemaTierFixture, buildSchemaTierSmokeFixture, calculateCodexBudgetUnits, calendarFixture, canonicalJsonStringify, captureLoCoMoRetrievalTrace, captureMachineFingerprint, chatFixture, checkCodingGraphRegression, checkDatasetContamination, checkRegression, clampScore, cohensD, compareResults, computeCohensKappa, computeSealHash, containsAnswer, createSeededRng$1 as createAdamSeededRng, createAmaBenchDiagnosticAdapter, createAnthropicProvider, createCanaryAdapter, createClaudeCliProvider, createCodexCliProvider, createSeededRng as createCodingGraphSeededRng, createDeterministicSpotCheckLogger, createGatewayResponder, createLightweightAdapter, createLiteLlmProvider, createLocalLlmProvider, createMcpDemoMemCorrectAdapter, createMcpDemoMemoryAdapter, createMcpMemCorrectAdapter, createMcpMemoryAdapter, createMitigatedTarget, createOllamaProvider, createOpenAiCompatibleProvider, createOpenAiResponsesBenchJudge, createOpenAiResponsesProvider, createSeededRandom as createProceduralAblationSeededRandom, createProvider, createProviderBackedAmaBenchRecommendedJudge, createProviderBackedJudge, createProviderBackedResponder, createProviderBackedStructuredJudge, createRemnicAdapter, createResponderFromProvider, createSeededRng$2 as createSeededRng, createSpotCheckFileLogger, createStructuredBenchJudge, createStructuredJudgeFromProvider, createSyntheticEmailIngestionAdapter, createSyntheticTarget, createTimeoutGuardedAdapter, defaultBenchmarkBaselineDir, defaultBenchmarkPublishPath, deleteBenchmarkResults, diagnoseLoCoMoRetrievalTraceDelta, diagnoseLoComoProfileDelta, diagnoseLoComoRecallDelta, discoverAllProviders, discoveryEndpointFor, emailFixture, entityRecall, exactMatch, extractMetrics as extractCodingGraphMetrics, extractMarkdownSectionsByTitle, f1Score, fixtureToAblationScenarios, formatHandoffNote, formatMissingDatasetError, generateReport, generateSyntheticRepo, getAblationCell, getBenchmark, getBenchmarkLowerIsBetter, getGitSha, getMemoryEvalDimension, getProviderBackedJudgePromptIdentity, getRemnicVersion, hashBenchmarkArtifact, hashBytes, hashCanonicalJson, hashOrderedQuestionIds, hashString, integrityMetaIsComplete, interpretEffectSize, isAmaBenchUnknownLikeAnswer, isContaminationEntry, isContaminationManifest, isSealedQrelsArtifact, isSha256Hex, isStructuredJudgeProvider, judgeMemCorrectCorrectionAcceptance, judgeMemCorrectStaleMemoryHarm, linkMatches, listBenchmarkBaselines, listBenchmarkResults, listBenchmarks, listMemoryEvalBenchmarkIds, listMemoryEvalDimensions, llmJudgeScore, llmJudgeScoreDetailed, loadAblationFixture, loadBaseline, loadBeamDatasetPreview, loadBenchmarkArtifact, loadBenchmarkBaseline, loadBenchmarkReportCardProvenance, loadBenchmarkResult, loadCustomBenchmarkFile, loadJudgeCalibrationState, loadLoCoMo10, loadLocalLabManifest, loadLongMemEvalS, loadSealKeyFromEnv, loadSealedQrels, loadSealedRubric, matchEntity, mergeContaminationManifests, openSeal, orchestrateBenchmarkRuns, pairedDeltaConfidenceInterval, parseBenchmarkArtifact, parseCodexJsonlUsage, parseCustomBenchmark, parseLocalLabManifest, parseRubricResponse, parseSealedQrels, pickStableQualifiedName, precisionAtK, preflightLoCoMoRetrievalTraceCapture, preflightLocalLabRole, projectFolderFixture, recallAtK, reconcileCodexCreditLedger, redactBenchmarkResultSecrets, renderBaselineMarkdown, renderBenchmarkResultExport, renderLoComoProfileDeltaMarkdown, renderLoComoRecallDeltaMarkdown, renderMemorySummaryForJudge, renderMemoryViewForAgent, resolveAssistantAgent, resolveAssistantRubricId, resolveAssistantSeeds, resolveAssistantSpotCheckDir, resolveBenchRuntimeProfile, resolveBenchmarkPhaseTimeoutMs, resolveBenchmarkProgressLogging, resolveBenchmarkResultReference, resolveBenchmarkRunCount, resolveCodexCreditBudgetConfig, resolveLocalLabJudgeProviderConfig, resolveLocalLabProfile, resolveLocalLabRole, resolveStructuredJudge, rotateDistractors, rougeL, runAssistantBenchmark, runAssistantMeetingPrepBenchmark, runAssistantMorningBriefBenchmark, runAssistantNextBestActionBenchmark, runAssistantSynthesisBenchmark, runBaseline, runBenchSuite, runBenchmark, runCodingGraphBenchmark, runCustomBenchmarkFile, runExplain, runExtractionAttack, runJudgeCalibration, runMitigatedBaseline, runProceduralAblation, runProceduralAblationCli, runSealedJudge, runSequentialPhases, runWithinCodexCreditBudget, safeHexEqual, sanitizeLoComoResultReference, saveBaseline, saveBenchmarkBaseline, schemaCompleteness, sealPayload, selectAmaBenchDiagnosticVariants, selectCalibrationSlice, selectFixtureVariant, serializeBenchmarkArtifact, serializeBuildWeekEvidenceReceipt, serializeJsonl, serializeLoCoMoRetrievalTraceDelta, serializeLoCoMoRetrievalTraceReceipt, serializeSealedQrels, shuffleTasks, timed, verifyRubricDigest, writeBenchmarkArtifact, writeBenchmarkPublishFeed, writeBenchmarkReproManifest, writeBenchmarkResult, writeBuildWeekEvidenceReceipt, writeJudgeCalibrationState, writeLeaderboardArtifactsForResult, zeroScores };
package/dist/index.js CHANGED
@@ -9777,7 +9777,7 @@ async function runWithBenchmarkPhaseTimeout(label, timeoutMs, fn, options = {})
9777
9777
  }
9778
9778
  }
9779
9779
  function wrapResponder(responder, run) {
9780
- return {
9780
+ const wrapped = {
9781
9781
  respond(question, recalledText, control) {
9782
9782
  return run("respond", async (signal) => {
9783
9783
  const merged = mergeBenchPhaseControl(signal, control);
@@ -9789,6 +9789,11 @@ function wrapResponder(responder, run) {
9789
9789
  });
9790
9790
  }
9791
9791
  };
9792
+ if (typeof responder.identity === "function") {
9793
+ const inner = responder.identity.bind(responder);
9794
+ wrapped.identity = () => inner();
9795
+ }
9796
+ return wrapped;
9792
9797
  }
9793
9798
  function wrapJudge(judge, run) {
9794
9799
  const wrapped = {
@@ -15030,6 +15035,24 @@ function getProviderBackedJudgePromptIdentity(config) {
15030
15035
  };
15031
15036
  return `sha256:${createHash9("sha256").update(JSON.stringify(contract)).digest("hex")}`;
15032
15037
  }
15038
+ function getProviderBackedResponderIdentity(config) {
15039
+ const sanitized = {};
15040
+ for (const [key, value] of Object.entries(config)) {
15041
+ if (key === "apiKey" || key === "authToken" || key === "bearerToken") continue;
15042
+ sanitized[key] = value;
15043
+ }
15044
+ return `responder:sha256:${createHash9("sha256").update(stableStringifyForIdentity(sanitized)).digest("hex")}`;
15045
+ }
15046
+ function stableStringifyForIdentity(value) {
15047
+ if (value === null || typeof value !== "object") {
15048
+ return JSON.stringify(value);
15049
+ }
15050
+ if (Array.isArray(value)) {
15051
+ return `[${value.map((entry) => stableStringifyForIdentity(entry)).join(",")}]`;
15052
+ }
15053
+ const keys = Object.keys(value).sort();
15054
+ return `{${keys.map((key) => `${JSON.stringify(key)}:${stableStringifyForIdentity(value[key])}`).join(",")}}`;
15055
+ }
15033
15056
  var AMA_BENCH_RECOMMENDED_JUDGE_SYSTEM_PROMPT = [
15034
15057
  "You are evaluating an AMA-Bench long-horizon memory question.",
15035
15058
  "Decide whether the predicted answer correctly answers the question using the reference answer as ground truth.",
@@ -15043,8 +15066,8 @@ var CONTEXT_COMPACTION_MARKER = "[...omitted unrelated recalled context...]";
15043
15066
  var COMPACTED_CONTEXT_PREFIX = "[Remnic memory context compacted for the responder prompt; full recalled text is preserved in the benchmark artifact.]";
15044
15067
  var TRAJECTORY_ANALYSIS_HEADING = "## Trajectory analysis";
15045
15068
  var TRAJECTORY_LABELS = Object.freeze(["action", "observation", "step", "turn"]);
15046
- function createResponderFromProvider(provider, options = {}) {
15047
- return {
15069
+ function createResponderFromProvider(provider, options = {}, responderIdentity) {
15070
+ const responder = {
15048
15071
  async respond(question, recalledText, control) {
15049
15072
  const responderQuestion = options.promptBudgetChars === void 0 ? question : compactResponderQuestion(question, options.promptBudgetChars);
15050
15073
  const responderContext = options.contextBudgetChars === void 0 ? recalledText : compactResponderContext(recalledText, question, options.contextBudgetChars);
@@ -15072,13 +15095,21 @@ function createResponderFromProvider(provider, options = {}) {
15072
15095
  };
15073
15096
  }
15074
15097
  };
15098
+ if (responderIdentity && responderIdentity.trim().length > 0) {
15099
+ responder.identity = () => responderIdentity;
15100
+ }
15101
+ return responder;
15075
15102
  }
15076
15103
  function createProviderBackedResponder(config, providerInstance) {
15077
15104
  validateProviderConfig(config, "responder");
15078
- return createResponderFromProvider(providerInstance ?? createProvider(config), {
15079
- contextBudgetChars: config.responderContextBudgetChars,
15080
- promptBudgetChars: config.responderPromptBudgetChars
15081
- });
15105
+ return createResponderFromProvider(
15106
+ providerInstance ?? createProvider(config),
15107
+ {
15108
+ contextBudgetChars: config.responderContextBudgetChars,
15109
+ promptBudgetChars: config.responderPromptBudgetChars
15110
+ },
15111
+ getProviderBackedResponderIdentity(config)
15112
+ );
15082
15113
  }
15083
15114
  function compactResponderQuestion(question, maxChars) {
15084
15115
  if (!Number.isInteger(maxChars) || maxChars <= 0) {
@@ -15576,7 +15607,11 @@ function createGatewayResponder(options) {
15576
15607
  ...options.workspaceDir ? { workspaceDir: options.workspaceDir } : {}
15577
15608
  };
15578
15609
  const llm = options.llmFactory?.(options.gatewayConfig, runtimeContext) ?? new FallbackLlmClient(options.gatewayConfig, runtimeContext);
15579
- return {
15610
+ const responderIdentity = getGatewayResponderIdentity(
15611
+ options.gatewayConfig,
15612
+ options.agentId
15613
+ );
15614
+ const responder = {
15580
15615
  async respond(question, recalledText, control) {
15581
15616
  const startedAt = performance.now();
15582
15617
  const response = await llm.chatCompletion(
@@ -15614,6 +15649,25 @@ function createGatewayResponder(options) {
15614
15649
  };
15615
15650
  }
15616
15651
  };
15652
+ if (responderIdentity) {
15653
+ responder.identity = () => responderIdentity;
15654
+ }
15655
+ return responder;
15656
+ }
15657
+ function getGatewayResponderIdentity(config, agentId) {
15658
+ const sanitized = sanitizeGatewayConfigForIdentity(config);
15659
+ return `gateway:sha256:${createHash9("sha256").update(stableStringifyForIdentity({ agentId: agentId ?? null, config: sanitized })).digest("hex")}`;
15660
+ }
15661
+ function sanitizeGatewayConfigForIdentity(value) {
15662
+ if (value === null || typeof value !== "object") return value;
15663
+ if (Array.isArray(value)) return value.map(sanitizeGatewayConfigForIdentity);
15664
+ const record = value;
15665
+ const out = {};
15666
+ for (const [key, child] of Object.entries(record)) {
15667
+ if (key === "apiKey" || key === "headers" || key === "authHeader") continue;
15668
+ out[key] = sanitizeGatewayConfigForIdentity(child);
15669
+ }
15670
+ return out;
15617
15671
  }
15618
15672
  function validateProviderConfig(config, kind) {
15619
15673
  if (typeof config.model !== "string" || config.model.trim().length === 0) {
@@ -17365,7 +17419,7 @@ async function resolveLocalLabRuntimeProfile(options) {
17365
17419
  // src/benchmark.ts
17366
17420
  import fs2 from "fs";
17367
17421
  import path35 from "path";
17368
- import { createHash as createHash15 } from "crypto";
17422
+ import { createHash as createHash16 } from "crypto";
17369
17423
  import { expandTildePath as expandTildePath3 } from "@remnic/core";
17370
17424
 
17371
17425
  // src/judges/judge-cache.ts
@@ -21503,7 +21557,7 @@ function formatMissingDatasetError(benchmark, datasetDir, filenames, errors) {
21503
21557
  }
21504
21558
 
21505
21559
  // src/benchmarks/published/harness.ts
21506
- import { randomUUID as randomUUID5 } from "crypto";
21560
+ import { createHash as createHash11, randomUUID as randomUUID5 } from "crypto";
21507
21561
 
21508
21562
  // src/benchmarks/published/category-aggregates.ts
21509
21563
  function computeCategoryAggregates(tasks) {
@@ -21534,34 +21588,45 @@ async function runPublishedHarness(ctx) {
21534
21588
  validateContext(ctx);
21535
21589
  const executionProvenance = captureBenchmarkExecutionProvenance();
21536
21590
  const answerSupportGate = resolveAnswerSupportGate(ctx.options);
21537
- const trialConcurrency = resolveTrialConcurrency(
21538
- ctx.options.benchmarkOptions?.trialConcurrency
21539
- );
21591
+ const trialConcurrency = resolveTrialConcurrency(ctx.options.benchmarkOptions?.trialConcurrency);
21540
21592
  const tasks = [];
21541
- for await (const plan of toAsyncIterable(ctx.plans)) {
21542
- await ctx.options.system.reset();
21543
- for (const session of plan.ingestSessions) {
21544
- if (session.messages.length > 0) {
21545
- await ctx.options.system.store(session.sessionId, session.messages);
21593
+ const pendingPairedAnswerReplays = /* @__PURE__ */ new Map();
21594
+ try {
21595
+ for await (const plan of toAsyncIterable(ctx.plans)) {
21596
+ await ctx.options.system.reset();
21597
+ for (const session of plan.ingestSessions) {
21598
+ if (session.messages.length > 0) {
21599
+ await ctx.options.system.store(session.sessionId, session.messages);
21600
+ }
21601
+ }
21602
+ try {
21603
+ await ctx.options.system.drain?.();
21604
+ } catch (drainErr) {
21605
+ throw new Error(
21606
+ `PublishedBenchmarkHarness: drain failed before scoring; public benchmark evidence would be incomplete: ${drainErr instanceof Error ? drainErr.message : String(drainErr)}`,
21607
+ { cause: drainErr }
21608
+ );
21546
21609
  }
21610
+ const planIndex = tasks.length;
21611
+ await executePlanTrials(ctx, plan.trials, {
21612
+ planIndex,
21613
+ tasks,
21614
+ trialConcurrency,
21615
+ answerSupportGate,
21616
+ pendingPairedAnswerReplays
21617
+ });
21547
21618
  }
21548
- try {
21549
- await ctx.options.system.drain?.();
21550
- } catch (drainErr) {
21551
- throw new Error(
21552
- `PublishedBenchmarkHarness: drain failed before scoring; public benchmark evidence would be incomplete: ${drainErr instanceof Error ? drainErr.message : String(drainErr)}`,
21553
- { cause: drainErr }
21554
- );
21619
+ } catch (error) {
21620
+ if (ctx.options.runtimeProfile === "baseline") {
21621
+ ctx.options.pairedAnswerReplayCache?.clear();
21555
21622
  }
21556
- const planIndex = tasks.length;
21557
- await executePlanTrials(ctx, plan.trials, {
21558
- planIndex,
21559
- tasks,
21560
- trialConcurrency,
21561
- answerSupportGate
21562
- });
21623
+ throw error;
21624
+ }
21625
+ const result = await buildBenchmarkResult(ctx, tasks, executionProvenance);
21626
+ if (ctx.options.runtimeProfile === "baseline" && result.meta.status === "partial") {
21627
+ ctx.options.pairedAnswerReplayCache?.clear();
21563
21628
  }
21564
- return buildBenchmarkResult(ctx, tasks, executionProvenance);
21629
+ return result;
21565
21630
  }
21566
21631
  async function executePlanTrials(ctx, trials, options) {
21567
21632
  if (options.trialConcurrency === 1 || trials.length <= 1) {
@@ -21569,28 +21634,28 @@ async function executePlanTrials(ctx, trials, options) {
21569
21634
  appendCompletedTask(
21570
21635
  ctx,
21571
21636
  options.tasks,
21637
+ options.pendingPairedAnswerReplays,
21572
21638
  await executeTrialWithFailure(
21573
21639
  ctx,
21574
21640
  trial,
21575
21641
  options.planIndex,
21576
- options.answerSupportGate
21642
+ options.answerSupportGate,
21643
+ options.pendingPairedAnswerReplays
21577
21644
  )
21578
21645
  );
21579
21646
  }
21580
21647
  return;
21581
21648
  }
21582
21649
  for (let batchStart = 0; batchStart < trials.length; batchStart += options.trialConcurrency) {
21583
- const batch = trials.slice(
21584
- batchStart,
21585
- batchStart + options.trialConcurrency
21586
- );
21650
+ const batch = trials.slice(batchStart, batchStart + options.trialConcurrency);
21587
21651
  const settled = await Promise.allSettled(
21588
21652
  batch.map(
21589
21653
  (trial) => executeTrialWithFailure(
21590
21654
  ctx,
21591
21655
  trial,
21592
21656
  options.planIndex,
21593
- options.answerSupportGate
21657
+ options.answerSupportGate,
21658
+ options.pendingPairedAnswerReplays
21594
21659
  )
21595
21660
  )
21596
21661
  );
@@ -21611,7 +21676,7 @@ async function executePlanTrials(ctx, trials, options) {
21611
21676
  `PublishedBenchmarkHarness: concurrent trial ${batchStart + offset} did not settle before canonical emission.`
21612
21677
  );
21613
21678
  }
21614
- appendCompletedTask(ctx, options.tasks, result.value);
21679
+ appendCompletedTask(ctx, options.tasks, options.pendingPairedAnswerReplays, result.value);
21615
21680
  }
21616
21681
  if (terminalOffset >= 0) {
21617
21682
  const terminalResult = settled[terminalOffset];
@@ -21625,14 +21690,18 @@ async function executePlanTrials(ctx, trials, options) {
21625
21690
  }
21626
21691
  }
21627
21692
  }
21628
- function appendCompletedTask(ctx, tasks, task) {
21693
+ function appendCompletedTask(ctx, tasks, pendingPairedAnswerReplays, task) {
21694
+ const pendingReplay = pendingPairedAnswerReplays.get(task);
21695
+ if (pendingReplay) {
21696
+ ctx.options.pairedAnswerReplayCache?.set(pendingReplay.key, pendingReplay.entry);
21697
+ }
21629
21698
  tasks.push(task);
21630
21699
  ctx.options.onTaskComplete?.(task, tasks.length, ctx.totalCount);
21631
21700
  }
21632
- async function executeTrialWithFailure(ctx, trial, planIndex, answerSupportGate) {
21701
+ async function executeTrialWithFailure(ctx, trial, planIndex, answerSupportGate, pendingPairedAnswerReplays) {
21633
21702
  const trialId = trial.taskId ?? trial.question.slice(0, 60);
21634
21703
  try {
21635
- return await executeTrial(ctx, trial, answerSupportGate);
21704
+ return await executeTrial(ctx, trial, answerSupportGate, pendingPairedAnswerReplays);
21636
21705
  } catch (err) {
21637
21706
  const blocked = findBenchmarkRunBlockedError(err);
21638
21707
  if (blocked) {
@@ -21678,13 +21747,7 @@ function validateContext(ctx) {
21678
21747
  "PublishedBenchmarkHarness requires metricsSpec.metrics: one of f1, contains_answer, rouge_l, llm_judge, judge_accuracy."
21679
21748
  );
21680
21749
  }
21681
- const allowed = [
21682
- "f1",
21683
- "contains_answer",
21684
- "rouge_l",
21685
- "llm_judge",
21686
- "judge_accuracy"
21687
- ];
21750
+ const allowed = ["f1", "contains_answer", "rouge_l", "llm_judge", "judge_accuracy"];
21688
21751
  for (const metric of ctx.metricsSpec.metrics) {
21689
21752
  if (!allowed.includes(metric)) {
21690
21753
  throw new Error(
@@ -21713,9 +21776,7 @@ function resolveTrialConcurrency(raw) {
21713
21776
  }
21714
21777
  const parsed = typeof raw === "number" ? raw : Number(raw);
21715
21778
  if (!Number.isInteger(parsed) || parsed <= 0 || parsed > 64) {
21716
- throw new Error(
21717
- "PublishedBenchmarkHarness: benchmarkOptions.trialConcurrency must be an integer from 1 to 64."
21718
- );
21779
+ throw new Error("PublishedBenchmarkHarness: benchmarkOptions.trialConcurrency must be an integer from 1 to 64.");
21719
21780
  }
21720
21781
  return parsed;
21721
21782
  }
@@ -21740,15 +21801,77 @@ function resolveAnswerSupportGate(options) {
21740
21801
  "PublishedBenchmarkHarness: answerSupportGate must be a boolean or one of true/false, 1/0, yes/no, on/off."
21741
21802
  );
21742
21803
  }
21743
- async function executeTrial(ctx, trial, answerSupportGate) {
21804
+ function stableStringify3(value) {
21805
+ if (value === null || typeof value !== "object") {
21806
+ return JSON.stringify(value);
21807
+ }
21808
+ if (Array.isArray(value)) {
21809
+ return `[${value.map((entry) => stableStringify3(entry)).join(",")}]`;
21810
+ }
21811
+ const keys = Object.keys(value).sort();
21812
+ return `{${keys.map((key) => `${JSON.stringify(key)}:${stableStringify3(value[key])}`).join(",")}}`;
21813
+ }
21814
+ function pairedAnswerReplayKey(trial, recalledText, recallSupport, systemProvider, responderIdentity) {
21815
+ return createHash11("sha256").update(
21816
+ stableStringify3({
21817
+ responder: {
21818
+ baseUrl: systemProvider?.baseUrl ?? null,
21819
+ disableThinking: systemProvider?.disableThinking ?? null,
21820
+ model: systemProvider?.model ?? null,
21821
+ provider: systemProvider?.provider ?? null,
21822
+ providerRequestTimeoutMs: systemProvider?.providerRequestTimeoutMs ?? null,
21823
+ reasoningEffort: systemProvider?.reasoningEffort ?? null,
21824
+ responderContextBudgetChars: systemProvider?.responderContextBudgetChars ?? null,
21825
+ responderPromptBudgetChars: systemProvider?.responderPromptBudgetChars ?? null,
21826
+ retryOptions: systemProvider?.retryOptions ?? null,
21827
+ seed: systemProvider?.seed ?? null,
21828
+ temperature: systemProvider?.temperature ?? null
21829
+ },
21830
+ responderIdentity,
21831
+ responderPrompt: buildStrictBenchmarkQuestion(
21832
+ trial.question,
21833
+ trial.answerFormat ?? "auto"
21834
+ ),
21835
+ answerMode: "strict",
21836
+ question: trial.question,
21837
+ recalledText,
21838
+ recallSupport: recallSupport ? {
21839
+ evidenceCount: recallSupport.evidenceCount ?? null,
21840
+ maxScore: recallSupport.maxScore ?? null,
21841
+ reason: recallSupport.reason ?? null,
21842
+ status: recallSupport.status,
21843
+ supportThreshold: recallSupport.supportThreshold ?? null
21844
+ } : null,
21845
+ taskId: trial.taskId
21846
+ })
21847
+ ).digest("hex");
21848
+ }
21849
+ function pairedAnswerReplayEntry(sourceRuntimeProfile, answer) {
21850
+ return {
21851
+ sourceRuntimeProfile,
21852
+ finalAnswer: answer.finalAnswer,
21853
+ answeredText: answer.answeredText,
21854
+ ...answer.model === void 0 ? {} : { model: answer.model }
21855
+ };
21856
+ }
21857
+ function resolveResponderIdentity(responder) {
21858
+ if (!responder || typeof responder.identity !== "function") {
21859
+ return null;
21860
+ }
21861
+ let raw;
21862
+ try {
21863
+ raw = responder.identity();
21864
+ } catch {
21865
+ return null;
21866
+ }
21867
+ const trimmed = typeof raw === "string" ? raw.trim() : "";
21868
+ return trimmed.length > 0 ? trimmed : null;
21869
+ }
21870
+ async function executeTrial(ctx, trial, answerSupportGate, pendingPairedAnswerReplays) {
21744
21871
  const { result: recallResult, durationMs } = await timed(async () => {
21745
- const recallBudget = benchmarkRecallBudgetForSessionCount(
21746
- trial.recallSessionIds.length
21747
- );
21872
+ const recallBudget = benchmarkRecallBudgetForSessionCount(trial.recallSessionIds.length);
21748
21873
  const recalledSessions = await Promise.all(
21749
- trial.recallSessionIds.map(
21750
- (sessionId) => ctx.options.system.recall(sessionId, trial.question, recallBudget)
21751
- )
21874
+ trial.recallSessionIds.map((sessionId) => ctx.options.system.recall(sessionId, trial.question, recallBudget))
21752
21875
  );
21753
21876
  const rawRecalledText = recalledSessions.filter(Boolean).join("\n\n");
21754
21877
  const recalledText2 = trial.recallTextTransform ? trial.recallTextTransform({
@@ -21759,17 +21882,39 @@ async function executeTrial(ctx, trial, answerSupportGate) {
21759
21882
  return { recalledText: recalledText2, recallSupport: recallSupport2 };
21760
21883
  });
21761
21884
  const { recalledText, recallSupport } = recallResult;
21762
- let answered = await answerBenchmarkQuestion({
21763
- question: trial.question,
21885
+ const responderIdentity = resolveResponderIdentity(ctx.options.system.responder);
21886
+ const answerReplayKey = ctx.options.pairedAnswerReplayCache && responderIdentity !== null ? pairedAnswerReplayKey(
21887
+ trial,
21764
21888
  recalledText,
21765
- responder: ctx.options.system.responder,
21766
- answerMode: "strict",
21767
- answerFormat: trial.answerFormat,
21768
- recallSupport
21769
- }).catch(
21770
- (error) => answerWithTrialFallback(trial, recalledText, error)
21771
- );
21772
- answered = refineTrialAnswer(trial, recalledText, answered);
21889
+ recallSupport,
21890
+ ctx.options.systemProvider,
21891
+ responderIdentity
21892
+ ) : void 0;
21893
+ const cachedAnswer = answerReplayKey ? ctx.options.pairedAnswerReplayCache?.get(answerReplayKey) : void 0;
21894
+ const currentProfile = ctx.options.runtimeProfile ?? null;
21895
+ const pairedAnswerReusedFrom = cachedAnswer?.sourceRuntimeProfile === "baseline" && currentProfile === "real" ? "baseline" : void 0;
21896
+ let answered;
21897
+ if (pairedAnswerReusedFrom) {
21898
+ const reusedAnswer = cachedAnswer;
21899
+ answered = {
21900
+ finalAnswer: reusedAnswer.finalAnswer,
21901
+ recalledText,
21902
+ answeredText: reusedAnswer.answeredText,
21903
+ latencyMs: 0,
21904
+ tokens: { input: 0, output: 0 },
21905
+ model: reusedAnswer.model
21906
+ };
21907
+ } else {
21908
+ answered = await answerBenchmarkQuestion({
21909
+ question: trial.question,
21910
+ recalledText,
21911
+ responder: ctx.options.system.responder,
21912
+ answerMode: "strict",
21913
+ answerFormat: trial.answerFormat,
21914
+ recallSupport
21915
+ }).catch((error) => answerWithTrialFallback(trial, recalledText, error));
21916
+ answered = refineTrialAnswer(trial, recalledText, answered);
21917
+ }
21773
21918
  const hookResult = trial.postAnswerHook ? await trial.postAnswerHook({
21774
21919
  question: trial.question,
21775
21920
  recalledText,
@@ -21789,10 +21934,7 @@ async function executeTrial(ctx, trial, answerSupportGate) {
21789
21934
  scores.f1 = f1Score(answered.finalAnswer, trial.expected);
21790
21935
  break;
21791
21936
  case "contains_answer":
21792
- scores.contains_answer = containsAnswer(
21793
- answered.finalAnswer,
21794
- trial.expected
21795
- );
21937
+ scores.contains_answer = containsAnswer(answered.finalAnswer, trial.expected);
21796
21938
  break;
21797
21939
  case "rouge_l":
21798
21940
  scores.rouge_l = rougeL(answered.finalAnswer, trial.expected);
@@ -21811,9 +21953,7 @@ async function executeTrial(ctx, trial, answerSupportGate) {
21811
21953
  break;
21812
21954
  default: {
21813
21955
  const exhaustive = metric;
21814
- throw new Error(
21815
- `PublishedBenchmarkHarness: metric ${String(exhaustive)} not handled.`
21816
- );
21956
+ throw new Error(`PublishedBenchmarkHarness: metric ${String(exhaustive)} not handled.`);
21817
21957
  }
21818
21958
  }
21819
21959
  }
@@ -21834,6 +21974,7 @@ async function executeTrial(ctx, trial, answerSupportGate) {
21834
21974
  answeredText: answered.finalAnswer,
21835
21975
  ...trial.answerFormat ? { answerFormat: trial.answerFormat } : {},
21836
21976
  ...answerSupportGate ? { answerSupportGate: true, recallSupport } : {},
21977
+ ...pairedAnswerReusedFrom ? { pairedAnswerReusedFrom } : {},
21837
21978
  responderModel: answered.model,
21838
21979
  judgeModel: judgeResult.model,
21839
21980
  ...answered.fallbackReason ? { answerFallbackReason: answered.fallbackReason } : {},
@@ -21849,7 +21990,7 @@ async function executeTrial(ctx, trial, answerSupportGate) {
21849
21990
  if (hookResult.extraDetails) {
21850
21991
  Object.assign(details, hookResult.extraDetails);
21851
21992
  }
21852
- return {
21993
+ const task = {
21853
21994
  taskId: trial.taskId,
21854
21995
  question: trial.question,
21855
21996
  expected: trial.expected,
@@ -21862,6 +22003,13 @@ async function executeTrial(ctx, trial, answerSupportGate) {
21862
22003
  },
21863
22004
  details
21864
22005
  };
22006
+ if (answerReplayKey && currentProfile === "baseline" && answered.fallbackReason === void 0) {
22007
+ pendingPairedAnswerReplays.set(task, {
22008
+ key: answerReplayKey,
22009
+ entry: pairedAnswerReplayEntry(currentProfile, answered)
22010
+ });
22011
+ }
22012
+ return task;
21865
22013
  }
21866
22014
  async function assessRecallSupport(ctx, trial, recalledText) {
21867
22015
  if (recalledText.trim().length === 0) {
@@ -21898,13 +22046,7 @@ async function assessRecallSupport(ctx, trial, recalledText) {
21898
22046
  }
21899
22047
  }
21900
22048
  function validateRecallSupportAssessment(assessment) {
21901
- const allowed = [
21902
- "supported",
21903
- "weak",
21904
- "empty",
21905
- "unavailable",
21906
- "backend_failure"
21907
- ];
22049
+ const allowed = ["supported", "weak", "empty", "unavailable", "backend_failure"];
21908
22050
  if (!assessment || !allowed.includes(assessment.status)) {
21909
22051
  throw new Error("adapter returned an invalid recall support status");
21910
22052
  }
@@ -21919,21 +22061,11 @@ function validateRecallSupportAssessment(assessment) {
21919
22061
  }
21920
22062
  async function scoreTrialJudge(ctx, trial, answeredText) {
21921
22063
  if (!trial.binaryJudgePrompt) {
21922
- return llmJudgeScoreDetailed(
21923
- ctx.options.system.judge,
21924
- trial.question,
21925
- answeredText,
21926
- trial.expected
21927
- );
22064
+ return llmJudgeScoreDetailed(ctx.options.system.judge, trial.question, answeredText, trial.expected);
21928
22065
  }
21929
22066
  const judge = ctx.options.system.judge;
21930
22067
  if (!judge?.scoreBinaryPrompt) {
21931
- return llmJudgeScoreDetailed(
21932
- judge,
21933
- trial.question,
21934
- answeredText,
21935
- trial.expected
21936
- );
22068
+ return llmJudgeScoreDetailed(judge, trial.question, answeredText, trial.expected);
21937
22069
  }
21938
22070
  const prompt = trial.binaryJudgePrompt({
21939
22071
  question: trial.question,
@@ -21941,21 +22073,15 @@ async function scoreTrialJudge(ctx, trial, answeredText) {
21941
22073
  answeredText
21942
22074
  });
21943
22075
  if (typeof prompt !== "string" || prompt.trim().length === 0) {
21944
- throw new Error(
21945
- "PublishedBenchmarkHarness: binaryJudgePrompt returned an empty prompt."
21946
- );
22076
+ throw new Error("PublishedBenchmarkHarness: binaryJudgePrompt returned an empty prompt.");
21947
22077
  }
21948
22078
  const binaryJudge = {
21949
22079
  scoreBinaryPrompt: judge.scoreBinaryPrompt.bind(judge)
21950
22080
  };
21951
- return llmBinaryJudgeScoreDetailed(
21952
- binaryJudge,
21953
- prompt,
21954
- {
21955
- predicted: answeredText,
21956
- expected: trial.expected
21957
- }
21958
- );
22081
+ return llmBinaryJudgeScoreDetailed(binaryJudge, prompt, {
22082
+ predicted: answeredText,
22083
+ expected: trial.expected
22084
+ });
21959
22085
  }
21960
22086
  function answerWithTrialFallback(trial, recalledText, error) {
21961
22087
  if (isBenchmarkRunBlockedError(error)) {
@@ -22000,14 +22126,8 @@ function refineTrialAnswer(trial, recalledText, answered) {
22000
22126
  async function buildBenchmarkResult(ctx, tasks, executionProvenance) {
22001
22127
  const remnicVersion = await getRemnicVersion();
22002
22128
  const totalLatencyMs = tasks.reduce((sum, task) => sum + task.latencyMs, 0);
22003
- const totalInputTokens = tasks.reduce(
22004
- (sum, task) => sum + task.tokens.input,
22005
- 0
22006
- );
22007
- const totalOutputTokens = tasks.reduce(
22008
- (sum, task) => sum + task.tokens.output,
22009
- 0
22010
- );
22129
+ const totalInputTokens = tasks.reduce((sum, task) => sum + task.tokens.input, 0);
22130
+ const totalOutputTokens = tasks.reduce((sum, task) => sum + task.tokens.output, 0);
22011
22131
  const mode = ctx.options.mode;
22012
22132
  const failedTasks = tasks.flatMap((task) => {
22013
22133
  const marker = task.details?.benchmarkFailure;
@@ -22015,10 +22135,12 @@ async function buildBenchmarkResult(ctx, tasks, executionProvenance) {
22015
22135
  return [];
22016
22136
  }
22017
22137
  const message = marker.message;
22018
- return [{
22019
- taskId: task.taskId,
22020
- message: typeof message === "string" ? message : "unknown trial failure"
22021
- }];
22138
+ return [
22139
+ {
22140
+ taskId: task.taskId,
22141
+ message: typeof message === "string" ? message : "unknown trial failure"
22142
+ }
22143
+ ];
22022
22144
  });
22023
22145
  const failureReason = failedTasks.length > 0 ? `trial_execution_failure: ${failedTasks.length}/${tasks.length} scored trial(s) failed (${failedTasks.slice(0, 3).map((failure) => `${failure.taskId}: ${failure.message.slice(0, 240)}`).join("; ")}${failedTasks.length > 3 ? `; and ${failedTasks.length - 3} more` : ""})` : void 0;
22024
22146
  const categoryAggregates = computeCategoryAggregates(tasks);
@@ -25283,7 +25405,7 @@ var StructuredLiteralParser = class {
25283
25405
  };
25284
25406
 
25285
25407
  // src/benchmarks/published/personamem/runner.ts
25286
- import { createHash as createHash11, randomUUID as randomUUID7 } from "crypto";
25408
+ import { createHash as createHash12, randomUUID as randomUUID7 } from "crypto";
25287
25409
  import { readFile as readFile17, realpath as realpath5 } from "fs/promises";
25288
25410
  import path19 from "path";
25289
25411
 
@@ -25888,7 +26010,7 @@ function buildMcqPrompt(sample, seed) {
25888
26010
  function deterministicShuffle(values, seedMaterial) {
25889
26011
  return values.map((value, index) => ({
25890
26012
  value,
25891
- key: createHash11("sha256").update(`${seedMaterial}:${index}:${value}`).digest("hex"),
26013
+ key: createHash12("sha256").update(`${seedMaterial}:${index}:${value}`).digest("hex"),
25892
26014
  index
25893
26015
  })).sort((left, right) => {
25894
26016
  const byKey = left.key.localeCompare(right.key);
@@ -34354,7 +34476,7 @@ function pairedDeltaConfidenceInterval(candidateValues, baselineValues, options
34354
34476
  }
34355
34477
 
34356
34478
  // src/judges/sealed-rubric.ts
34357
- import { createHash as createHash12 } from "crypto";
34479
+ import { createHash as createHash13 } from "crypto";
34358
34480
  import { appendFileSync, mkdirSync } from "fs";
34359
34481
  import path31 from "path";
34360
34482
 
@@ -34463,7 +34585,7 @@ function loadSealedRubric(id = DEFAULT_ASSISTANT_RUBRIC_ID, options = {}) {
34463
34585
  if (typeof prompt !== "string" || prompt.length === 0) {
34464
34586
  throw new Error(`sealed rubric not found in registry: ${id}`);
34465
34587
  }
34466
- const sha2564 = createHash12("sha256").update(prompt, "utf8").digest("hex");
34588
+ const sha2564 = createHash13("sha256").update(prompt, "utf8").digest("hex");
34467
34589
  const version = parseVersionFromId(id);
34468
34590
  return { id, version, prompt, sha256: sha2564 };
34469
34591
  }
@@ -36666,7 +36788,7 @@ async function runRetentionAgedDatasetBenchmark(options) {
36666
36788
  import { randomUUID as randomUUID31 } from "crypto";
36667
36789
 
36668
36790
  // src/benchmarks/remnic/memcorrect/generator.ts
36669
- import { createHash as createHash13 } from "crypto";
36791
+ import { createHash as createHash14 } from "crypto";
36670
36792
 
36671
36793
  // src/benchmarks/remnic/memcorrect/token-pools.ts
36672
36794
  var PERSONAS = [
@@ -36990,7 +37112,7 @@ function corpusHash(corpus) {
36990
37112
  uptakeLatencyCap: corpus.options.uptakeLatencyCap,
36991
37113
  scenarios: corpus.scenarios
36992
37114
  });
36993
- return createHash13("sha256").update(canonical).digest("hex");
37115
+ return createHash14("sha256").update(canonical).digest("hex");
36994
37116
  }
36995
37117
 
36996
37118
  // src/benchmarks/remnic/memcorrect/schema.ts
@@ -37947,7 +38069,7 @@ import { mkdir as mkdir17, writeFile as writeFile16 } from "fs/promises";
37947
38069
  import path34 from "path";
37948
38070
 
37949
38071
  // src/benchmarks/remnic/bounded-memory-contracts/fixture.ts
37950
- import { createHash as createHash14 } from "crypto";
38072
+ import { createHash as createHash15 } from "crypto";
37951
38073
  var SCOPE_ACME = "project:acme";
37952
38074
  var SCOPE_BETA = "project:beta";
37953
38075
  var SCOPE_ALICE = "user:alice";
@@ -38430,7 +38552,7 @@ var BOUNDED_MEMORY_SMOKE_FIXTURE = [
38430
38552
  function fixtureHash(tasks) {
38431
38553
  const source = tasks ?? BOUNDED_MEMORY_FIXTURE;
38432
38554
  const payload = JSON.stringify(source);
38433
- return createHash14("sha256").update(payload, "utf8").digest("hex");
38555
+ return createHash15("sha256").update(payload, "utf8").digest("hex");
38434
38556
  }
38435
38557
 
38436
38558
  // src/benchmarks/remnic/bounded-memory-contracts/agent.ts
@@ -39690,13 +39812,13 @@ function wrapJudgeWithCache(args) {
39690
39812
  // differentiator is part of the prompt hash. Bumping
39691
39813
  // JUDGE_CACHE_PROTOCOL_VERSION invalidates verdicts when judge
39692
39814
  // prompt/parse semantics change (PR #1591, High).
39693
- judgePromptHash: createHash15("sha256").update(JUDGE_CACHE_PROTOCOL_VERSION).update("").update(args.amaBenchJudgeProtocol).update("").update(args.role).digest("hex"),
39815
+ judgePromptHash: createHash16("sha256").update(JUDGE_CACHE_PROTOCOL_VERSION).update("").update(args.amaBenchJudgeProtocol).update("").update(args.role).digest("hex"),
39694
39816
  judgeModelId: args.provider?.model !== void 0 && args.provider.model.length > 0 ? `${args.provider.model}${crossJudgeIdSuffix}` : `unknown-${args.role}-judge`,
39695
39817
  // Full judge configuration, deterministically serialized (sorted
39696
39818
  // keys) so provider/base-url/retry changes produce fresh cache
39697
39819
  // keys. `role` is included so primary and cross judges never
39698
39820
  // share a paramsHash.
39699
- judgeParamsHash: createHash15("sha256").update(
39821
+ judgeParamsHash: createHash16("sha256").update(
39700
39822
  stableStringify2({
39701
39823
  role: args.role,
39702
39824
  provider: args.provider
@@ -40402,7 +40524,7 @@ function formatSignedScore(value) {
40402
40524
  }
40403
40525
 
40404
40526
  // src/stats/locomo-recall-delta.ts
40405
- import { createHash as createHash16 } from "crypto";
40527
+ import { createHash as createHash17 } from "crypto";
40406
40528
  import { basename as basename2 } from "path";
40407
40529
  var LOCOMO_FULL_TASK_COUNT = 1986;
40408
40530
  var LOCOMO_RECALL_EXCERPT_CHARS = 240;
@@ -40914,7 +41036,7 @@ function normalizeText3(value) {
40914
41036
  return value.replaceAll("\r\n", "\n").replaceAll("\r", "\n");
40915
41037
  }
40916
41038
  function sha2563(value) {
40917
- return createHash16("sha256").update(value).digest("hex");
41039
+ return createHash17("sha256").update(value).digest("hex");
40918
41040
  }
40919
41041
  function stableJson(value) {
40920
41042
  return JSON.stringify(value);
@@ -43430,7 +43552,7 @@ var chatFixture = {
43430
43552
  };
43431
43553
 
43432
43554
  // src/judges/calibration-slice.ts
43433
- import { createHash as createHash17, randomBytes as randomBytes3 } from "crypto";
43555
+ import { createHash as createHash18, randomBytes as randomBytes3 } from "crypto";
43434
43556
  import { chmod as chmod2, lstat as lstat5, mkdir as mkdir18, open as open3, readFile as readFile23, rename as rename4, unlink as unlink5, writeFile as writeFile17 } from "fs/promises";
43435
43557
  import path37 from "path";
43436
43558
 
@@ -43579,7 +43701,7 @@ function selectCalibrationSlice(questionIds, size = CALIBRATION_SLICE_SIZE) {
43579
43701
  unique.push(id);
43580
43702
  }
43581
43703
  }
43582
- return unique.map((id) => ({ id, digest: createHash17("sha256").update(id, "utf8").digest("hex") })).sort((a, b) => a.digest < b.digest ? -1 : a.digest > b.digest ? 1 : 0).slice(0, Math.min(size, unique.length)).map((entry) => entry.id);
43704
+ return unique.map((id) => ({ id, digest: createHash18("sha256").update(id, "utf8").digest("hex") })).sort((a, b) => a.digest < b.digest ? -1 : a.digest > b.digest ? 1 : 0).slice(0, Math.min(size, unique.length)).map((entry) => entry.id);
43583
43705
  }
43584
43706
  async function runJudgeCalibration(options) {
43585
43707
  const binScore = options.binScore ?? ((score) => binarizeJudgeScore(score));
@@ -43696,7 +43818,7 @@ function hashOrderedQuestionIds(questionIds) {
43696
43818
  if (questionIds.some((id) => typeof id !== "string" || id.length === 0)) {
43697
43819
  throw new Error("hashOrderedQuestionIds: question ids must be non-empty strings.");
43698
43820
  }
43699
- return createHash17("sha256").update(JSON.stringify(questionIds), "utf8").digest("hex");
43821
+ return createHash18("sha256").update(JSON.stringify(questionIds), "utf8").digest("hex");
43700
43822
  }
43701
43823
  function validatePinnedQuestionIds(ids, availableIds) {
43702
43824
  if (ids.length === 0 || ids.length > CALIBRATION_SLICE_SIZE || ids.some((id) => typeof id !== "string" || id.length === 0) || new Set(ids).size !== ids.length) {
@@ -43709,7 +43831,7 @@ function validatePinnedQuestionIds(ids, availableIds) {
43709
43831
  return [...ids];
43710
43832
  }
43711
43833
  function hashCalibrationAnswerSet(answers) {
43712
- return createHash17("sha256").update(JSON.stringify(answers.map((answer) => [
43834
+ return createHash18("sha256").update(JSON.stringify(answers.map((answer) => [
43713
43835
  answer.questionId,
43714
43836
  answer.question,
43715
43837
  answer.predicted,
@@ -43775,7 +43897,7 @@ async function loadOrInitializeCheckpoint(benchmarkId, provenance, sliceQuestion
43775
43897
  frontierJudgeConfigHash: provenance.frontierJudgeConfigHash,
43776
43898
  binningIdentity: provenance.binningIdentity
43777
43899
  };
43778
- const contractHash = createHash17("sha256").update(stableJson2(contract)).digest("hex");
43900
+ const contractHash = createHash18("sha256").update(stableJson2(contract)).digest("hex");
43779
43901
  let raw;
43780
43902
  try {
43781
43903
  const info = await lstat5(checkpointPath);
@@ -45303,7 +45425,7 @@ function createMitigatedTarget(config) {
45303
45425
  }
45304
45426
 
45305
45427
  // src/coding-graph/generator.ts
45306
- import { createHash as createHash18 } from "crypto";
45428
+ import { createHash as createHash19 } from "crypto";
45307
45429
  function createSeededRng3(seed) {
45308
45430
  let state = seed >>> 0;
45309
45431
  return function rng() {
@@ -45332,7 +45454,7 @@ var EDGE_TYPE_WEIGHTS = [
45332
45454
  var PROVENANCE_VALUES = ["heuristic", "heuristic", "heuristic", "trace"];
45333
45455
  var AVG_BYTES_PER_LINE = 40;
45334
45456
  function hashContent(input) {
45335
- return createHash18("sha256").update(input).digest("hex").slice(0, 16);
45457
+ return createHash19("sha256").update(input).digest("hex").slice(0, 16);
45336
45458
  }
45337
45459
  function generateSyntheticRepo(config) {
45338
45460
  const rng = createSeededRng3(config.seed);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/bench",
3
- "version": "9.21.0",
3
+ "version": "9.22.1",
4
4
  "description": "Retrieval latency ladder benchmarks + CI regression gates for @remnic/core",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,8 +40,8 @@
40
40
  "hyparquet": "^1.25.7",
41
41
  "yaml": "^2.4.2",
42
42
  "zod": "^3.24.0",
43
- "@remnic/coding-graph": "^9.21.0",
44
- "@remnic/core": "^9.21.0"
43
+ "@remnic/coding-graph": "^9.22.1",
44
+ "@remnic/core": "^9.22.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.5.1",